What size of box uses the least cardboard? What price brings in the most money? Where should a pipeline meet the shore to cost the least? These are optimization problems: finding the best value of something under a constraint. They are among the most useful applications of calculus in engineering, business and science. In this lesson you will learn a reliable six-step method and apply it to four classic problems: a fenced field, an open box, a can, and a shortest-path problem.
In this lesson you will learn
- A six-step method for any optimization problem
- How to use a constraint to reduce two variables to one
- How to check that you have found a maximum or minimum
- Four classic worked examples with full solutions
- How to handle end points and domain restrictions
You should know the first derivative test, the second derivative test and the chain rule.
The Six-Step Method
- Draw a diagram and name the variables.
- Write the quantity to optimize (the objective) as a formula.
- Use the constraint to write the objective in terms of one variable.
- State the domain: which values of the variable make physical sense?
- Differentiate, set the derivative to zero and solve.
- Check it is a max or min (second derivative test or end points) and answer the question asked.
Example 1: Fencing a Field by a River
A farmer has 600 m of fencing to enclose a rectangular field beside a straight river. No fence is needed along the river. What dimensions give the largest area?
Let x = each side perpendicular to the river, y = side parallel to it.
Objective: A = xy
Constraint: 2x + y = 600 → y = 600 − 2x
A(x) = x(600 − 2x) = 600x − 2x², domain 0 < x < 300
A′(x) = 600 − 4x = 0 → x = 150
A″(x) = −4 < 0 → maximum
y = 600 − 300 = 300
Answer: 150 m by 300 m (long side along the river), area 45,000 m²
Example 2: The Open Box
An open box is made from a 30 cm × 30 cm sheet of card by cutting equal squares of side x from each corner and folding up the sides. What value of x gives the largest volume?
Base: (30 − 2x) by (30 − 2x), height x
V(x) = x(30 − 2x)², domain 0 < x < 15
V′(x) = (30 − 2x)² + x · 2(30 − 2x)(−2)
= (30 − 2x)[(30 − 2x) − 4x]
= (30 − 2x)(30 − 6x)
V′ = 0 → x = 15 (outside the domain) or x = 5
V′ changes from + to − at x = 5 → maximum
V(5) = 5 · 20² = 2000 cm³
Notice how factorising the derivative made the zeros easy to find, and how the domain threw out one of them.
Example 3: The Cheapest Can
A cylindrical can must hold 500 cm³. What radius uses the least metal (smallest surface area, including top and bottom)?
Volume constraint: πr²h = 500 → h = 500/(πr²)
Surface area: S = 2πr² + 2πrh = 2πr² + 1000/r, r > 0
S′(r) = 4πr − 1000/r² = 0 → r³ = 250/π → r ≈ 4.30 cm
S″(r) = 4π + 2000/r³ > 0 → minimum
h = 500/(π · 4.30²) ≈ 8.60 cm
The best can has h = 2r: its height equals its diameter. Real drink cans are taller than this because of other costs, like the thicker top and the shape that fits in a hand.
Example 4: The Shortest Path
A lifeguard at point A on the beach must reach a swimmer. A is 40 m from the water’s edge; the swimmer is 30 m out and 100 m further along the shore. The lifeguard runs at 5 m/s and swims at 1 m/s. Where should they enter the water?
Let x = distance along the shore before entering the water (0 ≤ x ≤ 100).
Run: √(x² + 40²) at 5 m/s; Swim: √((100 − x)² + 30²) at 1 m/s
T(x) = √(x² + 1600)/5 + √((100 − x)² + 900)
T′(x) = x / (5√(x² + 1600)) − (100 − x)/√((100 − x)² + 900) = 0
Solving numerically: x ≈ 94.4 m, T ≈ 51.0 s
Check the end points: T(0) ≈ 112.4 s, T(100) ≈ 51.5 s
The lifeguard should run almost all the way and swim only a short distance. This is the same mathematics as the bending of light when it passes from air into water (Snell’s law).
Common Mistakes
- Differentiating before using the constraint. Reduce to one variable first.
- Ignoring the domain, so impossible answers like negative lengths slip in.
- Not checking it is a maximum or minimum.
- Answering the wrong question. If asked for the dimensions, give all of them, with units.
Practice Exercises
Exercise 1. Two positive numbers add to 20. Find them so that their product is as large as possible.
Show answer
P = x(20 − x), P′ = 20 − 2x = 0: 10 and 10, product 100.
Exercise 2. A rectangle has perimeter 40 cm. What is its largest possible area?
Show answer
A = x(20 − x), maximum at x = 10: a square, 100 cm².
Exercise 3. An open box with a square base must hold 32 m³. Find the dimensions using the least material.
Show answer
Base x by x, height 32/x². S = x² + 128/x, S′ = 2x − 128/x² = 0 gives x = 4. 4 m × 4 m × 2 m, using 48 m².
Frequently Asked Questions
How do you solve optimization problems in calculus?
Draw a diagram, write a formula for the quantity to optimize, use the constraint to reduce it to one variable, state the allowed domain, set the derivative equal to zero, and check with the second derivative or the end points that you have a maximum or minimum.
Why do I need to check the end points?
On a closed interval the largest or smallest value can happen at an end point rather than at a stationary point. Comparing the function at the end points and the critical points makes sure you find the true best value.
Summary
- Write the objective, then use the constraint to reduce to one variable.
- State the domain before differentiating.
- Solve f′ = 0 and check with f″ or a sign chart.
- Compare with the end points on a closed interval.
- Give the final answer in words, with units.
