Extrema and Rolle's Theorem

Interior extremum and Fermat's lemma

Local extremum

Let ff be defined on an interval II. We say that ff has a local maximum at cc if there is a neighborhood of cc on which f(x)≤f(c)f(x) \leq f(c); a local minimum is defined in the same way. The word local is important: nothing is required far from cc.

An extremum is a maximum or a minimum. It is called interior when cc is not an endpoint of II.

Fermat's lemma

If ff is differentiable at cc, a point in the interior of II, and if ff has a local extremum at cc, then f′(c)=0f'(c) = 0.

Proof, in the case of a local maximum. For h>0h > 0 small enough, f(c+h)≤f(c)f(c + h) \leq f(c), so the difference quotient is negative:

f(c+h)−f(c)h≤0hencef′(c)=lim⁡h→0+f(c+h)−f(c)h≤0\frac{f(c + h) - f(c)}{h} \leq 0 \qquad \text{hence} \qquad f'(c) = \lim_{h \to 0^+} \frac{f(c + h) - f(c)}{h} \leq 0

For h<0h < 0 small enough, the numerator is still negative but the denominator changes sign, so the quotient is positive, and taking the limit from the left, f′(c)≥0f'(c) \geq 0.

The two inequalities give f′(c)=0f'(c) = 0. The case of a minimum follows by applying the above to −f-f.

Three counterexamples to keep in mind

Situation Function What goes wrong
Extremum at an endpoint f(x)=xf(x) = x on [0 ; 1][0 \,;\, 1] maximum at 11, but f′(1)=1≠0f'(1) = 1 \neq 0
Non-differentiable function f(x)=∣x∣f(x) = \lvert x \rvert on [−1 ; 1][-1 \,;\, 1] minimum at 00, no derivative there
False converse f(x)=x3f(x) = x^3 on R\mathbb{R} f′(0)=0f'(0) = 0 with no extremum at 00

The third row is worth remembering as is: f′(c)=0f'(c) = 0 is a necessary condition for an interior extremum, never a sufficient one. That is why studying a function does not stop at where the derivative vanishes, but examines its change of sign.

Classic pitfall

Applying Fermat's lemma at an endpoint of the interval. On [0 ; 1][0 \,;\, 1], the function x↦xx \mapsto x does reach its maximum, at 11, without the derivative vanishing there: the proof uses increments hh of both signs, which no longer makes sense at an endpoint. Always check that the point is interior before writing f′(c)=0f'(c) = 0.