Why Interior Extrema Constrain the Derivative
A local maximum or minimum describes how the function behaves near a point: nearby function values do not exceed, or fall below, the value at that point. Differentiability describes the limiting slope of secant lines through the point. Fermat’s theorem connects these ideas: if the point is an interior local extremum and the derivative exists there, that limiting slope must be zero.
The conditions matter. The point must be interior to the domain, the function must have a local extremum there, and the derivative must exist there. The theorem gives a necessary condition, not a test that by itself proves a local extremum.
The Hypotheses and Conclusion
A point \(c\) is an interior point of the domain if there is some \(\varepsilon>0\) such that every point in \((c-\varepsilon,c+\varepsilon)\) belongs to the domain. This ensures that the function is defined both to the left and to the right of \(c\), at least sufficiently close to it.
The function \(f\) has a local maximum at \(c\) if there is a \(\delta>0\) such that \(f(x)\leq f(c)\) for every domain point \(x\) with \(|x-c|<\delta\). It has a local minimum at \(c\) if there is a \(\delta>0\) such that \(f(x)\geq f(c)\) for every such \(x\). These definitions allow equality: nearby values need not be strictly smaller or strictly larger.
Differentiability at \(c\) means that the following finite limit exists:
The quotient in this limit is the slope of a secant line. Fermat’s theorem says that the two-sided limit of these slopes must be zero when the hypotheses hold.
Proof of Fermat’s Theorem
We prove the local-maximum case first. Suppose \(f\) has a local maximum at the interior point \(c\), and \(f\) is differentiable at \(c\). By interiority, choose \(\varepsilon>0\) such that \((c-\varepsilon,c+\varepsilon)\) lies in the domain. By the local-maximum condition, choose \(\delta>0\) such that \(f(x)\leq f(c)\) for domain points satisfying \(|x-c|<\delta\).
Set \(\rho=\min(\varepsilon,\delta)\). This choice ensures both that \(c+h\) is in the domain and that the local-maximum inequality applies whenever \(0<|h|<\rho\). For positive \(h\), the numerator is nonpositive and the denominator is positive, so the quotient is nonpositive. For negative \(h\), the numerator is still nonpositive, but the denominator is negative, so the quotient is nonnegative.
Because \(f'(c)\) exists, both one-sided limits of the difference quotient equal the same number, \(f'(c)\). The limit from positive \(h\) is at most zero, so \(f'(c)\leq 0\). The limit from negative \(h\) is at least zero, so \(f'(c)\geq 0\). Therefore \(f'(c)=0\).
For a local minimum, the inequalities reverse. With the same choice of \(\rho\), \(f(c+h)-f(c)\geq 0\) for \(0<|h|<\rho\). Thus the quotient is nonnegative for positive \(h\), and nonpositive for negative \(h\). Taking the one-sided limits gives \(f'(c)\geq 0\) and \(f'(c)\leq 0\), respectively. Hence \(f'(c)=0\) in this case as well.
Applying the Theorem
Worked Example: A Differentiable Local Minimum
Consider \(f(x)=x^2\) at \(c=0\). First verify the local-minimum condition. For every real \(x\), \(x^2\geq 0\), and \(f(0)=0\). Thus \(f(x)\geq f(0)\) for all \(x\), so in particular \(f\) has a local minimum at \(0\). The point is interior because the domain is \(\mathbb R\).
Compute the derivative at \(0\) from its definition:
The derivative exists, and its value is zero, as Fermat’s theorem predicts. As a check on the extremum, \(f(x)-f(0)=x^2\geq 0\), with equality at \(x=0\).
Worked Example: A Differentiable Local Maximum
Let \(g(x)=5-(x-2)^2\), and consider \(c=2\). Since \((x-2)^2\geq 0\), we have \(g(x)=5-(x-2)^2\leq 5=g(2)\) for every real \(x\). Thus \(g\) has a local maximum at \(2\), and \(2\) is interior to its domain \(\mathbb R\).
Using the derivative rule for a square, \(g'(x)=-2(x-2)\), so
The hypotheses are satisfied and the derivative is zero. To check the maximum directly, \(g(2)=5\), while \(g(x)=5-(x-2)^2\leq 5\) for every \(x\). This confirms the asserted local-maximum property.
Worked Example: A Local Minimum Without a Derivative
Consider \(q(x)=|x|\) at \(c=0\). Since \(|x|\geq 0=|0|\) for every real \(x\), the function has a local minimum at \(0\); this point is interior to the domain. We check differentiability rather than assuming it.
For \(h>0\), \(|h|=h\), so the difference quotient is
For \(h<0\), \(|h|=-h\), so it is
The right-hand limit is \(1\), while the left-hand limit is \(-1\). Since they are unequal, \(q'(0)\) does not exist. Fermat’s theorem does not apply: its differentiability hypothesis fails. There is no contradiction, because the theorem makes a claim only when all its hypotheses hold.
What the Theorem Does—and Does Not—Say
Fermat’s theorem has the logical form: if a differentiable function has an interior local extremum at \(c\), then \(f'(c)=0\). It gives a necessary condition. It does not say that every point where \(f'(c)=0\) is a local maximum or minimum. A zero derivative alone is not a sufficient condition for an extremum.
It also does not say that every local extremum has zero derivative without qualification. Differentiability is essential, as the absolute-value example shows. Interiority is essential to the proof’s two-sided argument: the definition of an interior point guarantees domain values on both sides, while a domain may fail to contain such a neighborhood at a boundary point. The theorem as stated makes no conclusion for a point that is not interior.
A Common Mistake: Reversing the Implication
A frequent error is to treat Fermat’s theorem as if it said that \(f'(c)=0\) guarantees a local extremum. That reverses the implication. The theorem starts with a differentiable interior local extremum and concludes that the derivative is zero; it does not establish an extremum from the derivative condition.
For example, for \(r(x)=x^3\), the derivative is \(r'(x)=3x^2\), so \(r'(0)=0\). But \(r(x)<0\) for \(x<0\) and \(r(x)>0\) for \(x>0\). Consequently, values near \(0\) occur both below and above \(r(0)=0\), so \(0\) is neither a local maximum nor a local minimum. The calculation \(r'(0)=0\) is correct; the mistaken conclusion that this alone proves an extremum is not.
Why the Hypotheses Matter in Optimization
When searching for local extrema of a differentiable function, Fermat’s theorem tells us that any interior extremum must occur where the derivative is zero. This narrows the search, but it does not settle whether a point is an extremum. Each candidate still requires further analysis of the function’s behavior. Conversely, an extremum where differentiability fails is not ruled out by this theorem, because it falls outside the theorem’s assumptions.
Confirm that a two-sided open interval around \(c\) lies in the domain.
Establish that nearby domain values are all at most \(f(c)\), or all at least \(f(c)\).
Verify that the derivative exists at \(c\).
If all three conditions hold, Fermat’s theorem gives \(f'(c)=0\).
Summary
Fermat’s theorem links local behavior to the derivative: a differentiable function has derivative zero at any interior local maximum or local minimum. The proof compares difference quotients from the two sides; their sign constraints are compatible with a common limit only when that limit is zero.
The assumptions are part of the result, not optional details. Interiority supplies domain points on both sides, differentiability supplies a common limiting slope, and the local-extremum condition supplies the quotient inequalities. The conclusion is necessary under these hypotheses, but a zero derivative alone does not establish a local extremum.
Check Your Understanding
Use the theorem’s hypotheses carefully when answering these questions.
- State Fermat’s theorem for a local maximum, including the conditions on the point and the function.
- In the proof for a local maximum, why is the difference quotient nonpositive when \(h>0\), but nonnegative when \(h<0\)?
- Why must the proof choose a neighborhood that ensures both domain membership and the local-extremum inequality?
- What does Fermat’s theorem conclude if a differentiable function has an interior local minimum at \(c\)?
- Why does a local minimum of \(q(x)=|x|\) at \(0\) not contradict Fermat’s theorem?
- Does \(f'(c)=0\) by itself prove that \(f\) has a local extremum at \(c\)? Explain.