This is the most profitable part of calculus. Companies use it to minimize cost. Engineers use it to maximize strength. How?
The Derivative Test
At the very top of a hill (maximum) or the bottom of a valley (minimum), the slope is zero. So, to optimize anything:
- Write an equation for it.
- Take the derivative.
- Set it to zero and solve.
The logic is beautifully simple: while a quantity is still rising, you haven't reached the peak; once it's falling, you've passed it. The best possible moment is the instant the rise stops — where the derivative equals zero. Points where that happens are called critical points, and they're the only candidates for a max or min on a smooth curve.
Worked Example: The Classic Fence Problem
You have 100 meters of fencing and want to enclose the largest possible rectangular garden. What dimensions win?
- Write the constraint. The perimeter is fixed: 2L + 2W = 100, so W = 50 − L.
- Write the objective. Area A = L × W = L(50 − L) = 50L − L².
- Differentiate. dA/dL = 50 − 2L.
- Set to zero and solve. 50 − 2L = 0 → L = 25, and then W = 50 − 25 = 25.
- Confirm it's a maximum. The second derivative is −2, which is negative — the curve is a downward-opening parabola, so L = 25 is the peak, giving A = 25 × 25 = 625 m².
The answer is a square — and that's a recurring theme in optimization: symmetric shapes frequently win. Compare a skinny 10 × 40 plot: same 100 m of fence, only 400 m² of garden. The calculus quantified exactly how much better the square is.
A Reliable Recipe for Any Optimization Problem
Every optimization word problem yields to the same six steps: (1) draw a picture and name the variables; (2) write the formula for the quantity you want to optimize; (3) write the constraint equation from the given limitation; (4) use the constraint to eliminate all but one variable; (5) differentiate, set to zero, and solve; (6) confirm max versus min and answer the actual question asked, with units. Students who follow the recipe mechanically outperform students who improvise, because steps 1–4 — the setup — are where word problems are actually won or lost.
Telling Max from Min
Setting the derivative to zero finds candidates, but doesn't say which kind. Two tests settle it. The second derivative test: negative second derivative means concave down — a maximum; positive means concave up — a minimum. Or the first derivative test: check the slope's sign just before and after the critical point; rising-then-falling is a peak, falling-then-rising is a valley.
Common Mistakes to Avoid
- Optimizing with two variables still in play. You can't differentiate A = L × W usefully until the constraint eliminates one variable. Always substitute the constraint first.
- Assuming every critical point is the answer. A zero derivative can also mark a minimum or a flat "shelf" (like x³ at 0). Run the second derivative test before circling your result.
- Ignoring the endpoints. On a restricted domain, the true max or min can sit at the boundary where the derivative isn't zero at all. Compare critical-point values against endpoint values before answering.
- Answering the wrong question. After finding L = 25, don't forget what was asked — the maximum area (625 m²), the dimensions (25 × 25), or both. Easy marks are lost at the finish line.
Frequently Asked Questions
How do I turn a word problem into an equation to optimize?
Identify two things: the quantity to maximize or minimize (the objective) and the limitation you must respect (the constraint). Write both as equations, use the constraint to express the objective in a single variable, then differentiate. Naming the variables with a quick sketch makes this almost mechanical.
What if the derivative is never zero?
Then the function is always rising or always falling on your interval, and the extreme values sit at the domain's endpoints. This is common in real problems with natural bounds — a factory can't produce negative items, a dose can't exceed the vial. Check the boundaries.
Where is optimization used outside the classroom?
Everywhere decisions have trade-offs: airlines price seats to maximize revenue, engineers minimize material while preserving strength, delivery apps minimize route time, and machine learning literally trains by minimizing an error function via derivatives (gradient descent). The fence problem is a toy version of billion-dollar questions.