# 4.2 Optimization

In Section 3.1 we learned about extreme values — the largest and smallest values a function attains on an interval. We motivated our interest in such values by discussing how it made sense to want to know the highest/lowest values of a stock, or the fastest/slowest an object was moving. In this section we apply the concepts of extreme values to solve “word problems,” i.e., problems stated in terms of situations that require us to create the appropriate mathematical framework in which to solve the problem.

We start with a classic example which is followed by a discussion of the topic of optimization.

###### Example 4.2.1 Optimization: perimeter and area

A man has 100 feet of fencing, a large yard, and a small dog. He wants to create a rectangular enclosure for his dog with the fencing that provides the maximal area. What dimensions provide the maximal area? margin: Figure 4.2.1: A sketch of the enclosure in Example 4.2.1. Λ

SolutionOne can likely guess the correct answer — that is great. We will proceed to show how calculus can provide this answer in a context that proves this answer is correct.

It helps to make a sketch of the situation. Our enclosure is sketched twice in Figure 4.2.1, either with green grass and nice fence boards or as a simple rectangle. Either way, drawing a rectangle forces us to realize that we need to know the dimensions of this rectangle so we can create an area function — after all, we are trying to maximize the area.

We let $x$ and $y$ denote the lengths of the sides of the rectangle. Clearly,

 $\text{Area}=xy.$

We do not yet know how to handle functions with 2 variables; we need to reduce this down to a single variable. We know more about the situation: the man has 100 feet of fencing. By knowing the perimeter of the rectangle must be 100, we can create another equation:

 $\text{Perimeter}=100=2x+2y.$

We now have 2 equations and 2 unknowns. In the latter equation, we solve for $y$:

 $y=50-x.$

Now substitute this expression for $y$ in the area equation:

 $\text{Area}=A(x)=x(50-x).$

Note we now have an equation of one variable; we can truly call the Area a function of $x$.

This function only makes sense when $0\leq x\leq 50$, otherwise we get negative values of area. So we find the extreme values of $A(x)$ on the interval $[0,50]$.

To find the critical points, we take the derivative of $A(x)$ and set it equal to 0, then solve for $x$.

 $\displaystyle A(x)$ $\displaystyle=x(50-x)$ $\displaystyle=50x-x^{2}$ $\displaystyle A^{\prime}(x)$ $\displaystyle=50-2x$

We solve $50-2x=0$ to find $x=25$; this is the only critical point. We evaluate $A(x)$ at the endpoints of our interval and at this critical point to find the extreme values; in this case, all we care about is the maximum.

Clearly $A(0)=0$ and $A(50)=0$, whereas $A(25)=625\text{ ft}^{2}$. This is the maximum. Since we earlier found $y=50-x$, we find that $y$ is also $25$. Thus the dimensions of the rectangular enclosure with perimeter of 100 ft. with maximum area is a square, with sides of length 25 ft.

This example is very simplistic and a bit contrived. (After all, most people create a design then buy fencing to meet their needs, and not buy fencing and plan later.) But it models well the necessary process: create equations that describe a situation, reduce an equation to a single variable, then find the needed extreme value.

“In real life,” problems are much more complex. The equations are often not reducible to a single variable (hence multi-variable calculus is needed) and the equations themselves may be difficult to form. Understanding the principles here will provide a good foundation for the mathematics you will likely encounter later.

We outline here the basic process of solving these optimization problems.

###### Key Idea 4.2.1 Solving Optimization Problems

1. (a)

Understand the problem. Clearly identify what quantity is to be maximized or minimized. Make a sketch if helpful.

2. (b)

Create equations relevant to the context of the problem, using the information given. (One of these should describe the quantity to be optimized. We’ll call this the fundamental equation.)

3. (c)

If the fundamental equation defines the quantity to be optimized as a function of more than one variable, reduce it to a single variable function using substitutions derived from the other equations.

4. (d)

Identify the domain of this function, keeping in mind the context of the problem.

5. (e)

Find the extreme values of this function on the determined domain.

6. (f)

Identify the values of all relevant quantities of the problem.

We will use Key Idea 4.2.1 in a variety of examples.

margin: Figure 4.2.2: A sketch of the enclosure in Example 4.2.2. Λ
###### Example 4.2.2 Optimization: perimeter and area

Here is another classic calculus problem: A woman has a 100 feet of fencing, a small dog, and a large yard that contains a stream (that is mostly straight). She wants to create a rectangular enclosure with maximal area that uses the stream as one side. (Apparently her dog won’t swim away.) What dimensions provide the maximal area?

SolutionWe will follow the steps outlined by Key Idea 4.2.1.

1. (a)

We are maximizing area. A sketch of the region will help; Figure 4.2.2 gives two sketches of the proposed enclosed area. A key feature of the sketches is to acknowledge that one side is not fenced.

2. (b)

We want to maximize the area; as in the example before,

 $\text{Area}=xy.$

This is our fundamental equation. This defines area as a function of two variables, so we need another equation to reduce it to one variable. We again appeal to the perimeter; here the perimeter is

 $\text{Perimeter}=100=x+2y.$

Note how this is different than in our previous example.

3. (c)

We now reduce the fundamental equation to a single variable. In the perimeter equation, solve for $y$: $y=50-x/2$. We can now write Area as

 $\text{Area}=A(x)=x(50-x/2)=50x-\frac{1}{2}x^{2}.$

Area is now defined as a function of one variable.

4. (d)

We want the area to be nonnegative. Since $A(x)=x(50-x/2)$, we want $x\geq 0$ and $50-x/2\geq 0$. The latter inequality implies that $x\leq 100$, so $0\leq x\leq 100$.

5. (e)

We now find the extreme values. At the endpoints, the minimum is found, giving an area of 0. Find the critical points. We have $A^{\prime}(x)=50-x$; setting this equal to 0 and solving for $x$ returns $x=50$. This gives an area of

 $A(50)=50(25)=1250.$
6. (f)

We earlier set $y=50-x/2$; thus $y=25$. Thus our rectangle will have two sides of length 25 and one side of length 50, with a total area of 1250 ft${}^{2}$.

Keep in mind as we do these problems that we are practicing a process; that is, we are learning to turn a situation into a system of equations. These equations allow us to write a certain quantity as a function of one variable, which we then optimize.

margin: Figure 4.2.3: Running a power line from the power station to an offshore facility with minimal cost in Example 4.2.3. Λ
###### Example 4.2.3 Optimization: minimizing cost

A power line needs to be run from a power station located on the beach to an offshore facility. Figure 4.2.3 shows the distances between the power station to the facility.

It costs $50/ft. to run a power line along the land, and$130/ft. to run a power line under water. How much of the power line should be run along the land to minimize the overall cost? What is the minimal cost?

SolutionWe will follow the strategy of Key Idea 4.2.1 implicitly, without specifically numbering steps.

There are two immediate solutions that we could consider, each of which we will reject through “common sense.” First, we could minimize the distance by directly connecting the two locations with a straight line. However, this requires that all the wire be laid underwater, the most costly option. Second, we could minimize the underwater length by running a wire all 5000 ft. along the beach, directly across from the offshore facility. This has the undesired effect of having the longest distance of all, probably ensuring a non-minimal cost.

The optimal solution likely has the line being run along the ground for a while, then underwater, as the figure implies. We need to label our unknown distances — the distance run along the ground and the distance run underwater. Recognizing that the underwater distance can be measured as the hypotenuse of a right triangle, we choose to label the distances as shown in Figure 4.2.4.

margin: Figure 4.2.4: Labeling unknown distances in Example 4.2.3. Λ

By choosing $x$ as we did, we make the expression under the square root simple. We now create the cost function.

 $\begin{array}[]{ c c c c c }\text{Cost}&=&\text{land cost}&+&\text{water cost}% \\ &=&\text{\50}\times\text{land distance}&+&\text{\130}\times\text{water % distance}\\ &=&50(5000-x)&+&130\sqrt{x^{2}+1000^{2}}.\\ \end{array}$

So we have $c(x)=50(5000-x)+130\sqrt{x^{2}+1000^{2}}$. This function only makes sense on the interval $[0,5000]$. While we are fairly certain the endpoints will not give a minimal cost, we still evaluate $c(x)$ at each to verify.

 $c(0)=380,000\quad\quad c(5000)\approx 662,873.$

We now find the critical points of $c(x)$. We compute $c\mkern 1.35mu ^{\prime}(x)$ as

 $c\mkern 1.35mu ^{\prime}(x)=-50+\frac{130x}{\sqrt{x^{2}+1000^{2}}}.$

Recognize that this is never undefined. Setting $c\mkern 1.35mu ^{\prime}(x)=0$ and solving for $x$, we have:

 $\displaystyle-50+\frac{130x}{\sqrt{x^{2}+1000^{2}}}$ $\displaystyle=0$ $\displaystyle\frac{130x}{\sqrt{x^{2}+1000^{2}}}$ $\displaystyle=50$ $\displaystyle\frac{130^{2}x^{2}}{x^{2}+1000^{2}}$ $\displaystyle=50^{2}$ $\displaystyle 130^{2}x^{2}$ $\displaystyle=50^{2}(x^{2}+1000^{2})$ $\displaystyle 130^{2}x^{2}-50^{2}x^{2}$ $\displaystyle=50^{2}\cdot 1000^{2}$ $\displaystyle(130^{2}-50^{2})x^{2}$ $\displaystyle=50,000^{2}$ $\displaystyle x^{2}$ $\displaystyle=\frac{50,000^{2}}{130^{2}-50^{2}}$ $\displaystyle x$ $\displaystyle=\frac{50,000}{\sqrt{130^{2}-50^{2}}}$ $\displaystyle x$ $\displaystyle=\frac{50,000}{120}=\frac{1250}{3}\approx 416.67.$

Evaluating $c(x)$ at $x=416.67$ gives a cost of about $370,000. The distance the power line is laid along land is $5000-416.67=4583.33$ ft., and the underwater distance is $\sqrt{416.67^{2}+1000^{2}}\approx 1083$ ft. margin: Figure 4.2.5: A sketch for Example 4.2.4. Λ ###### Example 4.2.4 Optimization: Minimizing Surface Area Design a closed cylindrical can of volume $8$ ft${}^{3}$ so that it uses the least amount of metal. In other words, minimize the surface area of the can. Following the strategy of Key Idea 4.2.1, we make a sketch in Figure 4.2.5 and identify the quantity to be minimized as the surface area of the cylinder. The formula for the surface area is our fundamental equation since it relates all of our relevant quantities.  $A=\underbrace{\pi r^{2}}_{\text{Top}}+\underbrace{\pi r^{2}}_{\text{Bottom}}+% \underbrace{2\pi rh}_{\text{Side}}=2\pi r^{2}+2\pi rh$ Our surface area is now defined in terms of two variables. To reduce this to a single variable we use the volume of a can, $V=\pi r^{2}h$. Since the can must have $V=8$ ft${}^{3}$, we set $\pi r^{2}h=8$. Thus $h=\dfrac{8}{\pi r^{2}}$ and  $A(r)=2\pi r^{2}+2\pi r\frac{8}{\pi r^{2}}=2\pi r^{2}+\frac{16}{r}$ Next we find the critical points of $A(r)$. We compute  $A^{\prime}(r)=4\pi r-\dfrac{16}{r^{2}}=\dfrac{4\pi r^{3}-16}{r^{2}}$ and find that $A^{\prime}(r)=0$ when $r^{3}=\dfrac{4}{\pi}$, that is, $r=\left(\dfrac{4}{\pi}\right)^{1/3}\approx 1.08$ ft. Looking back at $A(r)$, we notice that $r$ is not restricted to a closed interval. The radius can take on any positive value making the interval of optimization $(0,\infty)$. Since we do not have endpoints to test in $A(r)$ we consider what happens to $A(r)$ as $r$ approaches the endpoints of $(0,\infty)$. We see that  $\displaystyle A(r)$ $\displaystyle\to\infty\text{ as }r\to\infty$ (because of the $r^{2}$ term) and $\displaystyle A(r)$ $\displaystyle\to\infty\text{ as }r\to 0$ (because of the $\frac{16}{r}$ term) Thus, the surface area must be minimized at the critical point we found. Finally, we determine the height of the cylinder.  $h=\frac{8}{\pi r^{2}}=\frac{8}{\pi}r^{-2}=2\left(\frac{4}{\pi}\right)\left(% \frac{4}{\pi}\right)^{-2/3}=2\left(\frac{4}{\pi}\right)^{1/3}\approx 2.17\text% { ft.}$ Notice that the height is twice the length of the radius. This means that the surface area is minimized when the can is as tall as it is wide. In the exercises you will see a variety of situations that require you to combine problem-solving skills with calculus. Focus on the process; learn how to form equations from situations that can be manipulated into what you need. Eschew memorizing how to do “this kind of problem” as opposed to “that kind of problem.” Learning a process will benefit one far longer than memorizing a specific technique. The next section introduces another application of the derivative: differentials. Given $y=f(x)$, they offer a method of approximating the change in $y$ after $x$ changes by a small amount. ## Exercises 4.2 ### Terms and Concepts 1. 1. T/F: An “optimization problem” is essentially an “extreme values” problem in a “story problem” setting. 2. 2. T/F: This section teaches one to find the extreme values of a function that has more than one variable. ### Problems 1. 3. Find the maximum product of two numbers (not necessarily integers) that have a sum of 100. 2. 4. Find the minimum sum of two positive numbers whose product is 500. 3. 5. Find the maximum sum of two positive numbers whose product is 500. 4. 6. Find the maximum sum of two numbers, each of which is in $[0,300]$ whose product is 500. 5. 7. Find the maximal area of a right triangle with hypotenuse of length 1. 6. 8. A rancher has 1000 feet of fencing in which to construct adjacent, equally sized rectangular pens. What dimensions should these pens have to maximize the enclosed area? 7. 9. A standard soda can is roughly cylindrical and holds 355cm${}^{3}$ of liquid. What dimensions should the cylinder be to minimize the material needed to produce the can? Based on your dimensions, determine whether or not the standard can is produced to minimize the material costs. 8. 10. Find the dimensions of a cylindrical can with a volume of 206in${}^{3}$ that minimizes the surface area. The “#10 can”is a standard sized can used by the restaurant industry that holds about 206in${}^{3}$ with a diameter of 6 2/16in and height of 7in. Does it seem these dimensions were chosen with minimization in mind? 9. 11. The United States Postal Service charges more for boxes whose combined length and girth exceeds 108” (the “length” of a package is the length of its longest side; the girth is the perimeter of the cross section, i.e., $2w+2h$). What is the maximum volume of a package with a square cross section ($w=h$) that does not exceed the 108” standard? 10. 12. The strength $S$ of a wooden beam is directly proportional to its cross sectional width $w$ and the square of its height $h$; that is, $S=kwh^{2}$ for some constant $k$. Given a circular log with diameter of 12 inches, what sized beam can be cut from the log with maximum strength? 11. 13. A power line is to be run to an offshore facility in the manner described in Example 4.2.3. The offshore facility is 2 miles at sea and 5 miles along the shoreline from the power plant. It costs$50,000 per mile to lay a power line underground and $80,000 to run the line underwater. How much of the power line should be run underground to minimize the overall costs? 12. 14. A power line is to be run to an offshore facility in the manner described in Example 4.2.3. The offshore facility is 5 miles at sea and 2 miles along the shoreline from the power plant. It costs$50,000 per mile to lay a power line underground and \$80,000 to run the line underwater.

How much of the power line should be run underground to minimize the overall costs?

13. 15.

A woman throws a stick into a lake for her dog to fetch; the stick is 20 feet down the shore line and 15 feet into the water from there. The dog may jump directly into the water and swim, or run along the shore line to get closer to the stick before swimming. The dog runs about 22ft/s and swims about 1.5ft/s.

How far along the shore should the dog run to minimize the time it takes to get to the stick? (Hint: the figure from Example 4.2.3 can be useful.)

14. 16.

A woman throws a stick into a lake for her dog to fetch; the stick is 15 feet down the shore line and 30 feet into the water from there. The dog may jump directly into the water and swim, or run along the shore line to get closer to the stick before swimming. The dog runs about 22ft/s and swims about 1.5ft/s.

How far along the shore should the dog run to minimize the time it takes to get to the stick? (Google “calculus dog” to learn more about a dog’s ability to minimize times.)

15. 17.

What are the dimensions of the rectangle with largest area that can be drawn inside the unit circle?

16. 18.

Four squares are going to be cut from a larger square piece of paper of side length 10 inches. After the paper is folded into a topless box, what is the largest volume the box could have?

17. 19.

The material to make the sides of a box costs 2 ¢/in${}^{2}$. Making the bottom costs 4 ¢/in${}^{2}$, while the top costs 1 ¢/in${}^{2}$. What are the dimensions of the least expensive box with a square base and a volume of 10 in${}^{3}$?

18. 20.

A box needs to have a surface area of 12 in${}^{2}$ and be twice as long as it is wide. What is the largest volume the box can have? 