Optimization
The best rectangle, the cheapest can, the shortest path — turning word problems into single-variable max/min hunts.
01What an optimization problem is
Every optimization problem has the same anatomy: an objective — the quantity to maximize or minimize (area, volume, cost, distance, time) — and usually a constraint — a fixed resource linking the variables (so much fence, so much material, a point that must lie on a curve). The calculus part is Module 08: find critical points, confirm max or min. The hard part is translation — converting a paragraph of English into a function of one variable. That translation is a repeatable skill, not a talent, and the procedure below makes it mechanical.
02The six-step procedure
- Draw a picture and label every quantity with a symbol.
- Write the objective — the formula for what's being optimized.
- Write the constraint — the equation from the fixed resource.
- Substitute the constraint into the objective to get a function of one variable.
- Find the domain — what values are physically possible? (Lengths $\ge 0$, etc.)
- Optimize: critical points, then verify max vs. min, then answer the question that was actually asked.
Step 5 is the one everyone skips and shouldn't: the domain decides whether you use the closed interval method (compare endpoints) or a derivative test, and endpoints sometimes win.
03Worked example: the fence
You have 400 ft of fence for a rectangular pen against a river — no fence needed on the river side. Maximize the area.
Picture: width $x$ (two sides), length $y$ (one side). Objective: $A = xy$. Constraint: $2x + y = 400$, so $y = 400 - 2x$. Substitute:
$$A(x) = x(400 - 2x) = 400x - 2x^2, \qquad 0 \le x \le 200$$
Optimize: $A'(x) = 400 - 4x = 0 \Rightarrow x = 100$. Then $A'' = -4 < 0$: a maximum. Dimensions $100 \times 200$ ft, area $20{,}000$ ft². (Endpoints give $A = 0$ — sanity confirmed.) Note the answer is not a square: the free river side breaks the symmetry, which is why you compute instead of guessing.
04Worked example: the open box
Cut equal squares of side $x$ from the corners of a 12 in × 12 in sheet and fold up the sides. Maximize the volume.
Folding gives a base of $(12 - 2x) \times (12 - 2x)$ and height $x$:
$$V(x) = x(12 - 2x)^2, \qquad 0 \le x \le 6$$
$V'(x) = (12-2x)^2 + x\cdot 2(12-2x)(-2) = (12 - 2x)(12 - 6x)$, zero at $x = 6$ (endpoint, $V = 0$) and $x = 2$. So $x = 2$ in gives the max: $V = 2 \cdot 8^2 = 128$ in³. The product-plus-chain differentiation and the factored form are typical — factoring $V'$ beats expanding it.
05Verifying max vs. min
A critical point is a suspect, not a conviction. Three ways to close the case: (1) Second derivative test — fastest when $f''$ is simple ($A'' = -4 < 0$ above). (2) First-derivative sign chart — always works. (3) Closed interval comparison — when the domain is closed, just evaluate at the critical points and endpoints; no test needed. And one honest shortcut: if the domain is an open interval, the function is positive inside, zero (or $\to 0$/$\to\infty$ appropriately) at the ends, and there's exactly one critical point — that point must be the extremum. State the reasoning; don't just assert it.
06Minimizing distance
Find the point on $y = x^2$ closest to $(0, 3)$. The distance from $(x, x^2)$ to $(0,3)$ is $\sqrt{x^2 + (x^2-3)^2}$ — but square roots are miserable to differentiate, so use the standard trick: minimize the squared distance, which has the same minimizer:
$$D(x) = x^2 + (x^2 - 3)^2 \qquad D'(x) = 2x + 2(x^2-3)(2x) = 2x(2x^2 - 5)$$
Critical points $x = 0$ and $x = \pm\sqrt{5/2}$. Compare: $D(0) = 9$, $D\left(\pm\sqrt{5/2}\right) = \tfrac{5}{2} + \tfrac14 = \tfrac{11}{4}$. Closest points: $\left(\pm\sqrt{5/2},\, 5/2\right)$. The symmetric pair of answers reflects the symmetric setup — a useful sanity check.
07Cost, revenue, and the economics pattern
Business problems dress the same math in dollars. A cylindrical can must hold $500$ cm³; material for the top and bottom costs twice the side material. The constraint $\pi r^2 h = 500$ eliminates $h$ from the cost objective $C = 2\cdot 2\pi r^2 k + 2\pi r h k$, leaving $C(r)$ to minimize. In pure revenue problems, if raising a price $p$ loses customers linearly, revenue $R = p \cdot (\text{quantity}(p))$ becomes a downward parabola — maximize as usual. The pattern never changes: constraint kills a variable, derivative finds the balance point where the competing pressures (bigger base vs. taller side, higher price vs. fewer buyers) exactly cancel.
08Pitfalls and pro habits
The four ways good students lose points: (1) Answering the wrong question — the problem asks for the maximum area and you report the optimal width, or vice versa; reread the final sentence. (2) Skipping the domain — and missing that an endpoint wins or that a negative critical point is meaningless. (3) No max/min justification — a bare "$f'(x) = 0$ at $x=2$" earns partial credit at best. (4) Differentiating before eliminating — the objective must be a one-variable function first; that's what the constraint is for. Build the habit of ending every solution with a sentence: "so the maximum area is 20,000 ft², achieved at 100 ft × 200 ft."
The whole module in one line. Picture → objective → constraint → substitute to one variable → domain → critical points → justify max/min → answer the actual question, with units. Six problems from now this will feel like one move, not eight.
Two positive numbers sum to 50. Maximize their product.
Solution
$P = x(50 - x) = 50x - x^2$; $P' = 50 - 2x = 0 \Rightarrow x = 25$.
$P'' = -2 < 0$: max. Numbers $25$ and $25$; product $625$.
Find two positive numbers whose product is 100 and whose sum is minimal.
Solution
$S = x + \dfrac{100}{x}$; $S' = 1 - \dfrac{100}{x^2} = 0 \Rightarrow x = 10$.
$S'' = \dfrac{200}{x^3} > 0$: min. Numbers $10$ and $10$; sum $20$.
A rectangle has perimeter 36. Maximize its area.
Solution
$y = 18 - x$; $A = x(18-x)$; $A' = 18 - 2x = 0 \Rightarrow x = 9$.
A $9 \times 9$ square, area $81$. (With the full perimeter fenced, the square does win.)
400 ft of fencing encloses a rectangular pen against a river (no fence on the river side). Maximize the area.
Solution
$A(x) = x(400 - 2x)$; $A' = 400 - 4x = 0 \Rightarrow x = 100$, $y = 200$.
$A'' < 0$: max. Area $= 20{,}000$ ft².
A farmer subdivides a rectangular field of total area with 600 m of fence, including one divider parallel to a side. Maximize the enclosed area.
Solution
Fence: $2y + 3x = 600 \Rightarrow y = 300 - \tfrac{3}{2}x$. $A = xy = 300x - \tfrac{3}{2}x^2$.
$A' = 300 - 3x = 0 \Rightarrow x = 100$, $y = 150$. Max area $15{,}000$ m².
Cut squares of side $x$ from the corners of a 12 in × 12 in sheet and fold into an open box. Maximize the volume.
Solution
$V = x(12-2x)^2$; $V' = (12-2x)(12-6x) = 0 \Rightarrow x = 2$ (interior).
Max $V = 2(8)^2 = 128$ in³.
An open-top box has a square base and volume 32 ft³. Minimize the material (surface area).
Solution
$h = \dfrac{32}{x^2}$; $S = x^2 + 4xh = x^2 + \dfrac{128}{x}$.
$S' = 2x - \dfrac{128}{x^2} = 0 \Rightarrow x^3 = 64 \Rightarrow x = 4$, $h = 2$. Min $S = 48$ ft².
Find the point on the line $y = 2x + 3$ closest to the origin.
Solution
$D = x^2 + (2x+3)^2$; $D' = 2x + 4(2x+3) = 10x + 12 = 0 \Rightarrow x = -\dfrac{6}{5}$.
Point: $\left(-\dfrac{6}{5}, \dfrac{3}{5}\right)$.
Find the point(s) on $y = x^2$ closest to $(0, 3)$.
Solution
$D = x^2 + (x^2 - 3)^2$; $D' = 2x(2x^2 - 5) = 0 \Rightarrow x = 0, \pm\sqrt{5/2}$.
$D(0) = 9 > D(\pm\sqrt{5/2}) = \tfrac{11}{4}$: closest points $\left(\pm\sqrt{\tfrac{5}{2}}, \tfrac{5}{2}\right)$.
Maximize the area of a rectangle inscribed under $y = 12 - x^2$ with its base on the $x$-axis (symmetric about the $y$-axis).
Solution
$A = 2x(12 - x^2) = 24x - 2x^3$; $A' = 24 - 6x^2 = 0 \Rightarrow x = 2$.
Max area $= 2(2)(8) = 32$.
A rectangle is inscribed in a semicircle of radius 5 with its base on the diameter. Maximize its area.
Solution
$A = 2x\sqrt{25 - x^2}$; maximize $A^2 = 4x^2(25 - x^2)$: derivative $8x(25) - 16x^3 = 0 \Rightarrow x = \dfrac{5}{\sqrt2}$.
Max area $= 2\cdot\dfrac{5}{\sqrt2}\cdot\dfrac{5}{\sqrt2} = 25$.
A closed cylindrical can must hold $250\pi$ cm³. Minimize its surface area.
Solution
$h = \dfrac{250}{r^2}$; $S = 2\pi r^2 + 2\pi r h = 2\pi r^2 + \dfrac{500\pi}{r}$.
$S' = 4\pi r - \dfrac{500\pi}{r^2} = 0 \Rightarrow r^3 = 125 \Rightarrow r = 5$, $h = 10$. (Optimal can: $h = 2r$.)
A ticket price of \$10 draws 800 fans; each \$1 increase loses 50 fans. What price maximizes revenue?
Solution
With $x$ dollar-increases: $R = (10 + x)(800 - 50x)$.
$R' = 800 - 50x - 500 - 100x\cdot\tfrac12$… expand instead: $R = 8000 + 300x - 50x^2$, $R' = 300 - 100x = 0 \Rightarrow x = 3$.
Price $\$13$, attendance $650$, revenue $\$8450$.
Cost to produce $x$ units is $C(x) = 2000 + 10x + 0.05x^2$. Find the production level minimizing average cost $\dfrac{C(x)}{x}$.
Solution
$\bar C = \dfrac{2000}{x} + 10 + 0.05x$; $\bar C' = -\dfrac{2000}{x^2} + 0.05 = 0 \Rightarrow x^2 = 40000 \Rightarrow x = 200$ units.
A wire 20 cm long is cut and bent into a square and a circle. How should it be cut to minimize the total area? Should it be cut at all to maximize it?
Solution
Square gets $x$: area $\left(\tfrac{x}{4}\right)^2$; circle gets $20 - x$: area $\dfrac{(20-x)^2}{4\pi}$.
$A'(x) = \dfrac{x}{8} - \dfrac{20 - x}{2\pi} = 0 \Rightarrow x = \dfrac{80}{4 + \pi} \approx 11.2$ cm to the square (min).
Max is at an endpoint: give everything to the circle ($x = 0$) — circles enclose area most efficiently.
Find the dimensions of the largest rectangle with base on the $x$-axis inscribed in the triangle with vertices $(0,0)$, $(8,0)$, $(0,6)$.
Solution
Hypotenuse: $y = 6 - \tfrac{3}{4}x$. Rectangle with corner at $(x, y)$: $A = x\left(6 - \tfrac34 x\right)$.
$A' = 6 - \tfrac{3}{2}x = 0 \Rightarrow x = 4$, $y = 3$. Max area $12$ — exactly half the triangle.
A rectangular poster needs 96 in² of printed area, with 2-in margins top and bottom and 1-in margins on each side. Minimize the total paper area.
Solution
Printed area $x \times y = 96$. Paper: $(x + 2)(y + 4) = (x+2)\left(\tfrac{96}{x} + 4\right)$.
$A = 104 + 4x + \dfrac{192}{x}$; $A' = 4 - \dfrac{192}{x^2} = 0 \Rightarrow x = \sqrt{48} = 4\sqrt3$.
Paper dimensions: $(4\sqrt3 + 2) \times (8\sqrt3 + 4)$ in.
What positive number exceeds its square by the greatest amount?
Solution
Maximize $f(x) = x - x^2$: $f' = 1 - 2x = 0 \Rightarrow x = \dfrac{1}{2}$.
Trick check: minimize $f(x) = x^2$ on $[1, 3]$. Where's the answer, and why isn't it a critical point?
Solution
$f' = 2x$ is never zero on $(1,3)$. Compare endpoints: $f(1) = 1 < f(3) = 9$.
Min at the endpoint $x = 1$ — endpoint extrema need no horizontal tangent. This is why step 5 (domain) exists.
Challenge: a swimmer 2 km offshore wants to reach a point 6 km down the straight beach. She swims 4 km/h and runs 10 km/h. Where should she land to minimize total time?
Solution
Land $x$ km down the beach: $T(x) = \dfrac{\sqrt{4 + x^2}}{4} + \dfrac{6 - x}{10}$.
$T' = \dfrac{x}{4\sqrt{4+x^2}} - \dfrac{1}{10} = 0 \Rightarrow 10x = 4\sqrt{4+x^2} \Rightarrow 100x^2 = 16(4 + x^2) \Rightarrow x = \dfrac{8}{\sqrt{84}} \approx 0.87$ km.
Land about $0.87$ km down the beach, then run. (Snell's law of refraction is this exact problem.)