Optimization Using Calculus

Introduction to Optimization

As we’ve seen before, there are many useful applications of differential calculus. One that is very useful is to use the derivative of a function (and set it to 0) to find a minimum or maximum to find either the smallest something can be, or the largest it can be. We call this optimization, since we are typically finding the optimal or “best value” for something. Some examples of optimization include finding the greatest profit, least cost, greatest volume, optimum size, greatest strength, and so on.

Absolute Extrema

Let’s first revisit absolute extrema, which are the absolute minimum and maximum of a function on an interval. We first learned about Relative and Absolute Minimums and Maximums here in the Advanced Functions section.
In the Curve Sketching section here, we learned that a critical number is where the function’s derivative is 0, or not defined and from the First Derivative Test, critical numbers exist at relative minimums or maximums (also called local minimums or maximums). We can also take the second derivative of the function to verify that the function is a minimum (“cup up”, or positive 2nd derivative) or maximum (“cup down” or negative 2nd derivative).

With optimization, if we have more than one critical point, we need to check the candidates to see which one is the absolute extrema in the possible domain (values that the “$ x$” can be). Typically, to get the domain of a problem, we find the $ x$-values that would “make sense”; for example, we can’t have a dimension of 0 or less. It’s also important to check the endpoints of an interval, if these make sense in the context of the problem, since these points could also be the minimum or maximum to get the absolute extrema.

When we solve optimization problems, we typically put everything in terms of one variable (the “constraint”), determine what we want the maximize (the “objective”), and then take the derivative, and set to 0 to get the minimum or maximum. And in the case of a closed interval (for example, when we could have a 0-value for an amount), we need to check the endpoints of the interval to make sure they aren’t lower (in the case of a minimum) or higher (in the case of a maximum).

Optimization Problems

Here are some problems; the first have to do with area and volume. Remember to always draw a picture first!

Area and Volume Optimization Problems

Calculus Optimization Problem Solution          
Find the length and width of a rectangle with a perimeter of 160 meters and a maximum area.

 

Let $ x=$ the length of the rectangle, and $ y=$ the width. The perimeter is 160, so $ 2x+2y=160$. The area $ A=xy$.

To get the maximum area, take the derivative of the area and set to 0. But we’ll need to have only one variable in the area equation to do this. Use the perimeter equation to solve for a variable; get $ y$ in terms of $ x$:

$ 2x+2y=160;\,\,\,2y=160-2x;\,\,y=80-x$

Now substitute, take the derivative of the area (length times width), and set to 0:

$ \displaystyle A=xy;\,\,\,A=x\left( {80-x} \right)=80x-{{x}^{2}};\,\,\,\frac{{dA}}{{dx}}=80-2x$

$ \displaystyle 80-2x=0;\,\,\,\,\,80=2x;\,\,\,\,x=40;\,\,\,\,\,\,y=80-x=40$

(The second derivative is negative, so we know we have a maximum.)

To get the maximum area, the length should be 40 meters and the width should be 40 meters. It turns out that the largest area of a rectangle is as close to a square as possible.

Make sure our answer ($ x$) is in in the domain. To get the domain, we’ll assume we want a rectangle with no negative sides. Thus, domain is $ \left( {0,80} \right)$, since $80-x>0;\,\,x < 80.$

A rectangular page with 25 square inches of print has margins of 1 inch on each side.

 

Find the dimensions of the page so that the least amount of paper is used.

Let $ x=$ the width of the print and $ y=$ the height of the print. Since there’s a 1-inch margin on each side, $ x+2$ is the width of the piece of paper, and $ y+2$ is the height of the paper (see picture). Relate the two variables, $ x$ and $ y$, by using the area of the print:

$ \displaystyle xy=25;\,\,\,\,y=\frac{{25}}{x}$

Since we want minimum area (length times width), take the derivative of the area of the whole piece of paper and set to 0:

$ \displaystyle A=\left( {x+2} \right)\left( {y+2} \right);\,\,\,A=\left( {x+2} \right)\left( {\frac{{25}}{x}+2} \right)=50{{x}^{{-1}}}+2x+29$

$ \displaystyle \frac{{dA}}{{dx}}=-50{{x}^{{-2}}}+2;\,\,-50{{x}^{{-2}}}+2=0;\,\,{{x}^{{-2}}}=\frac{1}{{25}};\,\,\,x=\pm 5\,\,\,(\text{use positive)}$

$ \displaystyle \,\,y=\frac{{25}}{5}=5$

(The second derivative is positive, so we know we have a minimum.)

To get the minimum area, the width of the print should be 5 inches, and the height should be 5 inches. This means the width and height of the paper should each be 7 inches.

Make sure our answer ($ x$) is in in the domain; we want rectangles, so the domain is $ \left( {0,\infty } \right)$ (no subtracting).

A rectangular package with square ends must have a maximum combined length and girth (the perimeter around the rectangle) of 144 inches.

 

Find the dimensions of the box that yields the maximum volume.

Let $ x=$ the sides of the square end of the box and $ y=$ the length of the box. Since the combined length ($ y$) and girth ($ 4x$) can be 144 inches, and we need a maximum volume, use 144 for this sum. Get $ y$ in terms of $ x$: $ 4x+y=144;\,\,\,\,y=144-4x$.

Since we the want maximum volume (length times width times height), take the derivative of the volume of the box and set to 0:

$ V = x \cdot x \cdot y = {x^2}\left( {144 – 4x} \right) = 144{x^2} – 4{x^3}$

$ \displaystyle {{dV} \over {dx}} = 288x – 12{x^2};\,\,\,12{x^2} = 288x;\,\,\,x = \pm 24\,\,({\text{use positive)}}$

$ y = 144 – 4\left( {24} \right) = 48$

(The second derivative is negative, so we know we have a maximum.)

To get the maximum area, the box should be 24 inches by 24 inches by 48 inches. Make sure our answer ($ x$) is in the domain; we want a box, so the domain is $ \left( {0,36} \right)$, since $ 144-4x>0;\,\,x < 36$.

The owner of a dog park has 120 feet of fencing, and wants to create a rectangular area that is divided into three rectangular pens, as in the picture below.

 

Find the dimensions of the rectangle that would yield the largest possible total area of the three pens. What is this area?

As shown in the picture, let $ x=$ the width of the pen, and $ y=$ the side of each of the smaller rectangular pens. The length of the total pen is $ 3y$. The total amount of fencing needed is $ 6y+4x$, since there are 10 different sides of the fence. Thus,  $ 6y+4x=120$; get $ y$ in terms of $ x$: $ \displaystyle y=\frac{{120-4x}}{6}$.

 

The total area is width times the total length, which is $ \displaystyle A\left( x \right)=x\left( {3y} \right)=x\cdot 3\left( {\frac{{120-4x}}{6}} \right)=60x-2{{x}^{2}}$. Take the derivative to get $ {A}’\left( x \right)=60-4x$, and set to 0 to get $ x=15$. Then $ \displaystyle y=\frac{{120-4\left( {15} \right)}}{6}=10$.

(The second derivative is negative, so we know we have a maximum.) 

The dimensions of the rectangle to get the largest area are a length of $ 3y$ (30 feet) and a width of $ x$ (15 feet), with an area of 450 feet.

Make sure our answer ($ x$) is in in the domain; we want rectangles, so the domain is $ \left( {0,30} \right)$, since $ \displaystyle {{120-4x}\over 6} > 0;\,\,x < 30$.

Endpoint Candidates Problem

Here is a difficult optimization problem where we need to use the Pythagorean Theorem. Note that since the domain can actually contain endpoints, we have to check the endpoint candidates to make sure we have the minimum distance we need:

Calculus Optimization Problem Solution          
Lucy is in a canoe 6 miles from the nearest coast. She needs to go to a snack bar at point A, which is 8 miles down the coast and 4 miles inland (where she has to walk).

 

If she can row at 2 mph and walk at 4 mph, toward what point on the coast should she row in order to reach point A in the least amount of time?

 

(Drawing the picture is almost the most difficult part of the problem!)

Let $ x$ (in miles) be the horizontal distance on the coastline from point B (closest point to Lucy’s boat) to where she should stop rowing and start walking. Do you see how the rest of the distance on the coastline (to where point A is) would then be $ 8-x$? (The total horizontal distance between where the boat is and point A is 8 miles).

 

We want the least amount of time for Lucy to travel. We have the distances and the rates she’ll travel, so we have to use the $ \text{”Distance}=\text{Rate }\times \,\text{Time”}$ equation to get time. To get the slanted distance, use the Pythagorean Theorem.

 

Since we want the minimum time, add distances, take the derivative of the two hypotenuse’s and set to 0:

$ \displaystyle \begin{align}T&=\frac{{\text{Distanc}{{\text{e}}_{1}}}}{{\text{Rat}{{\text{e}}_{1}}}}+\frac{{\text{Distanc}{{\text{e}}_{2}}}}{{\text{Rat}{{\text{e}}_{2}}}}=\frac{{\sqrt{{36+{{x}^{2}}}}}}{2}+\frac{{\sqrt{{{{{\left( {8-x} \right)}}^{2}}+}}{{4}^{2}}}}{4}\\&=\frac{{\sqrt{{36+{{x}^{2}}}}}}{2}\,+\frac{{\sqrt{{{{x}^{2}}-16x+80}}}}{4}=\frac{1}{2}{{\left( {36+{{x}^{2}}} \right)}^{{\frac{1}{2}}}}+\frac{1}{4}{{\left( {{{x}^{2}}-16x+80} \right)}^{{\frac{1}{2}}}}\\{T}’&=\frac{1}{4}{{\left( {36+{{x}^{2}}} \right)}^{{-\frac{1}{2}}}}\cdot 2x+\frac{1}{8}{{\left( {{{x}^{2}}-16x+80} \right)}^{{-\frac{1}{2}}}}\left( {2x-16} \right)\\0&=\frac{x}{2}{{\left( {36+{{x}^{2}}} \right)}^{{-\frac{1}{2}}}}+\frac{{x-8}}{4}{{\left( {{{x}^{2}}-16x+80} \right)}^{{-\frac{1}{2}}}}\end{align}$

 

This is tough to solve algebraically, so I used the graphing calculator with Y1 = the expression with the $ x$ and Y2 = 0 (see first calculator screen). Use the intersect function (2nd TRACE 5 ENTER, ENTER, ENTER) to get $ x\approx 2.6$ miles.

 

Note you can also put the original function in Y1, and use the nDeriv( function (MATH 8) to take the derivative of Y1 (using ALPHA TRACE ENTER to get Y1, and $ x$’s in the rest) to put in the Y2 value. Then put 0 for Y3. Turn off the graph of Y1 (put cursor up to equal sign and hit enter) before getting the intersection (see second calculator screen). You can also use what you know about the domain to put in the $  x$-values in the WINDOW.

 

Notice in the calculator graph, that the derivative (blue) is negative to the left of 0, and positive to the right. This means 0 is the minimum (we could have also created a sign chart, or taken the second derivative).

 

The domain in this problem is $ [0,8]$, since it’s possible that the minimum time would be going straight north to the coastline or over 8 miles in the water, and then up. Thus, we have to test the endpoints to make sure we have the minimum time. We can get the $ T$ values by turning Y1 back on by putting the cursor back to the equal sign and hitting enter. Then use 2nd trace 1 to enter values.

Candidates ($ \boldsymbol {x}$) $ f(x)$  ($ \boldsymbol {T}$)
0 miles $ \approx $ 5.2 hours
$ \approx $ 2.6 miles $ \approx $4.95 hours
8 miles 6 hours

 

Lucy should still row towards a point 2.6 miles up the coastline from point B in order to reach the snack bar at point A in the least amount of time.

Learn these rules, and practice, practice, practice!

On to Differentials, Linear Approximation and Error Propagation – you are ready!