# 3.7: Optimization

**At Grade**Created by: CK-12

## Learning Objectives

A student will be able to:

- Use the First and Second Derivative Tests to find absolute maximum and minimum values of a function.
- Use the First and Second Derivative Tests to solve optimization applications.

## Introduction

In this lesson we wish to extend our discussion of extrema and look at the absolute maximum and minimum values of functions. We will then solve some applications using these methods to maximize and minimize functions.

*Absolute Maximum and Minimum*

We begin with an observation about finding absolute maximum and minimum values of functions that are continuous on a closed interval. Suppose that \begin{align*}f\end{align*}

- Find the values of \begin{align*}f\end{align*}
f for each critical value in \begin{align*}(a,b)\end{align*}(a,b) ; - Find the values of the function \begin{align*}f\end{align*}
f at the endpoints of \begin{align*}[a,b]\end{align*}[a,b] ; - The absolute maximum will be the largest value of the numbers found in 1 and 2; the absolute minimum will be the smallest number.

The optimization problems we will solve will involve a process of maximizing and minimizing functions. Since most problems will involve real applications that one finds in everyday life, we need to discuss how the properties of everyday applications will affect the more theoretical methods we have developed in our analysis. Let’s start with the following example.

**Example 1:**

A company makes high-quality bicycle tires for both recreational and racing riders. The number of tires that the company sells is a function of the price charged and can be modeled by the formula \begin{align*}T(x) = -x^3 + 36.5 x^2 + 50x + 250,\end{align*}

**Solution:**

Let’s first look at a graph and make some observations. Set the viewing window ranges on your graphing calculator to \begin{align*}[-10, 50]\end{align*}

We first note that since this is a real-life application, we observe that both quantities, \begin{align*}x\end{align*}** feasible domain,** illustrates a common feature of optimization problems: that the real-life conditions of the situation under study dictate the domain values. Once we make this observation, we can use our First and Second Derivative Tests and the method for finding absolute maximums and minimums on a closed interval (in this problem, \begin{align*}[0,37]\end{align*}

In addition to the feasible domain issue illustrated in the previous example, many optimization problems involve other issues such as information from multiple sources that we will need to address in order to solve these problems. The next section illustrates this fact.

*Primary and Secondary Equations*

We will often have information from at least two sources that will require us to make some transformations in order to answer the questions we are faced with. To illustrate this, let’s return to our Lesson on Related Rates problems and recall the right circular cone volume problem.

\begin{align*}V=\frac{1}{3}\pi r^2h.\end{align*}

We started with the general volume formula \begin{align*}V=\frac{1}{3}\pi r^2h\end{align*}

We started with a ** primary equation**, \begin{align*}V=\frac{1}{3}\pi r^2h\end{align*}, that involved two variables and provided a general model of the situation. However, in order to solve the problem, we needed to generate a

**\begin{align*}r(t)=\frac{2h(t)}{5}\end{align*}, that we then substituted into the primary equation. We will face this same situation in most optimization problems.**

*secondary equation,*Let’s illustrate the situation with an example.

**Example 2:**

Suppose that Mary wishes to make an outdoor rectangular pen for her pet chihuahua. She would like the pen to enclose an area in her backyard with one of the sides of the rectangle made by the side of Mary's house as indicated in the following figure. If she has \begin{align*}90 \;\mathrm{ft}\end{align*} of fencing to work with, what dimensions of the pen will result in the maximum area?

**Solution:**

The primary equation is the function that models the area of the pen and that we wish to maximize,

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

The secondary equation comes from the information concerning the fencing Mary has to work with. In particular,

\begin{align*}2 x + y = 90.\end{align*}

Solving for \begin{align*}y\end{align*} we have

\begin{align*}y = 90 - 2x.\end{align*}

We now substitute into the primary equation to get

\begin{align*}A = xy = x (90-2x),\end{align*} or

\begin{align*}A = 90x -2x ^2.\end{align*}

It is always helpful to view the graph of the function to be optimized. Set the viewing window ranges on your graphing calculator to \begin{align*}[-10, 100]\end{align*} for \begin{align*}x\end{align*} and \begin{align*}[-500,1200]\end{align*} for \begin{align*}y.\end{align*} The graph should appear as follows:

The feasible domain of this function is \begin{align*}0 < \times < 45,\end{align*} which makes sense because if \begin{align*}x\end{align*} is \begin{align*}45 \;\mathrm{feet}\end{align*}, then the figure will be two \begin{align*}45\end{align*}-foot-long fences going away from the house with \begin{align*}0\;\mathrm{feet}\end{align*} left for the width, \begin{align*}y.\end{align*} Using our First and Second Derivative Tests and the method for finding absolute maximums and minimums on a closed interval (in this problem, \begin{align*}[0, 45]\end{align*}), we see that the function attains an absolute maximum at \begin{align*}x = 22.5,\end{align*} at the point \begin{align*}(22.5,1012.5).\end{align*} So the dimensions of the pen should be \begin{align*}x = 22.5,\end{align*} \begin{align*}y = 45\end{align*}; with those dimensions, the pen will enclose an area of \begin{align*}1012.5 \;\mathrm{ft}^2.\end{align*}

Recall in the Lesson Related Rates that we solved problems that involved a variety of geometric shapes. Let’s consider a problem about surface areas of cylinders.

**Example 3:**

A certain brand of lemonade sells its product in \begin{align*}16-\end{align*}ounce aluminum cans that hold \begin{align*}473\;\mathrm{ml}\end{align*} \begin{align*}(1 \;\mathrm{ml} = 1 \;\mathrm{cm^3}).\end{align*} Find the dimensions of the cylindrical can that will use the least amount of aluminum.

**Solution:**

We need to develop the formula for the surface area of the can. This consists of the top and bottom areas, each \begin{align*}\pi r^2,\end{align*} and the surface area of the side, \begin{align*}2 \pi rh\end{align*} (treating the side as a rectangle, the lateral area is (circumference of the top) \begin{align*}\times\end{align*} (height)). Hence the primary equation is

\begin{align*}A = 2 \pi r^2 + 2 \pi rh.\end{align*}

We observe that both our feasible domains require \begin{align*}r, h > 0.\end{align*}

In order to generate the secondary equation, we note that the volume for a circular cylinder is given by \begin{align*}V = \pi r^2h.\end{align*} Using the given information we can find a relationship between \begin{align*}r\end{align*} and \begin{align*}h,\end{align*} \begin{align*}h=\frac{473}{\pi r^2}\end{align*}. We substitute this value into the primary equation to get \begin{align*}A = 2\pi r^2+2\pi r\left (\frac{473}{\pi r^2}\right )\end{align*}, or \begin{align*}A=2\pi r^2+\frac{946}{r}.\end{align*}

\begin{align*}\frac{dA}{dr}=4\pi r-\frac{946}{r^2}=0\end{align*} when \begin{align*}r=\sqrt[3]{\frac{946}{4\pi}}\approx 9.06\;\mathrm{cm}\end{align*}. We note that \begin{align*}\frac{d^2A}{dr^2}>0\end{align*} since \begin{align*}r > 0.\end{align*} Hence we have a minimum surface area when \begin{align*}r=\sqrt[3]{\frac{946}{4\pi 0}}\approx 4.22\;\mathrm{cm}\end{align*} and \begin{align*}h=\frac{473}{\pi(\sqrt[3]{\frac{946}{4\pi})^2}}=8.44 \;\mathrm{cm}\end{align*}.

## Lesson Summary

- We used the First and Second Derivative Tests to find absolute maximum and minimum values of a function.
- We used the First and Second Derivative Tests to solve optimization applications.

## Multimedia Links

For video presentations of maximum-minimum Business and Economics applications **(11.0)**, see Math Video Tutorials by James Sousa, Max & Min Apps. w/calculus, Part 1 (9:57)

and Math Video Tutorials by James Sousa, Max & Min Apps. w/calculus, Part 2 (4:51).

To see more examples of worked out problems involving finding minima and maxima on an interval **(11.0)**, see the video at Khan Academy Minimum and Maximum Values on an Interval (11:42).

This video shows the process of applying the first derivative test to problems with no context, just a given function and a domain. A classic problem in calculus involves maximizing the volume of an open box made by cutting squares from a rectangular sheet and folding up the edges. This very cool calculus applet shows one solution to this problem and multiple representations of the problem as well. Calculus Applet on Optimization

## Review Questions

In problems #1–4, find the absolute maximum and absolute minimum values, if they exist.

- \begin{align*}f (x) = 2x^2 - 6 x + 6\end{align*} on \begin{align*}[0,5]\end{align*}
- \begin{align*}f(x) = x^3 + 3 x^2\end{align*} on \begin{align*}[-2,3]\end{align*}
- \begin{align*}f(x)=3x^\frac{2}{3}-6x+6\end{align*} on \begin{align*}[1,8]\end{align*}
- \begin{align*}f(x) = x^4 - x^3\end{align*} on \begin{align*}[-2,2]\end{align*}
- Find the dimensions of a rectangle having area \begin{align*}2000 \;\mathrm{ft}^2\end{align*} whose perimeter is as small as possible.
- Find two numbers whose product is \begin{align*}50\end{align*} and whose sum is a minimum.
- John is shooting a basketball from half-court. It is approximately \begin{align*}45 \;\mathrm{ft}\end{align*} from the half court line to the hoop. The function \begin{align*}s(t) = -0.025 t^2 + t + 15\end{align*} models the basketball’s height above the ground \begin{align*}s(t)\end{align*} in feet, when it is \begin{align*}t\;\mathrm{feet}\end{align*} from the hoop. How many feet from John will the ball reach its highest height? What is that height?
- The height of a model rocket \begin{align*}t\end{align*} seconds into flight is given by the formula \begin{align*}h(t)=-\frac{1}{3}t^3+4t^2+25t+4\end{align*}.
- How long will it take for the rocket to attain its maximum height?
- What is the maximum height that the rocket will reach?
- How long will the flight last?

- Show that of all rectangles of a given perimeter, the rectangle with the greatest area is a square.
- Show that of all rectangles of a given area, the rectangle with the smallest perimeter is a square.

## Review Answers

- Absolute minimum at \begin{align*}x=\frac{3}{2},f\left (\frac{3}{2}\right )=\frac{3}{2}\end{align*}. Absolute maximum at \begin{align*}x = 5,\end{align*} \begin{align*}f(5) = 26.\end{align*}
- Absolute minimum at \begin{align*}x = 0,\end{align*} \begin{align*}f(0) = 0.\end{align*} Absolute maximum at \begin{align*}x = 3,\end{align*} \begin{align*}f(3) = 54.\end{align*}
- Absolute minimum at \begin{align*}x = 8,\end{align*} \begin{align*}f(8) = -30.\end{align*} Absolute maximum at \begin{align*}x = 1,\end{align*} \begin{align*}f(1) = 3.\end{align*}
- Absolute minimum at \begin{align*}x = 0.75,\end{align*} \begin{align*}f(0.75) = -0.105.\end{align*} Absolute maximum at \begin{align*}x = -2,\end{align*} \begin{align*}f(-2) = 24.\end{align*}
- \begin{align*}x=y=20\sqrt{5}\end{align*}
- \begin{align*}x=y=5\sqrt{2}\end{align*}
- At \begin{align*}t = 20 \;\mathrm{ft}\end{align*}, the basketball will reach a height of \begin{align*}s(t) = 25 \;\mathrm{ft}\end{align*}.
- The rocket will take approximately \begin{align*}t\approx10.4 \;\mathrm{sec}\end{align*} to attain its maximum height of \begin{align*}321.7 \;\mathrm{ft}\end{align*}. the rocket will hit the ground at \begin{align*}t\approx16.6 \;\mathrm{sec}\end{align*}.
- Assume that the given perimeter is a constant \begin{align*}P\end{align*}. Then: \begin{align*}P = 2w + 2l\end{align*}, where \begin{align*}w\end{align*} is the width of the rectangle and \begin{align*}l\end{align*} is the length. The area of this rectangle is given by \begin{align*}A = Wl\end{align*}. Since we want to maximize the area, we first isolate \begin{align*}w\end{align*} in the perimeter equation: \begin{align*}w = \frac{P-2l}{2}\end{align*} And then substitute this into the area equation: \begin{align*}A = lw = l\left( \frac{P-2l}{2} \right) = \frac{Pl}{2} - l^2\end{align*}. To find the maximum of \begin{align*}A\end{align*}, we then take the derivative of \begin{align*}A\end{align*} with respect to \begin{align*}l\end{align*}, set the derivative equal to zero, and solve for \begin{align*}l\end{align*} and the associated critical value: \begin{align*}\frac{dA}{dl} = \frac{P}{2} - 2l = 0\end{align*} Which means that: \begin{align*}2l = \frac{P}{2}, or \ l = \frac{P}{4},\end{align*} will produce either a max or minimum for the area \begin{align*}A\end{align*}. We can also take the second derivative of \begin{align*}A\end{align*} with respect to \begin{align*}l\end{align*} to determine whether this \begin{align*}l = \frac{P}{4}\end{align*} produces a maximum or a minimum: \begin{align*}\frac{d^2 A}{dl^2} = -2\end{align*} And this negative value for the second derivative over the entire domain of \begin{align*}A\end{align*} means that the function A is concave downwards everywhere, which, in turn, means that the function \begin{align*}A\end{align*} at the point \begin{align*}l = \frac{P}{4}\end{align*} is a maximum. Finally, since \begin{align*}l = \frac{P}{4}\end{align*} we know that: \begin{align*}w = \frac{P-2l}{2} = \frac{P-2\left(\frac{P}{4}\right)}{2} = \frac{\frac{P}{2}}{2} = \frac{P}{4}\end{align*} Accordingly, since \begin{align*}w = l = \frac{P}{4}\end{align*}, we have shown that the dimensions that produce the maximum area are square dimensions.
- Assume that the given area is a constant \begin{align*}A\end{align*}. Then: \begin{align*}A = wl\end{align*}, where \begin{align*}w\end{align*} is the width of the rectangle and \begin{align*}l\end{align*} is the length. Then the perimeter of this rectangle is given by \begin{align*}P = 2w+2l\end{align*}. Since we want to minimize the perimeter, we first isolate \begin{align*}w\end{align*} in the area equation: \begin{align*}w = \frac{A}{l}\end{align*}. Substituting this into the perimeter equation we get: \begin{align*}P = 2w+2l = 2\left( \frac{A}{l} \right)+2l\end{align*}. To find the point of minimization of this perimeter function, we take the derivative of this function with respect to \begin{align*}l\end{align*} and set it to zero and solve for \begin{align*}l\end{align*}: \begin{align*}\frac{dP}{dl} &= \frac{-2A}{l^2}+2 = 0\\ 2 &= \frac{2A}{l^2}\\ l^2 &= A\\ l &= \sqrt{A}\end{align*} To find \begin{align*}w\end{align*} we substitute this value back into the area formula: \begin{align*}A &= wl = w\sqrt{A}\\ W &= \frac{A}{\sqrt{A}} = \sqrt{A}\end{align*} So we have either a perimeter maximum or a minimum at \begin{align*}w = l = \sqrt{A}\end{align*}. To determine which, we look at the second derivative of the perimeter function: \begin{align*}\frac{d^2 P}{dl^2} = \frac{4A}{l^3}\end{align*}. Since we know that the domain of \begin{align*}l\end{align*} is limited to positive values, then \begin{align*}\frac{d^2 P}{dl^2} = \frac{4A}{l^3}\end{align*} is positive for all values of \begin{align*}l\end{align*}, and the function \begin{align*}P\end{align*} is concave upwards everywhere in the domain for \begin{align*}l\end{align*}, and so \begin{align*}w = l = \sqrt{A}\end{align*} produces an absolute minimum for \begin{align*}P\end{align*}. Accordingly, we have shown that the smallest perimeter is in the shape of a square.