In mathematics, Fermat's theorem (also known as interior extremum theorem) is a method to find local maxima and minima of differentiable functions on open sets by showing that every local extremum of the function is a stationary point (the function derivative is zero in that point). Fermat's theorem is a theorem in real analysis, named after Pierre de Fermat.
Contents
- Statement
- Corollary
- Extension
- Applications
- Intuitive argument
- Proof 1 Non vanishing derivatives implies not extremum
- Proof 2 Extremum implies derivative vanishes
- Cautions
- Continuously differentiable functions
- Pathological functions
- References
By using Fermat's theorem, the potential extrema of a function
Statement
One way to state Fermat's theorem is that, if a function has a local extremum at some point and is differentiable there, then the function's derivative at that point must be zero. In precise mathematical language:
LetAnother way to understand the theorem is via the contrapositive statement: if the derivative of a function at any point is not zero, then there is not a local extremum at that point. Formally:
IfCorollary
The global extrema of a function f on a domain A occur only at boundaries, non-differentiable points, and stationary points. If
Extension
In higher dimensions, exactly the same statement holds; however, the proof is slightly more complicated. The complication is that in 1 dimension, one can either move left or right from a point, while in higher dimensions, one can move in many directions. Thus, if the derivative does not vanish, one must argue that there is some direction in which the function increases – and thus in the opposite direction the function decreases. This is the only change to the proof or the analysis.
Applications
Fermat's theorem is central to the calculus method of determining maxima and minima: in one dimension, one can find extrema by simply computing the stationary points (by computing the zeros of the derivative), the non-differentiable points, and the boundary points, and then investigating this set to determine the extrema.
One can do this either by evaluating the function at each point and taking the maximum, or by analyzing the derivatives further, using the first derivative test, the second derivative test, or the higher-order derivative test.
Intuitive argument
Intuitively, a differentiable function is approximated by its derivative – a differentiable function behaves infinitesimally like a linear function
More precisely, the intuition can be stated as: if the derivative is positive, there is some point to the right of
The intuition is based on the behavior of polynomial functions. Assume that function f has a maximum at x0, the reasoning being similar for a function minimum. If
The theorem (and its proof below) is more general than the intuition in that it doesn't require the function to be differentiable over a neighbourhood around
Proof 1: Non-vanishing derivatives implies not extremum
Suppose that f is differentiable at
The schematic of the proof is:
Formally, by the definition of derivative,
In particular, for sufficiently small
one has replaced the equality in the limit (an infinitesimal statement) with an inequality on a neighborhood (a local statement). Thus, rearranging the equation, if
so on the interval to the right, f is greater than
so on the interval to the left, f is less than
Thus
Proof 2: Extremum implies derivative vanishes
Alternatively, one can start by assuming that
Suppose that
Since the limit of this ratio as
but again the limit as
Hence we conclude that
Cautions
A subtle misconception that is often held in the context of Fermat's theorem is to assume that it makes a stronger statement about local behavior than it does. Notably, Fermat's theorem does not say that functions (monotonically) "increase up to" or "decrease down from" a local maximum. This is very similar to the misconception that a limit means "monotonically getting closer to a point". For "well-behaved functions" (which here mean continuously differentiable), some intuitions hold, but in general functions may be ill-behaved, as illustrated below. The moral is that derivatives determine infinitesimal behavior, and that continuous derivatives determine local behavior.
Continuously differentiable functions
If f is continuously differentiable
If
However, in the general statement of Fermat's theorem, where one is only given that the derivative at
Conversely, if the derivative of f at a point is zero (
One can analyze the infinitesimal behavior via the second derivative test and higher-order derivative test, if the function is differentiable enough, and if the first non-vanishing derivative at
Pathological functions
Consider the function
Continuing in this vein,
This pathology can be understood because, while the function is everywhere differentiable, it is not continuously differentiable: the limit of