Chapter 7 Optimization One of the most important applications of the derivatives is in the optimization of a quantity. In realworld applications, a quantity will often need to be maximized or minimized. For example, a manufacturing company may need to know what level of production will yield the maximum profit for the company. A doctor may need to find out the minimum dose of a drug that will effect to her patient. A farmer may be interested in finding the right dimension of his pasture in order to maximize the area or to minimize the cost. Before we start to solve these real-world problems, we need to learn how to locate the absolute (global) maximum and the absolute (global) minimum of a function. . Recall that a relative (local) maximum or a relative (local) minimum value of a function is a larger or smaller value compared with nearby function values. However, an absolute maximum of a function is the largest value in its domain. Similarly, an absolute minimum is the smallest value in its domain. A precise definition of the absolute extrema (absolute maximum and absolute minimum) of a function follows. Table 7.1 Definition of Absolute Extrema If f (c) f ( x) for all x in the domain of f , then f (c) is called the absolute maximum value of f. If f (c) f ( x) for all x in the domain of f , then f (c) is called the absolute minimum value of f. Absolute Extrema on a Closed Interval The following theorem guarantees the existence of the extrema of a function that is continuous on a closed interval [a, b]. Table 7.2 Extreme Value Theorem If a function is continuous on a closed interval [a, b], then the function must have both an absolute maximum and an absolute minimum on [a, b]. Figure 7.1 Absolute Extrema on a Closed Interval ● Relative maximum ● Absolute maximum ● Relative minimum ● ● Absolute minimum a b From Figure 7.1, we see that if a function is continuous on a closed interval [a, b], then the extreme value of f occurs either at a relative extreme or at one of the endpoints of the interval [a, b]. To find the absolute extrema, or optimize the function, we take the following steps. Table 7.3 Steps for Locating the Absolute Extrema of f on [a, b] If f is continuous on [a, b], then to find the absolute extrema of f on [a, b], 1. Find all the critical values in (a, b). 2. Evaluate f(x) at the critical values and at the endpoints a and b. 3. The largest value found in step 2 is the absolute maximum of f on [a, b], and the smallest value found in step 2 is the absolute minimum of f on [a, b]. Example 7.1 Find the absolute extrema of f ( x) 2x3 3x2 12x on each interval: [-4. 2] and [-1, 2]. Solution Since f is a polynomial, f is continuous on each of the intervals. The Extreme Value Theorem guarantees both maximum and minimum values on each of the intervals. Let us find them by following the steps in Table 7.3. Step 1. Find all critical values in (a, b). f ( x) 2 x3 3x 2 12 x f '( x) 6 x 2 6 x 12 6( x 2 x 2) 6( x 2)( x 1) The first derivative is zero when x = -2 and x = 1. Hence, f(x) has two critical values: x = -2 and x = 1. Step 2. Evaluate f(x) at the critical values and at the endpoints a and b. Both critical values lie in the interval (-4. 2), so we need to compare four values: f (4) , f (2) , f (1) , and f (2) : x -4 -2 1 2 The left endpoint The critical values The right endpoint f(x) -32 20 -7 4 The absolute minimum of f The absolute maximum of f Step 3: In the above table, the largest number is 20 and the smallest number is -32. The absolute maximum value of the function on [-4, 2] is f (2) 20 , and the absolute minimum value of the function on [-4, 2] is f (4) 32 . Figure 7.2 confirms our answer. Figure 7.2 Absolute Extrema of f on [-4, 2] (-2, 20) (-4, -32) Only one critical value, -2, lies in the interval [-1, 3], so we need to compare three values: f (1) , f (2) , and f (3) : x f(x) The left endpoint -1 The critical values 1 13 -7 The absolute minimum of f The right endpoint 3 45 The absolute maximum of f The absolute maximum is 45 and occurs at x = 3. The absolute minimum is -7 and occurs at x = 1. See Figure 7.3 Figure 7.3 Absolute Extrema of f on [-1, 3] (3, 45) (1, -7) Absolute Extrema on an Open Interval The Extreme Value Theorem guarantees that a continuous function on the closed interval [a, b] has an absolute maximum and an absolute minimum on [a, b]. However, what if the function is continuous on an open interval (a, b) (excluding its endpoints), or on the entire real line which has no endpoints? Figure 7.4 demonstrates that a function that is continuous in an open interval may or may not have an absolute extrema. Figure 7.4 ○ b a ○ No absolute extrema on (a, b). Absolute maximum and absolute minimum exist on (∞, ∞). Absolute minimum exist, no absolute maximum on (∞, ∞). One of the best methods to find the absolute extremes of a continuous function on an open interval is to find values of the function at all the critical values and sketch the graph (See Chapter 6—Curve Sketching). However, if the function has only one critical value in the interval, the following Second Derivative Test can quickly find the absolute extreme of the function. Table 7.4 Second Derivative Test When f is continuous on an interval I and c is the only critical value in I. 1. If f ''(c) 0 , then f(c) is an absolute minimum of f on I. ( 2. If f ''(c) 0 , then f(c) is an absolute maximum of f on I. ) ( c ) c 3. If f ''(c) 0 , then the test fails. The Second Derivative Test may be used on any interval (closed, open, or half-closed) that contains only one critical value. Example 7.2 Find the absolute extreme on the interval (0, ∞) for f ( x) 2xe.2 x . Solution To find the absolute extreme of a function, we first need to find the critical values. f '( x) 2e.2 x 2 xe.2 x .2 2e.2 x (1 .2 x) Product rule and Chain rule Factor out 2e.2 x If f '( x) 0 , then 2e.2 x (1 .2x) 0 . Since e.2 x is always bigger than zero, we find that 1 .2 x 0 , or x = 5. Thus, f(x) only has one critical value in (0, ∞). Also f ''( x) 2e.2 x (.2) 2e.2 x (.2) 2 xe .2 x (.2) 2 2e.2 x (.2)[1 1 x(.2)] .4e.2 x (2 .2 x) f ''(5) .4e.25 (2 .2 5) .4e1 and e1 0 , we have f ''(5) 0 . Using the Second Derivative Test, the function has an absolute maximum at x = 5, and the absolute maximum value is f (5) 3.679 . See the following figure. Figure 7.5 Graph of f ( x) 2xe.2 x (5, 3.679) f ( x) 2xe.2 x Applications We now turn our attention to illustrate how calculus can be used to solve real-world optimization problems. Example 7.3 Maximizing Area Lisa has 50 yards of fencing with which she wants to fence in three sides of a rectangular vegetable garden. The wall of the house will form the fourth side. Find the dimensions of the rectangle such that the largest garden Lisa can fence. Solution In order to get an idea of what is happening, Lisa might draw several rectangles that each use 50 yards of fencing. Figure 7.7 (not to scale) shows three possible plans of her garden. Figure 7.6 14 18 30 16 16 10 10 House House Area 10 30 300 yards2 18 18 House Area 16 18 288 yards2 Area 18 14 252 yards2 Unfortunately, there are infinitely many rectangles like those above. How can Lisa find which one has the greatest area? Figure 7.7 illustrates a general rectangle with x as the width and y as the length (in yards). The phrase “largest garden” indicates that our object is to maximize the area, A, which is the product of width and length. Hence, our objective equation is A x y . However, Lisa only has 50 yards of fencing, so we have the constraint equation 2 x y 50 . Figure 7.7 y x A Hous e x Therefore, our optimization problem can be formulated as: A x y 50 2 x y Objective Equation Constraint Equation We cannot maximize A directly from the objective equation, because A is a function of two variables. But from the constraint equation, we find y 50 2 x . By plugging y 50 2 x into the objective equation, A is given as a function only of x: A( x) x (50 2x) 50x 2x2 , 0 x 25 Note that the domain of A(x) will be [0, 25] (otherwise A 0 ). Now, we can use the techniques we learned from this chapter to maximize A(x). A '( x) 50 4 x A ''( x) 4 0 From A '( x) 0 , we find the critical value, x = 12.5, (only one) and that A ''( x) 0 for all x (A(x) is always concave up). Therefore, A(x) will attain its absolute maximum at x = 12.5. Replacing x by 12.5 in y 50 2 x , we find y = 25. Thus, if Lisa chooses the following dimensions: x 12.5 yards y 25 yards the garden will attain the largest area: A x y 12.5 25 312.5 yards2 . There are several alternative ways to determine the absolute extreme. In this problem, because A(x) is continuous on the closed interval [0, 25], the maximum value of A exists and must occur either at a critical value or at an endpoint of the interval by extreme value theorem. Since both A(0) and A(25) = 0, A(12.5) = 312.5 must be the absolute maximum of A(x). Also, since A '( x) 0 for all x < 12.5, means A(x) is increasing for all x < 12.5, and A '( x) 0 for all x > 12.5, means A(x) is decreasing for all x >12.5, A(12.5) must be the absolute maximum value of A. This is called the first derivative test for absolute extrema. From algebra, we know that A( x) 50 x 2 x2 is a quadratic function. See Figure 7.8. Figure 7.8 Graph of A( x) 50 x 2 x2 (12.5, 312.5) For a quadratic function f ( x) ax2 bx c , f(x) has an absolute maximum value at x b if a 0 . In 2a this case, x 50 12.5 and A(12.5) 312.5 . This is the same answer we achieved using calculus. 2(2) It is not possible to give an explicit procedure for solving optimization problems; However, Example 7.3 suggests a useful procedure. Table 7.5 Suggestions for Solving Optimization Problems Steps: In Example 7.3: 1. Sketch a picture, if possible. Identify the unknowns with a symbol. Let x be the width and y be the length of the garden. 2. Decide which quantity Q is to be maximized or minimized. The area of the garden, A, is to be maximized. 3. Determine the objective equation that expresses Q as a function of the variables involved in the problem and the constraint equation(s) (if any) that expresses limitations on related variables. Objective equation: A x y Constraint equation: 2 x y 50 4. Use the constraint equation to simplify the objective equation in such a way that Q becomes a function of only one variable. Find the domain of this function. A is a function only for x: A( x) x (50 2x) 50x 2x2 , 0 x 25 5. Find the absolute maximum (or minimum) of the objective function by using the techniques we have learned with derivatives. 6. Answer the question in the problem. Example 7.4. Minimizing a Surface See details from last page. If Lisa chooses the dimensions: x 12.5 yards and y 25 yards , the garden will attain the largest area: A = 312.5 yards2. A large soup can is to be designed so that the can will hold 50 cubic inches (about 28 ounces) of soup. Find the dimensions that will minimize the cost of the metal to manufacture the can. Solution Let us follow the suggested steps in Table 7.5. Step 1. Sketch a picture and identify the unknowns. Figure 7.9 2π r r h h r Side unrolled Step 2. Let S be the total surface area of the cylinder (top, bottom, and side). In order to minimize the cost of the metal, we need to minimize the total surface of the cylinder S. Step 3. The objective equation is S top + bottom + side r 2 r 2 2 r h . 2 r 2 2 rh The volume of the can must be 50 cubic inches, so the constraint equation is 50 r 2 h . Therefore, our optimization problem can be formulated as: S 2 r 2 2 rh Objective Equation 50 r h 2 Constraint Equation Step 4. To eliminate one variable from the objective equation, solve for h in terms of r using the 50 constraint equation. Since h 2 , we can substitute this into the expression for S to get r S (r ) 2 r 2 2 r 50 r2 2 r 2 100 r r 0 Note that r cannot be zero, otherwise S(r) will be undefined. Moreover, in order to make a real can, r must be positive. Step 5. Find the minimized surface of the can using calculus. To find the critical values, rewrite S(r) as S (r ) 2 r 2 100 r -1 and differentiate it: S '(r ) 4 r 100 r2 100 25 , so the only critical value is r 3 2 . For any r > 0 2 r 200 25 S ''(r ) 4 3 0 (S(r) is always concave up), S(r) has an absolute minimum at r 3 2 . The r 25 value of h corresponding to r 3 2 is Then note that S '(r ) 0 when 4 r h 50 50 25 253 25 3 2 2 2 3 2r 4 2 2 2 3 2 3 3 25 25 25 r ( ) ( ) ( ) Step 6. Answer the question in the problem. To minimize the cost of the can, the radius should be r 3 25 2 inches, and the height should be twice the radius: 4 inches. Example 7.5 Maximizing Revenue and Profit A company manufactures and sells x DVD players per week. Assume that the weekly cost and demand equations are C ( x) 20 x 10,000 p( x) 100 .01x 0 x 10,000 (a) Find the maximum revenue, the production level that will maximize the revenue, and the price that the company should charge for each player to maximize the revenue. (b) Find the maximum profit, the production level that will maximize the profit, and the price that the company should charge for each player to maximize the profit. Solution (a) The revenue received for selling x players at $p per player is R x p . Our object is to maximize R while satisfying the price equation, p( x) 100 .01x . So the mathematical problem is R x p p ( x) 100 .01x Objective equation Constraint equation We should start with substituting p(x) into R, R( x) 100x .01x2 Now 0 x 10,000 R '( x) 100 .02 x R ''( x) .02 0 By setting R '( x) 0 , we have 100 .02 x 0 or x = 5000. Since x = 5000 is the only critical value for R(x) and the second derivative is a negative constant, R(x) has an absolute maximum when x = 5000 and the maximum revenue is R(5000) 100 5000 .01 (5000)2 $250,000 To realize the maximum revenue, the price should be p(5000) 100 .01 5000 $50 . (b) The profit received for selling x players is the difference between the revenue and the cost: P( x) R( x) C ( x) (100 x .01x 2 ) (20 x 10,000) 80 x .01x 2 10,000 Now we find P '( x) 80 .02 x P ''( x) .02 0 By setting P( x) 0 , we have x = 4000. Since x = 4,000 is the only critical value and P ''( x) 0 for all x, P(x) will be maximized when x = 4000. By finding P(4000) $150,000 and p(4000) 100 .01 4000 $60 , we know that if the company produces 4,000 players and sold each one for $60 each week, the maximum weekly profit will be $150,000. From the results of (a) and (b), we notice that the maximum revenue and maximum profit don’t occur at same production level. We also note that profit is maximized when P '( x) R '( x) C '( x) 0 or R '( x) C '( x) Thus profit is maximized at a production level for which the marginal revenue equals marginal cost (the slopes of the two curves are the same at this point). See the following figure. Figure 7.10 m = 20 C ( x) 20 x 10,000 Maximum profit Maximum revenue Example 7.6 R( x) 100x .01x2 Maximizing Sustainable Harvest A farmer estimates from past records that if 20 pecan trees are planted per acre, each tree on average will yield 78 pounds of nuts per year. For each additional tree planted per acre (up to 10), the average yield per tree drops 3 pounds due to overcrowding. How many trees should be planted to maximize the yield per acre? What is the maximum yield? Solution Let x be the number of pecan trees the farmer should plant per acre and y be the yield per tree. Then, the yield per acre, denoted as Y, will be Yield per acre = (Total number of tree per acre) (Yield per tree) Y x y Since each additional tree per acre causes the yield to drop 3 pounds per tree, the yield per tree, y, is a linear function of the number of trees per acre. Using the point-slope formula of a line with the point (78, 20) and the slope -3, we have y 78 3( x 20) or y 3x 138 Therefore, our optimization problem will be Y xy y 3 x 138 Objective equation Constraint equation Plugging the constraint equation into the objective equation, the objective equation is reduced to a function only of x: Y ( x) x (3x 138) 3x 2 138 x 0 x 30 Now we must find x such that Y(x) will be maximized. Since Y '( x) 6 x 138 Y ''( x) 6 0 for all x Y(x) has only one critical value when x = 23. The second derivative test implies that if 23 trees are planted per acre, the yield will be maximized with a value of Y (23) 1,587 pounds per acre . Inventory control is a very important question for many companies. For example, a furniture store expects to sell 700 sofas next year. The manager faces the following problem: How often should she order sofas, and how large should each order be to meet customer demand at all times and to minimize the cost of delivery and storage at same time? In such problems, we assume that the sofas sell steadily throughout the year and the new order arrives when the stock is depleted. The manager could decide to order all 700 sofas at the beginning of the year. This would certainly minimize the delivering cost but would result in very large storage cost. At the other extreme, she could order 2 sofas (assume the store opens 350 days per year, then 700 / 350 = 2) daily. This would minimize the storage cost but would result in very large delivery cost. Between these two extremes, she could order these sofas at any times with different lot sizes. The inventory throughout the year would look like the graph as follows. See Figure 7.11. Figure 7.11 Inventory 700 Inventory Average number in storage 350 Average number in storage 87.5 350 175 12 months One order of 700 sofas 3 6 9 12 months Four orders of 175 sofas Let’s determine the best lot size that minimizes the total inventory cost in Example 7.7. Example 7.7 Minimizing Inventory Costs A furniture store expects to sell 700 sofas next year. The cost for each delivery is $450 (a fixed cost per delivery), and the storage cost for each sofa per year is around $30. How large should each order be and how often should be ordered per year in order to minimize the inventory costs? Solution Let x be the number of sofas in each order and y be the number of orders. Assuming that each shipment arrives just as the previous shipment has been sold, then the average number of sofas in store is x/2 over a year. See Figure 7.12. Figure 7.12 Inventory x Average number in storage x 2 1st order arrives 2nd order arrives 3rd order arrives Since it costs $30 to store a sofa, the total storage cost is 30 x , and each delivery costs $450, the total 2 delivery cost is 450y . Thus the total Inventory Cost = delivery cost + storage cost x C = 450 y 30 2 The store expects to sell 700 sofas in a year, so the constraint equation is xy 700 . Our mathematical problem is x C = 450 y 30 Objective equation 2 xy 700 Constraints equation C is a function of two variables, but from the constraints equation, we find y 700 . Substituting into the x objective equation gives C ( x) 450 700 15 x 315000 x 1 15x x Now, C is a function only of x C '( x) 315000 x 2 15 Setting C '( x) 0 , we can solve it for x: 315000 15 x2 0 x 700 315000 15 0 x2 315000 15 x2 x 315000 144.9 15 - 144.9 is not a critical value, since 0 x 700 , leaving x = 144.9 as the only critical value of C(x). Next, we find C ''( x) 630000 0 The second derivative test implies that C(x) has an absolute maximum at the critical point x = 144.9 . Since x represents the lot size, we round to the nearest integer 145. If there are 145 sofas per order, the yearly total of 700 sofas would need 700 /145 4.83 5 orders per year. Therefore, to minimize inventory costs, the store should place 5 orders throughout of the year with 145 sofas per order. In fact, if the store place 5 orders a year with 140 sofas per order, then 140 5 700 . The difference is due to roundoff mistakes. Sample Quiz 1. Find the absolute extrema of f ( x) 3x4 4x3 12 x2 10 on [-3, 2] if they exist. 2. Repeat the above problem for the interval [-1, 1]. 3. Find the value(s) at which f ( x) x2 2 attains absolute extreme on (-∞, ∞). 4. The quantity of a drug in the bloodstream t hours after injection is given, in mg, by Q(t ) 50(et e3t ) When is the maximum quantity of the drug in the bloodstream? 5. A farmer wants to fence in a rectangular pasture adjacent to a river. The pasture must contain 180,000 square yards in order to provide enough grass for the herd. What dimensions should the farmer choose to minimize the cost of fencing if no fencing is needed along the river? 6. At a price of $50 per person for a day trip, the company attracts 200 tourists. For every $1 decrease in price, an additional 5 tourists are attracted. What price should the company charge to maximize the revenue? 7. The total cost C(x) of producing x products is given by C( x) 0.02x2 0.9x 5000 How many products should the company produce in order to minimize the average cost (Hint: the average C ( x) cost, C or AC, is defined as C ). x 8. A restaurant sells x hamburger per week. Assume that the weekly cost and demand equations are C ( x) 1.1x 300 p( x) 5 .003x 0 x 1000 Find the number of hamburgers that the restaurant should sell and the price that the restaurant should charge for each hamburger to maximize the profit. 9. A box with an open top is to be constructed from a square piece of cardboard, 5 ft wide, by cutting out a square from each corner and folding up the sides. What should x be to maximize the volume? x x 5 5 10. A local garage estimates using the past records that 2000 tires will be steadily needed next year. The delivery cost for each shipment of tires is $250 and the cost of storing each tire for a year is about $9. Assuming that each shipment of tires is used up before the next shipment arrives, determine how many orders the garage should place next year and how many tires should be in each shipment in order to minimize the delivery and storage cost. Answer to Sample Quiz 1. absolute maximum is f(2) = 42, absolute minimum is f(-2) = 22 2. absolute maximum is f(0) = 10, absolute minimum is f(-1) = 3 3. absolute minimum at x = 0, no absolute maximum 4. 0.55 hours. About half of an hour. 5. 600 yards × 300 yards 6. $45 7. 500 8. x = 650, price is $3.05 9. x = 5/6 ft 10. The garage should place 6 orders a year with 333 tires in each shipment.