Is WolframAlpha wrong on piecewise differentiation at $x=0$?
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]
with D[Piecewise[{{xsin(1/x), x < 0 || x > 0 }, {0, x = 0}}], x]
. Using the input x < 0 || x > 0
signals 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.