How to Solve an Optimization Problem With Discrete and Continuous Variables
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.
Overview
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
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.
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:
\begin{align*}
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
\end{align*}
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$$
thus
$$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.
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:
"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:
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 that — especially 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$
Summary: Problem Solving Strategy
We've now illustrated the steps we use to solve every single Optimization problem we encounter, and they always work.
PROBLEM SOLVING STRATEGY: Optimization
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:
- Draw a picture of the physical situation.
Also note any physical restrictions determined by the physical situation. - Write an equation that relates the quantity you want to optimize in terms of the relevant variables.
- 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.
- Take the derivative of your equation with respect to your single variable. Then find the critical points.
- Determine the maxima and minima as necessary.
Remember to check the endpoints if there are any. - Justify your maxima or minima either by reasoning about the physical situation, or with the first derivative test, or with the second derivative test.
- 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.]
Source: https://www.matheno.com/blog/how-to-solve-optimization-problems-in-calculus/
0 Response to "How to Solve an Optimization Problem With Discrete and Continuous Variables"
Post a Comment