Matheno - Learn Well and Excel


How to Solve Optimization Problems in Calculus

Need to solve Optimization problems in Calculus? Let’s break ’em down and develop a strategy that you can use to solve them routinely for yourself.


Optimization problems will always ask you to maximize or minimize some quantity, having described the situation using words (instead of immediately giving you a function to max/minimize). Typical phrases that indicate an Optimization problem include:

  • Find the largest ….
  • Find the minimum….
  • What dimensions will give the greatest…?
Each of these phrases should start you thinking, “I’m looking for a maximum (or minimum) value.”

Most students don’t realize that you need to complete two distinct Stages.
Before you can look for that max/min value, you first have to develop the function that you’re going to optimize. There are thus two distinct Stages to completely solve these problems—something most students don’t initially realize [Ref].

The first stage doesn’t involve Calculus at all, while by contrast the second stage is just a max/min problem that you recently learned how to solve:

Stage I. Develop the function. You must first convert the problem’s description of the situation into a function — crucially, a function that depends on only one single variable.

Stage II. Maximize or minimize that function. Now maximize or minimize the function you just developed. You’ll use your usual Calculus tools to find the critical points, determine whether each is a maximum or minimum, and so forth.

We’ll break these two big Stages into smaller steps below. To illustrate those steps, let’s together solve this classic Optimization example problem:

Example problem: Least-Expensive Closed-Top Can
solve optimation problem of can with lid
A cylindrical can, with a top lid, must contain V cm$^3$ of liquid. (A typical can of soda, for example, has V = 355 cm$^3$.) What dimensions (height and radius) will minimize the cost of metal needed to construct the can?

Stage I. Develop the function

Step 1.
In Optimization problems, always begin by sketching the situation. Always. If nothing else, this step means you’re not staring at a blank piece of paper; instead you’ve started to craft your solution.
solve optimization problem - sketch of can with radius and height labeled
The problem asks us to minimize the cost of the metal used to construct the can, so we’ve shown each piece of metal separately: the can’s circular top, cylindrical side, and circular bottom. We’ve labeled the can’s height h and its radius r. We’re looking for the values of h and r (in terms of V) that will minimize the cost of constructing the can.

Step 2.

Most frequently you’ll use your geometry knowledge.
Having drawn the picture, the next step is to write an equation for the quantity we want to optimize. Most frequently you’ll use your everyday knowledge of geometry for this step. In this problem, for instance, we want to minimize the cost of constructing the can, which means we want to use as little metal as possible. Hence we want to minimize the can’s surface area. So let’s write an equation for that total surface area:

A_\text{total} &= A_\text{top} + A_\text{cylinder} + A_\text{bottom} \\[8px] &= \pi r^2 + 2\pi r h + \pi r^2 \\[8px] &= 2\pi r^2 + 2 \pi r h

That’s it; you’re done with Step 2! You’ve written an equation for the quantity you want to minimize $(A_\text{total})$ in terms of the relevant quantities (r and h).

Step 3.
Here’s a key thing to know about how to solve Optimization problems: you’ll almost always have to use detailed information given in the problem to rewrite the equation you developed in Step 2 to be in terms of one single variable.

Above, for instance, our equation for $A_\text{total}$ has two variables, r and h. We must eliminate one of them in order to proceed. The choice of which to keep and which to eliminate is arbitrary; for our solution here, we choose to keep r. (We could just as easily choose h, and develop our solution along that path instead. We’d arrive at the same final result.) Since we’re choosing to work with r, we need to use other detailed information given in the problem to write h in terms of r so we can substitute for h as a variable.

Begin subproblem.

To accomplish this substitution, we look back to see what other constraints/information the problem gave us: recall that the can must hold an amount V of liquid, where V is some number. (V might be 355 cm$^3$, for instance.) Now a cylinder of radius r and height h has a volume of $V = \pi r^2 h,$ and so we can solve for h in terms of V and constants:
$$V = \pi r^2 h$$
$$h = \dfrac{V}{\pi r^2} $$
That’s our expression for h in terms of r (and the constants V and $\pi).$
End subproblem.

We can now make this substitution $h = \dfrac{V}{\pi r^2}$ into the equation we developed earlier for the can’s total area:
\[ \begin{align*}
A_\text{total} &= 2\pi r^2 + 2 \pi r h \\[8px] &= 2\pi r^2 + 2 \pi r \left( \frac{V}{\pi r^2}\right) \\[8px] &= 2\pi r^2 + 2 \cancel{\pi} \cancel{r} \left(\frac{V}{\cancel{\pi} r\cancel{^2}}\right) \\[8px] &= 2\pi r^2 + \frac{2V}{r}
\end{align*} \]

We’re done with Step 3: we now have the function in terms of a single variable, r:
$$A(r) = 2\pi r^2 + \frac{2V}{r}$$
We’re now writing $A(r)$ to emphasize that A is a function of only the single variable r, and we’ve dropped the subscript “total” from $A_\text{total}$ since we no longer need it.

This also concludes Stage I of our work: in these threes steps, we’ve developed the function we’re now going to minimize!

Notice, by the way, that so far in our solution we haven’t used any Calculus at all. That will always be the case when you solve an Optimization problem: you don’t use Calculus until you come to Stage II.

Buy us a coffee We're working to add more,
and would appreciate your help
to keep going! 😊

Stage II: Maximize or minimize your function

Many students don’t realize that an Optimization problem is really a max/min problem.
Many students don’t realize that an Optimization problem is really a max/min problem; it’s just one where you first have to develop the function you’re going to maximize or minimize, as we did in Stage I above. Having done that, the remaining steps are exactly the same as they are for the max/min problems you recently learned how to solve.

For instance, a few weeks ago you could have gotten this as a standard max/min homework problem:

Graph of surface area of can with top lid, versus radius
“The surface area of a can is given by $A(r) = 2\pi r^2 + \dfrac{710}{r}\,.$ Find the value of r that minimizes that area.”

You would probably automatically find the derivative $A'(r)$ (which you could equivalently write as $\dfrac{dA}{dr})$, then find the critical points, then determine whether each represents a maximum or a minimum for the function, and so forth. That’s exactly what we’re now going to do in Stage II. Hence, you already know how to do all of the following steps; the only new part to maximization problems is what we did in Stage I above.

Step 4.
We want to minimize the function
$$ A(r) = 2\pi r^2 + \frac{2V}{r}$$
and so of course we must take the derivative, and then find the critical points.

Let’s thus first find the derivative. (Time to use Calculus!) Remember that V is just a constant — it’s some number, like 355.
\[ \begin{align*}
A'(r) &= \dfrac{d}{dr}\left(2\pi r^2 + \frac{2V}{r} \right) \\[8px] &= \dfrac{d}{dr}\left(2\pi r^2 \right) + \dfrac{d}{dr}\left(\frac{2V}{r} \right) \\[8px] &= 2\pi \dfrac{d}{dr}\left(r^2 \right) + 2V \dfrac{d}{dr}\left(r^{-1} \right) \\[8px] &= 2\pi(2r) + 2V \left((-1)r^{-2} \right)\\[8px] &= 4 \pi r\, – \frac{2V}{r^2}
\end{align*} \]

The critical points occur when $A'(r) = 0$:
\[ \begin{align*}
A'(r) = 0 &= 4 \pi r\, – \frac{2V}{r^2} \\[8px] \frac{2V}{r^2} &= 4 \pi r \\[8px] \frac{2V}{4 \pi} &= r^3 \\[8px] r^3 &= \frac{V}{2\pi} \\[8px] r &= \sqrt[3]{\frac{V}{2\pi}}
\end{align*} \] We thus have only one critical point to examine, at $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$

Step 5.
Next we must justify that the critical point we’ve found represents a minimum for the can’s surface area (as opposed to a maximum, or a saddle point). We could reason physically, or use the First Derivative Test, but we think it’s easiest in this case to use the Second Derivative Test. Let’s quickly compute the second derivative, starting with the first derivative that we found above:

\[ \begin{align*}
A'(r) &= 4\pi r\, – 2V r^{-2} \\[8px] A’^\prime(r) &= 4\pi \dfrac{d}{dr}(r) -2V \dfrac{d}{dr}\left(r^{-2} \right) \\[8px] &= 4\pi -2V \left((-2)r^{-3} \right) \\[8px] &= 4\pi + \frac{4V}{r^3}
\end{align*} \]

Since $r > 0$, this second derivative $\left(A’^\prime(r) = 4\pi + \dfrac{4V}{r^3}\right)$ is always positive $\left(A’^\prime(r) > 0 \right)$. That is, the graph of A(r) versus r is always concave up. Hence this single critical point gives us a minimum (as opposed to a maximum or saddlepoint), which is what we’re after:

Can's surface area versus radius, with minimum marked

The minimum surface area occurs when $r = \sqrt[3]{\dfrac{V}{2\pi}}\,. \quad \triangleleft$

Step 6.
Now that we’ve found the critical point that corresponds to the can’s minimum surface area (thereby minimizing the cost), let’s finish answering the question: The problem asked us to find the dimensions — the radius and height — of the least-expensive can. We’ve already found the relevant radius, $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$

To find the corresponding height, recall that in the Subproblem above we found that since the can must hold a volume V of liquid, its height is related to its radius according to
$$h = \dfrac{V}{\pi r^2}\,. $$
Hence when $r = \sqrt[3]{\dfrac{V}{2\pi}}\,,$
\[ \begin{align*}
h &= \frac{V}{\pi}\,\frac{1}{r^2} \\[8px] &= \frac{V}{\pi}\,\frac{1}{\left( \sqrt[3]{\frac{V}{2\pi}}\right)^2} \\[8px] &= \frac{V}{\pi}\,\frac{2^{2/3}\pi^{2/3}}{V^{2/3}} \\[8px] &= 2^{2/3}\frac{V^{1/3}}{\pi^{1/3}} \\[8px] h &= 2^{2/3}\sqrt[3]{\frac{V}{\pi}} \quad \triangleleft
\end{align*} \] The preceding expression for h is correct, but we can gain a nice insight by noticing that
$$2^{2/3} = 2 \cdot\frac{1}{2^{1/3}}$$
and so
\[ \begin{align*}
h &= 2^{2/3}\sqrt[3]{\frac{V}{\pi}} \\[8px] &= 2 \cdot\frac{1}{2^{1/3}}\,\sqrt[3]{\frac{V}{\pi}} \\[8px] &= 2 \sqrt[3]{\frac{V}{2\pi}} = 2r
\end{align*} \] since recall that the ideal radius is $r = \sqrt[3]{\dfrac{V}{2\pi}}\,.$ Hence the ideal height h is exactly twice the ideal radius.

To summarize, we conclude that the optimum dimensions for a closed-topped can that must contain a volume V of liquid are
\[ \begin{align*}
\text{radius } r &= \sqrt[3]{\dfrac{V}{2\pi}} \quad \cmark \\[8px] \text{height } h &= 2\sqrt[3]{\dfrac{V}{2\pi}} \quad \cmark
\end{align*} \]

Step 7. One last check

You’ll lose points if you don’t answer the question that was asked.
Because Optimization solutions can be long, we recommend that before finishing you go back and check what quantity/quantities the problem requested, and make sure you’ve provided thatespecially on an exam, where you’ll lose points if you don’t answer the exact question that was asked. For example, the problem could have asked to find the value of the smallest possible surface area A, or the minimum cost.

Instead, in this case, the problem stated, “What dimensions (height and radius) will minimize the cost of metal to construct the can?” We have provided those two dimensions, and so we are done. $\checkmark$

Buy us a coffee If we've helped, please consider
giving a little something back.
Thank you! 😊

Summary: Problem Solving Strategy

We’ve now illustrated the steps we use to solve every single Optimization problem we encounter, and they always work.

The strategy consists of two Big Stages. The first does not involve Calculus at all; the second is identical to what you did for max/min problems.

Stage I: Develop the function.

Your first job is to develop a function that represents the quantity you want to optimize. It can depend on only one variable. The steps:

  1. Draw a picture of the physical situation.
    Also note any physical restrictions determined by the physical situation.
  2. Write an equation that relates the quantity you want to optimize in terms of the relevant variables.
  3. If necessary, use other given information to rewrite your equation in terms of a single variable.

Stage II: Maximize or minimize the function.

You now have a standard max/min problem to solve.

  1. Take the derivative of your equation with respect to your single variable. Then find the critical points.
  2. Determine the maxima and minima as necessary.
    Remember to check the endpoints if there are any.
  3. Justify your maxima or minima either by reasoning about the physical situation, or with the first derivative test, or with the second derivative test.
  4. Finally, check to make sure you have answered the question as asked: Re-read the problem and verify that you are providing the value(s) requested: an x or y value; or coordinates; or a maximum area; or a shortest time; whatever was asked.
Want to see how we solve other example problems?
Want to see how we use this strategy to solve other example problems? Head on over to our Optimization page for more examples with free, complete solutions.

For now, over to you:

  • What tips do you have to share about how to solve Optimization problems?
  • What questions do you have? Optimization problems can be tricky to start, and we’re happy to help!
  • How can we make posts such as this one more useful to you?

Please head to our Forum and post!

[Thanks to S. Campbell for his specific research into students’ learning of Optimization:

“College Student Difficulties with Applied Optimization Problems in Introductory Calculus,” unpublished masters thesis, The University of Maine, 2013.]

We'd appreciate your feedback! 😊
How helpful?

These days we use our Forum for comments and discussion of this topic, and for any math questions. We'd love to see you there and help! Please tap to visit our Forum:

Archive of comments from before we started our forum:

What are your thoughts or questions?

I'd like to be
oldest most voted
Inline Feedbacks
View all comments
7 months ago

What a phenomenal explanation, you just saved my ap calculus grade haha

Reply to  Anonymous
7 months ago

We’re happy to have helped. Good luck with your exam! : )

2 years ago

Man, if only everyone was a thorough in their explanations as this one is

Reply to  Anonymous
2 years ago

Thank you for the compliment. We are very happy to have helped! : )

Chris M
3 years ago

Nice explanation and methodical approach. Setting up the problem is 99% of the problem. I’m still trying to figure out on other optimization solutions what yo do if the 2nd derivative is simply a constant. If f ‘(x) has a desired min or max, and f ‘’(x) differentiates to a constant, what does this mean to the max or min in the first derivative test? Does the sign of the constant alone in f ‘’(x) then determine concavity since there’s no potential inflection point? If that constant’s sign is negative (concave down) and the solution requires an optimization max, does that satisfy a proof? And vice versa if concavity is positive (concave up) confirm a minimum in the first derivative test?

Reply to  Chris M
3 years ago

Thanks, Chris. We’re glad to know you liked our explanation and approach. And agreed about getting the problem set-up right as the vast majority of the work here.

The answer to all of your questions is: yes! If the second derivative is a negative constant, then the function is concave down everywhere, and so you’re guaranteed that the point x=c you found where f'(c) = 0 is a maximum. (See the figure below.) Similarly, if the second derivative is a positive constant, then the function is concave up everywhere, and so the point x=c where f'(c) = 0 is guaranteed to be a minimum. And the fact that there’s no point of inflection anywhere doesn’t affect those conclusions.

The only thing that you wrote that isn’t quite right are the very last words, “in the first derivative test”; instead, you’re using the Second Derivative Test. That test is just as conclusive as the First Derivative Test, and is often easier to use. The one exception is if the second derivative is zero at the point of interest (f”(c)=0), in which case the Second Derivative Test is inconclusive and you have to revert to the First Derivative Test. But otherwise, the conclusion you reach with the Second Derivative test is indeed conclusive.

Hope that helps, and thanks for asking!

4 years ago

what problems can help to solve optimization

Reply to  Anonymous
4 years ago

Thanks for asking! We have more completely solved optimization problems on this page: Optimization: Problems and Solutions.

We hope that helps!

4 years ago

very nicely organized! however i think it would have been more effective with some numbers, instead of variables. it can get hard to follow, especially when there’s multiple(in this case). but it was still lovely and easy to follow

Reply to  Anonymous
4 years ago

Thank you for your nice comment, and for your suggestion. We’ll keep it in mind for future posts. For now: thanks very much!

This site is free?!?

We don't charge for anything on this site, we don't run ads, and we will never sell your personal information.

We're passionate educators with a goal:

Provide high-quality, interactive materials to dedicated learners everywhere in the world, regardless of ability to pay,
so they (you!) can learn well and excel.

We're working to develop more.
If you'd like to give back and help support our efforts, all we ask is that you perhaps

Buy us a coffee We're working to add more,
and would appreciate your help
to keep going! 😊