Skip to content
Tutorials Center
My learning

Topics

Lesson 20 of 39 · Applications of Derivatives

Extrema and the First Derivative Test

Find maximum and minimum values of a function using critical points and the first derivative test, with worked examples, a plot and a quiz.

Where is a function at its highest? Where is it lowest? Questions like these appear everywhere: the highest profit, the lowest cost, the peak height of a thrown ball. A function's highest and lowest values are called its extrema, and derivatives give a clean way to find them.

This lesson shows you how to find candidates for extrema (critical points) and how to decide which ones are maxima, minima, or neither.

Key words

  • A local maximum at x = c means f(c) is the biggest value of f in some small neighborhood around c.
  • A local minimum is the same with "smallest".
  • The absolute (global) maximum or minimum is the biggest or smallest value on the whole domain being considered.
  • A critical point is an x in the domain where f'(x) = 0 or where f'(x) does not exist.

Why derivatives? At the top of a smooth hill the tangent line is flat, so the slope is zero. That is why local extrema of a smooth function can only happen at critical points. The reverse is not true: a critical point is only a candidate. For example, f(x) = x³ has f'(0) = 0, but x = 0 is neither a maximum nor a minimum.

The first derivative test

Once you have a critical point c, look at the sign of f' just before and just after c:

Sign of f' left of c Sign of f' right of c Conclusion
positive negative local maximum (rising, then falling)
negative positive local minimum (falling, then rising)
same sign on both sides same sign neither (no turning point)

The reasoning is simple. Where f' > 0 the function is increasing, and where f' < 0 it is decreasing. A change from increasing to decreasing is a peak.

Worked example

Let f(x) = x³ - 6x² + 9x + 2. Find and classify its local extrema.

Step 1: differentiate. f'(x) = 3x² - 12x + 9 = 3(x² - 4x + 3) = 3(x - 1)(x - 3).

Step 2: solve f'(x) = 0. The critical points are x = 1 and x = 3.

Step 3: test the sign of f' in the intervals x < 1, 1 < x < 3 and x > 3. Pick a test value in each:

  • x = 0: f'(0) = 9 > 0, increasing.
  • x = 2: f'(2) = 3(1)(-1) = -3 < 0, decreasing.
  • x = 4: f'(4) = 3(3)(1) = 9 > 0, increasing.

So x = 1 is a local maximum (positive then negative) and x = 3 is a local minimum (negative then positive). The values are f(1) = 1 - 6 + 9 + 2 = 6 and f(3) = 27 - 54 + 27 + 2 = 2.

The code below does the same work: it finds critical points with sympy, tests signs just either side, and prints a classification.

Python Classify critical points automatically

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Absolute extrema on a closed interval

If f is continuous on a closed interval [a, b], the Extreme Value Theorem guarantees it has an absolute maximum and an absolute minimum there. To find them:

  1. Find all critical points inside (a, b).
  2. Evaluate f at those points and at the endpoints a and b.
  3. The largest value is the absolute maximum, the smallest is the absolute minimum.

For our function on [0, 4]: f(0) = 2, f(1) = 6, f(3) = 2, f(4) = 64 - 96 + 36 + 2 = 6. The absolute maximum is 6 (at both x = 1 and x = 4) and the absolute minimum is 2 (at both x = 0 and x = 3). The endpoints matter: here they tie with the interior extrema.

Always check the endpoints. A function can reach its biggest value at the edge of the interval without any critical point there.

See it on a plot

The plot below marks the two turning points on the graph of f. The maximum sits where the curve stops rising and begins to fall.

Python Plot the extrema

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A function with a sharp corner

Critical points also include places where f' does not exist. Take g(x) = |x|. At x = 0 the graph has a sharp corner, so g'(0) does not exist. The derivative is -1 to the left and +1 to the right, so by the first derivative test x = 0 is a local (and absolute) minimum.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which statement about a critical point c is true?

    Critical points are only candidates. For example x = 0 for f(x) = x³ is a critical point that is neither a maximum nor a minimum.
  2. 2. If f' changes from negative to positive at x = c, then f has a

    The function falls then rises, so the point is the bottom of a valley.
  3. 3. For f(x) = x² - 4x, what is the critical point?

    f'(x) = 2x - 4 = 0 gives x = 2. Since f' changes from negative to positive there, it is a minimum.
  4. 4. To find the absolute maximum of a continuous function on [a, b] you must also check

    The absolute maximum can occur at an endpoint, so compare f at the critical points and at both endpoints.

Summary

  • Local extrema occur only at critical points: where f' = 0 or f' is undefined.
  • First derivative test: + to - is a maximum, - to + is a minimum, no sign change means neither.
  • On a closed interval, compare f at all critical points and both endpoints to find absolute extrema.
  • A critical point is a candidate, not a guarantee.

Next: Concavity and Curve Sketching