# Differentiability of the function$f(x)= x^2 \sin(1/x)$, $f(0)=0$ at the origin

It is easy to verify by definition that the function $f(x)=x^2 \sin(1/x), x\neq0,f(0)=0$is differentiable at the origin ,that is, $f'(0)=0$.But by the formula we can not calculate this.$f'(x)=2x\sin(1/x)-\cos(1/x)$. How can we explain this?Do you know any other function excluding $x^2\cos(1/x)$ that behaves like this.

Yegan

A differentiable function need not be of class $C^1$. If your second approach worked, then it is easy to check that $f$ would be $C^1$.
Any function $f(x)$ such that $|f(x)|\leq C x^2$ for some $C>0$ and $x$ in a neighborhood of $0$ is differentiable at zero with $f'(0)=0$. Simply use the difference quotient so see this:
Note that $f(0)=0$. Thus $$|f'(0)|\leftarrow\frac{|f(x)-f(0)|}{|x-0|}\leq C |x| \to 0$$ as $x\to 0$
$$\left| \frac{f(x) - f(0)}{x- 0} - 0 \right|= |x||\sin(1/x)| \leq |x|\cdot 1,$$
which certainly goes to $0$ as $x \to 0$. Thus $f'(0) = 0$.