Blog · Calculus guides · 6 November 2026 · 5 min read
By the Asymptote team. Every answer on this page is checked by the same machine that grades the game.
Optimization Problems: 3 Examples & Practice Problems

An optimization problem asks for the largest or smallest value of a quantity, such as an area, a volume or a distance, under a constraint. Write the quantity as a function of one variable, solve to find the critical points, then compare the function's value there and at the ends of the allowed interval. The biggest value is the maximum and the smallest is the minimum.
The formula
The closed interval method. It is less a formula than a shopping list, but once the function is on the page it is the whole job.
When to use it
Use it whenever a word problem says maximize, minimize, largest, smallest, cheapest or closest, and something is holding you back: a fixed length of fence, a can that must hold a fixed volume, a point that has to stay on a curve. Without a constraint there is usually nothing to optimize (make the field infinitely big, done). The calculus is often the easy part. The real work is turning a paragraph into one function of one variable, which is why the steps below spend more time on setup than on derivatives.
How to do it, step by step
- Draw it and name things. Sketch the situation, label every length that can change, and write down the quantity you want to make big or small (the objective).
- Write the constraint as an equation. The fence is 400 m long, the volume is fixed, the point lies on . This is the equation that links your variables.
- Get the objective down to one variable. Solve the constraint for one variable and substitute it in, so you have and nothing else. Write down the interval of values that make physical sense.
- Differentiate and solve . These critical points are the candidates. Throw out any outside the interval.
- Check the candidates and the ends. Evaluate at each critical point and at the endpoints (or use the second derivative test), then answer the question that was actually asked, with units.
Worked examples
Example 1: A field along a river
EasyA farmer has 400 m of fencing and wants a rectangular field along a straight river, fencing only the three sides away from the water. What is the largest area she can enclose?
Let be the length of each side running away from the river. Those two sides use metres, so the side parallel to the river gets . Area is width times length:
Expand and differentiate: , so , which is zero at .
At the ends, and (a field with no width, or no length, which the farmer will not thank you for). At the area is .
Answer
Example 2: An open-top box
MediumAn open-top box is made from a 12 cm by 12 cm sheet by cutting a square of side from each corner and folding up the sides. What value of gives the largest volume, and what is that volume?
After the cuts, the base is on each side and the height is , so
Differentiate with the product rule and the chain rule, then pull out the common factor:
So at or . At there is no base left and , the same as at . At the base is 8 by 8 and the height is 2.
Answer
Example 3: The closest point on a parabola
HarderFind the point on (with ) closest to , and the shortest distance.
A point on the curve is , and its distance to is . Square roots are a nuisance to differentiate, and the distance is smallest exactly where its square is smallest, so minimize the square instead:
For the only zero is at , so . is negative just before it and positive just after, so it is a minimum. There , and
That is the squared distance. Take the square root at the very end, and only then.
Answer
Optimization practice problems
Three to try, easy to harder. Type an answer and it is checked instantly by the same checker that grades the game; any correct form counts. Stuck? The answer and the first step are under each one.
Problem 1
EasyA rectangle has a perimeter of 100 m, so with one side its area is the function below. What is the largest possible area, in square metres?
Stuck? Show the answer
Answer
How to start
Expand to , so . Find where that is zero, then check it beats the endpoints.
Problem 2
MediumAn open-top box is made from a 16 cm by 10 cm sheet by cutting a square of side from each corner. Its volume is below. What is the largest possible volume, in cubic centimetres?
Stuck? Show the answer
Answer
How to start
Multiply out to , then . Only one root is inside .
Problem 3
HarderAn open-top cylindrical can must hold cubic centimetres. With radius , its surface area is below. What is the smallest possible surface area?
Stuck? Show the answer
Answer
How to start
Differentiate: . Setting it to zero gives , so find and put it back into .
Want more? Asymptote has 392 more optimization problems, free, with no account.
Common mistakes
- Differentiating with two variables still in. If your function has both and in it, you are not ready. Use the constraint to get rid of one of them first.
- Forgetting the endpoints. A critical point is a candidate, not a winner. On a closed interval the biggest value can sit at an end, so check and too.
- Answering the wrong question. The box problem may ask for rather than the volume, and the closest-point problem for a coordinate rather than the distance. Reread the last sentence before you type.
- Keeping critical points that make no sense. A negative length, or a box with no base, solves but not the problem. The interval from step 3 is there to throw them out.
Practice it now
No clock, three strikes
Optimization lives in Diverge, from about difficulty 7: fences along rivers, open-top boxes, cans that must hold a fixed volume, and the closest point on . Answers are rounded to three decimal places, so keep the algebra exact and round at the end.
FAQ
- What are the steps to solve an optimization problem?
- Draw and label, write the objective and the constraint, reduce to one variable on an interval, solve , then compare the critical points with the endpoints.
- How do you know if it is a maximum or a minimum?
- Compare values: the largest on the interval is the maximum. Or use the second derivative, where at the critical point means a maximum and a minimum. There is more in local maximum and minimum.
- Do I have to check the endpoints?
- On a closed interval, yes. If the interval is open, or the function heads off to infinity at the ends, check the sign of on either side of the critical point instead.
- Why minimize the distance squared instead of the distance?
- Because is increasing, the distance and its square are smallest at the same . The square has no root to differentiate, so the algebra is shorter.
- Where can I find optimization practice problems?
- Right on this page: the practice problems section has three optimization problems, easy, medium and harder, with the answer and the first step under each one, and a box that checks what you type with the same checker that grades Asymptote. The game has 392 more optimization problems after that, free and with no account: try Diverge, which has no clock.
Keep going
Related Rates: 5 Steps, Ladder & Cone, Practice Problems
Related rates in 5 steps: name it, link it, differentiate with respect to t, then plug in. Balloon, ladder and cone examples and practice problems.
Linear Approximation: Formula, 3 Examples & Practice Problems
Linear approximation: f(x) ≈ f(a) + f'(a)(x − a), the tangent line. Estimating √4.1 and friends, over or under, 3 worked examples and practice problems.
Area Between Curves: Formula, 3 Examples & Practice Problems
The area between two curves is ∫(top − bottom) dx between where they meet. Curves that cross, 3 step-by-step examples and practice problems with answers.