Local Extrema: First and Second Derivative Tests

A local maximum or minimum of a differentiable function can occur only where f′(x) = 0 (a critical point), and the first derivative test (sign change of f′) or the second derivative test (sign of f″) decides which it is. In brief: for f(x) = x3 − 3x, f′(x) = 3x2 − 3 = 0 at x = ±1. Since f″(x) = 6x, f″(−1) = −6 < 0 gives a local maximum f(−1) = 2, and f″(1) = 6 > 0 gives a local minimum f(1) = −2.

Extrema are the highest and lowest points in a neighborhood, and they are the answers to questions about maximum profit, minimum cost and the best design. The theory of local extrema provides systematic tests, and on a closed interval the absolute maximum and minimum are found by comparing the critical values with the endpoint values. This guide states Fermat’s theorem, the two tests with their limitations, the closed interval method, the case of non-differentiable points, with worked examples and a summary table.

What are local and absolute extrema?

A function f has a local maximum at c if f(c) ≥ f(x) for all x in some neighborhood of c, and a local minimum if f(c) ≤ f(x) nearby. An absolute (global) maximum on a set is the largest value on the whole set. By the extreme value theorem, a continuous function on [a, b] has an absolute maximum and minimum, which occur at critical points or at the endpoints.

What does Fermat’s theorem say?

If f has a local extremum at c and f is differentiable at c, then f′(c) = 0. The converse is false: f(x) = x3 has f′(0) = 0 but no extremum at 0. A critical point is a point c in the domain with f′(c) = 0 or f′(c) not defined. Local extrema can only occur at critical points (and endpoints). So the search is: solve f′ = 0, add the points where f′ does not exist, then test each.

What is the first derivative test?

Let c be a critical point where f is continuous.

The test works for all critical points, including those where f′ does not exist.

Example 1: a polynomial

f(x) = 2x3 − 9x2 + 12x. f′ = 6x2 − 18x + 12 = 6(x − 1)(x − 2). Sign: + for x < 1, − for 1 < x < 2, + for x > 2. So a local maximum at x = 1: f(1) = 5, and a local minimum at x = 2: f(2) = 4.

1 2 3 5 + − +

Example 2: no extremum

f(x) = x3: f′ = 3x2 ≥ 0, which is + on both sides of 0. No extremum at x = 0.

Example 3: a corner

f(x) = |x − 2| + 1: f′ does not exist at x = 2; f′ = −1 for x < 2 and +1 for x > 2. The sign changes from − to +, so there is a local (and absolute) minimum f(2) = 1.

Example 4: a cusp

f(x) = x2/3 has f′(x) = (2/3)x−1/3, not defined at 0. f′ < 0 for x < 0 and f′ > 0 for x > 0, so there is a minimum at 0 with f(0) = 0.

Example 5: with an exponential

f(x) = x e−x. f′ = e−x(1 − x) = 0 at x = 1; sign + before, − after: a local maximum f(1) = 1/e ≈ 0.368, which is also the absolute maximum, since f → 0 as x → ∞ and f < 0 for x < 0.

What is the second derivative test?

Suppose f′(c) = 0 and f″ exists near c.

Example 6

f(x) = x4 − 8x2. f′ = 4x3 − 16x = 4x(x − 2)(x + 2), critical points 0, ±2. f″ = 12x2 − 16. f″(0) = −16 < 0: local maximum f(0) = 0. f″(±2) = 32 > 0: local minima f(±2) = 16 − 32 = −16.

−2 2 −16

Example 7: an inconclusive case

f(x) = x4: f′(0) = 0 and f″(0) = 0. The first derivative test shows f′ = 4x3 changes from − to +, so a minimum. For f(x) = x3: f″(0) = 0 and there is no extremum. In general, for the first nonzero derivative f(n)(c): if n is even, it is an extremum (a min for f(n) > 0, max for < 0); if n is odd, it is not.

Example 8: trigonometric

f(x) = sin x + cos x on [0, 2π]. f′ = cos x − sin x = 0 at x = π/4 and 5π/4. f″ = −sin x − cos x: f″(π/4) = −√2 < 0 (maximum, f = √2) and f″(5π/4) = +√2 > 0 (minimum, f = −√2).

How do you find absolute extrema on a closed interval?

  1. Find the critical points in (a, b).
  2. Compute f at each critical point and at the endpoints a and b.
  3. The largest value is the absolute maximum and the smallest is the absolute minimum.

Example 9

f(x) = x3 − 3x2 + 1 on [−1, 4]. f′ = 3x2 − 6x = 3x(x − 2): critical points 0 and 2. Values: f(−1) = −1 − 3 + 1 = −3; f(0) = 1; f(2) = 8 − 12 + 1 = −3; f(4) = 64 − 48 + 1 = 17. Absolute maximum 17 at x = 4, and absolute minimum −3 at both x = −1 and x = 2.

−1 2 4 −3 1 17

Example 10: a rational function

f(x) = x/(x2 + 1) on [0, 3]. f′ = (1 − x2)/(x2 + 1)2 = 0 at x = 1. f(0) = 0, f(1) = 0.5, f(3) = 0.3. Maximum 0.5 at x = 1; minimum 0 at x = 0.

Summary table of tests

Tests for a critical point c
Situation Conclusion Example
f′ changes from + to −local maximum2x³ − 9x² + 12x at x = 1
f′ changes from − to +local minimum2x³ − 9x² + 12x at x = 2
f′ keeps its signno extremumx³ at x = 0
f′(c) = 0 and f″(c) > 0local minimumx⁴ − 8x² at x = 2
f′(c) = 0 and f″(c) < 0local maximumx⁴ − 8x² at x = 0
f′(c) = 0 and f″(c) = 0inconclusivex⁴ (min), x³ (none)
f′ does not exist at cuse the first derivative test|x − 2| at x = 2

Where do these tests come from?

Pierre de Fermat described a method for finding maxima and minima in the 1630s (his method of adequality), setting the “derivative” of a quantity to zero, and Fermat’s theorem is named after this. The second derivative test was developed by Newton, Leibniz and the Bernoulli family, and Maclaurin and Euler gave systematic treatments in the eighteenth century. The question of the highest or lowest values led later to the calculus of variations.

Where are they used?

Businesses find the production level that maximises profit P(q) = R(q) − C(q) by solving P′ = 0, which gives the point where marginal revenue equals marginal cost. Engineers minimise the material for a container of given volume, and physicists find equilibrium positions where the potential energy has a minimum.

Which mistakes are common?

Assuming that f′(c) = 0 gives an extremum

x3 has f′(0) = 0 but no extremum.

Using the second derivative test when f″(c) = 0

The test is inconclusive. Use the sign of f′ around c.

Forgetting the endpoints

On a closed interval, the absolute extrema may be at the endpoints, as at x = 4 in Example 9.

Confusing local and absolute extrema

A local maximum need not be the highest value of the function. Compare all candidates.