π Key idea of this section
To maximize or minimize: build ONE formula for the quantity, solve its derivative = 0, and VERIFY β check the second derivative and the endpoints.
The game plan
Optimization is calculus earning its paycheck. Four steps, every time:
Step 1: name variables and write the quantity you want to max/min.
Step 2: use the constraint (the fixed budget, fence, volume...) to
reduce to ONE variable β and note the allowed interval.
Step 3: differentiate and solve derivative = 0.
Step 4: verify it is really the best: second derivative test,
and compare with the endpoints.
Worked example 1 β the fence against the wall. A farmer has 2,400 m of fencing for a rectangular pen, and a long stone wall forms one whole side (no fence needed there). What is the largest area she can enclose?
Step 1: let x = each of the two sides perpendicular to the wall,
and L = the side parallel to the wall. Maximize A = xΒ·L.
Step 2: the fence budget: 2x + L = 2,400, so L = 2,400 β 2x.
Then A(x) = x(2,400 β 2x) = 2,400x β 2xΒ².
Allowed interval: 0 β€ x β€ 1,200 (at x = 1,200 the fence is all
used by the two x-sides, leaving L = 0).
Step 3: A'(x) = 2,400 β 4x = 0 β 4x = 2,400 β x = 600.
Step 4: verify: A''(x) = β4 < 0 β a cap β a MAX β
.
Endpoints: A(0) = 0 and A(1,200) = 0 β both worse. β
Harvest: L = 2,400 β 2Γ600 = 1,200 m, and
A = 600 Γ 1,200 = 720,000 mΒ²
That is 72 hectares of pen from 2,400 m of fence β and the proof that no other rectangle beats it is the derivative, not a guess.
Worked example 2 β the open box. From a 36 cm square sheet of cardboard, cut equal squares of side x from the four corners and fold up the flaps to make an open-top box. Which x gives the biggest volume?
Step 1: the base becomes (36 β 2x) by (36 β 2x), the height is x.
Maximize V(x) = x(36 β 2x)Β² on 0 β€ x β€ 18.
Step 2: expand: (36 β 2x)Β² = 1,296 β 144x + 4xΒ², so
V(x) = 4xΒ³ β 144xΒ² + 1,296x.
Step 3: V'(x) = 12xΒ² β 288x + 1,296 = 12(xΒ² β 24x + 108).
Factor: xΒ² β 24x + 108 = (x β 6)(x β 18)
(6 Γ 18 = 108 and 6 + 18 = 24 β
), so V'(x) = 0 at x = 6, x = 18.
Step 4: x = 18 makes the base 36 β 36 = 0 β volume 0, a MINIMUM.
Check x = 6: V''(x) = 24x β 288, so V''(6) = 144 β 288 = β144 < 0
β cap β MAX β
. Endpoints give V = 0. β
Harvest: V(6) = 6 Γ 24Β² = 6 Γ 576 = 3,456 cmΒ³.
Intuition check: x = 6 is exactly 1/6 of the sheet's side β small enough to leave a generous base, tall enough to matter. Calculus found the sweet spot; geometry alone could only guess.
Worked example 3 β the five-digit profit. A company sells gadgets. When the price is p dollars per gadget, customers buy x of them, where p(x) = 1,000 β 2x (charge less, sell more). Each gadget costs $200 to make, plus fixed costs of $45,000. How many gadgets maximize profit?
Step 1: revenue R(x) = xΒ·p(x) = 1,000x β 2xΒ² (units Γ price).
Cost C(x) = 200x + 45,000.
Step 2: profit P(x) = R β C = 1,000x β 2xΒ² β 200x β 45,000
= β2xΒ² + 800x β 45,000.
Step 3: P'(x) = β4x + 800 = 0 β x = 200 gadgets.
Step 4: P''(x) = β4 < 0 β cap β MAX β
.
Harvest: price p(200) = 1,000 β 400 = $600;
revenue = 200 Γ 600 = $120,000;
cost = 200 Γ 200 + 45,000 = $85,000;
profit = $120,000 β $85,000 = $35,000.
Neighbor check: P(190) = β2Γ36,100 + 152,000 β 45,000 = $34,800 < $35,000 β
(moving 10 units either way costs the company $200 of profit).
βοΈ Your Turn!
Redo the fence problem with only 800 m of fencing (still one stone wall).
π Show the answers
Answer: 2x + L = 800 β L = 800 β 2x; A(x) = 800x β 2xΒ²; A'(x) = 800 β 4x = 0 β x = 200; A'' = β4 < 0 β max; L = 800 β 400 = 400 m; A = 200 Γ 400 = 80,000 mΒ². One-third the fence, one-ninth the area β scaling is not linear!