Maxima and Minima
What You'll Learn
- 1Define local and absolute extrema and locate every critical point of a function
- 2Apply the first derivative test through a sign chart and the second derivative test where it is valid
- 3Find absolute extrema on a closed interval by comparing endpoints with interior critical points
- 4Translate a word problem into a single-variable objective function with a stated domain
- 5Verify each classification numerically with a short scanning script
Cost engineers minimise the material in a can, structural engineers maximise the load a beam carries before it bows, and statisticians minimise residual squares to fit a line. Every one of those tasks reduces to the same calculus question: where does a differentiable function stop increasing and start decreasing, and how large or small does it get along the way? The derivative answers the location question, and the sign of the derivative on either side answers the classification question. This lesson builds both derivative tests, handles the closed-interval cases that word problems produce, and flags the degenerate points where the standard tests go silent.
Definitions and critical points
Two features of the definitions deserve emphasis. "Local" compares only against nearby values, so a function may have many local extrema and just one absolute one; the flat stretch of between two humps has a local maximum at every point of the stretch, and each one satisfies the definition. And critical points include non-differentiable corners: has a sharp minimum at the origin even though does not exist, which is why a search that solves only misses candidates. The Extreme Value Theorem guarantees that a continuous function on a closed bounded interval attains an absolute maximum and an absolute minimum, and the candidate list is always the same: endpoints plus interior critical points.
| Situation at | Classification |
|---|---|
| changes to | local maximum |
| changes to | local minimum |
| keeps its sign | neither (inflection-like) |
| and | local maximum |
| and | local minimum |
| and | inconclusive, fall back to the first test |
The first derivative test
The test is a statement about signs, so the reliable way to run it is a sign chart: factor completely, mark its zeros and its undefined points on a number line, and read the sign of in each open interval by substituting any convenient test number. If the sign flips at , the classification is settled; if it does not flip, the function climbs straight through and no extremum exists there â the behaviour of at the origin, where the tangent is horizontal but the graph keeps rising. The first derivative test never produces an inconclusive verdict, which is its decisive advantage over the second.
The second derivative test
Curvature gives the test its power and its limit. A positive second derivative means the graph bends upward like a cup, so a horizontal tangent must sit at the bottom of that cup; a negative second derivative bends downward and traps the tangent at a crest. When the curvature vanishes at the critical point the bending may change sign (as in ) or simply be very weak (as in at the origin, which is a maximum despite ), and only the first derivative test separates these cases. Compute with as little effort as possible: if it is already in factored form, substituting the critical point costs one multiplication.
Worked example: classifying a cubic
Find local maxima and minima of .
The two local extrema sit only one unit of height apart, and the function keeps rising after without bound â a reminder that a local maximum need not be the largest value the function ever takes. The sign chart for the same function reads on , on , and on , and both classifications follow from the flips alone, independent of the second derivative.
Absolute extrema on a closed interval
Find absolute max and min of on .
Both and deliver the minimum value, which the question format must allow: "the absolute minimum value" is , while "the point where it occurs" is not unique. On an unbounded domain no absolute maximum may exist at all â the same cubic shoots to infinity â and questions that omit the closed interval are usually testing whether you notice that.
Turning a word problem into a function
Step 2 is where marks are won or lost. The constraint equation must be used to eliminate a variable before the objective is differentiated; carrying two variables and differentiating implicitly works but invites algebra slips. Step 3 quietly determines the answer: a factory cannot produce negative units, a fence length cannot exceed the material on hand, and the endpoints of that domain frequently supply the optimum when the objective function has no interior critical point.
Find the dimensions of a rectangle with perimeter 20 m that has maximum area.
The domain here is ; at the excluded endpoints the area collapses to zero, so the interior critical point is unambiguously the winner. The companion question â minimise perimeter for a fixed area â runs the same machinery and returns the square again, which is the isoperimetric fact behind every honeycomb cell and shipping container. When the constraint is not linear, as in an open-top box cut from a square sheet, the same five-step routine applies; only the algebra of step 2 grows heavier.
Where the tests go silent
Three degenerate cases must be recognised on sight. A horizontal inflection, at the origin, has and no extremum: the sign of does not change. A flat extremum, at the origin, also has but is a genuine maximum because flips from positive to negative â only the first test can certify it. A corner, , has no derivative at all at the critical point and must be classified directly from the definition or from one-sided slopes. CBSE questions probe all three; the unifying advice is that the second derivative test is a convenience, and the first derivative test is the authority.
Scanning critical points in Python
The first script locates critical points of the cubic by a sign scan of the numerical derivative, then classifies them exactly as the sign chart does.
def f(x):
return 2 * x**3 - 9 * x**2 + 12 * x + 15
def fprime(x):
h = 1e-6
return (f(x + h) - f(x - h)) / (2 * h)
guesses = [g * 0.01 for g in range(-50, 300)]
roots = []
for i in range(1, len(guesses)):
a, b = guesses[i - 1], guesses[i]
if fprime(a) * fprime(b) < 0:
roots.append((a + b) / 2)
for c in roots:
left, right = fprime(c - 0.05), fprime(c + 0.05)
kind = "max" if left > 0 > right else "min" if left < 0 < right else "neither"
print(f"critical x = {c:6.3f} f = {f(c):7.3f} {kind}")
The scan finds as a maximum of height 20 and as a minimum of height 19, matching the analytic classification.
The second script evaluates the candidate list for the absolute-extreme problem and sweeps the rectangle family to confirm the square is optimal.
def f(x):
return x**3 - 3 * x + 3
candidates = [-2, -1, 1, 3]
values = [(x, f(x)) for x in candidates]
print("candidates :", values)
print("abs max :", max(values, key=lambda t: t[1]))
print("abs min :", min(values, key=lambda t: t[1]))
best = max(((l, l * (10 - l)) for l in [i * 0.001 for i in range(1, 10000)]),
key=lambda t: t[1])
print("best rectangle:", best)
The candidate table reproduces and , and the sweep lands on with area , confirming the square.
Where marks are lost
The recurring failures are predictable. Differentiating the objective before substituting the constraint, which forces multi-variable calculus into a single-variable problem. Forgetting to test endpoints on a closed interval, so a boundary maximum is missed. Dividing by zero in a second derivative test that should have been abandoned for the first. And declaring an interior critical point "the" maximum without checking the domain endpoints, which silently assumes the question had no boundary solution. A two-minute candidate table eliminates the last two errors entirely.
Common Mistakes
Skipping the endpoint check on a closed interval
Fix: List the two endpoints and every interior critical point, evaluate the function at each, and compare; the absolute extreme always sits somewhere on that list.
Stopping the analysis when the second derivative test returns zero
Fix: A zero second derivative is a signal to run the first derivative test on a sign chart, which classifies flat maxima and horizontal inflections correctly.
Leaving two variables in the objective function
Fix: Use the constraint to write one variable in terms of the other before differentiating, and state the resulting domain so endpoint behaviour is visible.
Key Takeaways
- Local extrema occur only at critical points, which include both zeros of the derivative and points where the derivative fails to exist
- The first derivative test classifies by sign change and never fails; the second derivative test is faster but goes silent when the curvature vanishes
- Absolute extrema on a closed interval come from comparing function values at the endpoints and at every interior critical point
- Word problems need the constraint applied first, the objective reduced to one variable, and the domain stated before any differentiation
- Degenerate points â horizontal inflections, flat maxima and corners â are the designed traps of this topic and are settled only by the first derivative or the definition