One quantity, one variable
An optimization problem asks for the largest or smallest value of some quantity: the most area, the least material, the lowest cost. The quantity usually depends on two or more measurements, tied together by a condition, the constraint.
A rectangle is to be fenced with 40 meters of fence. The quantity is its area, A = xy, where x and y are the width and the length in meters. The constraint is the perimeter: 2x + 2y = 40, so x + y = 20 and y = 20 − x.
Now the area depends on x alone: . Whatever width is chosen, the length follows. The width must be positive and leave a positive length, so the domain is 0 < x < 20.
One highest point
is a parabola opening downwards. At x = 4 the area is 4 × 16 = 64 square meters; at x = 9 it is 99; near either end of the domain it shrinks toward 0, as the rectangle flattens into a line. Somewhere between, the curve has one highest point.
A = 20x − x² and A′ = 20 − 2x = 12: the area is still 12 m² per meter of extra width away from its peak
Slide x to the width that gives the biggest area
A rectangle of width x and length 20 − x, with its area plotted against x. Drag the width: the area is 0 at the two ends of the range, and largest, 100 square meters, at x = 10, where is 0.
Differentiate, then justify
, which is 0 when x = 10. Then the length is 20 − 10 = 10, so the rectangle is a square.
A stationary point is not yet a maximum. Here there are two ways to be sure. The second derivative, , is negative, so the curve bends downwards and x = 10 is a maximum. Or compare: at the ends of the domain the area falls to 0, and at x = 10 it is 100, and the only stationary point between them is x = 10.
Then answer the question that was asked. The largest area is 100 square meters, from a 10 m by 10 m square. x = 10 is the width, not the answer.
The method
Name the quantity to be made largest or smallest, and give each measurement a letter. Write the constraint, and use it to put the quantity in terms of one variable. State the domain of that variable, from what the measurements can physically be.
Differentiate, set the derivative to 0, and solve, keeping only solutions in the domain. Justify the kind of point: the second derivative, or the values at the ends of a closed domain. Then give the value asked for, with its units.
An open box
An open box has a square base of side x meters and height h meters, and must hold 32 cubic meters. Find the least material, its surface area S.
The quantity is : the base and four sides. The constraint is the volume, , so , and . The domain is x > 0, with no upper limit.
, which is 0 when , so and x = 4. Then .
The second derivative is , which is positive for every x > 0. So the curve bends upwards along its whole domain, and its one stationary point is its lowest point overall. The least material is square meters, for a base 4 m square and a height of 2 m. Other bases cost more: x = 2 needs 4 + 64 = 68, and x = 8 needs 64 + 16 = 80.
The gold curve for x > 0, with the vertical scale squeezed. It falls from very large values near x = 0 to its lowest point (4, 48) and rises after it, through (2, 68) and (8, 80).
When an end wins
A wire 20 cm long is cut in two. A piece x cm long is bent into a square, of side , and the rest, 20 − x cm, into a circle, of radius . Find the least and the greatest total area.
The total area is square centimeters. Here x = 0 (all circle) and x = 20 (all square) are allowed, so the domain is the closed interval [0, 20].
The gradient of A is , and setting it to 0 gives , so and . The second derivative, , is positive, so this is a minimum: square centimeters.
The greatest area is not at the stationary point, so compare the ends. At x = 0, ; at x = 20, . The greatest total area is about 31.83 square centimeters, with no cut at all: the whole wire made into a circle.
The gold curve from x = 0 to x = 20. Its stationary point is the lowest point, about (11.20, 14.00); the highest value is at the end x = 0.
The usual mistakes
Differentiating before using the constraint. A = xy has two letters; until y is written as 20 − x, there is no single derivative to set to 0.
Giving the variable instead of the quantity. For the fence, x = 10 is a width; the largest area is 100 square meters.
Taking a stationary point as the answer without checking it. For the wire, the stationary point gives the least area, and the question asked for the greatest as well.
Putting the whole half-perimeter into one side. A side of 20 leaves a length of 0, and the area is 0.
Leaving off the units, or giving square meters for a length.
A can of fixed capacity
In the application below, a closed can must hold cubic centimeters. The capacity is the constraint that puts the metal in terms of the radius alone.
Worked example: A Cylindrical Can of Fixed Capacity: the Shape That Uses the Least Metal
Question A closed cylindrical can is to hold 128π cubic centimeters, which is about 402 milliliters. Its surface is the curved side together with two circular ends, so the metal used is A = 2π r2 + 2π rh square centimeters, where r cm is the radius and h cm the height. (a) Find the radius and the height that use the least metal. (b) Find that least area, and say how the height compares with the radius.
1.Use the capacity to remove one of the two letters. The volume is π r2 h = 128π, so h = 128r2.
The capacity ties the two lengths together: π r2 h = 128π, so h = 128r2. 2.Put that into the area: A = 2π r2 + 2π r × 128r2 = 2π r2 + 256πr, which is a function of r alone.
Putting that into the area leaves one letter: A = 2π r2 + 256πr, the curve on the right. 3.Differentiate: dAdr = 4π r − 256πr2.
Differentiating gives dAdr = 4π r − 256πr2. 4.Set it to zero: 4π r = 256πr2, so 4r3 = 256 and r3 = 64, giving r = 4 cm. A radius cannot be negative, and r3 = 64 has only this one real root, so there is nothing to reject.
(a) Setting it to zero gives 4r3 = 256, so r3 = 64 and r = 4 cm, the bottom of the curve. 5.(a) Then h = 12816 = 8 cm. Check the capacity: π × 16 × 8 = 128π cubic centimeters, as the can must hold.
Then h = 12816 = 8 cm, and the capacity checks out: π × 16 × 8 = 128π cubic cm. 6.(b) The least metal is A = 2π × 16 + 256π4 = 32π + 64π = 96π ≈ 301.6 square centimeters. Since d2Adr2 = 4π + 512πr3 = 12π is positive, this is a minimum, and h = 8 = 2r: the best can is exactly as tall as it is wide.
(b) The least metal is 32π + 64π = 96π ≈ 301.6 square cm, and h = 8 = 2r: as tall as it is wide.
Answer: (a) radius 4 cm and height 8 cm; (b) 96π ≈ 301.6 square centimeters, with the height twice the radius
Common mistakes
- Differentiating A = 2π r2 + 2π rh with respect to r while treating h as a constant. The height is not free to stay where it is: the capacity ties it to the radius, so it must be replaced by 128r2 before the area is differentiated.
- Leaving out one of the ends and using A = π r2 + 2π rh. That is an open can, and it leads to r3 = 128 and a radius of about 5.04 cm: a different can with a different answer.