Model it, differentiate it, set f′ = 0, check the range — and find the very best box, fence, and can.
Every curve in this stage has been answering one question — how fast is it changing, right here? Now we turn that answer into a tool. Out in the world we rarely want a slope for its own sake; we want the best one: the box that holds the most, the fence that wraps the largest yard, the can that costs the least metal. The trick is to write the thing you care about as one function — an objective — on the range of inputs that make sense, and then notice that at the very top of a hill, or the very bottom of a valley, the tangent is flat. Set the derivative to zero, solve, and the calculus hands you the optimum.
An optimization problem always arrives as a story: "least material," "most profit," "biggest area." Our job is to translate it into one honest function. Three moves do it every time:
1. Name what you want to make best. That quantity — volume, area, cost, profit — becomes the objective. 2. Get it down to one variable. Use the constraints in the story (a fixed sheet size, a fixed length of fence, a fixed volume) to eliminate every variable but one. 3. State the allowed range. A cut size cannot be negative; a fence length cannot exceed what you have. That interval — the domain — is part of the problem, not an afterthought.
Once the story is a function f(x) on an interval, the calculus from §36.5 takes over: the peaks and valleys live where f′(x) = 0, and on a closed interval we also check the two endpoints.
An optimization problem is a function on a domain. Build the objective f(x), find where f′(x) = 0 (the critical points), and compare those values with the endpoints of the allowed range. The largest is the maximum; the smallest, the minimum.
Here is the classic. Take a square sheet of card, L on a side. Cut a small square of side x from each corner, fold up the four flaps, and you have an open-top box. How big should the cut be to hold the most?
The base of the box is a square of side L − 2x (you removed x from both ends), and the height is the flap, x. So the volume is
V(x) = x · (L − 2x)2, for 0 < x < L/2.
The domain is forced by geometry: if x ≤ 0 there is no flap, and if x ≥ L/2 the base vanishes. Take L = 12. Expanding, V(x) = 4x3 − 48x2 + 144x, so by the power rule
V′(x) = 12x2 − 96x + 144 = 12(x2 − 8x + 12) = 12(x − 2)(x − 6).
Set V′ = 0: the roots are x = 2 and x = 6. Only x = 2 lies inside the domain 0 < x < 6 — the other root sits at the forbidden endpoint where the base disappears.
Check the sign of V′: just left of 2 it is positive (rising), just right it is negative (falling) — a maximum. So x* = 2 and the most volume is V(2) = 2 · 82 = 128.
Below, dial the cut size yourself. The figure draws the sheet with its corners removed beside the volume curve, and every number in the readout — the current volume, the maximum, the location x* — is computed by findRoots on V′, never read off the picture.
It is the volume you maximize, so it is V′ you set to zero — not the volume itself. Setting V(x) = 0 just finds where the box is empty (x = 0 and x = 6). And respect the domain: a cut size must satisfy 0 < x < 6. The root x = 6 is a real solution of V′ = 0 but a meaningless box.
You have P metres of fencing and want to wrap the rectangle of greatest area. Let the width be x. The perimeter pins the other side: 2x + 2(height) = P, so the height is P/2 − x. The objective is the area,
A(x) = x · (P/2 − x), for 0 < x < P/2.
This is a downward parabola — the same shape you maximized by completing the square back in Stage 23 (quadratic extremes). Calculus gives the same answer, faster. With P = 40: A(x) = 20x − x2, so A′(x) = 20 − 2x, which is zero at x = 10. The height there is 20 − 10 = 10 — a square. The greatest area is A(10) = 100 m².
For any fixed perimeter P, A′(x) = P/2 − 2x = 0 gives x = P/4. The width is P/4 and the height is P/2 − P/4 = P/4 too — they are equal. Among all rectangles of a given perimeter, the square has the most area. The fence "knows" no algebra, yet the derivative does.
Slide the width below and watch the area peak. The mark sits at x* = 10, found by findRoots on A′.
Optimization is not only about biggest — it is just as often about least. A maker wants an open-top box with a square base that must hold a fixed volume of 4 m³, using the least material. Let the base side be x; the height is then h = 4/x2 (so the volume stays 4). The material is the base plus four sides:
C(x) = x2 + 4 · x · h = x2 + 16x, for x > 0.
Differentiate (the second term is 16x⁻¹, whose derivative is −16x⁻²):
C′(x) = 2x − 16x2. Set it to zero: 2x = 16/x2 ⇒ 2x3 = 16 ⇒ x3 = 8 ⇒ x = 2.
Left of 2, C′ is negative (cost falling); right of 2 it is positive (cost rising) — a minimum. The cheapest box has base side 2 m, height h = 4/22 = 1 m, and material C(2) = 4 + 8 = 12 m².
Here the area curve dips instead of rising. The green dot marks the bottom of the valley, where the slope is flat — found by findRoots on C′.
A critical point can be a minimum just as easily as a maximum — read the sign change of f′ to tell which (− to + is a valley). And the extreme is not always where f′ = 0: on a closed interval the best value can sit at an endpoint. Always evaluate the objective at the critical points and the endpoints, then compare.
Every optimization problem in this lesson — and in AP Calculus, and in engineering, and in economics — follows the same four steps. Learn the rhythm and you can solve any of them.
| Step | What you do | In the box problem |
|---|---|---|
| 1. Model it | Write the objective as one variable on its allowed range | V(x) = x(12 − 2x)², 0 < x < 6 |
| 2. Differentiate | Compute f′ with the power / sum / chain rules | V′ = 12x² − 96x + 144 |
| 3. Set f′ = 0 | Solve for the critical points | x = 2 (x = 6 is outside) |
| 4. Check the range | Compare f at the critical points and the endpoints | V(2) = 128 wins |
The interactive method-stepper below walks all four steps for a problem you choose. Toggle between the box, the fence, and the can; each step's line fills in from the same honest helpers.
Stand back and see the whole arc. We began by chasing a number a quantity approaches — the limit. We let a secant tip over into a tangent and read off the instant rate, the derivative. We built a toolbox of rules to differentiate anything, used the sign of f′ as a spotlight on a curve's shape, and just now turned that spotlight on the real world to find the very best design. That is the first shape of calculus — the mathematics of change.
One question remains, the mirror image of everything here. The derivative cuts a curve into instantaneous slopes; what if we instead add up infinitely many thin slivers — to find the area under a curve, the distance from a speed graph, the volume of a strange solid? That accumulating process is the integral, and it turns out to undo the derivative exactly. It is the second half of calculus, and it is where Stage 37 begins. For now, carry the four-step method with you: it is the moment calculus stopped being theory and started building boxes.
Differentiation answers "how fast, right here?" Its partner, integration, answers "how much, all together?" — the area under a curve. The two are inverses, a fact so important it has a name: the Fundamental Theorem of Calculus. That is the door Stage 37 opens.
| Idea | How it works |
|---|---|
| The objective & domain | Write what you want best as one function f(x) on its allowed range |
| Critical points | Where f′(x) = 0 — possible peaks and valleys |
| Max or min? | + to − is a max; − to + is a min (the sign change of f′) |
| Closed interval | Compare f at the critical points and the two endpoints |
| Open box, side L | V = x(L − 2x)²; for L = 12 the best cut is x = 2, V = 128 |
| Fixed perimeter P | A = x(P/2 − x) is largest at the square, x = P/4 |
Six questions to lock it in. Tap the answer you think is right.
This lesson applies derivatives to applied extrema (optimization), the capstone of a first calculus course. It builds directly on HSF-IF.B.4 (relative maxima/minima and intervals of behavior from a function) and the modeling standards (★), since each problem begins by translating a real situation into an objective function on a domain. The four-step method — model, differentiate, set f′ = 0, check the range — is the core procedure of AP Calculus AB/BC optimization. A common pitfall to watch for: students set the objective itself to zero instead of its derivative, or forget that on a closed interval the extreme may occur at an endpoint. The closing section previews integration (Stage 37) so learners see calculus as a single connected subject.