Interior extremum theorem

A differentiable function graph with lines tangent to the minimum and maximum. The interior extremum theorem guarantees that these lines will always be horizontal.

In calculus and real analysis, the interior extremum theorem states that any local extremum of a real function at which it is differentiable is a stationary point. It is also known as Fermat's theorem, named after the French mathematician Pierre de Fermat.

The interior extremum theorem gives a necessary, but not sufficient condition for local extrema at which the function is differentiable, as some stationary points are not local extrema.

The second derivative, if non-zero, can be used to determine whether a local extremum at which the function is twice differentiable is a maximum or a minimum. However, the second derivative can be zero at local extrema.