Why is the answer of differentiability varying when using first principle and direct differentiation

continuityderivatives

Let us consider a function $f(x)$,

$f(x)= x^2\sin(\frac{1}{x})$, when $x\not =0$,
and $f(x)=0$ when $x=0$.

If I use first principle here for $x=0$,LHD=RHD=$0$ and the function comes out to be differentiable at $x=0$.

But if I directly differentiate then

$f'(x)=2x\sin(1/x)-\cos(1/x)$ when $x\not=0$,
$f'(x)=0$ when $x=0$.

Now If I put $x=0$, LHD and RHD come out to be non unique and hence non differentiable.

I am not able to figure out what concept am I missing out on.

PS:This is my first question here so I didnt know much about formatting so sorry for that..

Best Answer

Differentiation as a concept heavily relies on the idea of "local behavior" of a function. This means that a derivative can never depend on a function's value at a single point alone. It always depends on how the function behaves in a small region surrounding that point.

In this case, you are trying to differentiate $f(x)=0$, but the rule that $f'(x)=0$ for $f(x)=a$, where $a$ is some number, relies on the fact that $f(x)=a$ not just at a single point, but on a whole interval. This is not the case for the function you gave: While $f(x)=0$ for $x=0$, it is not the case that $f(x)=0$ on a whole interval surrounding $x=0$, so you can't use direct differentiation.

Related Question