A Necessary Condition at an Interior Extremum
The Mean Value Theorem connects a secant slope to a derivative somewhere between its endpoints. Fermat’s Theorem gives a different kind of information: if a differentiable function has a local maximum or minimum at an interior point, then its derivative there must be zero. It turns a geometric observation about the graph into a precise condition that can help locate extrema.
The word interior matters. A function may attain its largest or smallest value at an endpoint, where the theorem makes no claim. Differentiability matters too: a graph can have a local extremum at a point where there is no derivative. We will state the theorem, explore these distinctions, and use the result to organize the search for absolute extrema on a closed interval. The proof of Fermat’s Theorem follows in the next tutorial.
Local Extrema and Fermat’s Theorem
Let \(I\) be an interval and let \(a\) be an interior point of \(I\). The function \(f\) has a local maximum at \(a\) if there is some \(\delta>0\) such that \(f(x)\leq f(a)\) whenever \(x\in I\) and \(|x-a|<\delta\). It has a local minimum at \(a\) if there is some \(\delta>0\) such that \(f(x)\geq f(a)\) for all such \(x\). A local extremum is either a local maximum or a local minimum. These definitions compare nearby values, not necessarily every value on the domain.
The condition \(f'(a)=0\) is called a stationary-point condition. Fermat’s Theorem says that it is necessary for a differentiable function to have a local extremum at an interior point. A necessary condition is not automatically sufficient: satisfying it does not, by itself, guarantee an extremum.
Worked Example: A Local Minimum of a Quadratic
Consider \(f(x)=(x-3)^2+2\), defined for all real \(x\). For every \(x\),
Thus \(f(3)\leq f(x)\) for every \(x\), so \(x=3\) is not only a local minimum but also an absolute minimum. The derivative is \(f'(x)=2(x-3)\), and therefore \(f'(3)=2(3-3)=0\), as Fermat’s Theorem requires. In this example the stationary point can be identified directly, but the theorem itself is a necessary-condition result: it does not say that every stationary point is a minimum.
Why Interior and Differentiability Are Essential
The conclusion can fail at an endpoint because the function is only being compared with points on one side. For instance, let \(f(x)=x\) on \([0,1]\). The point \(0\) is an absolute minimum on this domain, but the derivative at \(0\) is \(1\), not \(0\). There is no contradiction: \(0\) is not an interior point of \([0,1]\). The derivative condition in Fermat’s Theorem concerns points where nearby domain points are available on both sides.
Worked Example: An Endpoint Minimum with Nonzero Derivative
For \(f(x)=x\) on \([0,1]\), if \(x\in[0,1]\), then \(x\geq0=f(0)\). Hence \(0\) is an absolute minimum. Also, for any nonzero \(h\) with \(0+h\in[0,1]\),
Thus the right-hand derivative at \(0\) is \(1\). This example shows why one cannot apply Fermat’s Theorem at an endpoint, even if a one-sided derivative exists there.
Differentiability cannot be dropped either. Consider \(g(x)=|x-2|\) on the real line. Since \(g(2)=0\) and \(g(x)\geq0\) for every \(x\), the point \(2\) is an absolute minimum. But \(g\) is not differentiable there: for \(h>0\), the difference quotient at \(2\) is \(1\), while for \(h<0\), it is \(-1\). The two-sided derivative does not exist. Fermat’s Theorem does not apply, and its conclusion is not available.
Worked Example: A Minimum Where the Derivative Does Not Exist
Let \(g(x)=|x-2|\). For \(h\ne0\),
The right- and left-hand limits of this quotient are different, so \(g'(2)\) does not exist. Nevertheless, \(|x-2|\geq0=g(2)\) for every \(x\), which verifies that \(2\) is a minimum. This is consistent with Fermat’s Theorem because its differentiability hypothesis is not satisfied.
A Zero Derivative Need Not Give an Extremum
Fermat’s Theorem cannot be reversed: a zero derivative does not ensure that the point is a local maximum or minimum. The next example verifies this limitation explicitly. It also highlights the difference between a stationary point and an extremum.
Proof. The power rule gives \(p'(x)=3x^2\), so \(p'(0)=3\cdot0^2=0\). For any \(\delta>0\), choose \(t\) with \(0<t<\delta\). Then both \(t\) and \(-t\) are within distance \(\delta\) of \(0\), and
There are therefore values arbitrarily close to \(0\) that are smaller than \(p(0)\), and values arbitrarily close that are larger. The definition of a local maximum fails because \(p(t)>p(0)\); the definition of a local minimum fails because \(p(-t)<p(0)\). Thus \(0\) is neither. \(\square\)
In applications, \(f'(a)=0\) identifies a point worth checking; it does not settle what happens there. One must still examine the function’s values, its behavior on either side, or other information relevant to the problem. The point \(0\) for \(x^3\) is a direct warning against treating every solution of \(f'(x)=0\) as an extremum.
Using Fermat’s Theorem on a Closed Interval
Fermat’s Theorem becomes especially useful when combined with the Extreme Value Theorem. A continuous function on a closed bounded interval attains both an absolute maximum and an absolute minimum. If an attained extreme occurs in the interior and the function is differentiable there, Fermat’s Theorem says its derivative must vanish. The endpoints must also be checked.
Proof. By the Extreme Value Theorem, \(f\) attains an absolute maximum and an absolute minimum on \([a,b]\). Let \(x_{\max}\in[a,b]\) be a point where the maximum is attained. If \(x_{\max}=a\) or \(x_{\max}=b\), it is an endpoint. Otherwise, \(x_{\max}\in(a,b)\). In that case \(f\) has a local maximum at \(x_{\max}\), since its value there is at least as large as \(f(x)\) for every \(x\in[a,b]\), and in particular for all nearby \(x\). The function is differentiable at \(x_{\max}\), so Fermat’s Theorem gives \(f'(x_{\max})=0\).
Now let \(x_{\min}\in[a,b]\) be a point where the minimum is attained. If it is an endpoint, the claim holds. If it lies in \((a,b)\), then it is a local minimum and \(f\) is differentiable there. Fermat’s Theorem gives \(f'(x_{\min})=0\). This proves the assertion for both absolute extrema. \(\square\)
This theorem supplies a search procedure, not a promise that each candidate is an extremum. Evaluate the function at both endpoints and at every interior solution of \(f'(x)=0\), then compare those values. Fermat’s Theorem justifies why no other interior point can be where an absolute extreme is attained under the stated assumptions.
Worked Example: Comparing Endpoint and Stationary-Point Values
Find the absolute maximum and minimum of \(f(x)=x^3-3x\) on \([-2,2]\). This polynomial is continuous on the closed interval and differentiable in its interior, so the candidate theorem applies. Its derivative is
The interior stationary points are \(x=-1\) and \(x=1\). We evaluate the function at these points and at both endpoints:
The largest candidate value is \(2\), attained at \(x=-1\) and \(x=2\), and the smallest is \(-2\), attained at \(x=-2\) and \(x=1\). Because the candidate theorem accounts for every possible location of an absolute extreme, these comparisons establish the absolute maximum and minimum on the whole interval.
What Fermat’s Theorem Does—and Does Not—Say
Fermat’s Theorem is a necessary condition for an interior local extremum, not a complete test for one. It does not claim that a stationary point is an extremum, as \(x^3\) demonstrates. Nor does it cover endpoints or points where the derivative does not exist. Those locations may still be extrema, as the linear function on \([0,1]\) and the absolute-value function illustrate.
When searching for absolute extrema on \([a,b]\), continuity provides existence through the Extreme Value Theorem, while Fermat’s Theorem restricts possible interior locations to stationary points. The endpoints remain candidates regardless of their derivatives. This combination is powerful precisely because its hypotheses and limits are clear: first identify the points where an extreme could occur, then compare the function values at those points.
Check Your Understanding
Use the definitions and results in this tutorial to answer the following.
- State Fermat’s Theorem and identify the two hypotheses that rule out its direct use at an endpoint or at a nondifferentiable point.
- Why does \(f(x)=x\) on \([0,1]\) not contradict Fermat’s Theorem, even though its minimum occurs at \(0\) and \(f'(0)=1\)?
- For \(p(x)=x^3\), verify that the derivative at \(0\) is zero, then explain why values on both sides show that \(0\) is neither a local maximum nor a local minimum.
- When using the candidate theorem to find absolute extrema on a closed interval, which points must be evaluated in addition to the interior solutions of \(f'(x)=0\)?
- For \(f(x)=x^2-4x\) on \([0,5]\), find the endpoint and stationary-point candidates, and evaluate \(f\) at each.