I want to calculate the indefinite Integral of
$$f(x)=\begin{cases} 2x\cos(\frac{1}{x})& \text{ if } x\ne 0 \\ 0& \text{ if } x=0 \end{cases}.$$
I use the following code:
F[x_] := Piecewise[{0, x==0}, {2*x*Cos[1/x], x != 0}];
Integrate[Piecewise[{{0, x == 0}, {2*x*Cos[1/x], x != 0}}], x]
It doesn't evaluate. I don't know why it doesn't evaluate the piecewise function.
Maybe this is quite simple question, but it's not easy for me, a greenest amateur.
Piecewise
expression. TryIntegrate[Piecewise[{{0, x == 0}, {2*x*Cos[1/x], x != 0}}], x]
$\endgroup$Piecewise
is still incorrect. Look closely at my previous comment. $\endgroup$