## Section10.1Introduction to Optimization

When we know how to find extreme values of a function, we can use those techniques to answer physical questions involving optimization. Optimization problems involve at least two related physical quantities. One quantity is a control variable, a physical attribute of the system that one can adjust. The other quantity depends on the control variable and measures an aspect of the system that we wish to improve.

In this section, we consider some examples of optimization. The primary challenge for such problems is in clearly defining the system, identifying the control variable and the quantity to optimize. We then apply the calculus techniques for finding extreme values.

### Subsection10.1.1Objective Functions

Optimization is the application of finding extreme values to either maximize or minimize some quantity of interest. We usually have a physical incentive for this optimization, such as minimizing energy consumption, maximizing evolutionary fitness, minimizing costs of materials, or maximizing profit. The quantity of interest will depend on some independent variable that we have the ability to control or adjust. We call the mapping from the control variable to the physical quantity being optimized the objective function.

Frequently, identifying the appropriate objective function is the more challenging aspect of an optimization problem. Once the function is identified, the task is reduced to identifying local extreme values and behavior at end points. Sometimes the objective function depends on multiple independent variables that are related through some constraint. The constraint typically determines an equation which can be used to rewrite the objective functions as having only have a single independent variable. In addition, we need to determine a meaningful physical domain for the function.

We begin with several examples of creating objective functions for optimization problems. The actual analysis will follow later. Several simple examples come from geometry where we need to construct a shape that has some feature (like a given perimeter, area or volume) and we wish to make some other feature as large as possible. We use these examples not because they are practical but because they illustrate the principles of optimization effectively.

###### Example10.1.1

Suppose we want to create a rectangle that has an area of $500 \; cm^2\text{.}$ Three sides will have one type of trim while the fourth side will have trim that is twice as expensive. What should be the dimensions of the rectange to minimize the cost of the trim?

Solution

Start by identifying the variables.

• $h$ is the horizontal width of the rectangle
• $v$ is the vertical length of the rectangle
• $C$ is the cost of the trim around the rectangle

Once we have identified our variables, we need to find a formula for the cost because that is what we want to minimize. We will assume that the more expensive side is one of the horizontal lengths. Let $p$ be the unit cost (per cm) of the less expensive trim so that $2p$ is the unit cost of the more expensive trim. The total cost of the trim is given by

\begin{equation*} C = (h+2v) \cdot p + h \cdot (2p) = (3h+2v) \cdot p. \end{equation*}

Our objective function $(h,v) \mapsto C$ involves two independent variables. This means we need an additional constraint. Reviewing the problem, we recall that the total area needs to be $500 \; cm^2\text{.}$ The area is computed by $A=h \cdot v = 500$ so that we can treat $v$ as another dependent variable,

\begin{equation*} v = \frac{500}{h}. \end{equation*}

Substituting this formula into our objective function, we can rewrite it involving only a single independent variable $h\text{:}$

\begin{equation*} C = \Big(3h + 2 \cdot \frac{500}{h}\Big) \cdot p = 3ph + \frac{1000p}{h}. \end{equation*}

Because $p$ is a constant multiple in this formula, the location of the minimum will not depend on $p\text{.}$

Finally, we need to consider the physical domain for the objective function. The natural domain for the map $h \mapsto C$ is $h \ne 0\text{.}$ However, negative values for $h$ don't make physical sense. The physical domain for this problem will be $h \in (0,\infty)\text{.}$ That is, the optimization problem will be answered by finding the global minimum of $C$ on the interval $(0,\infty)\text{.}$

A graph of this relation is shown below using $p=1\text{.}$ The minimum value occurs somewhere near $h=20$ with a cost $C$ close to $100p\text{.}$ We need to use calculus to find the exact value.

###### Example10.1.2

Suppose you have a flexible pipe of length 10 meters that you will bend to make three sides of a rectangle. How long should you make these sides so that the rectangle has as large an area as possible?

Solution

We start by identifying the variables. It is often helpful to draw a figure. A sample diagram is shown in Figure 10.1.3. We label the two opposite vertical sides by the variable $h$ (height) and the horizontal side by the variable $w$ (width).

We want to make the area as large as possible. This makes the area of the rectangle $A$ the dependent variable. The area of a rectangle is the height times the width, so our objective function is defined by

\begin{equation*} A = h \cdot w\text{.} \end{equation*}

We need to write this as a function of one independent variable.

The constraint for our independent variables $h$ and $w$ is that the total length of pipe used is 10 meters. The pipe is used for two edges of length $h$ and one edge of length $w\text{.}$ As an equation, the constraint becomes

\begin{equation*} 2h + w = 10 \text{.} \end{equation*}

If we solve this equation for $w\text{,}$ we find

\begin{equation*} w = 10-2h \end{equation*}

which we can substitute into the objective function,

\begin{equation*} A = h \cdot (10-2h) = 10h - 2h^2\text{.} \end{equation*}

The last step is to identify the physical domain for the objective function. A physical measurement of length must be non-negative, so $h \ge 0\text{.}$ What is the largest value of $h$ that is possible? We need $w \ge 0$ which requires $10-2h \ge 0\text{.}$ This implies $h \le 5\text{.}$ The physical domain is therefore $h \in [0,5]\text{.}$ Even though the shape would be an empty rectangle (no area), all of the variables are still defined when $h=0$ or $h=5\text{.}$ We include the end points since closed intervals are easier to analyze.

A graph of the objective function is shown in Figure 10.1.4. We can see that the area will be maximized at the vertex of this parabola. Calculus will give us an efficient method to find this point.

A biological example follows. A fundamental hypothesis of biology is that evolution drives organisms to maximize their fitness, which corresponds to the number of surviving offspring. There is often a trade-off between the number of offspring and the probability that the offspring survive. Let $f$ (fecundity) represent the number of offspring an organism produces and let $s$ (survival) represent the probability that an offspring will survive. The then fitness is given by $F=f \cdot s\text{,}$ the average number of offspring that survive.

###### Example10.1.5

Suppose that the survival probability is related to fecundity so that it decreases linearly. If each organism has ten offspring, the survival probability is $s=0.95\text{.}$ If each organism has forty offspring, the survival probability drops to $s=0.8\text{.}$ How many offspring should the organism have to maximize fitness?

Solution

First, identify the variables. The objective function is the fitness $F$ which depends on both $f$ (fecundity) and $s$ (survival probability) through

\begin{equation*} F = f \cdot s\text{.} \end{equation*}

This objective function has two independent variables, $(f,s) \mapsto F\text{.}$

We need to reduce the number of independent variables to a single variable by realizing that $f$ and $s$ will satisfy a linear relation. Because the original question asks for how many offspring should be produced, we will choose $f$ to be the independent variable. The line passes through points $(f,s)=(10,0.95)$ and $(f,s)=(40,0.8)\text{.}$ We can compute the slope

\begin{equation*} \frac{\Delta s}{\Delta f} = \frac{0.8 - 0.95}{40-10} = \frac{-0.15}{30} = -0.005 \text{.} \end{equation*}

Using the point-slope equation of a line, we find

\begin{equation*} s = 0.95 -0.005(f-10) = -0.005f + 1\text{.} \end{equation*}

Using substitution in the objective function gives

\begin{equation*} F = f \cdot (-0.005f + 1) = -0.005 f^2 + f\text{.} \end{equation*}

To find the physical domain, we require $f \ge 0$ and $s \ge 0\text{.}$ The second requirement becomes $-0.005f+1 \ge 0\text{,}$ which means that $f \le 200\text{.}$ The physical domain is therefore $f \in [0,200]\text{.}$ A graph shows that the maximum should occur at the vertex of a parabola.

### Subsection10.1.2Analysis for Optimization

Now that we have illustrated how to find the objective function for several examples, let us work through the analysis to solve the optimization problems. Two of our examples had objective functions that were quadratic polynomials. We start with those examples.

###### Example10.1.7

The bent pipe example resulted in an objective function

\begin{equation*} A = 10h - 2h^2 \end{equation*}

and a physical domain $h \in [0,5]\text{.}$ Complete the optimization and find the dimensions that will maximize the area of the resulting rectangle.

Solution

To find the global extreme of the function $A(h) = 10h-2h^2\text{,}$ we begin by computing the derivative,

\begin{equation*} A'(h) = 10(1)-2(2h) = 10-4h\text{.} \end{equation*}

To perform sign analysis of $A'(h)\text{,}$ we first find the root $A'(h)=0\text{:}$

\begin{gather*} 10-4h = 0\\ \frac{10}{4} = h\\ h = \frac{5}{2}. \end{gather*}

Our test intervals are $[0,\frac{5}{2})$ and $(\frac{5}{2},5]\text{.}$ Testing the sign at $h=1$ and $h=4$ as sample points, we find

\begin{gather*} A'(1)=10-4(1)=6 \gt 0,\\ A'(4)=10-4(4)=-6 \lt 0. \end{gather*}

The results of our sign analysis are summarized on the following number line.

Our sign analysis of $A'(h)$ implies that $A$ has a maximum value at $h=\frac{5}{2}\text{.}$ Because $A$ is increasing on $[0,\frac{5}{2}]$ and decreasing on $[]\frac{5}{2},5]\text{,}$ we see that this is a global maximum on the domain. The resulting dimensions of the rectangle are $h=\frac{5}{2}=2.5$ meters and $w = 10-2h = 10 - 2(2.5)=5$ meters. The area of the rectangle will be $A=12.5$ square meters.

###### Example10.1.8

The fitness example resulted in an objective function

\begin{equation*} F = -0.005f^2 + f \end{equation*}

and a physical domain $f \in [0,200]\text{.}$ Complete the optimization to find the number of offspring that will maximize the fitness.

Solution

To find the global maximum of $F(f)\text{,}$ we first compute the derivative,

\begin{equation*} F'(f) = -0.005(2f) + 1 = -0.01f+1\text{.} \end{equation*}

The root $F'(f)=0$ occurs at $f=100\text{.}$ Our sign analysis uses test intervals $[0,100)$ and $(100,200]\text{.}$ We compute the sign of $F'(f)$ at sample points $f=0$ and $f=200\text{:}$

\begin{gather*} F'(0)=-0.01(0)+1 = 1 \gt 0,\\ F'(200)=-0.01(200)+1 = -1 \lt 0. \end{gather*}

The results of our sign analysis are summarized on the following number line.

The First Derivative Test allows us to conclude that $F$ has a local maximum value at $f=100\text{.}$ Because $F$ is increasing on $[0,100]$ and decreasing on $[100,200]\text{,}$ this must also be a global maximum. The fitness will be maximized when each individual reproduces with 100 offspring.

For our third example, the objective function is not a polynomial. Because we have not yet established a rule for the derivative in this case, we will use technology to find it.

###### Example10.1.9

The cost to put trim on our rectangle was found to be the objective function

\begin{equation*} C(h) = 3ph + \frac{1000p}{h} \end{equation*}

with a physical domain $h \in (0,\infty)\text{.}$

Solution

The SageMath computer algebra system allows us to compute derivatives automatically.

We now know

\begin{equation*} C'(h) = 3p - \frac{1000p}{h^2}\text{.} \end{equation*}

Like $C(h)\text{,}$ this derivative is not defined for $h=0$ but is otherwise continuous. We find a root by solving $C'(h)=0$ and finding a common denominator:

\begin{gather*} 3p - \frac{1000p}{h^2} = 0\\ \frac{3ph^2}{h^2} - \frac{1000p}{h^2} = 0\\ \frac{p(3h^2-1000)}{h^2} = 0\\ 3h^2-1000 = 0\\ h^2 = \frac{1000}{3}\\ h = \pm \sqrt{\frac{1000}{3}} \end{gather*}

Only $h = +\sqrt{\frac{1000}{3}} \approx 18.257$ is in the domain.

We can test the signs of $C'(h)$ using $h=10$ and $h=20\text{.}$

\begin{gather*} C'(10) = 3p - \frac{1000p}{10^2} = 3p - 10p = -7p \lt 0\\ C'(20) = 3p - \frac{1000p}{20^2} = 3p - \frac{5p}{2} = \frac{p}{2} \gt 0 \end{gather*}

The First Derivative Test shows that $C$ has a local minimum at $h=\sqrt{\frac{1000}{3}}\text{.}$ Because $C$ is decreasing on $(0,\sqrt{\frac{1000}{3}}]$ and increasing on $[\sqrt{\frac{1000}{3}},\infty)\text{,}$ this minimum is a global minimum.

We finish by interpreting our mathematics. The question was how to find the dimensions of the rectangle. Our analysis gave us a value for $h=\sqrt{\frac{1000}{3}} \approx 18.257 \; cm\text{.}$ We also need $v\text{,}$ which was another dependent variable:

\begin{equation*} v=\frac{500}{h} = 500 \cdot \sqrt{frac{3}{1000}} \approx 27.386 \; cm. \end{equation*}

The minimal cost to trim a rectangle would have a horizontal length of 18.26 cm, one of which has the more expensive trim, and a vertical length of 27.386 cm.

### Subsection10.1.3Summary

• Optimization is the application of finding extreme values to physical problems. The dependent variable is the quantity that should be as large or as small as possible. The independent variable(s) are the quantities we can adjust. The map from the independent variable to the dependent variable is called the objective function.

• When more than one independent variable is involved, an extra equation called a constraint allows us to solve for one of the independent variables in terms of the other.

• A physical domain for the objective function represents the values of the independent variable(s) that are physically relevant.

### Subsection10.1.4Exercises

###### 8

A rectangular box with a square base and no top needs to contain a volume of 1000 cubic centimeters. The square base (all sides equal) is made from a material that costs 10 cents per square centimeter. The other four sides are made from a material that costs 6 cents per square centimeter. What dimensions should the box have to minimize the total cost of materials?

###### 9

A beverage can is being designed in the shape of a circular cylinder to hold 360 cubic centimeters (volume=$\pi r^2 h$). The top and bottom (circles, area=$\pi r^2$) are made from metal that costs $0.01 per square centimeter while the curved wall of the can (curved rectangle, area=$2\pi r h$) is made from metal that costs$0.004 per square centimeter. What should be the radius and height of the can that would minimize the materials cost?