Kevin Gonzales, Eric Hopkins, Catherine Zimmitti, Cheryl Kane, Modified to fit Applied Calculus from Coordinated Calculus by Nathan Wakefield et. al., Based upon Active Calculus by Matthew Boelkins

Section4.4Applied Optimization

Motivating Questions

In a setting where a situation is described for which optimal parameters are sought (e.g. maximizing or minimizing a value), how do we develop a function that models the situation and then use calculus to find the desired maximum or minimum?

We have seen in sections Section4.1 and Section4.3 how we can find the maximum of a function by setting the derivative equal to zero and solving for critical values. In this section we will explore how we can apply this. In most of the cases presented in this section we will not be explicitly provided a function to optimize (i.e. to find the maximum of the function).

In this section the primary emphasis is on the reader solving problems. Initially, some substantial guidance is provided, but the problems progress to require greater independence as we move along.

SubsectionOptimization in Business

First, let us explore some key relationships between Profit, Revenue and Cost functions.

Profit, Revenue and Cost

Given a price-demand function \(p(x)\text{,}\) where \(p(x)\) is the price per unit when selling \(x\) units, the total revenue from the sale of \(x\) units is:

\begin{equation*}
R(x)=xp(x).
\end{equation*}

In words, the total revenue is the product of the number of items sold \((x)\) times the price per item \(p(x)\text{.}\)

Given \(C(x)\text{,}\) the total cost to produce \(x\) items, the total profit from the sale of \(x\) items is

\begin{equation*}
P(x)=R(x)-C(x).
\end{equation*}

In words, the total profit is the revenue minus the cost.

Example4.34

A company reports that the cost of producing \(x\) automobiles weekly is given by

Since the number of units \(x \) cannot be negative, then the domain of the profit function is \([0, \infty) \text{.}\) Since \(P(x) \) is a parabola which faces down, then there is only one critical point, which is the vertex of the parabola, and it is an absolute maximum. To find this critical point, we find the derivative of the profit function and set it equal to 0:

From our reasoning in the previous paragraph, this should be a maximum for the function \(P(x) \text{.}\) To confirm this, we can use the second derivative test. Since

then the second derivative test tells us that \(x=35\) is a relative maximum. Again, since \(P(x) \) is a parabola which is facing down, then this is an absolute maximum, and thus the maximum profit is

Since the number of units \(x \) cannot be negative, then the domain of the profit function is \([0, \infty) \text{.}\) Since \(P(x) \) is a parabola which faces down, then there is only one critical point, which is the vertex of the parabola, and it is an absolute maximum. To find this critical point, we find the derivative of the profit function and set it equal to 0:

From our reasoning in the previous paragraph, this should be a maximum for the function \(P(x) \text{.}\) To confirm this, we can use the second derivative test. Since

then the second derivative test tells us that \(x=100\) is a relative maximum. Again, since \(P(x) \) is a parabola which is facing down, then this is an absolute maximum, and thus the company must produce and sell \(100\) suits to maximize profit.

SubsectionConstrained Optimization

First outline a strategy for solving constrained optimization problems involving area or perimeter.

Draw a picture and introduce variables.

It is essential to first understand what quantities are allowed to vary in the problem and then to represent those values with variables. Drawing a picture with these variables labeled is a particularly helpful way to accomplish this; in some cases, drawing several pictures might be useful. A nice example of this can be seen at http://gvsu.edu/s/99, where the choice of where to bend a piece of wire into the shape of a rectangle determines both the rectangle's shape and area.

Identify the quantity to be optimized as well as any key relationships among the variable quantities.

Essentially this step involves writing equations that involve the variables that have been introduced: one equation will represent the quantity whose minimum or maximum is sought; there may be additional equations showing how multiple variables in the problem are interrelated.

Determine a function of a single variable that models the quantity to be optimized.

It may be necessary to eliminate one or more variables in the function formula using the secondary equations that were found in the previous step.

Decide the domain on which to consider the function being optimized.

Often the physical constraints of the problem will limit the possible values that the independent variable can take on. Thinking back to the picture that describes the overall situation and any relationships among variables in the problem often helps identify the smallest and largest values of the input variable.

Use calculus to identify the absolute maximum and/or minimum of the quantity being optimized.

This always involves finding the critical numbers of the function first. Then depending on the domain, we either construct a first derivative sign chart (for an open or unbounded interval) or evaluate the function at the endpoints and critical numbers (for a closed, bounded interval).

Finally, we make certain we have answered the question that was posed.

Does the question seek the absolute maximum of a quantity, or do we need the values of the variables that produce the maximum? In other words, finding the maximum volume of a parcel is different from finding the dimensions of the parcel that yield that volume.

The remaining examples involve a variety of quantities to be optimized. Each task presents an opportunity to practice the above steps, possibly with some adaptations to suit the context of the problem.

Example4.36

A lifeguard at a beach needs to rope off a rectangular swimming area using \(180\) feet of rope. If no rope is needed along to shore, what dimensions of the rectangle will maximize the area of the swimming area? What is the maximum area?

We now wish to find the absolute maximum of the function \(A \) on its domain. Recall that \(x \) represents the width of the swimming area. So, \(x \) must be nonnegative. Similarly, since \(y = 180-2x \) represents the length of the swimming area, then \(y \) must be nonnegative, so \(x \) must be less than or equal to 90. Therefore, the domain of \(A \) is \([0,90]\text{.}\) To find the absolute maximum of \(A \text{,}\) we first find the derivative and set it equal to zero:

This is the maximum. Note that we have only found the width, so we also need to find the length, which we find by plugging \(x = 45 \) into the equation for \(y \text{:}\)

\begin{equation*}
y=180-2(45)=90.
\end{equation*}

Thus the maximum area is \(A=45(90)=4050\) square feet, and the dimensions are width \(45\) feet and length \(90\) feet.

Example4.38

A storage area added to one side of an existing warehouse needs an area of \(12800\) square meters. What dimensions for the storage area will use the least amount of fencing?

Start by sketching a picture and labeling all the sides that change with a variable, shown below.

If we call the width \(x\) and the length \(y\) then we want to find the minimum perimeter

\begin{equation*}
P=2x+y.
\end{equation*}

Since we have two variables we need a second equation. Here we note that we wish to enclose a total area of \(12800\) square meters, thus the area equation is:

We now wish to find the absolute maximum on the domain of \(P \text{.}\) Since the width \(x \) must be positive, then the domain for \(P \) is \((0,\infty)\text{.}\) To find the maximum, we find the derivative and set it equal to zero:

(Note that here we really have two solutions for \(x \text{,}\) which are \(x = 80 \) and \(x = -80 \text{,}\) but only the first solution is within our domain.) Since

then this is the minimum. At this point, we have only found the width, so we also need to find the length, which we find by plugging \(x=80 \) into the equation for \(y \text{:}\)

Thus the dimensions that use the least amount of fencing are \(80\) meters by \(160\) meters.

Example4.40

An ecologist is conducting a research project on breeding pheasants in captivity. She wants an enclosed rectangular area with two fences across the width of the rectangular area so that there are 3 identical pens. Find the maximum area that can be enclosed with 3600 meters of fencing.

Start by sketching a picture and labeling all the sides that change with a variable, shown below.

If we call the width \(x\) and the length \(y\text{,}\) then we want to find the maximum area

\begin{equation*}
A=xy.
\end{equation*}

Since we have two variables, we need a second equation. Here we want to use the fact that we have \(3600 \) meters of fencing, so we determine an equation for total fencing:

We now wish to find the absolute maximum of \(A \) on the domain of \(A \text{.}\) Since the length and the width cannot be negative, then the domain of \(A \) is \([0, 900] \text{.}\) To find the absolute maximum on this interval, find the derivative and set it equal to zero to get the critical numbers:

the second derivative test tells us this is the maximum. Finally, to find the length of the enclosed area, plug \(x = 450 \) into the equation for \(y\text{:}\)

Thus the maximum area is \(A=450\cdot 900=405000\) square feet. The dimensions are width \(450\) feet and length \(900\) feet.

SubsectionMore Applied Optimization Problems

Example4.42

A 20 cm piece of wire is cut into two pieces. One piece is used to form a square and the other to form an equilateral triangle. How should the wire be cut to maximize the total area enclosed by the square and triangle? To minimize the area?

The area is maximized when the wire is uncut and all used for the square; the area is minimized when approximately \(11.3\) cm of wire are used for the triangle and approximately \(8.7\) cm are used for the square.

We begin by sketching a picture that illustrates the situation. The variable in the problem is where we decide to cut the wire, so we label the cut point at a distance \(x\) cm from one end of the wire and note that the remaining portion of the wire then has length \(20-x\) cm.

Figure4.43 below shows how the wire is used to form the two regular polygons. From the \(x\) cm segment of wire, we obtain an equilateral triangle with three sides of length \(\frac{x}{3}\text{;}\) the square shaped from the remaining \(20-x\) cm of wire will have four sides of length \(\frac{20-x}{4}\text{.}\)

At this point, we note that there are obvious restrictions on \(x\text{:}\) in particular, \(0 \le x \le 20\text{.}\) In the extreme cases, all of the wire is being used to make just one figure. For instance, if \(x = 0\) then all 20 cm of wire are used to make a square that is \(5 \times 5\text{.}\)

Now, our overall goal is to find the minimum and maximum areas that can be enclosed, so we need to find an equation for the area enclosed by the triangle and square combined. Because the height \(h\) of an equilateral triangle is \(\sqrt{3}\) times half the length of the base \(b\text{,}\) the area of the triangle is

The area of the square is \(A_{\Box} = \left( \frac{20-x}{4} \right)^2\text{.}\) Therefore, the total area function is the sum of the two areas, which is

When we set \(A'(x) = 0\text{,}\) we find that \(x = \frac{180}{4\sqrt{3}+9} \approx 11.3007\) is the only critical number of \(A\) in the interval \([0,20]\text{.}\)

Evaluating \(A\) at the critical number and endpoints, we see that

Thus, the absolute minimum occurs when \(x \approx 11.3007\) cm and results in the minimum area of approximately \(10.8741\) square centimeters. The absolute maximum occurs when we invest all of the wire in the square (and none in the triangle), resulting in 25 square centimeters of area. These results are confirmed by a plot of \(y = A(x)\) on the interval \([0,20]\text{,}\) as shown below in Figure4.44.

Example4.45

A piece of cardboard that is \(10 \times 15\) (each measured in inches) is being made into a box without a top. To do so, squares are cut from each corner of the box and the remaining sides are folded up. Assuming that the box needs to be at least 1 inch deep and no more than 3 inches deep, answer the following questions.

Draw a labeled diagram that shows the given information. What variable should we introduce to represent the choice we make in creating the box? Label the diagram appropriately with the variable and write a sentence to state what the variable represents.

Determine a formula for the function \(V\) that tells us the volume of the box and depends on the variable defined in (a).

What is the domain of the function \(V\text{?}\) That is, in the context of this problem, what values of \(x\) make sense for the input of \(V\text{?}\) Are there additional restrictions provided in the problem?

Determine all critical numbers of the function \(V\text{.}\)

Evaluate \(V\) at each of the endpoints of the domain and at any critical numbers that lie in the domain.

What is the maximum possible volume of the box? What is the minimum volume? Justify your answers using calculus.

From each corner of the cardboard, we will cut a square with side length \(x\) inches. The result is the following picture:

After cutting out the four \(x\times x\) squares from the corners of the cardboard and folding up the edges, the resulting box is \(x\) inches tall, \(10-2x\) inches wide, and \(15-2x\) inches long. Thus the volume of the box (in cubic inches) is given by

At first glance, we see that \(V\) is a polynomial and so is defined for every real number \(x\text{.}\) However, because \(x\) represents a length in this problem, the smallest \(x\) can be is \(0\text{.}\) Moreover, since the shortest side of the cardboard is initially only \(10\) inches and cutting the squares reduces each side by \(2x\) inches, the largest \(x\) can be is \(5\text{.}\) We note that both of these extremes would result in a box with zero volume, as the first would have no height and the second would have no width. Finally, the problem says the height needs to be between \(1\) and \(3\) inches, so we will further restrict the domain of \(V\) to \(1 \le x \le 3\text{.}\)

Since \(V'(x) = 12x^2 - 100x + 150\text{,}\) it follows that the critical numbers (where \(V'(x) = 0\)) are

\begin{equation*}
x = \frac{25 \pm 5\sqrt{7}}{6} \approx 6.371, 1.962\text{.}
\end{equation*}

Only the latter critical number is in the domain of \(V\text{,}\) so we consider

The maximum possible volume of the box is about \(132.038\) cubic inches, occurring when squares with side length around \(1.962\) inches are cut from each corner of the cardboard. The minimum possible volume of the box is \(104\) in\(^3\) and occurs with a box that is \(1\) inch tall.

Example4.46

According to U.S.postal regulations, the girth plus the length of a parcel sent by mail may not exceed 108 inches, where by girth we mean the perimeter of the smallest end. What is the largest possible volume of a rectangular parcel with a square end that can be sent by mail? What are the dimensions of such a package? The process of answering these questions has been broken up into a sequence of tasks:

Let \(x\) represent the length of one side of the square end and \(y\) the length of the longer side. Label these quantities appropriately on an image like the one shown in Figure4.47 below.

What is the quantity to be optimized in this problem? Find a formula for this quantity in terms of \(x\) and \(y\text{.}\)

The problem statement tells us that the parcel's girth plus length may not exceed 108 inches. In order to maximize volume, we assume that we will actually need the girth plus length to equal 108 inches. What equation does this produce involving \(x\) and \(y\text{?}\)

Solve the equation you found in (c) for one of \(x\) or \(y\) (whichever is easier).

Now use your work in (b) and (d) to determine a formula for the volume of the parcel so that this formula is a function of a single variable.

Over what domain should we consider this function? Note that both \(x\) and \(y\) must be positive; how does the constraint that girth plus length is 108 inches produce intervals of possible values for \(x\) and \(y\text{?}\)

Find the absolute maximum of the volume of the parcel on the domain you established in (f) and hence also determine the dimensions of the box of greatest volume. Justify that you've found the maximum using calculus.

Sketch a picture of a box with a square end; you'll want to add to it as the problem progresses. Note that the question's wording suggests the square end should be the smallest end. What does that tell you about which of \(x\) and \(y\) is bigger?

What are you trying to maximize or minimize?

Recall that the girth is the perimeter of the smallest end.

Pick a variable to isolate and use basic algebra to solve for it.

Substitute your answer to (d) into your formula from (b).

Each term in the sum has to be between \(0\) and \(108\text{.}\)

Find the critical numbers of the volume function and use the first or second derivative test to ascertain which is a maximum. Once you have an answer, don't forget to check that it actually works: the fact that the girth measures the smallest end of the box tells you which of \(x\) or \(y\) should be bigger (based on the formulas you used). Does that relationship hold with the dimensions you found? If not, you'll need to rework the problem.

Since the problem says \(y\) is the length of the longer side, we assume \(x\le y\) and that the square end is smallest. However, we recognize that this may not end up being the case, and if necessary are prepared to rework the problem with the square end as the largest side.

We are asked to maximize the volume of the box. Since the box has a square end with side length \(x\) inches and is \(y\) inches long, the volume formula is

\begin{equation*}
V=x^2y\text{,}
\end{equation*}

measured in cubic inches.

We are working under the assumption that the square end is the smallest end, which means the perimeter of the square face will be the girth and the other side will be the length. This yields the relation

We know that \(x\) and \(y\) must both be positive, so we have \(0\lt x,y\text{.}\) Additionally, from above, we also have the constraint that \(x\le y\text{.}\) Finally, since \(4x+y=108\) and \(x\le y\text{,}\) it must be the case that \(5x\le4x+y=108\text{,}\) so \(x\le 108/5=21.6\text{.}\) Likewise, since \(x\) is positive, we must have \(y\lt 108\text{.}\) In sum, we have the intervals:

\begin{equation*}
0\lt x\le21.6 \text{ and }x\le y\lt108\text{.}
\end{equation*}

We now need to maximize the function \(V(x)=108x^2-4x^3\) on the interval \((0,21.6]\text{.}\) We begin by differentiating \(V\text{,}\) finding

As \(V'(x)\) is a polynomial, it is defined everywhere; to find the critical numbers of \(V\text{,}\) then, we need only solve the equation \(V'(x)=0\text{.}\) Doing so yields the critical numbers \(x=0\) and \(x=18\text{.}\) On the interval \(0\lt x\le 21.6\text{,}\) the only critical number is \(18\text{.}\)

We can use the first derivative test to check that this is a maximum. Using the first derivative test, we have \(V'(x)\gt0\) for \(0\lt x\lt 18\) and \(V'(x)\lt0\) for \(18\lt x \le 21.6\text{.}\) Thus \(V(18)\) is a relative maximum and, on the interval \((0,21.6]\text{.}\) Also, V increases from \(x=0 \) up to \(x=18 \text{,}\) and then decreases from \(x=18 \) to \(x=21.6 \text{,}\) so this is an absolute maximum on the interval \((0, 21.6] \text{.}\)

So, we have firmly established that the maximum volume occurs when \(x=18\text{.}\) This coincides with the length \(y=108-4(18)=36\) and the volume \(V=(18)^2(36)=11,664\text{.}\) Therefore the maximum volume of a parcel with a square end (provided that end is the smallest end of the box^{6}It turns out that when we assume the square end is the larger end, we end up with the dimensions \(24\times24\times18\) and a volume of \(10,368\text{ in}^3\text{,}\) so our process did indeed find the maximum volume of a parcel with a square end.) subject to the dimension constraints of the USPS is \(11,664\) cubic inches. This volume is achieved when the package is \(18\) inches by \(18\) inches by \(36\) inches.

Example4.50

A soup can in the shape of a right circular cylinder is to be made from two materials. The material for the side of the can costs $0.015 per square inch and the material for the lids costs $\(0.027\) per square inch. Suppose that we desire to construct a can that has a volume of 16 cubic inches. What dimensions minimize the cost of the can?

Draw a picture of the can and label its dimensions with appropriate variables.

Use your variables to determine expressions for the volume, surface area, and cost of the can.

Determine the total cost function as a function of a single variable. What is the domain on which you should consider this function?

Find the absolute minimum cost and the dimensions that produce this value.

Note that both the radius and the height of the can are variable.

Remember that volume is the area of the base times the height, while surface area can be thought of in terms of the area of the two lids, plus the area of the side of the can.

Use the fact that \(V = 16\) to write one of the variables in terms of the other.

Differentiate the total cost function and find its critical number(s) first.

Let the can have radius \(r\) and height \(h\text{.}\)

The volume is \(V = \pi r^2 h\text{;}\) the surface area is \(S = 2 \pi r^2 + 2 \pi r h\text{;}\) the total cost is \(C = 2 \pi r^2 \cdot 0.027 + 2 \pi r h \cdot 0.015\text{.}\)

The cost as a single-variable function is \(C(r) = 0.054 \pi r^2 + 0.48 \frac{1}{r}\text{,}\) considered on the interval \(r \gt 0\text{.}\)

The minimizing radius is

\begin{equation*}
r = \sqrt[3]{ \frac{0.48}{0.108 \pi} } \approx 1.123
\end{equation*}

inches; the minimizing height is \(h \approx 4.041\) inches; the minimum cost is \(C(1.12259) \approx \$0.642\text{.}\)

We let \(r\) be the radius of the base of the cylindrical can and \(h\) be its height.

The volume of a cylinder is the area of the base times the height, so \(V = \pi r^2 h\text{.}\) Surface area is the area of the lids plus the area of the side; we can think of the side as a rectangle (if we were to cut it and unroll it) with height \(h\) and width \(2\pi r\text{,}\) the perimeter of the base. Hence the surface area of the can is

\begin{equation*}
S = 2 \pi r^2 + 2 \pi r h\text{.}
\end{equation*}

Finally, the total cost (in dollars) is the cost of the lids plus the cost of the sides, which is

\begin{equation*}
C = 2 \pi r^2 \cdot 0.027 + 2 \pi r h \cdot 0.015\text{.}
\end{equation*}

Because the volume is fixed at 16 cubic inches, we know that \(16 = \pi r^2 h\text{.}\) Choosing to solve for \(h\text{,}\) we find that \(h = \frac{16}{\pi r^2}\text{.}\) We can then substitute this expression into the total cost formula in place of \(h\text{,}\) yielding

Note that \(C'(r)\) is undefined at \(r=0\text{,}\) but this point is not in the domain of \(C\text{,}\)^{7}Here, we mean both that \(C(0)\) is undefined and that contextually we require \(r\gt0\) as discussed in (c). Because \(C(0)\) is undefined, \(0\) is not a true critical number of \(C\text{;}\) however, it is still a value at which the sign of \(C'\) can change, and we can only disregard it here because the contextual supposition that \(r\gt0\) stipulates that we need only find critical numbers on the interval \((0,\infty)\text{.}\) so we only need to consider critical numbers at which the derivative is zero. Hence we set \(C'(r) = 0\) and solve for \(r\text{,}\) finding that

\begin{equation*}
0.108 \pi r = \frac{0.48}{r^2}\text{,}
\end{equation*}

so that \(r^3 = \frac{0.48}{0.108 \pi} \approx 1.415\text{,}\) from which it follows that \(r = \sqrt[3]{ \frac{0.48}{0.108 \pi} } \approx 1.123\) is the only critical number of \(C\text{.}\) At this point we can use either the first or second derivative test to justify that \(C\) has an absolute minimum at \(r = \sqrt[3]{ \frac{0.48}{0.108 \pi} }\text{.}\) We choose to use the second derivative test; note that \(C''(r) = 0.108 \pi + 0.96 \frac{1}{r^3}\text{,}\) which is always positive for \(r \gt 0\text{.}\) Thus \(C\) is always concave up on the relevant domain (\(r \gt 0\)), and consequently \(r = \sqrt[3]{ \frac{0.48}{0.108 \pi} } \approx 1.123\) is where the absolute minimum of \(C\) occurs. In addition, we note that since \(h = \frac{16}{\pi r^2}\text{,}\) the corresponding \(h\) value is \(h \approx 4.041\text{,}\) and the overall minimum value is \(C\left(\sqrt[3]{ \frac{0.48}{0.108 \pi} }\right) \approx 0.641\text{.}\)

Thus a can with radius approximately \(1.123\) inches and height approximately \(4.041\) inches will be cheapest among all cans with a volume of \(16\) cubic inches. The cost of constructing a can with these dimensions is about \(\$0.641\text{,}\) or roughly \(64\) cents.

SubsectionSummary

Optimization problems come in all different shapes and sizes. While there is no single algorithm that works in every situation where optimization is used, the following steps are helpful in most of the problems we consider: draw a picture and introduce variables; identify the quantity to be optimized and find relationships among the variables; determine a function of a single variable that models the quantity to be optimized; decide the domain on which to consider the function being optimized; use calculus to identify the absolute maximum and/or minimum of the quantity being optimized; check that the question that was asked has indeed been answered.

A rectangular box with a square bottom and closed top is to be made from two materials. The material for the side costs $1.50 per square foot and the material for the top and bottom costs $3.00 per square foot. If you are willing to spend $15 on the box, what is the largest volume it can contain? Justify your answer completely using calculus.

A farmer wants to start raising cows, horses, goats, and sheep, and desires to have a rectangular pasture for the animals to graze in. However, no two different kinds of animals can graze together. In order to minimize the amount of fencing she will need, she has decided to enclose a large rectangular area and then divide it into four equally sized pens by adding three segments of fence inside the large rectangle that are parallel to two existing sides. She has decided to purchase 7500 ft of fencing. What is the maximum possible area that each of the four pens will enclose?

Two vertical poles of heights 60 ft and 80 ft stand on level ground, with their bases 100 ft apart. A cable that is stretched from the top of one pole to some point on the ground between the poles, and then to the top of the other pole. What is the minimum possible length of cable required? Justify your answer completely using calculus.

A company is designing propane tanks that are cylindrical with hemispherical ends. Assume that the company wants tanks that will hold 1000 cubic feet of gas, and that the ends are more expensive to make, costing $5 per square foot, while the cylindrical barrel between the ends costs $2 per square foot. Use calculus to determine the minimum cost to construct such a tank.