Define f(x) = (x^2)sin(1/x) if x != 0 and define f(0) = 0.
If x != 0 then f’(x) = (2)(x)sin(1/x)-cos(1/x).
If x = 0 then f’(0) = lim ((x^2)sin(1/x)-0)/(x-0) as x->0 = lim (x)sin(1/x) as x->0 = 0.
So f(x) is at least 1-time differentiable at x=0.
Now lim f’(x) as x->0 = lim (2)(x)sin(1/x)-cos(1/x) as x->0 does not exist.
Hence, we cannot have lim f’(x) = f’(0) as x->0, i.e., f’(x) dose not continuous at x=0, which implies f’(x) is not differentiable at x=0, i.e., f(x) is only 1-time differentiable at x=0.
In WolframAlphan:
Inputting D[Piecewise[{{x^2 Sin[1/x], x != 0}, {0, x == 0}}], x] outputs Piecewise[{{-Cos[x^(-1)] + 2 x Sin[x^(-1)], x != 0}}, 0], which is correct math result.
But inputting D[Piecewise[{{-Cos[x^(-1)] + 2 x Sin[x^(-1)], x != 0}}, 0], x] outputs Piecewise[{{(-2 x Cos[x^(-1)] + (-1 + 2 x^2) Sin[x^(-1)])/x^2, x != 0}}, 0], which is incorrect math result; it does not show non-differentiability at x=0.
Also inputting D[D[Piecewise[{{x^2 Sin[1/x], x != 0}, {0, x == 0}}], x], x] again outputs the same incorrect math result.
This is the problem.