Calculus

🏔️Extrema and Optimization

Where the derivative hits zero, mountain tops and valley bottoms hide — one sign flip reveals the maximum area and the best price.

Once you can differentiate, the most natural question appears: where is this function highest, and where lowest? A fence enclosing the largest area, a price earning the largest profit — both are hunts for a "peak". Calculus turns peak-hunting into a procedure: differentiate, set to zero, read the signs. Three steps, and peaks and valleys reveal themselves.

Critical points: where the derivative is zero

The instant you stand on a summit, you are going neither up nor down — the slope is zero. Peaks and valleys of a function are the same: the tangent is horizontal and the derivative vanishes. Solutions of f(x)=0f'(x) = 0 are called critical points. Note that this is only a shortlist: every peak and valley appears on it, but not everyone on it is a peak or valley (some are just a flat stretch). A function can carry several critical points — like a winding road with several summits and hollows — and the procedure runs once for each candidate. So step one is always to solve f(x)=0f'(x) = 0 and summon the candidates.

Reading peaks and valleys from signs

The sign of the derivative on either side of a critical point announces its identity:

  • Positive then negative: up, then down — a local maximum (a summit);
  • Negative then positive: down, then up — a local minimum (a valley bottom);
  • Same sign on both sides: a level crossing, neither peak nor valley.
InteractiveSlope-Flip Observatory

Secant slope

2.500

Tangent slope

1.000

Drag h toward 0 and the secant hugs the tangent — that's the derivative.

Drag x0x_0 toward 0 and watch this parabola's slope flip from negative to positive, passing exactly through zero at the valley bottom — negative then positive, a textbook local minimum. Every function's peaks and valleys obey the same rule of sign flips.

Two worked problems

Two problems — one geometric, one commercial — run the exact same procedure.

Largest area from 20 meters of fence

Fence a rectangle with 20 meters. Let the width be xx; the length is then 10x10 - x, and the area is

A(x)=x(10x)=10xx2A(x) = x(10 - x) = 10x - x^2

Differentiate: A(x)=102xA'(x) = 10 - 2x. Setting it to zero gives x=5x = 5. Check the signs: at x=3x = 3, A=4>0A' = 4 > 0 (still climbing); at x=7x = 7, A=4<0A' = -4 < 0 (already falling) — positive then negative, a genuine summit. The length is 5 as well, so the largest area is 5×5=255 \times 5 = 25 square meters: the square wins.

Pricing for maximum profit

Each item costs 10 to make, and at a price of pp you sell (100p)(100 - p) items. The profit is

P(p)=(p10)(100p)=p2+110p1000P(p) = (p - 10)(100 - p) = -p^2 + 110p - 1000

Differentiate: P(p)=2p+110P'(p) = -2p + 110, zero at p=55p = 55. Check the signs: at p=50p = 50, P=10>0P' = 10 > 0; at p=60p = 60, P=10<0P' = -10 < 0 — another positive-then-negative summit. Price at 55, sell 45 items, and the profit is 45×45=202545 \times 45 = 2025.

Do not forget the endpoints

On a limited domain, the extreme values may hide at the ends — where the slope exists on one side only, the derivative need not be zero. Real domains usually arrive with edges attached: a fence width cannot be negative, and a price cannot fall below cost — write the boundaries down first, or the endpoint check has nothing to aim at. Both problems above got the courtesy check: the fence endpoints x=0x = 0 and x=10x = 10 give area 0, and the pricing endpoints p=10p = 10 (working for nothing) and p=100p = 100 (no buyers) give profit 0 — far below the interior champions 25 and 2025. The full procedure is three steps plus one look: solve f(x)=0f'(x) = 0, check the signs, compare the endpoints. Peaks and valleys of parabolas are easy to spot on a graph — see Graphing Quadratics; the differentiation procedure comes from Introduction to Derivatives, with a quick reference in Derivative Rules; the next stop downstream is Integration.

Check yourself

Quick quiz

  1. 1. Left of a point f′ is positive, right of it negative. What is this point?

  2. 2. The derivative of A(x) = 10x − x² is?

  3. 3. Is a critical point guaranteed to be a maximum or minimum?