Optimization Problems in Calculus: A 5-Step Method With Examples
Solve calculus optimization problems with a reliable 5-step method: box, fence and can examples worked in full, plus how to check endpoints.
By the PracticeCalculus team Published 7 min read
On this page
- What is an optimization problem?
- The 5-step method for optimization problems
- Worked example 1: the biggest open box
- Worked example 2: fencing a field along a river
- Worked example 3: the can that uses the least metal
- Why checking endpoints matters
- Common mistakes in optimization problems
- Quick reference
- Get comfortable through practice
What dimensions give the biggest box, the largest field, or the cheapest can? These are optimization problems, and they are where derivatives stop being symbols and start answering real questions. They also feel hard at first, because the calculus is easy but setting up the function is not. A fixed five-step method removes the guesswork.
What is an optimization problem?
An optimization problem asks for the maximum or minimum value of some quantity, subject to a condition. The quantity you want to make as big or small as possible is the objective function. The condition that limits your choices is the constraint.
The key fact from calculus is that a smooth function can only reach a maximum or minimum inside an interval where its derivative is zero (or undefined), or else at an endpoint:
So the whole job is to turn a word problem into a function of one variable, then find and test those candidate points.
The 5-step method for optimization problems
- Draw and name. Sketch the situation and label every changing quantity with a variable.
- Write the objective. Write a formula for the quantity to maximize or minimize. It will usually have two variables.
- Use the constraint to get one variable. Solve the constraint for one variable and substitute. State the domain: which values make physical sense?
- Find critical points. Differentiate, set the derivative equal to zero, and solve.
- Test and answer. Confirm a max or min (endpoints, first derivative test or second derivative test), then answer the exact question with units.
Worked example 1: the biggest open box
A square sheet of cardboard is 12 inches on each side. You cut equal squares from the four corners and fold up the sides to make an open box. What size squares give the largest volume?
Step 1. Draw and name. Let x be the side of each cut square. That becomes the height of the box. The base is a square with side 12 - 2x, since x is removed from each end.
Step 2. Objective. Volume is base area times height:
Step 3. Domain. Here the constraint is already built in, so V is a function of x alone. You cannot cut a negative square, and you cannot cut more than half the side, so 0 \le x \le 6.
Step 4. Critical points. Use the product rule and the chain rule:
V' = 0 at x = 6 and x = 2.
Step 5. Test. Compare the critical points and endpoints: V(0) = 0, V(6) = 0, and V(2) = 2\cdot 8^2 = 128.
Answer: cut 2-inch squares. The box is 8 by 8 by 2 inches, with a volume of 128 cubic inches.
Worked example 2: fencing a field along a river
A farmer has 600 feet of fencing to enclose a rectangular field along a straight river. No fence is needed along the river. What dimensions give the largest area?
Step 1. Draw and name. Let x be each side perpendicular to the river and y the side parallel to it.
Step 2. Objective. Area A = xy.
Step 3. Constraint. The fence covers two sides of length x and one of length y: 2x + y = 600, so y = 600 - 2x. Substitute:
Step 4. Critical points. A'(x) = 600 - 4x = 0 gives x = 150.
Step 5. Test. A''(x) = -4 < 0, so the graph is concave down and x = 150 is a maximum. The endpoints give A(0) = A(300) = 0, confirming it.
Answer: the sides perpendicular to the river are 150 feet and the side along the river is 600 - 300 = 300 feet, for a maximum area of 45{,}000 square feet.
Notice the answer is not a square. Because the river saves one side of fencing, it pays to make the parallel side twice as long.
Worked example 3: the can that uses the least metal
A closed cylindrical can must hold 1000 cubic centimeters. What radius and height minimize its surface area?
Step 1. Draw and name. Radius r, height h, both in centimeters.
Step 2. Objective. The surface is two circular ends plus the side:
Step 3. Constraint. Volume is fixed: \pi r^2 h = 1000, so h = \dfrac{1000}{\pi r^2}. Substitute:
Step 4. Critical points.
Step 5. Test. The domain r > 0 has no endpoints, so use the second derivative: S''(r) = 4\pi + \dfrac{4000}{r^3} > 0 for every r > 0. The curve is concave up everywhere, so this critical point is the absolute minimum.
For the height, use \pi r^3 = 500: h = \dfrac{1000}{\pi r^2} = \dfrac{1000\,r}{\pi r^3} = \dfrac{1000\,r}{500} = 2r \approx 10.84.
Answer: r \approx 5.42 cm and h \approx 10.84 cm, about 554 square centimeters of metal. The best can is exactly as tall as it is wide.
Why checking endpoints matters
The derivative only finds turning points. If the domain is a closed interval, the best value can sit at an edge where the derivative is not zero at all.
Find the maximum and minimum of f(x) = x^3 - 3x on [0, 3].
- f'(x) = 3x^2 - 3 = 0 gives x = \pm 1. Only x = 1 is in the interval.
- Evaluate all candidates: f(0) = 0, f(1) = -2, f(3) = 27 - 9 = 18.
The minimum is -2 at x = 1, but the maximum is 18 at the endpoint x = 3. Setting the derivative to zero alone would have missed it completely. This comparison of critical points and endpoints is called the closed interval method.
Tip: if the domain is open (like r > 0 for the can), there are no endpoints to check. Use the second derivative test, or show the function decreases then increases, to prove the critical point is the absolute best. See curve sketching with derivatives for both tests.
Common mistakes in optimization problems
- Differentiating with two variables. You must use the constraint to eliminate one variable before differentiating.
- Skipping the domain. Without it you cannot check endpoints or throw out impossible answers like x = 6 in the box problem.
- Assuming the critical point is a max. It might be a min. Always test.
- Answering the wrong question. If the question asks for the maximum area, x = 150 is not the answer; 45{,}000 square feet is.
- Dropping units. An answer of "2" is incomplete. Write "2-inch squares."
- Algebra slips in the constraint. In the fence problem, writing 2x + 2y = 600 fences the river side too. Read the problem carefully.
Quick reference
| Problem | Objective | Constraint | One-variable function | Answer |
|---|---|---|---|---|
| Open box | V = x(12-2x)^2 | built in | V(x), 0 \le x \le 6 | x = 2, V = 128 |
| River fence | A = xy | 2x + y = 600 | A = 600x - 2x^2 | 150 \times 300 |
| Can | S = 2\pi r^2 + 2\pi rh | \pi r^2 h = 1000 | S = 2\pi r^2 + \frac{2000}{r} | h = 2r \approx 10.84 |
| Closed interval | f(x) | a \le x \le b | compare f at critical points and ends | largest and smallest values |
Get comfortable through practice
Optimization rewards repetition more than almost any other topic, because the hard part is the setup and setups follow a handful of patterns. The interactive lesson below walks you through each step with instant feedback, so you learn to spot the objective, the constraint and the domain quickly, before an exam clock is running.
Practice it now
Optimization
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson