# If $f$ is differentiable in $B(a)$ and $f(x) \leq f(a)$ for all $x$ in $B(a)$, then $\nabla f(a) = 0$

Assume $f$ is differentiable at each point of an n-ball $B(a)$. Prove that if $f(x) \leq f(a)$ for all $x$ in $B(a)$, then $\nabla {f(a)} = 0.$

I had my proof, but I'm not sure it is correct.

Proof: Since f is differentiable at each point of the n-ball B(a), meaning

$$\lim_{h \to 0} \frac{f(a+hy)-f(a)}{h} = \nabla f(a) \cdot y$$ , where y is an arbitrary unit vector.

From the mean value theorem, we know that

$$\lim_{h \to 0} \frac{f(a+hy)-f(a-hy)}{h} = \nabla f(c) \cdot y$$ for some c where $||c|| < r$.

Since

$$\lim_{h \to 0} \frac{f(a+hy)-f(a)}{h} = \nabla f(c) \cdot y = - \lim_{h \to 0} \frac{f(a)-f(a-hy)}{h}$$

Since the RHS of the the first equation is 0, we have $\nabla f(a) = 0$.

So, is there any mistake of any suggestion about the point that I can improve mathematically or about the way that I wrote ?

• Rather use the symbol \nabla. – Did Nov 5 '16 at 6:30
• @Did thanks for pointing out – onurcanbektas Nov 5 '16 at 7:27

You never used the fact that $f(x)\leq f(a)$. I may be missing something, but it seems that your proof would imply that all differentiable functions have this property.

My proof is the following: Compute

$$\lim_{h\to 0 } \frac{f(a+hy)-f(a)}{h} = \nabla f(a) \cdot y,$$

and note that $f(a+hy)\leq f(a)$ for all $h$ sufficiently small, so $\nabla f(a)\cdot y\leq 0$. However, taking $y\mapsto -y=:\tilde{y}$ we again have

$$\lim_{h\to 0} \frac{f(a+h\tilde{y})-f(a)}{h} = \nabla f(a)\cdot \tilde{y},$$

implying $\nabla f(a) \cdot \tilde{y} \leq 0$. But, since $\tilde{y}=-y$ we have $\nabla f(a)\cdot y \geq 0$. Combining this with the first inequality we derive $\nabla f(a) \cdot y =0$. Since $y$ was arbitrary it immediately follows that $\nabla f(a)=0.$

EDIT: To make the last argument explicit: Our above work implies that $\nabla f(a) \cdot y =0$ for any $y$. In particular, take $y=\nabla f(a)$ so that

$$0 = \nabla f(a) \cdot \nabla f(a) = |\nabla f(a)|^2.$$

Then, $|\nabla f(a)|^2 = 0$ only if $\nabla f(a) =0.$

• I couldn't see the combination in the last sentence, could you express it explicitly ? – onurcanbektas Nov 5 '16 at 7:26
• @user251257 it didn't help at all :) – onurcanbektas Nov 5 '16 at 11:53
• @Leth I have made an edit to the proof so that the conclusion should be clear. Please let me know if there is any confusion. – Matt Nov 5 '16 at 14:28

Let $y \in R^n$ an arbitrary vector and let be $\alpha: (-\epsilon,\epsilon) \to B(a)$ given $\alpha(h) = a + hy$. Then the differentiable function $g: (-\epsilon,\epsilon) \to R$ where $g = f \circ \alpha$ has critical value in $h=0$ and therefore $$0 = g´(0) = \nabla f . y$$, how $y$ is arbitrary, this implies that $\nabla f = 0$

• how do we know that g has a critical value at h=0 ? – onurcanbektas Nov 5 '16 at 8:43
• @Leth It has a local minimum and is differentiable at $0$. – egreg Nov 5 '16 at 9:46
• Can you prove it ? Without proving saying that it has some property is meaningless unless it is obvious. – onurcanbektas Nov 5 '16 at 9:54
• Your Hipotesis that $f(x) \leq f(a)$ more the fact that I'm do choosing $\epsilon > 0$ such that $\alpha(h) \in B(a)$ for for all $|h| < epsilon$ implies that $g$ has maximal value in $h = 0$ and therefore $h =0$ is critical point. – A.D. Nov 5 '16 at 10:49
• I'm sorry I can't see the obvious implication, but I'm lost with the phrase "implies".I guess I don't remember the theorem that allows you to say "implies" – onurcanbektas Nov 5 '16 at 11:56