Optimization Problems

One function for the goal, then differentiate.

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: A = x(20 − x) = 20x − x². 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

A = 20x − x² 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.

x = 420 − x = 16A = 64 m²xA510152050100

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 A = 20x − x² 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 dA/dx = 20 − 2x is 0.

Differentiate, then justify

dA/dx = 20 − 2x, 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, d²A/dx² = −2, 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 S = x² + 4xh: the base and four sides. The constraint is the volume, x²h = 32, so h = 32/x², and S = x² + 4x × 32/x² = x² + 128/x. The domain is x > 0, with no upper limit.

dS/dx = 2x − 128/x², which is 0 when 2x³ = 128, so x³ = 64 and x = 4. Then h = 32/16 = 2.

The second derivative is d²S/dx² = 2 + 256/x³, 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 S = 16 + 128/4 = 16 + 32 = 48 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.

xS(4, 48)

The gold curve S = x² + 128/x 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 x/4, and the rest, 20 − x cm, into a circle, of radius (20 − x)/(2π). Find the least and the greatest total area.

The total area is A = x²/16 + π((20 − x)/(2π))² = x²/16 + (20 − x)²/(4π) 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 x/8 − (20 − x)/(2π), and setting it to 0 gives πx = 4(20 − x), so x(π + 4) = 80 and x = 80/(π + 4) ≈ 11.20. The second derivative, 1/8 + 1/(2π) ≈ 0.284, is positive, so this is a minimum: A ≈ 14.00 square centimeters.

The greatest area is not at the stationary point, so compare the ends. At x = 0, A = 400/(4π) = 100/π ≈ 31.83; at x = 20, A = 400/16 = 25. The greatest total area is about 31.83 square centimeters, with no cut at all: the whole wire made into a circle.

xA(0, 31.83)(11.20, 14.00)(20, 25)

The gold curve A = x²/16 + (20 − x)²/(4π) 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 128π 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. 1.Use the capacity to remove one of the two letters. The volume is π r2 h = 128π, so h = 128r2.

    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmpi r2h = 128 pih = 128/r2
    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmpi r2h = 128 pih = 128/r2
    The capacity ties the two lengths together: π r2 h = 128π, so h = 128r2.
  2. 2.Put that into the area: A = 2π r2 + 2π r × 128r2 = 2π r2 + 256πr, which is a function of r alone.

    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmA = 2 pi r2+ 256 pi/r
    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmA = 2 pi r2+ 256 pi/r
    Putting that into the area leaves one letter: A = 2π r2 + 256πr, the curve on the right.
  3. 3.Differentiate: dAdr = 4π r − 256πr2.

    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmdA/dr = 4 pi r − 256 pi/r2
    h2rit holds 128 pi cubic cm250400550258radius r, cmmetal, square cmdA/dr = 4 pi r − 256 pi/r2
    Differentiating gives dAdr = 4π r − 256πr2.
  4. 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.

    h2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)4r3= 256, so r3= 64r = 4 cm
    h2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)4r3= 256, so r3= 64r = 4 cm
    (a) Setting it to zero gives 4r3 = 256, so r3 = 64 and r = 4 cm, the bottom of the curve.
  5. 5.(a) Then h = 12816 = 8 cm. Check the capacity: π × 16 × 8 = 128π cubic centimeters, as the can must hold.

    h = 8 cm2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)h = 128/16 = 8 cmcheck: pi × 16 × 8 = 128 pi
    h = 8 cm2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)h = 128/16 = 8 cmcheck: pi × 16 × 8 = 128 pi
    Then h = 12816 = 8 cm, and the capacity checks out: π × 16 × 8 = 128π cubic cm.
  6. 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.

    h = 8 cm2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)A = 32 pi + 64 pi = 96 piabout 301.6 cm2, and h = 2r
    h = 8 cm2r = 8 cmit holds 128 pi cubic cm250400550258radius r, cmmetal, square cm(4, 301.6)A = 32 pi + 64 pi = 96 piabout 301.6 cm2, and h = 2r
    (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.

More using differentiation problems, worked step by step →

Practice Optimization Problems in the app