practicecalculus
Differential calculus theorems

Fermat's Theorem on Local Extrema: Statement and Examples

Fermat's theorem: if f has a local max or min at c and f'(c) exists, then f'(c) = 0. Statement, graph, why the converse fails, and worked examples.

Differential calculus theorems Updated 4 min read

At a glance

f'(c) = 0
Also called
Fermat's theorem on stationary points, interior extremum theorem
Hypotheses
f has a local maximum or minimum at an interior point c, and f'(c) exists
Conclusion
f'(c) = 0
Converse
False: f'(c) = 0 does not guarantee an extremum, as x^3 at 0 shows
Used for
Finding critical points, the closed interval method, optimization
Course
Calculus 1
On this page
  1. Statement of Fermat's theorem
  2. What Fermat's theorem means
  3. Why each hypothesis matters, and why the converse fails
  4. Critical points
  5. Worked examples
  6. Common mistakes
  7. Related theorems

Fermat's theorem (on local extrema) says that at the top of a hill or the bottom of a valley on a smooth graph, the tangent line is flat. It is the theorem behind the most common move in calculus: to find a maximum or minimum, set the derivative equal to zero.

Statement of Fermat's theorem

Suppose that

  1. f has a local maximum or local minimum at c, meaning f(c) \ge f(x) (or f(c) \le f(x)) for all x in some open interval around c, and
  2. f'(c) exists.

Then

f'(c) = 0

Because the definition of a local extremum uses an open interval around c, the point c must be an interior point of the domain, not an endpoint.

What Fermat's theorem means

At a local maximum, the function rises up to c and falls after it. Just to the right of c the difference quotient \frac{f(c + h) - f(c)}{h} is \le 0, and just to the left it is \ge 0. If the derivative exists, both one-sided limits are the same number, and the only number that is both \le 0 and \ge 0 is 0.

Fermat's theorem: horizontal tangents at the local max and min of y = x³ − 3x
The local maximum at x = -1 and the local minimum at x = 1 both have horizontal tangent lines, so f'(-1) = f'(1) = 0.

Why each hypothesis matters, and why the converse fails

The derivative must exist. f(x) = |x| has a minimum at x = 0, but f'(0) does not exist because of the corner. Fermat's theorem says nothing there. This is why critical points include points where f' is undefined.

The point must be interior. On [0, 1], f(x) = x has its maximum at the endpoint x = 1, yet f'(1) = 1 \ne 0. Endpoint extrema are not covered by the theorem, so the closed interval method checks endpoints separately.

The converse is false. f(x) = x^3 has f'(0) = 0, but x^3 is negative to the left of 0 and positive to the right, so 0 is not a local extremum. A horizontal tangent makes c a candidate, nothing more. You still need the first or second derivative test.

Critical points

Fermat's theorem justifies this definition: a critical point of f is a number c in its domain where f'(c) = 0 or f'(c) does not exist. Restated, every local extremum of f occurs at a critical point.

Worked examples

Example 1: f(x) = x^4 - 4x^3.

Step 1. f'(x) = 4x^3 - 12x^2 = 4x^2(x - 3).

Step 2. Critical points: x = 0 and x = 3. By Fermat's theorem these are the only possible local extrema.

Step 3. Classify. f'(x) < 0 for x < 0 and for 0 < x < 3, and f'(x) > 0 for x > 3. The function decreases through x = 0, so x = 0 is not an extremum, just like x^3. At x = 3 it switches from decreasing to increasing, so f(3) = 81 - 108 = -27 is a local minimum.

Example 2: a critical point where f' does not exist. For f(x) = x^{2/3},

f'(x) = \frac{2}{3}x^{-1/3} = \frac{2}{3\sqrt[3]{x}}

which is never 0 and is undefined at x = 0. So x = 0 is the only critical point, and since f(x) \ge 0 = f(0) for all x, it is a minimum. Setting f'(x) = 0 alone would miss it.

Example 3: optimization. Two numbers add to 10. Maximize their product P(x) = x(10 - x). Since the maximum is at an interior point and P is differentiable, Fermat's theorem says P'(x) = 10 - 2x = 0, so x = 5 and the maximum product is 25. See optimization problems for more.

Common mistakes

  1. Assuming f'(c) = 0 means an extremum. Always classify critical points with a sign chart or the second derivative.
  2. Ignoring points where f' is undefined. Corners and cusps are critical points too.
  3. Forgetting endpoints. On a closed interval the absolute extremes may sit at the endpoints, where Fermat's theorem does not apply.

Fermat's theorem pairs with the extreme value theorem to give the closed interval method, and it is the key step in proving Rolle's theorem and then the mean value theorem. For classifying critical points and sketching graphs, read curve sketching with derivatives.

Practice it now

Critical points

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is Fermat's theorem in calculus?

It says that if f has a local maximum or local minimum at c and f is differentiable at c, then f'(c) = 0. It is the reason we find extrema by setting the derivative equal to zero.

Is the converse of Fermat's theorem true?

No. f(x) = x^3 has f'(0) = 0, but x = 0 is not a local maximum or minimum because the function increases on both sides. A zero derivative only makes c a candidate.

Is this the same as Fermat's last theorem?

No. Fermat's last theorem is a result in number theory about the equation x^n + y^n = z^n. In calculus, Fermat's theorem refers to the local extremum result f'(c) = 0.

What is a critical point?

A critical point of f is a number c in the domain where f'(c) = 0 or f'(c) does not exist. Fermat's theorem says every local extremum happens at a critical point.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.