## Section3.4Optimization

In Section 3.2 we noticed that the high and low points of the graph of a function often coincided with a point where the derivative of the function was 0. In a business setting, we are often concerned with finding the maximum and minimum values of a function, because one or the other will be a best, or optimum value. We typically want to maximize functions like profit, utility, revenue, and market share. We typically want to minimize functions like cost and liability. We will use the same basic process to optimize, whether the extremum we are finding is a maximum and minimum.

Recall, we said that the derivative can be thought of as the slope of the apparent line, obtained by zooming in on the graph of a function. Clearly, we cannot have an extremum at an interior point of the domain if the derivative is nonzero, because we could go either higher or lower by moving a little to the right or left. Thus we can only have extrema at a critical point, a place when the derivative is zero or undefined, or at an endpoint where we cannot go both left and right. This gives us a small list of candidate points for the optimum value.

Our process for optimization will be to find all the candidate points, then to see which gives the highest and lowest values. When our curve has a point that is a maximum or minimum in some interval around the point, we call it a relative maximum or minimum. If it is the highest or lowest point for the whole domain of the function it is called a global maximum or minimum.

We have determined that the profit function for selling widgets is

\begin{equation*} \profit(\quantity)=\quantity*(400-\quantity)-5000\text{,} \end{equation*}

with the function valid on the interval $$0\le \quantity\le 500\text{.}$$ Find the minimum and maximum profit in the given interval.

Solution 1. Solution A: without calculus

The first example was chosen because it can be done without using any calculus, so we solve it with easier methods first. The profit function is a quadratic function in quantity, so it is a downward pointing parabola. The location of the vertex is at $$\quantity=200\text{,}$$ which we obtain from the coefficients of the quadratic and linear terms. Thus we need to check this point and the two endpoints. Plugging in values, we get $$(0,-5000)\text{,}$$ $$(200, 35000)$$ and $$(500, -55000)\text{.}$$ The maximum occurs when we sell 200 widgets and our profit is $35,000, the minimum occurs when we sell 500 widgets and our loss is$55,000. A relative minimum occurs when we sell 0 widgets and our loss is $5,000. Solution 2. Solution B: with calculus We want to set up the problem to be able to graph the profit function and its derivative on the same graph. We will us the calculator approximation of the derivative. As we did in the last section, we set up a worksheet with columns for $$q\text{,}$$ $$q+.001\text{,}$$ $$q-0.001\text{,}$$ $$p(q)\text{,}$$ $$p(q+.001)\text{,}$$ $$p(q-0.001)\text{,}$$ and $$p'(q)\text{.}$$ This allows most of the worksheet to be filled in with quick fill. We then look at the values, and compare the table to a graph. We find the same three candidate points and the same maximum and minimum values. For a second example we want to look at a function where we can’t find the maximum by algebraic means. We have determined that the profit function for selling cumquat oil is \begin{equation*} \profit(\quantity)=(10\quantity-20)*exp(-\quantity/50)-10\text{.} \end{equation*} We understand that the function is valid on the interval $$0\le \quantity\le 400\text{,}$$ where the quantity is measured in thousands of pints and profit is measured in thousands of dollars. Find the minimum and maximum profit in the given interval. Solution. The spreadsheet is set up like it was in the first example, but with the function changed. Looking at the graph and the chart we expect to find local minima at the endpoints, and the maximum when $$q$$ is close to 50. We use goal seek to find where the derivative is zero. As we see below, Goal Seek does not find a point where the derivative is zero. Instead it finds a point where the derivative is “close enough” to zero. By default, “close enough” is understood by Excel as being within 0.001. If the default definition of “close enough” is good enough for our purposes, then the maximum profit of$166,727 occurs when we sell 51,998 pints of oil. (In fact, selling 2 more pints of oil will yield an extra 0.01 cents.) The minimum profit occurs when we sell no product, in which case we have a loss of 30,000. One of the things to notice about the last example is the robustness of the method. From an algebraic point of view, the function was rather ugly. All we needed to know to use the method was that the function was smooth enough, that when we zoomed in to a scale of $$x$$ changing by 0.001 the graph looked like a straight line. Throughout the section we have looked for places where the derivative is zero when looking for extrema. We have not paid any attention to how we decide if the point we find is a local maximum or a local minimum. There are several approaches we could use. Since we are computing the derivative we could note that a local maximum is a place where the function goes from increasing to decreasing, so the derivative goes from positive to negative. (Similarly, a local minimum is at a place where the derivative goes from positive to negative.) There is also a test that looks at the derivative of the derivative. Those tests will be more useful in the next chapter when we are finding a formula for the derivative by symbolic means. However, with the numeric technique we are using, the easiest test is that a local maximum is greater than or equal to points a little bit to both the left and right. We simply plug in points a little bit to each side to test. Since a change in $$q$$ of 0.001 makes the graph look like a flat straight line, we change $$q$$ by 0.01. As expected, profit goes down as we move away from our expected maximum. A plant can produce between 150 and 300 gizmos. The profit function for the plant is: \begin{equation*} \profit(\quantity)=4 \quantity^2-1300 \quantity+125000\text{.} \end{equation*} Find the production level that maximizes profit. Solution. We set up the problem as before, using goal seek on the derivative to find critical points, and checking the ends of the interval. We have three candidates for the extrema, the two endpoints and the critical point at 162.5. However by looking at the points to the side of the critical point, we see it is a local minimum. We also see, that of our 3 candidate points, the one that gives the maximum profit is the right endpoint, when quantity is 300. For our first three examples we have been trying to find the minimum or maximum of a functions that has been given to us as a function of one variable. Sometimes we need to do a bit of work to get the function in that format. I am manufacturing goop, a liquid that needs to be put in cans. We will use cans that have a standard cylindrical shape. Find the height and radius of a 1 liter can that uses a minimal amount of metal surface. Solution. Using basic geometry we recall the formulas for the volume and surface area of a cylinder. \begin{align*} \text{volume} \amp = \pi \text{radius}^2*\text{height}\\ \text{area} \amp =2 \pi \text{radius}^2+2 \pi*\text{radius}*\text{height}\text{.} \end{align*} Since I am measuring volume in liters, I want to measure radius and height in decimeters so the units work correctly. In order to optimize, we need to reduce the problem to a single function of a single variable. We are told that the volume is 1, so we can solve for height as a function of radius, then plug it into the equation for area. Then area is a function of a single variable, radius, and we can find the critical points and check for a minimum. \begin{align*} \text{height} \amp =1/( \pi \text{radius}^2)\\ \text{area} \amp =2 \pi \text{radius}^2+\frac{2}{\text{radius}} \text{.} \end{align*} Since we now have area as a function of the single variable radius we can take a derivative to find the critical point, then find the optimal shape. Solving for where the derivative of area is zero, we find the radius of the can should be 0.5419 deciliters. We plug that value back into the formula for height in terms of radius and see that the height should be 1.083854 deciliters. To understand the shape of the can we see that the height is twice the radius, or the same thing as the diameter of the can. The can is optimally shaped when it is the shape of a large paint can. There are three technical details worth mentioning from the last example. First, in Excel, the best way to put $$\pi$$ in a formula is with the constant PI(). Second, the function for area is defined on an open interval where the radius is positive. There is no maximum area for a can of fixed volume. (However inefficient our can is, we can always make it worse, by moving farther from the optimum.) Third, one should also note that for this problem, we wanted several numbers as part of our answer. The worksheet for the problem puts the best height and radius at the top, where the reader can easily find it. In this last example we had to reduce two equations in two unknowns to a single equation in one unknown to be able to optimize. We may also need to produce an equation from data. For widget production and sales we have the following data on profit based on sales.  Quantity 10 100 200 250 300 400 Profit -2,083 $31,040$48,587 $49,845$46,146 $23,670 Find the break even points and the quantity that maximizes profit. Solution. From looking at a quick plot of the data, I am going to assume that the profit function is a downward facing parabola, so I find the best fitting quadratic polynomial for the data. Using trendlines, my profit function is \begin{equation*} \profit(q)=-1.002 q^2+477.22 q=6720.9\text{.} \end{equation*} I now set up the table for special values with goal seek. I use starting points of 20 and 450 for the break even points and 250 for the maximum. To find break even points, I Goal Seek on the profit function. To find the maximum point, I Goal Seek on the derivative of the profit function. Rounding to the nearest whole number in each case, my break even points are for selling 15 and 460 widgets. My maximum profit of$50,032 occurs when I sell 238 widgets.

We are running a business and want to minimize equipment expenses. For a particular piece of equipment the costs can be broken into initial outlays to buy the equipment, fixed annual expenses to keep the equipment in the inventory, and repair costs which we anticipate rising as the equipment gets older. A widget press costs $10,000 to buy, and the operating expenses are$500 a year, and the total repair costs are $$300t^2$$ over the first $$t$$ years. What is the optimal length of time to use a widget press before replacing it?

Solution.

My annual cost equation is total cost divided by $$t\text{.}$$ This annual cost is:

\begin{equation*} \AnnualCost(t)=10000/t+500+300t\text{.} \end{equation*}

I create a spreadsheet that calculates the cost and its derivative over the first 10 years.

#### 12.

The cost equation for gizmos is $$\cost(q)=1000+3q$$ and the demand function is $$\price(q)=500-3q\text{.}$$ Find the maximum profit.

#### 13.

The cost equation for gadgets is $$\cost(q)=1000+2q+.0001q^2$$ and the demand function is $$\price(q)=100/(1+.01q)\text{.}$$ Find the maximum profit.

Solution.
\begin{align*} \profit(q)\amp = \revenue(q)- \cost(q)\\ \amp =q*100/(1+.01q)- (1000+2q+.0001q^2)\text{.} \end{align*}

Assuming that the price should be a positive number does not help us in this problem. We can check, but all we get is that $$q \gt -100\text{,}$$ but $$q$$ should be positive.

If domain restrictions are not obvious or the algebra is challenging we can resort to trial and error. The small coefficients (.0001 for instance) do suggest we have fairly large values for $$q\text{.}$$

#### 16.

Suppose your cost function is $$\cost(q)=10000(0.8)^{.1q}+.1q^2\text{.}$$ Find the quantity that minimizes price.

#### 17.

With rental property, a simplified model of costs spreads the purchase cost over the time that the property is held and assume that repair costs will rise the longer the property is held. This gives a formula for annual expenses as

\begin{equation*} \AnnualExpense(t)=(\Pprice)/t+\RepairFactor*t^r\text{,} \end{equation*}

where $$r$$ is a positive number that depends on the type of property. Assume for carpet cleaners that the replacement cost is $600, that the repair costs in the first year are$50, and $$r=1\text{.}$$ Find the length of time the property should be held to minimize the annual expense.

Solution.

In this instance the Annual Expense function is

\begin{equation*} \AnnualExpense(t)=600/t+50*t^1=600/t+50t\text{.} \end{equation*}

Note that the function is not defined when $$t = 0\text{.}$$ So we will graph the function and the derivative for $$1 \le t \le 10\text{.}$$ The property should be held for 3.5 years.

#### 18.

With rental property, a better model factors in the depreciation of the property and how much can be recovered by selling the property used. If we use a 5 year straight line depreciation the formula becomes

\begin{equation*} \AnnualExpense(t)=(\Pprice*(1-0.2t))/t+\RepairFactor*t^r\text{.} \end{equation*}

Repeat the assumptions from the problem above. Assume for carpet cleaners that the replacement cost is $600, that the repair costs in the first year are$50, and $$r=1\text{.}$$ Find the length of time the property should be held to minimize the annual expense.

#### 19.

The annual sales rate for a new toy is found to be $$\Sales(t)=10000 t^2 \exp(-t^2/16)\text{.}$$ Find the month that maximizes sales.

Solution.

If we are minimizing according to month, we will graph the function for $$1 \le t \le 12\text{.}$$

GoalSeek does not improve our estimate, and we see that the maximum sales must occur when $$t = 4\text{.}$$ The derivative is (close to) 0 there and this means our sales are maximized in April (assuming 1 represents January).

#### 20.

 Production level 1903 2424 3065 3424 4076 Profit $828,560.10$942,625.40 $1,006,167.50$987,980.40 \$929,780.40