Fermat's theorem on stationary points (source code)

= Fermat's theorem on stationary points
{c}
{title2=$f\text{ differentiable at an interior local extremum }c\Longrightarrow f'(c)=0$}

If a <function> is <differentiable> at an interior <local minimum> or <local maximum>, its <derivative> there is zero. At a <local minimum> $c$, for small $h>0$ the <difference quotient> $(f(c+h)-f(c))/h$ is nonnegative, while for small $h<0$ it is nonpositive. The one-sided <limit of a function> from each side equals $f'(c)$, forcing $f'(c)\geq0$ and $f'(c)\leq0$. Apply the same argument to $-f$ at a <local maximum>.

The converse fails: $f(x)=x^3$ has $f'(0)=0$ but no <local minimum> or <local maximum> at zero. The interior hypothesis is essential; a <minimum> attained only at an endpoint need not have <derivative> zero.