Tutorials › Calculus I › Fermat’s Theorem for Interior Extrema

Critical Points and Monotonicity · Tutorial 751 of 1495

Fermat's Theorem for Interior Extrema

Learn why a differentiable function’s derivative must vanish at an interior local extremum, and how to check that the theorem’s hypotheses apply.

Intermediate 10 min read

What You'll Learn

  • State Fermat’s theorem for a differentiable function at an interior local extremum
  • Prove the theorem by comparing the signs of difference quotients on either side
  • Identify why the point must be interior to the domain
  • Check whether differentiability and the local-extremum condition both hold
  • Distinguish the theorem’s necessary condition from a guarantee of an extremum
  • Recognize why a nondifferentiable local extremum does not contradict the theorem

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.

Fermat’s theorem: Let \(f\) be defined on a domain containing an open interval around \(c\). If \(f\) is differentiable at \(c\) and has a local maximum or local minimum at \(c\), then \(f'(c)=0\).

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:

$$ f'(c)=\lim_{h\to 0}\frac{f(c+h)-f(c)}{h}. $$

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.

$$ 0<h<\rho \quad\Longrightarrow\quad \frac{f(c+h)-f(c)}{h}\leq 0, $$
$$ -\rho<h<0 \quad\Longrightarrow\quad \frac{f(c+h)-f(c)}{h}\geq 0. $$

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.

Proof’s key point: At a local extremum, the difference quotients on opposite sides of the point have opposite weak sign constraints. If they approach one common derivative, that derivative can only be zero.

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:

$$ f'(0)=\lim_{h\to 0}\frac{f(0+h)-f(0)}{h} =\lim_{h\to 0}\frac{h^2-0}{h} =\lim_{h\to 0}h =0. $$

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

$$ g'(2)=-2(2-2)=-2\cdot 0=0. $$

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

$$ \frac{q(0+h)-q(0)}{h} =\frac{|h|-0}{h} =\frac{h}{h} =1. $$

For \(h<0\), \(|h|=-h\), so it is

$$ \frac{q(0+h)-q(0)}{h} =\frac{|h|-0}{h} =\frac{-h}{h} =-1. $$

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.

Use the theorem only after checking: the point is interior to the domain; a local maximum or minimum occurs there; and the function is differentiable there. Under all three conditions, the conclusion is \(f'(c)=0\).

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.

1
Check the location.
Confirm that a two-sided open interval around \(c\) lies in the domain.
2
Check the local behavior.
Establish that nearby domain values are all at most \(f(c)\), or all at least \(f(c)\).
3
Check differentiability.
Verify that the derivative exists at \(c\).
4
Apply the conclusion.
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.

  1. State Fermat’s theorem for a local maximum, including the conditions on the point and the function.
  2. In the proof for a local maximum, why is the difference quotient nonpositive when \(h>0\), but nonnegative when \(h<0\)?
  3. Why must the proof choose a neighborhood that ensures both domain membership and the local-extremum inequality?
  4. What does Fermat’s theorem conclude if a differentiable function has an interior local minimum at \(c\)?
  5. Why does a local minimum of \(q(x)=|x|\) at \(0\) not contradict Fermat’s theorem?
  6. Does \(f'(c)=0\) by itself prove that \(f\) has a local extremum at \(c\)? Explain.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon