# Proving a scalar function is differentiable at the origin but that its partial derivatives are not continuous at that point.

Let $f: \mathbb R^2 \to \mathbb R$ defined as

$f(x,y)=(x^2+y^2)\sin(\dfrac{1}{\sqrt{x^2+y^2}})$ if $(x,y) \neq (0,0)$, $f(x,y)=(0,0)$ if $(x,y)=(0,0)$

Prove that $f$ is differentiable at $(0,0)$ but that the partial derivatives of $f$ are not continuous at the origin.

The attempt at a solution:

I had some problems at the first part of the exercise:

I've calculated $\dfrac{\partial f}{\partial x}(0,0)$ and $\dfrac{\partial f}{\partial y}(0,0)$, both exist and are equal to $1$.

So, to prove $f$ is differentiable at the origin, I have to show that

$\lim_{(x,y) \to (0,0)} \dfrac{|f(x,y)-(f(0,0)+<\nabla f(0,0),(x,y)>)|}{\|(x,y)\|}=0$ But $\lim_{(x,y) \to (0,0)} \dfrac{|f(x,y)-(f(0,0)+<\nabla f(0,0),(x,y)>)|}{\|(x,y)\|}$ equals

$\lim_{(x,y) \to (0,0)} \dfrac{|(x^2+y^2)\sin(\dfrac{1}{\sqrt{x^2+y^2}})-(x+y)|}{\|(x,y)\|}$. I don't know how to show this limit equals $0$.

For the second part (I've only analyzed $\dfrac{\partial f}{\partial x}$ since both cases are the same), what I did was try to show that $\lim_{(x,y) \to (0,0)} \dfrac{\partial f}{\partial x}(x,y) \neq \dfrac{\partial f}{\partial x}(0,0)$

I thought of considering the curve $\phi(t)=(t,0)$, so

$\lim_{t \to 0} (f\circ \phi)(t)=\lim_{t \to 0} 2t\sin(|t|^{-1})-\dfrac{t\cos(|t|^{-1})}{|t|^{-1}}$. But $\lim_{t \to 0^{+}} \dfrac{t\cos(|t|^{-1})}{|t|^{-1}}=\lim_{t \to 0^{+}} \cos(\dfrac{1}{t})$ and this limit doesn't exist, so the original limit doesn't exist. This shows the partial derivative with respect to $x$ at the point $(0,0)$ is not continuous.

I would appreciate if someone could help me to finish the first part and tell me if what I did in the second part of the problem is correct.

I assume the function is defined to be $0$ at $(0,0)$. Otherwise, it makes not senseto talk about differentiability at this point. I claim the derivative exists and is $\nabla f=\langle 0, 0\rangle$. To prove it, observe that $$\left|\frac{(x^{2}+y^{2})sin\left(\frac{1}{\sqrt{(x^{2}+y^{2})}}\right)-0}{\sqrt{x^{2}+y^{2}}}\right|=\sqrt{(x^{2}+y^{2})}\ \left|sin\left(\frac{1}{\sqrt{(x^{2}+y^{2})}}\right)\right|\leq\sqrt{(x^{2}+y^{2})}$$ The RHS goes to $0$ as $x,y\to 0$ so were done.
For the second part, compute the partials. Your computation will give the derivative at every nonzero point $(x,y)$. Use the fact that we have shown the derivative to be $\langle 0, 0 \rangle$ at $(0,0)$ along with a computation of the limits of the partials as $x,y\to 0$ to conclude that the partials are not continuous at $(0,0)$.
• Are you sure that $\nabla f(0,0)=(0,0)$? I've calculated $\dfrac{\partial f}{\partial x}(0,0)$ by definition: $\lim_{h \to 0} \dfrac{f((0,0)+h(1,0))-f(0,0)}{h}=\lim_{h \to 0} |h|\sin(\dfrac{1}{|h|})=1$, it doesn't give me $0$, am I doing something wrong? – user100106 Dec 15 '13 at 0:51
• Yes. That limit on the right is $0$. I think you are confusing it with $sin(h)/h$ as $h\to 0$. Its not the same limit. – user113529 Dec 15 '13 at 16:48