Function $g$ has all directional derivatives at $(0,0)$

calculusderivativesmultivariable-calculuspartial derivativevector analysis

Let $g:\mathbb{R}^2\longrightarrow\mathbb{R}$ be the function defined by

$$g(x,y)=\begin{cases}
\frac{x|y|}{\sqrt{x^2+y^2}} & \text{for } (x,y)\neq(0,0)\\
0 & \text{for } (x,y)=(0,0)
\end{cases}$$

Prove that all directional derivatives of $g$ exist at $(0,0)$, but $g$ is not differentiable at $(0,0)$.

Problem/Approach: I have already proven that $g$ is not differentiable at $(0,0)$. I am struggling with the directional derivatives at $(0,0)$.

If $v=(0,0)$, then it immediately follows that $\nabla_v f(x_0)=0$.

For any vector $v=\begin{pmatrix}v_1\\v_2\end{pmatrix}\in\mathbb{R}^2$ and $\|v\|=1$ with $v\neq(0,0)$, we have:
\begin{align*}
\nabla_a f(0,0)&=\lim_{h\rightarrow 0}\frac{f(0+hv)-f(0,0)}{hv_1|v_2|}\\
&=\lim_{h\rightarrow 0}\frac{\sqrt{(hv_1)^2+(hv_2)^2}}{h}\\
&=\lim_{h\rightarrow 0}\frac{hv_1|v_2|}{\sqrt{(hv_1)^2+(hv_2)^2}h}\\
&=\lim_{h\rightarrow 0}\frac{v_1|v_2|}{\sqrt{v_1^2+v_2^2}h}\\(*)
&=\lim_{h\rightarrow 0}\frac{v_1|v_2|}{h}\\
&=\lim_{h\rightarrow 0}v_1|v_2|\\
&=v_1|v_2|=0\quad\Longleftrightarrow v_1=0\vee v_2=0
\end{align*}

In (*), I referred to $h>0$. It all seems very artificial to me, and I have to consider many cases, which makes me doubt whether $g$ has directional derivatives everywhere at $(0,0)$ at all. What am I doing wrong? Thanks for any help!

Best Answer

You've made several mistakes when computing the directional derivative. In fact the first line is incorrect since it should read

$$ \lim_{h \to 0} \frac{f(hv_1,hv_2) - f(0,0)}{h}$$ instead of what you wrote (the denominator is incorrect). Substituting with the expression of our function we find

$$ \lim_{h\to 0}\frac{\frac{hv_1 \vert hv_2\vert}{\sqrt{(hv_1)^2 + (hv_2)^2}}-0}{h} = \lim_{h \to 0} \frac{hv_1 \vert hv_2\vert}{h\sqrt{(hv_1)^2 + (hv_2)^2}} = \lim_{h \to 0} \frac{v_1 \vert hv_2\vert}{\sqrt{(hv_1)^2 + (hv_2)^2}}$$

Finally you can clearly see that you can factor out $\vert h \vert $ in both the numerator and the denominator so the limit evaluates to $f(v_1,v_2$).


You say that you have to restrict to $h$ positive but that is not necessary. Indeed you're saying this because you are factoring

$${\sqrt{(hv_1)^2 + (hv_2)^2}} = \sqrt{h^2} \sqrt{v_1^2 + v_2^2} = h{\sqrt{v_1^2 + v_2^2}}$$ But this is incorrect ! Since we actually have $\sqrt{h^2} = \vert h \vert$ There is therefore no need for $h$ to be positive.

Related Question