Skip to content
Family Table Math

Optimization

What dimensions give the biggest garden for a fixed amount of fencing? What shape of can uses the least metal? Which route for a cable costs the least? These are optimization problems: finding the best value of something. You’ve done a few with quadratics, but derivatives let you optimize almost any function. Most of the work is in the setup; the calculus part uses the tests you already know.

  1. Draw a picture and label it with variables.
  2. Identify the objective: the quantity to maximize or minimize (area, volume, cost, distance). Write it as a formula.
  3. Write the constraint: the fixed condition (total fencing, fixed volume, a curve the point must lie on).
  4. Use the constraint to get one variable. Solve it for one variable and substitute, so the objective depends on a single variable.
  5. State the domain: which values of that variable make physical sense (lengths positive, cuts no bigger than the sheet, and so on).
  1. Differentiate and find the critical points in the domain.
  2. Justify that you’ve found the absolute max or min. Use one of these:
    • Candidates test: if the domain is a closed interval, compare the objective at the critical points and the endpoints.
    • Only one critical point: if there’s just one critical point in the domain and the first derivative test (sign of f′f' changes from ++ to −-) or the second derivative test (f′′<0f'' \lt 0) shows it’s a relative maximum, it’s the absolute maximum. Same idea for a minimum.
  3. Answer the question asked, with units. Read carefully: does it want the dimensions, the maximum value, or both?

AP free-response questions award a point for the justification, so don’t skip step 7.

To minimize a distance D=…D = \sqrt{\dots}, minimize D2D^2 instead. The square root is an increasing function, so DD and D2D^2 are smallest at the same point, and D2D^2 has no square root to differentiate.

A farmer has 600600 m of fencing to enclose a rectangular field and divide it into three pens with two fences parallel to one side. What dimensions give the largest total area?

Solution.

Variables: let yy be the length of each fence parallel to the dividers (the two ends of the field and the two dividers), and xx the length of the other two sides. So there are 44 fences of length yy and 22 of length xx.

Constraint: 2x+4y=6002x + 4y = 600, so y=150−x2y = 150 - \dfrac{x}{2}.

Objective:

A(x)=xy=x(150−x2)=150x−x22A(x) = xy = x\left(150 - \frac{x}{2}\right) = 150x - \frac{x^2}{2}

Domain: 0<x<3000 \lt x \lt 300 (both xx and yy must be positive).

Critical point: A′(x)=150−x=0A'(x) = 150 - x = 0 gives x=150x = 150.

Justify: A′′(x)=−1<0A''(x) = -1 \lt 0, so x=150x = 150 is a relative maximum, and it’s the only critical point in the domain, so it’s the absolute maximum.

Answer: x=150x = 150 m and y=150−75=75y = 150 - 75 = 75 m, for a maximum area of 150×75=11 250150 \times 75 = 11\,250 m².

An open-top box is made from a 3030 cm by 4848 cm sheet of cardboard by cutting equal squares from the corners and folding up the sides. What size of square gives the largest volume?

A 48 cm by 30 cm sheet with an x by x square cut from each corner. Folding up the sides along the dashed lines makes an open box with base 48 - 2x by 30 - 2x and height x. 48 cm 30 cm x x 48 − 2x by 30 − 2x 48 − 2x 30 − 2x x
Cutting squares of side xx leaves a base of (48−2x)(48 - 2x) by (30−2x)(30 - 2x) and a height of xx.

Solution. Let xx be the side of each square, in cm. The box has height xx and a base of (48−2x)(48 - 2x) by (30−2x)(30 - 2x).

V(x)=x(48−2x)(30−2x)=4x3−156x2+1440xV(x) = x(48 - 2x)(30 - 2x) = 4x^3 - 156x^2 + 1440x

Domain: 0≤x≤150 \le x \le 15 (at x=15x = 15 the short side is used up). Including the endpoints is fine, since they just give V=0V = 0, and it lets you use the candidates test.

V′(x)=12x2−312x+1440=12(x2−26x+120)=12(x−6)(x−20)V'(x) = 12x^2 - 312x + 1440 = 12(x^2 - 26x + 120) = 12(x - 6)(x - 20)

Only x=6x = 6 is in the domain. Candidates:

xx00661515
V(x)V(x)006⋅36⋅18=38886 \cdot 36 \cdot 18 = 388800

Cut 66 cm squares. The box is 3636 cm by 1818 cm by 66 cm, with a maximum volume of 38883888 cm³.

A closed cylindrical can must hold 500500 cm³. What radius and height use the least material (smallest surface area)? Give answers to three decimal places.

Solution. Let rr be the radius and hh the height, in cm.

Objective (top, bottom, and side): S=2πr2+2πrhS = 2\pi r^2 + 2\pi rh.

Constraint: πr2h=500\pi r^2 h = 500, so h=500πr2h = \dfrac{500}{\pi r^2}. Substitute:

S(r)=2πr2+2πr⋅500πr2=2πr2+1000r,r>0S(r) = 2\pi r^2 + 2\pi r \cdot \frac{500}{\pi r^2} = 2\pi r^2 + \frac{1000}{r}, \qquad r \gt 0 S′(r)=4πr−1000r2=0⇒r3=250π⇒r=250π3≈4.301S'(r) = 4\pi r - \frac{1000}{r^2} = 0 \quad\Rightarrow\quad r^3 = \frac{250}{\pi} \quad\Rightarrow\quad r = \sqrt[3]{\frac{250}{\pi}} \approx 4.301

Justify: S′′(r)=4π+2000r3>0S''(r) = 4\pi + \dfrac{2000}{r^3} \gt 0 for all r>0r \gt 0, so this is a relative minimum, and it’s the only critical point, so it’s the absolute minimum.

h=500πr2≈8.603h = \dfrac{500}{\pi r^2} \approx 8.603 cm. The best can has radius about 4.3014.301 cm and height about 8.6038.603 cm, using about 348.734348.734 cm² of material.

Notice h=2rh = 2r: the height equals the diameter. (You can show this exactly: r3=250πr^3 = \frac{250}{\pi} gives h=500πr2=2r3r2=2rh = \frac{500}{\pi r^2} = \frac{2 r^3}{r^2} = 2r.)

Find the point on the curve y=xy = \sqrt{x} that is closest to the point (3,0)(3, 0).

Solution. A point on the curve is (x,x)(x, \sqrt{x}), with x≥0x \ge 0. Minimize the squared distance:

D2=(x−3)2+(x−0)2=x2−6x+9+x=x2−5x+9D^2 = (x - 3)^2 + (\sqrt{x} - 0)^2 = x^2 - 6x + 9 + x = x^2 - 5x + 9 ddx(D2)=2x−5=0⇒x=52\frac{d}{dx}(D^2) = 2x - 5 = 0 \quad\Rightarrow\quad x = \frac{5}{2}

The derivative changes from negative to positive at x=52x = \frac{5}{2}, and it’s the only critical point on [0,∞)[0, \infty), so it gives the absolute minimum. (At the endpoint x=0x = 0, D2=9D^2 = 9, which is larger.)

The closest point is (52,52)≈(2.5,1.581)\left(\dfrac{5}{2}, \sqrt{\dfrac{5}{2}}\right) \approx (2.5, 1.581), at a distance of 254−252+9=112≈1.658\sqrt{\frac{25}{4} - \frac{25}{2} + 9} = \dfrac{\sqrt{11}}{2} \approx 1.658.

Differentiating before you have one variable. A=xyA = xy can’t be optimized until you use the constraint to replace yy. Get the objective in terms of a single variable first.

Skipping the domain. The domain tells you which critical points count and gives the endpoints for the candidates test. In Example 2, x=20x = 20 solves V′(x)=0V'(x) = 0 but makes no sense: you can’t cut 2020 cm squares from a 3030 cm side.

No justification. Finding a critical point isn’t enough. Say why it’s the absolute max or min: a candidates table, or “the only critical point, and f′f' changes from positive to negative there.”

Answering the wrong question. If the question asks for the dimensions, give both dimensions with units. If it asks for the maximum volume, give the volume. In Example 2, "x=6x = 6" alone isn’t the volume.

Mixing up the constraint and the objective. The objective is what you’re making as large or small as possible. The constraint is what’s fixed. In Example 3, the volume is fixed (500500 cm³) and the surface area is minimized.

Forgetting a side or a face. Check your formula against the picture. Is the box open or closed? Is one side of the pen against a wall? Do the dividers count?

1. (Warm-up) Two positive numbers have a product of 6464. What is the smallest possible value of their sum?

Solution

Let the numbers be xx and 64x\dfrac{64}{x}, with x>0x \gt 0. The sum is S(x)=x+64xS(x) = x + \dfrac{64}{x}.

S′(x)=1−64x2=0S'(x) = 1 - \dfrac{64}{x^2} = 0 gives x=8x = 8. S′′(x)=128x3>0S''(x) = \dfrac{128}{x^3} \gt 0, so it’s a minimum, and it’s the only critical point.

The numbers are 88 and 88, and the smallest sum is 1616.

2. (Warm-up) A rectangle has a perimeter of 4040 m. Write its area as a function of one side length xx, state the domain, and find the largest possible area.

Solution

The other side is 20−x20 - x, so A(x)=x(20−x)=20x−x2A(x) = x(20 - x) = 20x - x^2, with 0<x<200 \lt x \lt 20.

A′(x)=20−2x=0A'(x) = 20 - 2x = 0 gives x=10x = 10. A′′(x)=−2<0A''(x) = -2 \lt 0, and it’s the only critical point, so it’s the absolute maximum.

The largest area is 10×10=10010 \times 10 = 100 m² (a square).

3. (Core) A rectangular garden of area 200200 m² is built against a house, so only three sides need fencing. What dimensions use the least fencing?

Solution

Let xx be each side perpendicular to the house and yy the side parallel to it. Constraint: xy=200xy = 200, so y=200xy = \dfrac{200}{x}.

L(x)=2x+y=2x+200x,x>0L(x) = 2x + y = 2x + \frac{200}{x}, \qquad x \gt 0

L′(x)=2−200x2=0L'(x) = 2 - \dfrac{200}{x^2} = 0 gives x2=100x^2 = 100, so x=10x = 10. L′′(x)=400x3>0L''(x) = \dfrac{400}{x^3} \gt 0, so it’s a minimum, and it’s the only critical point.

The garden is 1010 m (out from the house) by 2020 m (along the house), using 4040 m of fencing.

4. (Core) A closed box with a square base must hold 22 m³. The material for the top and bottom costs $10 per m², and the material for the sides costs $5 per m². Find the dimensions that minimize the cost, and the minimum cost.

Solution

Let the base be xx m by xx m and the height hh m. Constraint: x2h=2x^2 h = 2, so h=2x2h = \dfrac{2}{x^2}.

Top and bottom: 2x22x^2 m² at $10. Four sides: 4xh4xh m² at $5.

C(x)=10(2x2)+5(4xh)=20x2+20x⋅2x2=20x2+40x,x>0C(x) = 10(2x^2) + 5(4xh) = 20x^2 + 20x \cdot \frac{2}{x^2} = 20x^2 + \frac{40}{x}, \qquad x \gt 0

C′(x)=40x−40x2=0C'(x) = 40x - \dfrac{40}{x^2} = 0 gives x3=1x^3 = 1, so x=1x = 1. C′′(x)=40+80x3>0C''(x) = 40 + \dfrac{80}{x^3} \gt 0, so it’s a minimum, and it’s the only critical point.

The box is 11 m by 11 m by 22 m tall, and the minimum cost is C(1)=20+40=60C(1) = 20 + 40 = 60, or $60.

5. (Core) An open-top box is made from a 1212 cm by 1212 cm square sheet by cutting equal squares from the corners. Find the largest possible volume.

Solution

V(x)=x(12−2x)2V(x) = x(12 - 2x)^2 for 0≤x≤60 \le x \le 6.

V′(x)=(12−2x)2+x⋅2(12−2x)(−2)=(12−2x)((12−2x)−4x)=(12−2x)(12−6x)\begin{aligned} V'(x) &= (12 - 2x)^2 + x \cdot 2(12 - 2x)(-2) \\ &= (12 - 2x)\big((12 - 2x) - 4x\big) \\ &= (12 - 2x)(12 - 6x) \end{aligned}

V′(x)=0V'(x) = 0 at x=6x = 6 and x=2x = 2. Candidates:

xx002266
V(x)V(x)002⋅82=1282 \cdot 8^2 = 12800

The largest volume is 128128 cm³, with 22 cm squares cut out.

6. (Core) Find the points on the parabola y=x2y = x^2 that are closest to the point (0,4)(0, 4), and the minimum distance.

Solution

A point on the parabola is (x,x2)(x, x^2).

D2=x2+(x2−4)2=x4−7x2+16D^2 = x^2 + (x^2 - 4)^2 = x^4 - 7x^2 + 16

ddx(D2)=4x3−14x=2x(2x2−7)=0\dfrac{d}{dx}(D^2) = 4x^3 - 14x = 2x(2x^2 - 7) = 0 gives x=0x = 0 or x=±72x = \pm\sqrt{\dfrac{7}{2}}.

xx00±7/2\pm\sqrt{7/2}
D2D^21616494−492+16=154\frac{49}{4} - \frac{49}{2} + 16 = \frac{15}{4}

D2D^2 heads to infinity as ∣x∣\lvert x \rvert grows, so the minimum is at x=±72=±142x = \pm\sqrt{\frac{7}{2}} = \pm\frac{\sqrt{14}}{2}. The closest points are (±142,72)\left(\pm\dfrac{\sqrt{14}}{2}, \dfrac{7}{2}\right), at distance 152≈1.936\dfrac{\sqrt{15}}{2} \approx 1.936. (At x=0x = 0, the point (0,0)(0, 0) is a relative maximum of the distance.)

7. (Core) A rectangle is inscribed in a semicircle of radius 1010 cm, with its base on the diameter. Find the dimensions that give the largest area.

Solution

Put the centre at the origin. If the top-right corner is (x,y)(x, y) on the circle, then y=100−x2y = \sqrt{100 - x^2}, the base is 2x2x, and

A(x)=2x100−x2,0≤x≤10A(x) = 2x\sqrt{100 - x^2}, \qquad 0 \le x \le 10A′(x)=2100−x2+2x⋅−x100−x2=2(100−x2)−2x2100−x2=200−4x2100−x2A'(x) = 2\sqrt{100 - x^2} + 2x \cdot \frac{-x}{\sqrt{100 - x^2}} = \frac{2(100 - x^2) - 2x^2}{\sqrt{100 - x^2}} = \frac{200 - 4x^2}{\sqrt{100 - x^2}}

A′(x)=0A'(x) = 0 when x2=50x^2 = 50, so x=52x = 5\sqrt{2}. (A′A' is undefined at x=10x = 10, an endpoint.) Candidates: A(0)=0A(0) = 0, A(10)=0A(10) = 0, and

A(52)=2(52)50=102⋅52=100A(5\sqrt{2}) = 2(5\sqrt{2})\sqrt{50} = 10\sqrt{2} \cdot 5\sqrt{2} = 100

The rectangle is 102≈14.14210\sqrt{2} \approx 14.142 cm wide and 52≈7.0715\sqrt{2} \approx 7.071 cm tall, with area 100100 cm².

8. (Challenge) A power line runs from a station on one bank of a straight river 300300 m wide to a factory on the other bank, 12001200 m downstream. Cable costs $50 per metre under water and $30 per metre along the bank. The cable goes straight across the river to a point xx m downstream, then along the far bank. Find the cheapest route.

Solution

The underwater part has length 3002+x2\sqrt{300^2 + x^2} and the land part 1200−x1200 - x, for 0≤x≤12000 \le x \le 1200.

C(x)=5090 000+x2+30(1200−x)C(x) = 50\sqrt{90\,000 + x^2} + 30(1200 - x)C′(x)=50x90 000+x2−30=0C'(x) = \frac{50x}{\sqrt{90\,000 + x^2}} - 30 = 050x=3090 000+x2  ⇒  2500x2=900(90 000+x2)  ⇒  1600x2=81 000 000  ⇒  x=22550x = 30\sqrt{90\,000 + x^2} \;\Rightarrow\; 2500x^2 = 900(90\,000 + x^2) \;\Rightarrow\; 1600x^2 = 81\,000\,000 \;\Rightarrow\; x = 225

(Only the positive root counts.) Candidates:

xx (m)0022522512001200
C(x)C(x) ($)15 000+36 000=51 00015\,000 + 36\,000 = 51\,00050(375)+30(975)=48 00050(375) + 30(975) = 48\,000≈61 847\approx 61\,847

The cheapest route crosses the river to a point 225225 m downstream, then follows the bank. The minimum cost is $48 000.

9. (Challenge) Find the dimensions of the cylinder with the largest volume that fits inside a sphere of radius 66 cm. Give the volume exactly and to three decimal places.

Solution

Let the cylinder have radius rr and height hh. A cross-section through the centre shows a right triangle with legs rr and h2\frac{h}{2} and hypotenuse 66:

r2+(h2)2=36⇒r2=36−h24r^2 + \left(\frac{h}{2}\right)^2 = 36 \quad\Rightarrow\quad r^2 = 36 - \frac{h^2}{4}V(h)=πr2h=π(36h−h34),0≤h≤12V(h) = \pi r^2 h = \pi\left(36h - \frac{h^3}{4}\right), \qquad 0 \le h \le 12

V′(h)=π(36−3h24)=0V'(h) = \pi\left(36 - \dfrac{3h^2}{4}\right) = 0 gives h2=48h^2 = 48, so h=43≈6.928h = 4\sqrt{3} \approx 6.928 cm.

V(0)=V(12)=0V(0) = V(12) = 0, so this critical point gives the maximum. Then r2=36−12=24r^2 = 36 - 12 = 24, so r=26≈4.899r = 2\sqrt{6} \approx 4.899 cm.

V=π(24)(43)=963 π≈522.374 cm3V = \pi(24)(4\sqrt{3}) = 96\sqrt{3}\,\pi \approx 522.374 \text{ cm}^3