$f(x,y) = g(\sqrt{x^{2}+y^{2}})$. Prove that f is differentiable at $(0,0)$ iff $g'(0)=0$
This was a question on my midterm a few days ago. I've been thinking about it for a while and still cannot come up with an answer.
My guess would be to use partials and prove that they're continuous at $(0,0)$ but I don't know how to incorporate the fact that $g'(0)=0$.
Note that $f(x,0)=g(|x|)$ and $f(0,y)=g(|y|)$ so
$$\frac{\partial f}{\partial x}(0,0)=\frac{\partial f }{\partial y}(0,0)=g^{\prime}(0)$$
Now the condition for differentiability is $$\lim\limits_{(h,k)\rightarrow 0} \frac{f(h,k)-f(0,0)-g^{\prime}(0)h-g^{\prime}(0)k}{\sqrt{h^2+k^2}} =0 $$
Now $$\lim\limits_{(h,k)\rightarrow 0} \frac{f(h,k)-f(0,0)}{\sqrt{h^2+k^2}} = \lim\limits_{r\rightarrow 0} \frac{g(r)-g(0)}{r} =g^{\prime}(0)$$
So the condition becomes
$$\lim\limits_{(h,k)\rightarrow 0} g^{\prime}(0)\left(1-\frac{h+k}{\sqrt{h^2+k^2}}\right) =0 $$ Note however that
$\lim\limits_{(h,k)\rightarrow 0} \frac{h+k}{\sqrt{h^2+k^2}} $ does not exist, so we must have $g^{\prime}(0)=0$. Conversely, $g^{\prime}(0)=0$ gives the limit $0$ and shows that $f$ is differentiable.
Note that the calculation of the values if the partials, $\frac{\partial f}{\partial x}(0,0)$ and $\frac{\partial f}{\partial y}(0,0)$ is irrelevant to the solution to the problem. We were just to say $\frac{\partial f}{\partial x}(0,0)=a$ and $\frac{\partial f}{\partial y}(0,0)=b$ the differentiability condition becomes $$\lim\limits_{(h,k)\rightarrow 0} \frac{f(h,k)-f(0,0)-ah-bk}{\sqrt{h^2+k^2}} =0 $$ And the nonexistence of the limits $\lim\limits_{(h,k)\rightarrow 0} \frac{h}{\sqrt{h^2+k^2}} $ and $\lim\limits_{(h,k)\rightarrow 0} \frac{h}{\sqrt{h^2+k^2}} $ gives $g^{\prime}(0)=a=b=0$.