Why a flat slope marks the best spots
Picture walking along a smooth hill drawn as the graph of f. At the very top of a peak, you are momentarily neither climbing nor descending — the ground is level under your feet. At the bottom of a valley it is the same: flat for an instant. Since the derivative f'(x) measures the slope, the peaks and valleys of a smooth curve hide where the slope is zero. That single observation is the engine behind nearly every real-world 'find the best value' problem.
The places worth checking are the critical points: the x-values where f'(x) = 0 (the slope is flat) or where f'(x) does not exist (a corner or a vertical tangent, where there is no single slope at all). A high or low point of a smooth function can only happen at one of these spots — so instead of searching the whole curve, you only have to inspect a short list of candidates.
Sorting candidates: the first and second derivative tests
Finding a critical point only tells you the slope is flat there; it does not yet say whether you are on a peak, in a valley, or just on a momentary plateau. The first derivative test sorts them by watching the sign of f' as you walk through the point. If f' switches from positive (rising) to negative (falling), you have just crested a peak — a local maximum. If it switches from negative to positive, you have passed through the bottom — a local minimum. If the sign does not switch, it is neither.
Often quicker is the second derivative test, which uses the second derivative f'' to read the curve's concavity at the flat spot. At a critical point where f'(x) = 0: if f''(x) > 0 the curve cups upward like a bowl, so you are at a local minimum; if f''(x) < 0 it cups downward like a dome, so you are at a local maximum. If f''(x) = 0 the test is inconclusive — the curve might do something subtle, so fall back on the first derivative test.
That extra step is checking the endpoints. If you only care about x on a closed interval like [0, 10], the best value might not sit at a flat interior spot at all — it could be jammed against an edge, where the curve is still climbing when it runs out of room. So the safe recipe on a closed interval is: evaluate f at every critical point and at both endpoints, then simply compare the heights. The largest f-value is the global maximum, the smallest is the global minimum.
The optimization workflow, with a worked box problem
Real optimization problems arrive as words, not formulas — 'make the box hold the most', 'use the least fence'. The skill is translating the words into one function of one variable, then turning the calculus crank. Here is the classic open-box problem: you have a 12-by-12 square sheet of cardboard, you cut an equal square of side x from each corner, and you fold up the flaps to make an open-top box. What x gives the largest volume?
- Model it. After cutting corners of side x, the base is (12 - 2x) by (12 - 2x) and the height is x, so volume V(x) = x (12 - 2x)^2. The variable is physically limited to 0 < x < 6 (cut too much and there is no base left).
- Differentiate. Expanding gives V(x) = 144x - 48x^2 + 4x^3, so V'(x) = 144 - 96x + 12x^2 = 12(x^2 - 8x + 12) = 12(x - 2)(x - 6).
- Find critical points. Set V'(x) = 0: that gives x = 2 or x = 6. But x = 6 is the forbidden edge (no box), so the only candidate inside our range is x = 2.
- Confirm it is a maximum. V''(x) = -96 + 24x, and V''(2) = -96 + 48 = -48 < 0 — concave down, so x = 2 is a local maximum. The endpoints x->0 and x->6 both give volume 0, so x = 2 wins globally.
- Answer in words. Cut squares of side 2, giving an 8-by-8-by-2 box of volume V(2) = 2 * 8^2 = 128 cubic units — the largest box you can fold from that sheet.
V(x) = x (12 - 2x)^2 = 144x - 48x^2 + 4x^3 V'(x) = 12(x - 2)(x - 6) -> zero at x = 2, x = 6 V''(x) = -96 + 24x -> V''(2) = -48 < 0 (a max) V(2) = 2 * 8 * 8 = 128
Habits that keep you out of trouble
The same workflow handles a 'least fence' problem just as well: if a farmer wants to enclose a fixed area A against a wall using the least fencing, you write the perimeter as a function of one side, set its derivative to zero, and out comes the cheapest shape. The recurring trick is using the constraint (fixed area, fixed cardboard) to eliminate the second variable, so you are left optimizing a function of a single variable — which is exactly the calculus you already know.
Two more honest reminders. First, a critical point where f' does not exist (a corner) can still be an extremum, so include those candidates, not just the f'=0 ones. Second, on an open interval or one running to infinity there may be no global maximum at all — the curve could keep rising forever. Optimization is powerful precisely because it is mechanical, but the human judgment is in setting up the right function and the right region.