Differentiability of $x^2\times\sin(1/x)$

continuityderivativeslimits

Using first principle, when we try to check the differentiability of $x^2\sin(1/x)$ at $x= 0$,we get 0.
But if we differentiate the function first, and then try to find differentiability at x=0,we we find it's not differentiable.
I have encountered similar questions on stack exchange , but none them gave clarity on which one is right ? Is the function differentiable or not ? Why does the first principle and checking differentiability after differentiating give different answers ?

I know that the derivative of $x^2\sin(1/x)$ is not continuous. Is this the reason why we get different answers ?

Best Answer

Presumably, you are talking about the continuous function $f:\Bbb R \to \Bbb R$ given by $$ f(x) = \begin{cases} x^2 \sin(1/x) & x \neq 0\\ 0 & x = 0. \end{cases} $$ As can be shown "using first principle" (by which I assume you mean the definition of the derivative), we find that the derivative of this function is given by $$ f'(x) = \begin{cases} 2x \sin(1/x) - \cos(1/x) & x \neq 0\\ 0 & x = 0. \end{cases} $$ Because the derivative of $f(x)$ exists at all $x \in \Bbb R$, the function $f(x)$ is indeed differentiable.

This function is unusual, however, in that the derivative $f'(x)$ is not continuous. For a more typical function, we would find that if $f$ is differentiable at $x = 0$, then it would necessarily satisfy $f'(0) = \lim_{x \to 0}f'(x)$. As this example illustrates, this does not always need to be the case.

Interestingly, Darboux's theorem implies that we cannot have a removable discontinuity or jump discontinuity in $f'(x)$. In other words, if $f'(x)$ exists but is discontinuous at $x = 0$, then it must be the case that $\lim_{x \to 0^+}f'(x)$ or $\lim_{x \to 0^-}f'(x)$ fails to exist.