Optimization problems
To optimize means to find the best value: the largest area, the smallest cost, the shortest distance. In this section, we use maximum and minimum values to solve problems like these.
The calculus is usually the easy part. The hard part is turning the words into a function. The steps below help.
How to solve an optimization problem
- Understand the problem. What quantity should be largest or smallest? What is given?
- Draw a picture, and give letters to the quantities that can change.
- Write a formula for the quantity to optimize.
- Use one variable. If the formula has two variables, use the other facts in the problem (the constraint) to replace one of them.
- Find the domain: the values of the variable that make sense in the problem.
- Find the absolute maximum or minimum. On a closed interval, use the closed interval method. Otherwise, use the first derivative test.
- Answer the question, with units.
For step 6 on an open interval, this fact helps. If $f$ has only one critical number $c$, and $f'$ changes from $-$ to $+$ there, then $f(c)$ is the absolute minimum. (If $f'$ changes from $+$ to $-$, it is the absolute maximum.) The graph goes down all the way to $c$ and up all the way after it.
Example 1: A farmer has $2400$ ft of fencing. The farmer wants to fence a rectangular field next to a straight river. The side along the river needs no fence. What size gives the largest area?
Solution:
Let $x$ be the length of each side that touches the river, and $y$ the length of the side opposite the river.
Formula: The area is $A=xy$.
Constraint: The fence covers three sides:
$2x+y=2400$, so $y=2400-2x$.
One variable:
$\begin{align*}&A(x)\\&=x(2400-2x)\\&=2400x-2x^2\end{align*}$
Domain: Both lengths must be at least $0$. So
$0\le x\le 1200$.
Maximize: $A'(x)=2400-4x$. It is $0$ at $x=600$.
- $A(0)=0$
- $A(600)=600\cdot 1200=720{,}000$
- $A(1200)=0$
Answer: The sides touching the river should be $600$ ft long, and the side opposite the river $1200$ ft long. The largest area is $720{,}000$ ft$^2$.
Example 2: An open box is made from a square sheet of cardboard, $12$ inches on each side. Equal squares are cut from the corners, and the sides are folded up. What size of square gives the largest volume?
Solution:
Let $x$ be the side of each cut square, in inches. Then the box is $x$ tall, and its base is a square with side $12-2x$.
Formula:
$V(x)=x(12-2x)^2$
Domain: $0\le x\le 6$. (At $x=6$, nothing is left of the base.)
Maximize: First, by the chain rule, the derivative of $(12-2x)^2$ is
$2(12-2x)(-2)=-4(12-2x)$.
Now use the product rule, and factor out $(12-2x)$:
$\begin{align*}&V'(x)\\&=(12-2x)^2-4x(12-2x)\\&=(12-2x)\big[(12-2x)-4x\big]\\&=(12-2x)(12-6x)\end{align*}$
So $V'(x)=0$ at $x=6$ or $x=2$.
- $V(0)=0$
- $V(2)=2\cdot 8^2=128$
- $V(6)=0$
Answer: Cut $2$-inch squares from the corners. The box is $8$ in by $8$ in by $2$ in, and its volume is $128$ in$^3$.
Example 3: A can in the shape of a cylinder must hold $1000$ cm$^3$ (one liter). What radius and height use the least metal?
Solution:
Let $r$ be the radius and $h$ the height, in centimeters. The metal is the surface area: the top, the bottom, and the side.
Formula:
$A=2\pi r^2+2\pi rh$
(The top and bottom are circles of area $\pi r^2$. The side unrolls into a rectangle, $2\pi r$ wide and $h$ tall.)
Constraint: The volume is $1000$:
$\pi r^2h=1000$, so $h=\dfrac{1000}{\pi r^2}$.
One variable:
$\begin{align*}&A(r)\\&=2\pi r^2+2\pi r\cdot\dfrac{1000}{\pi r^2}\\&=2\pi r^2+\dfrac{2000}{r}\end{align*}$
Domain: $r>0$. This is an open interval, so use the first derivative test.
Minimize:
$A'(r)=4\pi r-\dfrac{2000}{r^2}$
Set it equal to $0$:
$\begin{align*}4\pi r&=\dfrac{2000}{r^2}\\r^3&=\dfrac{500}{\pi}\\r&=\sqrt[3]{\dfrac{500}{\pi}}\approx 5.42\end{align*}$
For smaller $r$, $A'(r)<0$. For larger $r$, $A'(r)>0$. So this is the absolute minimum.
The height:
$h=\dfrac{1000}{\pi r^2}\approx 10.84$
Answer: The radius should be about $5.42$ cm and the height about $10.84$ cm.
Notice that $h=2r$: the best can is exactly as tall as it is wide. (Real cans are often taller, for other reasons, such as how easy they are to hold.)
Example 4: Find the points on the parabola $y=x^2$ that are closest to the point $(0,2)$.
Solution:
The distance from a point $(x,y)$ on the parabola to $(0,2)$ is
$d=\sqrt{x^2+(y-2)^2}$.
A square root gets smaller exactly when the number inside it gets smaller. So it is easier to minimize the square of the distance:
$D=d^2=x^2+(y-2)^2$
One variable: On the parabola, $x^2=y$. So
$\begin{align*}&D(y)\\&=y+(y-2)^2\\&=y^2-3y+4\end{align*}$
Domain: $y\ge 0$, because $y=x^2$.
Minimize: $D'(y)=2y-3$. It is $0$ when
$y=\dfrac{3}{2}$.
- For $y<\tfrac{3}{2}$: $D'(y)<0$.
- For $y>\tfrac{3}{2}$: $D'(y)>0$.
So this is the absolute minimum.
Then $x^2=\dfrac{3}{2}$, so $x=\pm\sqrt{\dfrac{3}{2}}\approx\pm 1.22$.
Answer: The closest points are
$\left(\pm\sqrt{\tfrac{3}{2}},\ \tfrac{3}{2}\right)\approx(\pm 1.22,\ 1.5)$.
The smallest distance is
$d=\sqrt{\tfrac{3}{2}+\tfrac{1}{4}}=\dfrac{\sqrt{7}}{2}\approx 1.32$.
Summary
- Write a formula for the quantity to optimize.
- Use the constraint to write it with one variable.
- Find the domain that makes sense.
- On a closed interval, compare critical numbers and endpoints. On an open interval, use the first derivative test.
- Answer the question that was asked, with units.