# Directional derivative in the direction of a sum of two vectors.

Q. Let $$f: \mathbb{R}^{n} \rightarrow \mathbb{R}$$ be a map. For each vector $$\mathbf{v} \in \mathbb{R}^{n}$$, we define $$D_{\mathbf{v}} f(\mathbf{a})=\lim _{t \rightarrow 0} \frac{f(\mathbf{a}+t \mathbf{v})-f(\mathbf{a})}{t}$$ if the limit exists. $$D_{\mathbf{v}} f(\mathbf{a})$$ is the directional derivative of $$f$$ with respect to $$v$$ at $$a$$. Show that for vectors $$\mathbf{v}, \mathbf{w} \in \mathbb{R}^{n},$$ one has $$D_{\mathbf{v}+\mathbf{w}} f(\mathbf{a})=D_{\mathbf{v}} f(\mathbf{a})+D_{\mathbf{w}} f(\mathbf{a})$$

My attempt: $$\begin{array}{l}\lim _{t \rightarrow 0} \frac{f(a+t(\mathbf v+\mathbf w))-f(a)}{t} \\ =\operatorname{lim}_{t \rightarrow 0}\frac{ f(a+t\mathbf v+t\mathbf w)-f(a)}{t}\\ =\operatorname{lim}_{t \rightarrow 0}\frac{ f(a+t\mathbf v+t\mathbf w)-f(a+t\mathbf v)}{t}+\frac{ f(a+t\mathbf v)-f(a)}{t} \end{array}$$ Now, I have to prove that $$\operatorname{lim}_{t \rightarrow 0}\frac{ f(a+t\mathbf v+t\mathbf w)-f(a+t\mathbf v)}{t}=D_{\mathbf{w}} f(\mathbf{a})$$ But how to?

• Can we assume that the directional derivative exists for all $v\in\mathbb{R}^n$? Jul 28, 2020 at 20:07

The counter-example is made of pieces of a cone:

$$z=f(x,y)=\text{sgn}(x)\sqrt{|xy|}.$$

Clearly $$f(x,0)=f(0,y)=0$$ for all $$x$$ or $$y$$, so the directional derivatives along $$\mathbf v=(1,0)$$ and $$\mathbf w=(0,1)$$ are both $$0$$.

But the directional derivative along $$\mathbf v+\mathbf w=(1,1)$$ is

$$\lim_{t\to0}\frac{f(t,t)-f(0,0)}{t}=\lim_{t\to0}\frac{\text{sgn}(t)\sqrt{t^2}}{t}$$

$$=\lim_{t\to0}\frac{\text{sgn}(t)\,|t|}{t}=\lim_{t\to0}\frac{t}{t}=1.$$

More generally, the directional derivative along $$(a,b)$$ is

$$\lim_{t\to0}\frac{f(at,bt)-f(0,0)}{t}=\lim_{t\to0}\frac{\text{sgn}(a)\text{sgn}(t)\sqrt{|ab|}\,|t|}{t}$$

$$=\text{sgn}(a)\sqrt{|ab|}.$$

• See the graph here. Jul 28, 2020 at 20:49
• Very nice counterexample! And you can even simplify it more, I believe, taking simply $\;f(x,y)=\sqrt{|xy|}\;$ and, again, taking the dir. deriv. on the same directions on the origin. Jul 28, 2020 at 20:53
• No, that doesn't work with two sided derivatives; the limit with $t\to0^+$ is $1$, but the limit with $t\to0^-$ is $-1$. Jul 28, 2020 at 20:54
• @mr I don't understand that: it anyways fulfills $\;f(0,y)=f(x,0)=f(0,0)\;$, and thus both dir. der. at the origin in the directions $\;(1,0),\,(0,1)\;$ are zero, but not so in the direction of $\;(1,1)\;$ since the limit doesn't even exist... Jul 28, 2020 at 20:57
• Okay, I guess I was assuming that the limit should exist. See Philipp's comment to the OP. Jul 28, 2020 at 20:58

If $$\;f\;$$ is differentiable at $$\;a\;$$ it is pretty easy, since then by linearity of the scalar product (or inner product, to name it with other words) we get

$$D_{v+w}f(a)=\nabla f(a)\cdot(v+w)=\nabla f(a)\cdot v+\nabla f(a)\cdot w=D_vf(a)+D_wf(a)$$

If $$\;f\;$$ isn't differentiable then it may not be true...but I can't produce a counterexample right now.

Assuming that $$f$$ is differentiable at $$x=a$$ we have

$$f(\mathbf a+t\mathbf v+t\mathbf w)=f(\mathbf a)+\nabla f(\mathbf a)\cdot(t\mathbf v+t\mathbf w)+o(|t\mathbf v+t\mathbf w|)=\\=f(\mathbf a)+\nabla f(\mathbf a)\cdot t\mathbf v+\nabla f(a)\cdot t\mathbf w+o(|t\mathbf v+t\mathbf w|)$$

therefore

$$\frac{ f(\mathbf a+t\mathbf v+t\mathbf w)-f(\mathbf a)}t=\nabla f(\mathbf a)\cdot \mathbf v+\nabla f(\mathbf a)\cdot \mathbf w+\frac{o(|t\mathbf v+t\mathbf w|)}{t}$$

and

$$\lim _{t \rightarrow 0} \frac{f(\mathbf a+t\mathbf v+t\mathbf w)-f(\mathbf{a})}{t}=\nabla f(\mathbf a)\cdot \mathbf v+\nabla f(\mathbf a)\cdot \mathbf w=D_{\mathbf{v}} f(\mathbf{a})+D_{\mathbf{w}} f(\mathbf{a})$$

• Yes. in that case it is pretty easy (and in fact the proof is way shorter...), but what if $\;f\;$ isn't differentiable...? Jul 28, 2020 at 20:16
• @DonAntonio I suppose it is not true if f is not diffrentiable, but I don't have a proof! Can we find a couterexample.
– user
Jul 28, 2020 at 20:18
• @user That's what I suspect also... Jul 28, 2020 at 20:19

As a counter example when $$f$$ is not differentiable, suppose $$f(0) = 0$$. Then take $$f(x) = 0$$ along the lines $$\{ te_1 \in \mathbb{R}^n \ | \ t\in\mathbb{R}\}$$ and $$\{t e_2\in \mathbb{R}^n \ | \ t\in\mathbb{R} \}$$ then $$D_{e_1}f(0) = 0, \ D_{e_2}f(0) = 0$$ Set $$f(x) = \text{sgn}(x_1)|x|$$ for $$x\in \{ t(e_1+e_2)\in \mathbb{R}^n \ | \ t\in\mathbb{R} \}$$ then \begin{align} D_{e_1+e_2}f(0) &= \lim_{t\rightarrow 0}\frac{f(t(e_1+e_2)) - f(0)}{t} \\ &= \lim_{t\rightarrow 0}\frac{\sqrt{2}|t|\text{sgn}(t) - 0}{t} \\ &= \sqrt{2} \\ &\neq D_{e_1}f(0) + D_{e_2}f(0) \end{align}

Let $$f:\mathbb{R}^2 \to \mathbb{R}$$ be one on the axes and zero everywhere else.

Then $$D_{e_k} f(0) = 0$$ but the directional derivative in any other direction does not exist.