Optimization Problems

The largest box or the cheapest tank: write the quantity, then find where its slope is zero.

You have 100 m of fence and a flat, empty site, and you want to enclose as much storage yard as you can. Does the shape matter? It's tempting to think it can't, since the same fence ought to surround the same ground. So try it. A yard 45 m by 5 m uses all the fence and encloses 225 m². A yard 25 m by 25 m uses the same fence and encloses 625 m².

That's nearly three times the ground from the same fence. Some shape has to be the best one, and you can find it without trying them all.

Every yard uses 100 m of fence 45 m 5 m 225 m2 35 m 15 m 525 m2 25 m 25 m 625 m2
The same 100 m of fence around three yards

Two variables are one too many

Call the yard's sides xx and yy. You want the largest area, so write that down:

A=xyA = xy

Now you'd like to differentiate, and you're stuck. The method from Maxima, Minima, and Inflection Points works on a function of one variable, and this has two. Pretend yy is a constant and you get dA/dx=ydA/dx = y. Set that to zero, and the best yard has a side of length zero, which is nonsense. The mistake is that yy isn't constant: make the yard longer and the fence has to come from somewhere, so the yard gets narrower.

The fence is what links the two sides. That link is the problem's constraint, and it lets you trade yy for xx:

2x+2y=100⇒y=50−x2x + 2y = 100 \quad\Rightarrow\quad y = 50 - x
A(x)=x(50−x)=50x−x2A(x) = x(50 - x) = 50x - x^2

That's one variable, and from here it's a problem you've already solved.

A′(x)=50−2x=0⇒x=25A'(x) = 50 - 2x = 0 \quad\Rightarrow\quad x = 25

The second derivative, A′′(x)=−2A''(x) = -2, is negative, so that's a peak. It's also physically possible, since a side has to fall between 0 and 50 m. The other side is y=50−25=25y = 50 - 25 = 25, so the best yard is a square, and its area is (25)(25)=625 m2(25)(25) = 625\ \text{m}^2.

0 10 20 30 40 50 0 100 200 300 400 500 600 700 x (m) A (m2) x = 5 m: 225 m2 x = 15 m: 525 m2 slope = 0 x = 25 m: 625 m2
Area of a yard with 100 m of fence, against one side's length
The yards from the first figure sit on this curve at x=5x = 5, 15, and 25. At x=0x = 0 and x=50x = 50 the yard has no area at all.

Every optimization problem you'll meet runs through that same pipeline:

  1. Write the quantity to optimize. Words like "largest" or "least" tell you which one.
  2. Use the constraint to make it a function of one variable.
  3. Find where its slope is zero, then confirm that it's the kind of point you're after and that it lies in the physical range.
  4. Answer what was asked: a dimension, or the best value.

The Handbook prints the tests for step 3 and says nothing about steps 1 and 2, which come from reading the problem.

The square isn't a quirk of 100 m. For any fixed perimeter PP, the same steps give a square with side P/4P/4. But change the problem slightly, and the shape changes with it.

Worked Example A yard along a river
1 of 3

A rectangular yard runs along a straight river, which needs no fence. You have 120 ft of fence for the other three sides. Find the dimensions of the largest yard, and its area.

River x x y
A yard with a river along one side

The box you can cut too far

Take a square metal sheet, 12 in on a side. Cut a square from each corner, fold up the flaps, and you have an open box. Cut tiny notches and you get a wide tray with hardly any depth. Cut huge notches and you get tall walls around hardly any floor. Neither holds much, so the best cut is somewhere between.

x x 12 − 2x 12 in x 12 − 2x 12 − 2x fold up
A 12 in sheet with its corners marked, and the box it folds into

Here the constraint never shows up as an equation, because the sheet itself is the constraint. You make one choice, the cut xx, and the sheet sets everything else. The height is xx, and each floor edge loses xx at both ends, leaving 12−2x12 - 2x. So the volume already comes as a function of one variable:

V(x)=x(12−2x)2=144x−48x2+4x3V(x) = x(12 - 2x)^2 = 144x - 48x^2 + 4x^3
V′(x)=144−96x+12x2=12(x−2)(x−6)=0⇒x=2, x=6V'(x) = 144 - 96x + 12x^2 = 12(x - 2)(x - 6) = 0 \quad\Rightarrow\quad x = 2,\ x = 6

Both roots solve the equation, but only one of them is a box. Cut 6 in from each corner of a 12 in sheet and the notches meet, leaving no floor. The physical range is 0<x<60 < x < 6, which rules that root out. The second derivative, V′′(x)=24x−96V''(x) = 24x - 96, agrees: V′′(2)=−48V''(2) = -48 is a peak, and V′′(6)=48V''(6) = 48 is a valley, the lowest a volume can go.

So cut 2 in, and the volume is V(2)=2(8)2=128 in3V(2) = 2(8)^2 = 128\ \text{in}^3.

0 1 2 3 4 5 6 7 0 40 80 120 160 x (in) V (in3) no box x = 6 in: no floor left x = 2 in: V = 128 in3
Volume of the box against the size of the cut
The algebra doesn't know it's a box. Past x=6x = 6, the formula squares a negative floor length and climbs again, and that part of the curve describes nothing real.
Checkpoint
1 of 2

An open box is folded from a square sheet 18 in on a side, after cutting an equal square from each corner. What is the greatest volume it can have?

in³

The tank that uses the least steel

A cylindrical tank has to hold a fixed volume, and you pay for every square foot of steel. Think about the extremes. A wide, shallow tank, shaped like a cake pan, spends its steel on the floor and lid. A tall, thin one, shaped like a drinking straw, spends it on the wall. So the best proportions are again somewhere between.

The Handbook's Mensuration of Areas and Volumes section has both formulas you need, under Right Circular Cylinder:

V=πr2hA=side area+end areas=2πr(h+r)V = \pi r^2 h \qquad A = \text{side area} + \text{end areas} = 2\pi r(h + r)

Multiply out that AA and you can see the parts, a wall and two ends:

A=2πrh+2πr2A = 2\pi rh + 2\pi r^2
r h Lid: πr2 Wall: 2πrh Floor: πr2
Where a closed tank's steel goes

That's the quantity, with two variables again. The constraint is the volume, which is a fixed number even though it's written as a letter, so it gives you h=V/(πr2)h = V/(\pi r^2). Substitute, and hh is gone:

A(r)=2πr2+2VrA(r) = 2\pi r^2 + \frac{2V}{r}

Now the trade-off is out in the open. The ends grow as rr grows, the wall shrinks, and their sum has a valley.

0 2 4 6 8 10 12 0 500 1,000 1,500 r (ft) Area (ft2) r = 5.42 ft: least steel Wall Two ends Total A Tall and thin: mostly wall Wide and shallow: mostly ends
Steel in a closed tank holding 1,000 ft³, against its radius

Find where the slope is zero:

A′(r)=4πr−2Vr2=0⇒r3=V2πA'(r) = 4\pi r - \frac{2V}{r^2} = 0 \quad\Rightarrow\quad r^3 = \frac{V}{2\pi}

The second derivative, A′′(r)=4π+4V/r3A''(r) = 4\pi + 4V/r^3, is positive for every r>0r > 0, so that's a valley. You could stop there, but look at what it says about the shape. Use V=2πr3V = 2\pi r^3 in the formula for hh:

h=Vπr2=2πr3πr2=2rh = \frac{V}{\pi r^2} = \frac{2\pi r^3}{\pi r^2} = 2r

The height is twice the radius, which is the diameter. So the closed tank of least steel is as tall as it is wide, whatever it holds. For the graph's 1,000 ft³, r3=1000/(2π)r^3 = 1000/(2\pi) gives r=5.42 ftr = 5.42\ \text{ft} and h=10.84 fth = 10.84\ \text{ft}.

Worked Example A tank with no lid
1 of 3

An open-top cylindrical tank must hold 1,000 ft³. Find the radius and height that use the least steel.

The same pipeline in other clothes

Exam wording dresses these problems up, but spot the standard form and the rest is routine. A word like largest, least, strongest, or cheapest names the quantity. Whatever's fixed, such as the fence on hand, the volume to hold, or the sheet you start with, is the constraint.

The quantity needn't be a length or an area. When some parts cost more than others, the quantity is the total cost, and each part carries its price. The method doesn't change, but the tidy shapes do.

Worked Example A yard with a pricey front
1 of 3

A rectangular storage yard must enclose 5,000 ft². Its front fence costs $30/ft, and the other three sides cost $10/ft. Find the dimensions that cost the least.

Check the shape

The classic problems have answers with recognizable shapes, and they're worth a glance once the algebra is done. If a closed tank comes out five times as tall as it is wide, there's a mistake somewhere.

x x Fixed perimeter: a square x x 2x Along a wall: long side = 2x L/6 L Open box: cut = L/6 r h r h Closed tank: h = 2r Open tank: h = r
The best shapes of the classic problems

There's less to remember here than it looks, because two of these are halves of the others. Reflect a riverside yard in the river and you have a closed rectangle with twice the fence, whose best shape is a square. Half a square has a long side twice its short side. Stand a second open tank upside down on the first, rim to rim, and you have a closed tank, whose best shape is as tall as it is wide. Half of that has h=rh = r.

These are checks, not substitutes. A priced side or a new constraint moves the answer off them, as the yard with the pricey front did. On a multiple-choice question, the options give you one more check: the right one has to meet the constraint and beat the others on the quantity, and both take seconds on a calculator.

Recap

  • Every optimization is one pipeline: write the quantity, use the constraint to reach one variable, and find where its slope is zero.
  • Eliminate before you differentiate. In A=xyA = xy, yy isn't a constant, because the constraint ties it to xx.
  • Confirm the point and the range. A root can solve the equation and still be a box with no floor.
  • The classic shapes make good checks: a square for a fixed perimeter, a long side of 2x2x along a wall, a cut of L/6L/6, a closed tank with h=2rh = 2r, and an open tank with h=rh = r.
  • Answer what was asked. A cut size isn't a volume, and a radius isn't a height.