# Proof that the derivative of an extremum is $0$

My notes say that if $f(x_0)$ is an extremum then $f'(x_0)=0$, but i'm having trouble proving it.

I've shown that if $f'(x_0)>0$ then $\exists h>0$ such that $\forall x_1 ,x_2 \in (x_0-h,x_0+h),\; x_1<x_0<x_2 \implies f(x_1)<f(x_0)<f(x_2)$

The result apparently follows trivially from this, but I can't do it. My first thought was to say that if $f(x_0)$ is a maximum then the right inequality doesn't hold and if $f(x_0)$ is a minimum then the left inequality doesn't hold, but I don't see how this implies that $f'(x_0) =0$.

Can anyone help?

• en.wikipedia.org/wiki/…
– user119256
Commented Jan 9, 2014 at 19:27
• Sorry about my last messy comment. If I'm ad-libbing this correctly, it should be "$\forall \epsilon > 0$ there exist $h$ with $0 <h<\epsilon$ such that" Commented Jan 9, 2014 at 19:30
• You are practically there. Suppose $f(x_0)$ is a local maximum: then, you get a contradiction (your right inequality cannot hold). The same happens if you suppose that it's a mininum. Hence, the supposition "$f(x_0)$ is a local extremum" is false. Commented Jan 9, 2014 at 19:47

The claim as written is not correct - it may be the case that $f'(x_0)$ does not even exist! Consider for example $f(x)=|x|$ which has a (local and global) minimum at $0$.

Assume $x_0\in(a,b)$ is a local minimum of $f\colon(a,b)\to\mathbb R$. To reiterate the definition of "local minimum":

For some $r>0$ we have $f(x)\ge f(x_0)$ for all $x$ with $|x-x_0|<r$.

Now assume additionally that $f'(x_0)$ exists. Since $$f'(x_0)=\lim_{h\to0}\frac{f(x_0+h)-f(x_0)}{h}$$ and for all $h$ with $|h|<r$ we have that $f(x_0+h)-f(x_0)\ge0$, we conclude that $$\lim_{h\to0^+}\frac{f(x_0+h)-f(x_0)}{h}\ge 0\qquad \text{and}\qquad\lim_{h\to0^-}\frac{f(x_0+h)-f(x_0)}{h}\le 0.$$ Since both equal $f'(x_0)$, we must have $f'(x_0)=0$.

(Up to signs, the argument for local maxima is the same)

You say you have already proved that if $f'(x_0)>0$ then $f$ does not have an extremum at $x_0$. Well if that is so, then certainly if $f'(x_0)<0$ there is no extremum at $x_0$ either. (Repeat the argument or consider $-f$.) So if $x_0$ is an extremum and $f$ is differentiable at $x_0$ then $f'(x_0)=0$, since neither $f'(x_0)<0$ nor $f'(x_0)>0$. And that is all that you can hope to prove, since it is of course possible that a function is not differentiable at an extremum, consider for example $f(x)=\lvert x\rvert$.

• However, in the latter case you can show that $0 \in \partial f(0)$, where $\partial f$ is the Clarke generalized gradient :-). Commented Jan 9, 2014 at 20:47
• @copper.hat, “all that you can hope to prove” may have been a bit too strong ;) Commented Jan 9, 2014 at 22:34

If $f$ has a local maximum at $x_{0}$ then the slope of the secant line through $(x_{0},f(x_{0}))$ and $(x,f(x))$ is negative for $x > x_{0}$ and is positive for $x < x_{0}$, at least for $x$ near enough to $x_{0}$ (remember, local maximum.) If $f$ also has a derivative at $x_{0}$ then slopes of these secants must both approach the derivative as $x\rightarrow x_{0}$. The only possibility is $f'(x_{0})=0$.

Whatever the values could be, f(x0) is either smaller than the smallest of f(x1) and f(x2) or larger or largest than the largest of f(x1) and f(x2) or larger. This is an extremum.

Now, consider that x1=x0-h and x2=x0+h. What is f(x0)-f(x1) or what is f(x2)-f(x0) ? By defintion, it correpond to h times the derivative. So to fulfill the condition of an extremum, the derivative must cancel at x0.

I hope and wish that this clarifies. If it does not, please post and we shall try together to find another way to explain.