[Math] Proof that the derivative of an extremum is $0$

derivativesreal-analysis

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?

Best Answer

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)