# Is this strange function differentiable?

I have to demonstrate that this function is differentiable in (0,0). The function is:

$f(x,y) = \begin{cases} (x^2+y^2)[cos(\frac{1}{x})-1] & \quad \text{if } x\neq 0\\ 0 & \quad \text{if } x=0 \\ \end{cases}$

This is what I've tried to do:

According to Taylor's formula:

$f(0+l,0+m)=f(0,0)+ \partial _xf(0,0)l +\partial_yf(0,0)m +o(\sqrt{l^2+m^2})$

So if this function is differentiable it has to be:

$$\lim_{(l,m) \to (0 , 0)} \frac{ f(0+l,0+m)-f(0,0)- \partial _xf(0,0)l -\partial_yf(0,0)m}{\sqrt{l^2+m^2}}=0$$

At this point I have to prove that both partial derivatives exist in $(0,0)$ and then calculate the limit. I find that $\partial_yf(0,0)$ exists and is $0$, but $\partial_xf(0,0)$ according to my calcuations does not exist.

I have also plotted the function on wolfram and It does not seem differentiable in $(0,0)$.

• You don't think $x^2[\cos (1/x)-1]$ is differentiable at $0?$ – zhw. Jan 17 '16 at 19:19
• Could you tell me why is $\partial_xf(0,0)=0$ ? Thank you. – Marco Intini Jan 17 '16 at 19:19
• Just use the definition of the derivative as in the answer below. – zhw. Jan 17 '16 at 19:38
• Sorry, my fault... It was so easy. I was trying calculating $\partial_xf(x,y)$ at a generic point and then calculate $$\lim_{(x,y) \to (0 , 0)} {\partial_xf(x,y) }=0$$. Thank you – Marco Intini Jan 17 '16 at 19:41

In fact, you can calculate the derivative $\partial_x f(0,0)$ by definition:
$$\partial_x f(0,0)=\lim_{x\to 0}\frac{x^2(\cos (1/x)-1)-f(0,0)}{x-0} = \lim_{x\to 0}x (\cos (1/x)-1)=0.$$
• Oh sorry, my fault... It was so easy. I was trying calculating $\partial_xf(x,y)$ at a generic point and then calculate $$\lim_{(x,y) \to (0 , 0)} {\partial_xf(x,y) }=0$$. Thank you – Marco Intini Jan 17 '16 at 19:38
• @MarcoIntini: That's not a good idea, since unless you know in advance that $\partial_x f$ is continuous at the origin (which you don't), there is no guarantee that the limit of $\partial_x f$ as $(x,y)\to(0,0)$ agrees with the actual value $\partial_x f(0,0)$. – Hans Lundmark Jan 17 '16 at 19:51