Optimization Problems
Turn real situations into functions to maximize or minimize, solve classic fencing, box, can and revenue problems, and justify that you found the optimum.
Welcome back!
Step 1 of 11Learn
The farmer's fence
A farmer has 400 meters of fencing to enclose a rectangular field along a straight river. The river side needs no fence. What dimensions give the largest area?
This is an optimization problem: find the best value (largest or smallest) of a quantity under a constraint.
- Variables. Let x be the length of each side perpendicular to the river, and y the side parallel to it.
- Objective. Maximize area: A = xy.
- Constraint. Fencing: 2x + y = 400, so y = 400 − 2x.
- One variable. A(x) = x(400 − 2x) = 400x − 2x².
- Domain. Lengths can't be negative: 0 ≤ x ≤ 200.
- Differentiate. A'(x) = 400 − 4x = 0, so x = 100.
- Check. A(0) = 0, A(100) = 100 × 200 = 20,000, A(200) = 0. The maximum is at x = 100.
Answer: 100 m perpendicular to the river and 200 m along it, for an area of 20,000 m².
Notice the shape: the side along the river is twice as long as the others. Intuition might say "make it a square," which gives 133⅓ × 133⅓ ≈ 17,800 m², about 11% less. Calculus beats intuition here because the river changes the problem.
Step 2 of 11Practice · Chart
Area of the riverside field: A(x) = x(400 − 2x)
Tap the value of x that gives the largest area.
Tap the point that answers the question, then press Check.
| x, side perpendicular to the river (m) | Area |
|---|---|
| 0 | 0 |
| 25 | 8,750 |
| 50 | 15,000 |
| 75 | 18,750 |
| 100 | 20,000 |
| 125 | 18,750 |
| 150 | 15,000 |
| 175 | 8,750 |
| 200 | 0 |
Step 3 of 11Tap to reveal
A method for optimization problems
1. Understand and draw
Read the problem twice. Draw a picture and label the quantities that can vary.
2. Name the objective
Write a formula for the quantity to maximize or minimize: area, volume, cost, time, profit.
3. Use the constraint
Find the equation linking the variables (fixed fencing, fixed volume, fixed budget) and use it to write the objective in terms of one variable.
4. Find the domain
Decide which values of the variable make physical sense. Lengths are positive; you can't cut more than half of a sheet from each side.
5. Differentiate and solve
Set the derivative equal to zero, and note any points where it does not exist.
6. Justify and answer
Confirm it is a max or min: compare with endpoint values, use a sign chart, or check the second derivative. Then answer the question asked, with units, often both dimensions and the optimal value.
Step 4 of 11Practice · Work it out
You have 200 m of fence to enclose a rectangular pen on all four sides. What is the largest possible area in square meters?
Step 5 of 11Learn
The open box
A 12-inch square sheet of cardboard is made into an open-top box by cutting equal squares of side x from each corner and folding up the sides. What value of x gives the largest volume?
- After cutting, the base is (12 − 2x) by (12 − 2x), and the height is x.
- Objective: V(x) = x(12 − 2x)².
- Domain: 0 ≤ x ≤ 6 (you can't cut more than half the side from each edge).
- Differentiate with the product and chain rules:
V'(x) = (12 − 2x)² + x · 2(12 − 2x)(−2) = (12 − 2x)[(12 − 2x) − 4x] = (12 − 2x)(12 − 6x)
- Critical points: x = 6 (an endpoint, volume 0) and x = 2.
- Check: V(0) = 0, V(2) = 2 × 8² = 128 in³, V(6) = 0.
Cut 2-inch squares, for a box 8 × 8 × 2 inches holding 128 cubic inches.
Factoring the derivative, instead of expanding it, made the critical points easy to read off. That's a habit worth keeping: when a derivative has a common factor, pull it out before setting it equal to zero.
For a square sheet of side L, the same steps always give x = L/6. Try it in the explorer below.
Step 6 of 11Explore
Box volume explorer
V(x) = x(L − 2x)² is the volume of an open box made from an L × L sheet by cutting squares of side x from the corners. Change L and watch the peak; it always sits at x = L/6. Cuts wider than L/2 are impossible, so the graph drops to zero there.
- Best cut x = L/6
- 2 in
- Maximum volume
- 128 in³
Step 7 of 11Learn
Minimizing material: the soup can
A company wants a cylindrical can that holds 1,000 cm³ (1 liter) using the least metal. What radius and height should it use?
- Objective: surface area A = 2πr² + 2πrh (top and bottom plus the side).
- Constraint: volume πr²h = 1000, so h = 1000/(πr²).
- One variable: A(r) = 2πr² + 2πr · 1000/(πr²) = 2πr² + 2000/r.
- Domain: r > 0 (an open interval, so no endpoints to check).
- Differentiate: A'(r) = 4πr − 2000/r² = 0, so 4πr³ = 2000 and r³ = 500/π.
- Solve: r ≈ 5.42 cm, and h = 1000/(π · 5.42²) ≈ 10.84 cm.
- Justify: A''(r) = 4π + 4000/r³ > 0 for all r > 0, so the graph is concave up and the critical point is the absolute minimum.
Notice that h = 2r: the most efficient can is exactly as tall as it is wide. Many real cans are taller and thinner, because metal cost isn't the only consideration: labels, grip, stacking and shelf space matter too. An optimization answer is only as good as the objective function you chose.
When the domain is open, like r > 0, the second derivative test (or a sign chart showing A' going from − to +) is how you justify that a single critical point is the absolute minimum.
Step 8 of 11Practice · Work it out
Find the minimum value of f(x) = x + 16/x for x > 0.
Step 9 of 11Learn
Maximizing revenue and profit
Businesses optimize constantly. Suppose a bike shop finds that at price p dollars per rental, it gets q = 1000 − 20p rentals per month. Raising the price earns more per rental but loses customers. What price maximizes revenue?
- Revenue R = price × quantity = p(1000 − 20p) = 1000p − 20p².
- R'(p) = 1000 − 40p = 0 gives p = $25.
- At $25: q = 1000 − 500 = 500 rentals, R = 25 × 500 = $12,500 per month.
- R''(p) = −40 < 0, so this is a maximum.
At $20 the shop would earn 20 × 600 = $12,000, and at $30, 30 × 400 = $12,000. The best price sits in between.
Profit = revenue − cost. Profit is maximized where its derivative is zero: R'(q) − C'(q) = 0, which means marginal revenue = marginal cost. In words: keep producing as long as one more unit brings in more than it costs. This principle, built on derivatives, is one of the foundations of economics.
Real demand curves are rarely perfectly linear, and businesses estimate them from data. But the method is identical: write the quantity you care about as a function of one decision variable, then find where its derivative is zero.
Step 10 of 11Practice · What would you do?
What would you do?
A student maximizing the area A(x) = 400x − 2x² on 0 ≤ x ≤ 200 finds A'(x) = 0 at x = 100 and writes "maximum at x = 100." What is the best way to complete the justification?
Step 11 of 11Practice · Work it out
A theater finds that at a ticket price of p dollars it sells q = 600 − 15p tickets. What ticket price, in dollars, maximizes revenue?
Lesson complete!