Optimization Problems in Calculus and a Reliable Method
Turn word problems into a single function, find the true maximum or minimum, and avoid the endpoint traps.
Key takeaways
- Identify the quantity to be optimized (the objective) and any equation that limits your choices (the constraint).
- Use the constraint to reduce the objective to a function of a single variable.
- Write down the domain before differentiating, since the best value may sit at an endpoint.
- On a closed interval, compare the function at all critical points and both ends.
- Finish by answering the question asked, with units.
An optimization problem asks for the largest or smallest value of some quantity: the most area from a length of fencing, or the least metal for a can of a given volume. The calculus method is to write that quantity as a function of one variable, state which values of the variable make sense, and compare the places where the derivative is zero or undefined with the ends of the allowed range.
Finding where the derivative vanishes is only part of the job. You also have to show that the point you found is the best one.
A method you can repeat
- Read the problem twice and draw a picture.
- Name the variables.
- Write the objective: the thing to make as large or small as possible.
- Write the constraint connecting the variables.
- Solve the constraint for one variable and substitute.
- State the domain.
- Differentiate and find critical points, the places where the derivative is zero or fails to exist.
- Decide which candidate wins, and state the answer in words.
The theory behind step 7 is covered in critical points and the derivative tests.
Fencing beside a river
You have 100 m of fence to enclose a rectangle along a straight river, with no fence needed on the river side. What dimensions give the most area?
Let x be the length of each side that runs away from the river. The side parallel to the river is then 100 − 2x.
A(x) = x (100 − 2x), 0 ≤ x ≤ 50
A′(x) = 100 − 4x = 0 gives x = 25
A(0) = 0, A(25) = 1250, A(50) = 0 The best rectangle is 25 m deep and 50 m along the river, with area 1250 m². The long side is twice the short one, not a square, because one side is free.
A box from a square sheet
Cut equal squares of side x from the corners of a 12 cm by 12 cm sheet and fold up the flaps to make an open box. Which x maximizes the volume?
V(x) = x (12 − 2x)², 0 ≤ x ≤ 6
V′(x) = (12 − 2x)² − 4x(12 − 2x)
= (12 − 2x)(12 − 6x) The derivative vanishes at x = 2 and x = 6. Since V(0) = V(6) = 0 and V(2) = 2 · 8² = 128, the maximum volume is 128 cm³, with 2 cm squares removed. The root x = 6 is a legitimate critical point of the polynomial but corresponds to a box with no base.
Factoring the derivative instead of expanding it saved the work of solving a quadratic from scratch.
The least material for a can
A closed cylindrical can must hold 1000 cm³. Which radius uses the least surface area?
The objective is S = 2πr² + 2πrh, two circular ends plus the side. The constraint is πr²h = 1000, so h = 1000/(πr²).
S(r) = 2πr² + 2000/r, r > 0
S′(r) = 4πr − 2000/r² = 0
r³ = 500/π
r ≈ 5.42 cm Then h = 1000/(πr²) ≈ 10.84 cm, exactly twice the radius, and S is about 554 cm².
The domain here is open, with no endpoints to check. Instead, note that S grows without bound as r approaches 0 and as r becomes large, and there is only one critical point, so it must be the minimum. Equivalently, S″ = 4π + 4000/r³ is positive for every r > 0, so the graph bends upward everywhere.
Real cans often differ from this shape. Seams, thicker lids, waste from cutting circles, shelf space and ease of handling all matter, and none of them is in the model.
When the best answer is at an end
A wire of length L is cut into two pieces. One piece, of length x, is bent into a square, and the rest into a circle. How should you cut it to get the least total area? The most?
A(x) = x²/16 + (L − x)²/(4π), 0 ≤ x ≤ L
A′(x) = x/8 − (L − x)/(2π) = 0
x = 4L/(π + 4) Because A″ = 1/8 + 1/(2π) is positive, this interior point is the minimum. It uses about 56 percent of the wire for the square.
The maximum is not at any point where the derivative vanishes. Compare the ends: all square gives L²/16, while all circle gives L²/(4π). Since 4π is less than 16, the circle wins, so you should not cut the wire at all. Solving A′ = 0 and calling the result a maximum would give exactly the wrong answer.
The closest point on a curve
Which point on the graph of y = √x is nearest to the point (2, 0)? Distance involves a square root, but a distance is smallest exactly where its square is smallest. So minimize:
D(x) = (x − 2)² + (√x)² = (x − 2)² + x, x ≥ 0
D′(x) = 2(x − 2) + 1 = 2x − 3
x = 3/2 D changes from decreasing to increasing there, so this is the minimum. The point is (1.5, √1.5), about (1.5, 1.22), and the distance is √1.75 ≈ 1.32. At the endpoint x = 0 the distance is 2, which is larger.
This trick of optimizing a squared quantity works for any nonnegative objective and often removes the messiest part of the algebra.
Shortest route by way of a line
A hiker at the point (0, 3) must walk to a straight river along the horizontal axis, fill a bottle, and continue to a camp at (8, 5). Units are kilometers. Where should the hiker meet the river to walk the least?
L(x) = √(x² + 9) + √((8 − x)² + 25), 0 ≤ x ≤ 8
L′(x) = x/√(x² + 9) − (8 − x)/√((8 − x)² + 25) = 0
solution: x/3 = (8 − x)/5, so x = 3
L(3) = √18 + √50 = 8√2 ≈ 11.31 The condition L′ = 0 says the two legs make equal angles with the river, the same rule that light obeys on reflection. Geometry confirms it: reflect the starting point to (0, −3), and the straight line from there to (8, 5) has length √128 = 8√2. For comparison, going to x = 0 first costs about 12.43 km and going to x = 8 costs about 13.54 km.
If the hiker moved at different speeds on the two sides of a boundary and had to cross it, minimizing time instead of distance would lead to the law of refraction, one of the oldest and most striking uses of optimization in physics.
Price, revenue and profit
Say a hypothetical shop finds that to sell q units it must charge p = 50 − 0.5q dollars, for q between 0 and 100. Revenue is R(q) = q(50 − 0.5q). Its derivative, 50 − q, vanishes at q = 50, giving a price of 25 and revenue of 1250.
Now suppose each unit costs 10 to make. Profit is revenue minus cost:
P(q) = 50q − 0.5q² − 10q = 40q − 0.5q²
P′(q) = 40 − q = 0 gives q = 40
price = 30, profit = 800 Maximizing profit leads to a higher price and fewer units than maximizing revenue. The condition P′ = 0 says that the extra revenue from one more unit equals its extra cost, which economists phrase as marginal revenue equaling marginal cost. The model is only as good as the assumed demand line, which in real life must be estimated and can shift.
Making sure you found the best
Three standard arguments settle the question.
| Situation | Argument |
|---|---|
| Continuous function on a closed interval | Evaluate at critical points and endpoints; take the largest and smallest |
| One critical point on an interval, derivative changes sign from − to + | It is the absolute minimum there |
| Open or infinite domain | Examine limits at the ends and compare with critical values |
The first rests on the extreme value theorem, which guarantees that a continuous function on a closed bounded interval attains a maximum and a minimum. Without those hypotheses there may be no best value at all. The function 1/x on the positive numbers gets as close to 0 as you like but never reaches a minimum.
When the objective is a quadratic, you can also check without calculus by completing the square. The fencing area x(100 − 2x) equals 1250 − 2(x − 25)². The subtracted term is never negative, so no choice of x can beat 1250, and only x = 25 reaches it. An independent argument like this is a good way to build trust in the derivative method before applying it where no algebraic shortcut exists.
Beyond one variable and common errors
Some problems resist reduction to one variable, or have several constraints. With two or more free variables, you set partial derivatives to zero, and with constraints you can use Lagrange multipliers. When both objective and constraints are linear, calculus gives no interior critical points, and linear programming is the tool. For functions too complicated to solve by hand, computers use methods such as gradient descent.
The errors that recur in coursework are predictable:
- optimizing the constraint when you should optimize the objective;
- differentiating while two independent letters remain;
- skipping the domain and accepting a negative length;
- reporting the value of x when the question asked for the maximum area;
- assuming a critical point is a maximum without any test.
A final reality check costs seconds: try a value slightly to each side of your answer and confirm that both do worse. In the fencing problem, x = 24 and x = 26 each give 1248 m², just short of 1250. The near tie also teaches something practical. Near a smooth maximum the objective is flat, so a small error in the choice costs very little. A builder who misses the ideal depth by a meter loses only 2 m² of area.
Units offer another check. A length should come out as a length, an area as an area. In the wire problem, x = 4L/(π + 4) is a pure number times L, as it must be, and it lies between 0 and L for every positive L.