I'm differentiating the function:
$${ f\left(x\right) = \begin{cases}{x \sin ( \frac{1}{x}) } && {x\>\ne\>0} \\ {0} && {x\>=\>0}\end{cases} }$$ In my understanding it is not differentiable at $x= 0$, as it is not a constant function so we must use the definition of a limit to differentiate at $x=0$.
Wolfram says its derivative is $0$ at $x=0$.
Where am I wrong?
This is a known bug. You can get WolframAlpha to return the correct result if you replace
D[Piecewise[{{xsin(1/x), x != 0}, {0, x = 0}}], x]withD[Piecewise[{{xsin(1/x), x < 0 || x > 0 }, {0, x = 0}}], x]. Using the inputx < 0 || x > 0signals to WolframAlpha that $x$ is real, and so the algorithm it uses to differentiate is more robust. See here for the correct result in WolframAlpha.