Extrema, Concavity, and Optimization
Learning Objectives
- Define absolute and local extrema, state the Extreme Value Theorem with its hypotheses, and give examples where dropping a hypothesis destroys the conclusion.
- Find critical points and explain why a critical point is a candidate, not a verdict.
- Locate the absolute extrema of a continuous function on a closed interval, including the endpoints.
- Classify critical points with the first and second derivative tests, and recognize the case where the second derivative test says nothing.
- Read concavity and inflection points from the sign of , and set up and solve an optimization word problem with the correct domain.
Context & Motivation
Training a model, tuning a cache size, choosing a block length for a data structure, and sizing a container are all the same question: which input makes some quantity as small or as large as possible? Single-variable calculus gives a complete method. Differentiate, find where the slope vanishes or fails to exist, and compare. The same pattern generalizes: gradients-extending-derivatives-to-several-variables sets the gradient to zero in many variables, and critical-points-and-the-second-derivative-test handles the classification step with a matrix of second derivatives.
This lesson builds on the-mean-value-theorem-and-monotonicity: the first derivative test is that lesson's sign-of-the-derivative result applied on both sides of a point, and the second derivative test is the same result applied to . The care this subject demands lies in the details: which points must be examined, which tests apply, and which domain the problem actually lives on.
Core Theory
Extrema and the Extreme Value Theorem
A value is an absolute maximum on a set if for every , and a local maximum if that inequality holds for all in some open interval around . Minima are defined with the inequality reversed.
Extreme Value Theorem. If is continuous on a closed, bounded interval , then attains an absolute maximum and an absolute minimum on .
Both hypotheses are needed. The function on the open interval is continuous but has neither a maximum nor a minimum, since values get arbitrarily close to and without reaching them. On the closed interval define for and . It is not continuous at , the values approach but never reach it, and there is no maximum. The theorem guarantees existence; it does not say where the extremum is.
Critical points
By Fermat's observation from the previous lesson, if has a local extremum at an interior point and exists, then . A critical point is an interior point of the domain where or does not exist. Every interior local extremum is at a critical point. The converse is false: has but no extremum.
The closed interval method
For continuous on :
- Find all critical points in .
- Evaluate at each critical point and at and .
- The largest value is the absolute maximum and the smallest is the absolute minimum.
The Extreme Value Theorem guarantees the extrema exist, and Fermat guarantees that any not at an endpoint is at a critical point. This is why the endpoints are on the list: an extremum can sit where the derivative is nowhere near zero.
First and second derivative tests
First derivative test. Let be a critical point and continuous at , and suppose has a constant sign on each side of . If changes from negative to positive at , is a local minimum. If it changes from positive to negative, a local maximum. If keeps the same sign on both sides, there is no extremum. This follows from the monotonicity results of the previous lesson on each side of , and it works even when does not exist. If changes sign infinitely often near , the test does not apply (Example 2).
Second derivative test. Suppose and exists near and is continuous at . If , has a local minimum at ; if , a local maximum. If , the test is inconclusive: any of the three outcomes can occur, as Example 2 shows. The test also requires to exist and equal zero, so it cannot classify a corner or a cusp.
Concavity and inflection points
If on an interval, then is increasing there (previous lesson, applied to ), so the slopes grow from left to right and the graph bends upward: is concave up. If , is concave down. An inflection point is a point where is continuous and the concavity changes. At such a point either or does not exist, but neither condition is sufficient by itself. The sign of must actually change.
Worked Examples
Example 1: absolute extrema on a closed interval
Find the absolute extrema of on . The function is a polynomial, so it is continuous and the method applies. Since , the critical points are , both inside the interval. Evaluating:
textx = -2 -1 1 3 f(x) = -2 2 -2 18
The absolute maximum is at the endpoint , where . The absolute minimum is , attained at two different points, and . The value is a local maximum only. The second derivative confirms it: (local maximum) and (local minimum). Since changes sign at , there is an inflection point at , with concave down to its left and concave up to its right.
Example 2: when the tests go silent
Five functions, all with a critical point at .
- : and . Local and absolute minimum.
- : and . Local and absolute maximum.
- : and . No extremum.
- : neither nor exists. Absolute minimum.
- with : , and does not exist. Strict absolute minimum.
Here means , and and below mean and : the real-root reading, defined for negative . In code use numpy.cbrt, since numpy.power(-1.0, 2/3) is nan.
The second derivative test is silent on the first three functions, since each time. The first derivative test settles them: for , is negative then positive; for the reverse; for , is positive on both sides. For , is negative for and positive for , so the first derivative test finds a minimum at a cusp, where the second derivative test cannot even be stated.
The fifth function defeats both tests. Since for , the minimum is clear. But , while for , , which equals at and at for every large integer . So changes sign infinitely often near (no sign pattern for the first derivative test), and has no limit, so does not exist. Only a direct comparison of values settles it.
Concavity has matching traps. For , but on both sides, so there is no inflection point at . For , does not exist at , and it is positive for and negative for , so there is an inflection point exactly where is undefined.
Example 3: an optimization problem on an open domain
A cylindrical can must hold . What radius minimizes the surface area? With radius and height , volume gives , and the area of the two ends plus the side is
Then gives , so cm. The domain has no endpoints to compare, so we need an argument that this critical point is the minimum. Here for every , so is increasing. With at , this means on all of and on all of . By the monotonicity results of the previous lesson, is decreasing up to and increasing after it, so is the absolute minimum. A numerical check agrees:
textr = 4.0 S = 600.53 r = 5.0 S = 557.08 r = 5.419 S = 553.58 (minimum) r = 6.0 S = 559.53 r = 7.0 S = 593.59
At the optimum : the best can is as tall as it is wide.
Example 4: choosing a block size
Jump search over sorted items skips ahead in blocks of and then scans inside one block. A simple cost model counts about jumps plus up to steps inside a block: . This is a model of the operation count, not an exact comparison count. Take and the closed interval , so the closed interval method applies. gives , with . The endpoints give . The minimum is why this strategy is . In practice must be an integer, so for non-square you compare the two integers beside .
Common Misconceptions & Pitfalls
- "Critical point means extremum." It means candidate. at is a critical point with no extremum.
- " means an inflection point." refutes it. An inflection point requires to change sign.
- "The second derivative test always decides." When it is silent, and it cannot be applied where does not exist. Fall back on the first derivative test, and if has no sign pattern near , compare values directly (Example 2).
- Forgetting the endpoints. In Example 1 the maximum is at , where the derivative is .
- Confusing local with absolute. In Example 1, is a local maximum but far from the largest value.
- Skipping the domain. A formula for is meaningless for , and an optimization on an open or unbounded domain needs an argument, such as the sign of or the behavior as and , because the Extreme Value Theorem does not apply.
Summary
An absolute extremum of a continuous function on a closed bounded interval always exists. It occurs at an endpoint or at an interior critical point, where or does not exist. A critical point is only a candidate: has one and no extremum. The first derivative test classifies it by the sign change of and works even at a cusp, as long as has a constant sign on each side. The second derivative test is quicker when and silent when , as with , , and . Concavity follows the sign of , and an inflection point needs a sign change, not just . Optimization is modeling plus this method: write one variable's formula, fix the domain, find the candidates, compare them, and justify the winner. The next lesson, lhopitals-rule, uses derivatives for a different job, resolving limits that the limit laws cannot.
Documentation Links
- Strang, Herman et al. (2016): Calculus Volume 1, 4.3 Maxima and Minima
- Strang, Herman et al. (2016): Calculus Volume 1, 4.5 Derivatives and the Shape of a Graph
- Strang, Herman et al. (2016): Calculus Volume 1, 4.7 Applied Optimization Problems
- MIT OpenCourseWare (2010): 18.01SC Single Variable Calculus, Unit 2 Part B