Peaks and valleys
A local maximum is a point of the graph higher than every point near it: a hilltop. A local minimum is lower than every point near it: a valley floor. "Near" means within some small distance on either side.
The global maximum of a function on an interval is its highest value there, and the global minimum its lowest. A local maximum need not be global: another hill may be taller.
An answer has two parts: where, an input in input units, and how much, the value in output units. For there is a hilltop at of height 2. Yet , higher than the hilltop.
Critical points
At a smooth hilltop the graph rises, then falls. The slope goes from positive to negative and passes through 0 on the way, so the tangent is flat for an instant. At a valley floor the slope goes from negative to positive.
A graph can also turn at a corner, where there is no tangent at all. has its lowest point at 0, where lesson 2.2.2 found no derivative.
Rule: Critical point
A point in the domain of where either holds is a critical point. Every local maximum or minimum inside the domain is one. The reverse fails: a critical point can be neither, so test each one.
For , the power and sum rules (lesson 2.3.1) give . It factorises as , which is zero at and . The values there are and .
A polynomial has a slope everywhere, so these two are its only critical points.
The first-derivative test
The slope can change sign only at a critical point. So one test input in each gap between critical points tells you the sign of on the whole gap.
Rule: First-derivative test
Rising then falling is a peak; falling then rising is a valley. If has the same sign on both sides, the point is neither.
For , test one input in each gap:
| 0 | 1 | 2 | |||
|---|---|---|---|---|---|
| 9 | 0 | 0 | 9 | ||
| graph | rising | flat | falling | flat | rising |
So is a local maximum and a local minimum. The factors give the same signs without test inputs. In , both brackets are negative below and both positive above 1, so the product is positive there; in between, they have opposite signs.
Slide the point across below. The slope graph underneath crosses zero from above to below: rising turns into falling. At it crosses from below to above.
Then switch to . At 0 the slope jumps from to 1, and the sign still changes from minus to plus.
Explore
Slide the point along the curve. Its tangent shows the slope there, and the lower graph plots that slope for every x: the derivative.
The slope of y = x³ − 3x, which is 3x² − 3
- Point
- (−1.8, −0.432)
- Slope there
- 6.72
- The curve is
- rising: the slope is positive, so the slope graph is above zero
Neither: a flat point on a rising curve
has slope , which is zero at 0, so 0 is a critical point. But is positive on both sides: 0.03 at and at . The graph rises to 0, flattens for an instant, and keeps rising.
So 0 is neither a maximum nor a minimum. Just left of it the value is lower ( at ), and just right it is higher ( at ). Lesson 2.2.1 met this point: the flat tangent crosses the curve there.
A corner
has slope for and 1 for (lesson 2.2.2). Minus then plus: 0 is a minimum, with value 0. The test needs a slope on each side, not at the point itself.
Try it
SymPy differentiates , solves , and evaluates at the two answers.
The loop prints the slope at one test input in each gap: , 0 and 2.
Try it
Central differences (lesson 2.2.2) estimate the slope just left and just right of 0, for and for .
For both sides give 0.03: no sign change, so neither. For they give and 1: a minimum.
Largest and smallest on a closed interval
A closed interval includes its two ends. A continuous function on a closed interval always has a largest and a smallest value there. Each one sits either at a critical point inside the interval or at an end.
Rule: Extremes on a closed interval
The largest of these values is the global maximum on , and the smallest is the global minimum. Critical points outside the interval do not count.
For on , the candidates are both ends and the two critical points:
| (end) | 1 | 2.5 (end) | ||
|---|---|---|---|---|
| 2 | 8.125 |
The largest value is 8.125, at the right end. The smallest is , reached twice: at the left end and at the local minimum.
The cubic on . The tangents are flat at the local maximum and minimum, but the largest value, 8.125, is at an end. The smallest, , is reached at an end and at the local minimum.
A second example: on
Start with a table of :
| 0 | 0.5 | 1 | 2 | 4 | |
|---|---|---|---|---|---|
| 0 | 0.3033 | 0.3679 | 0.2707 | 0.0733 |
The values climb, then fall, so the peak is near 1. Algebra pins it down. The product rule (lesson 2.3.2), with as the slope of (lesson 2.3.4), gives
is always positive, so has the sign of : plus before 1, minus after. So 1 is a maximum, with . Comparing with the ends, and , the largest value is 0.3679 at 1 and the smallest is 0 at the left end.
Critical points outside, and no ends at all
For on , the slope is zero only at 2, outside the interval. So only the ends compete: the smallest value is at 3, the largest 12 at 6.
Without ends there is no guarantee. On the whole number line has no largest value: it is 970 at and 999,700 at .
Try it
candidates lists both ends and every critical point strictly inside, with the value of at each. max(values, key=values.get) picks the input with the largest value.
The three lines are the three examples of this section. 5/2 is SymPy's exact 2.5.
Lesson 2.4.2 tells a maximum from a minimum with the second derivative. When has no formula, lesson 2.4.3 solves it with Newton's method.
Common mistakes
- does not guarantee a peak or a valley. is flat at 0 and still rising on both sides.
- A critical point can have no derivative. has its minimum at 0, where does not exist.
- Read the sign on both sides. A maximum needs plus then minus; one side alone decides nothing.
- Check the ends of a closed interval. For on the largest value is at the end 2.5.
- Drop critical points outside the interval. For on , the critical point 2 does not count.
- Local is not global. The hilltop 2 of is not its largest value on .
- Report where and how much: the of the maximum and the value there.
Maxima and minima
0 of 10 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- A local maximum or minimum is higher or lower than every nearby point; the global ones on an interval are the highest and lowest of all.
- A critical point is where or does not exist. Every local maximum or minimum inside the domain is one, but not every critical point is either ( at 0).
- First-derivative test: goes plus to minus at a maximum, minus to plus at a minimum, and keeps its sign at neither.
- On , compare at both ends and at each critical point inside.