You are on page 1of 11
Finding Maxima and Minima When you were learning about derivatives about functions of one variable, you learned some techniques for finding the maximum and minimum values of functions of one variable, We'll ‘now extend those techniques to functions of more than one variable, We'll concentrate on fimetions of two variables, though many of the techniques work more generally, Local Maxima and Minima One of the first things you did when you were developing the techniques used to find the ‘maximum and minimum values of f(z) was you asked yourself Suppose that the largest (or smallest) vale of f(z) is f(a). What does that tell us about a? After a little thought you answered If the largest (or smallest) value of f(x) is f(a) and f is differentiable at a, then f'(a) — 0. Let’s recall what that's true. Suppose that the largest value of f(x) is f(a). Then for all h>0, Path) ~ fla) a ‘Taking the limit h + 0 tells us that. f"(a) > 0, Similarly, for alll h < 0, fla +h) = F(a) p lath) > fla) => fla th) — fla) 20> 0 ifh>o Sla+h) > f(a) => fla+h)— f(a) >0 => <0 ifheo ‘Taking the limit h > 0 now tolls us that /"(a) <0. So we have both f(a) > O and f’(a) <0 which forees s"(a) = 0. You also observed at the time that for this argument. to work, you only need f(x) < f(a) for all 2°s close to a, not necessarily for all 2's in the whole world. (Iu the above inequalities, we ouly used f(a +h) with h small.) So you said If f(a) is @ local maximum or minimum for f(x) and f is differentiable at a, then F(a) =0. Exactly the same diseussion applies to finetions of more than one variable, Here are the corresponding definitions and statements, ‘The point (a,6) is a local maximum of the function f(x,y) if there is an r > 0 such that f(x,y) < f(a,6) for all points (x, y) within a distance r of (a, 6). Similarly, (a,6) isa local minimum of the function f(x, y) if there is an r > O such that f(x,y) > {(a,b) for all points (z,y) within a distance r of (a,2). ‘Local maximum and minimum values are also called extremal values. ‘The point (a, 6) is a critical point of the function f(x,y) © if £0) = (a,b) =0 © or if at least one of the derivatives $£(a,b), $£(a,b) does not exist. ‘Theorem 3. If the fmetion f(x,y) has local maximum or minimum at (a,4) and the partial atives 2£(a,6), 2£(a,h) exist, then af, Or Py (a,b) = (0.5) = 5 Proof. It easy to see that this theorem follows from what we already know about functions of one variable, Suppose that f(x, y) has a local maximum or minimum at (a,D). Define the single variable functions F(x) = f(z,b) Gy) = flay) ‘Thom a is a local maximum or miniznum for the function P(r), so that F(a) = 0, and b is, local maximum or minimum for the function G(y), so that G’(b) = 0. Now we just have to observe that F"(z) is the rate of change of F(x) = f(x,y)|,_, With respect to x when y is held fixed at y = b, which is exactly (2,8). Similarly G'(y) is the rate of change of Gy) = f(x,y)|,- With respect to y when x is held fixed at x =a, which is exactly 3(a, y). ‘Thus oy of, " a,b) = F(a) =0 a,b) = G'(b) = (a, ( (a,b) = G'(b) =0 a ‘Theorem 3 tells us that every local maximum or minimum is a critieal point. Beware that it does not tell us that every critical point is either a local maximum or a local minimum. In fact, we shall see later, in Example 10, a critical point that is neither a local maximum, nor a local minimum, None-the-less, ‘Theorem 3 is very useful beeause often functions have only a small number of critical points. To find local maxima and minima of such functions, wwe only need to consider its critical points. We'll return later to the question of how to tell ifa critical point is a local maximum, local minimum or neither, For now, we'll just prac finding critical points. ‘Example 4 (f(«,y) iy? + De — by + 12) Dry + 2y? + 2x — Oy +12. Solution, As a preliminary calculation, we find the two first order partial derivatives of F(z,y). dry Find all critical points of f(x So(t,y) = 20 —2y +2 Iylesy) = —2e + dy —6 So the critical points are the solutions of the pair of equations 2x —2y +2 = 0, —27+4y—6. ‘or equivalently (dividing by two and moving the constants to the tight hand side) oy=-l (ta) sot 2y=3 (ub) ‘One strategy for solving a system of two equations in two unknowns (x and y) like this is to ‘© First use one of the equations to solve for one of the umkowns in terms of the other unknown, For example (La) tells us that y = 2-+1. ‘This expresses y in terms of x. We say that we have solved for y in terms of ‘¢ Then substitute the result, cease, this gives =x +1 in our case, into the other equation, (1b). In our Art Qrtl)=3 es rt2Q=3 oe ‘© We have now found that g r+ 1=2 is the only solution, So the only critical point is (1,2). An alternative strategy for solving a system of two equations in two unknowns like (1) is to ‘© add equations (1a) and (1b) together. ‘This gives (a) + (1b): (Ae (14 2)y 1+3 => y=? ‘The point here is that adding equations (1a) and (1b) together eliminates the unknown, zr, leaving us with one equation in the unknown y, which is easily solved. For other systems of equations you might have multiply the equations by some numbers before adding them together. '* We now know that y = 2. Substituting it into (1a) gives us r-2=-le ‘© Once again we have found that the only critical point is (1,2). Bxample 4 Example & (f(#,y) = 2x4 — Gry +4? + 4y) Find all critical points of f(x,y) = 2e* — Gry + y? + 4y. Solution. The first order partial derivatives are. Sr= 60? Gy fy= Gr + By 44 So the critical points are the solutions of Gr? —6y=0 — —Or+2y44=0 We can rewrite the first equation as y — 2?, which expresses y as a function of 2, We can then substitute y = 2” into the second equation, giving Gr 2y +4 =O a> Crt 2x? $4=0 ee 2-82 t2=0 es (r—1)(e-2)=0 <=> c=1or2 When x = 1, y = 12 = 1 and when 2 = 2, y= 2 =4. So, there are two critical points: (1), 24) t Example 5 (Example 5 ‘Example 6 (F(.y) Find all critical points of f(x, y) = xy(5x + y— 15). Solution. The first order partial derivatives of f(x,y) = 2y(Sx + y—15) are felz,y) = ylSa+y—15) +xy(5) = yx + y— 15) + (Sx) = y(10r + y— 15) Solty) = a(S2+y—15)+2y(1) = 2(5e+y—15)+2(y) = 2(52 +2y— 15) ‘The critical points are the solutions of f.(z.y) — f,(z.y) —0 or y(lz +y—15)=0 and a(Se + 2y—15)=0 @ ‘The first equation, y(10:r-+y—15) = 0, is satisfied if either of the two factors y, (10z-+y—15) is zero. So the first oquation is satisfied if either of the two equations y=0 (3a) 1r+y=15 (3h) is satisfied. ‘The second equati O, is satisfied if either of the two factors x, (Br + 2y — 15) is zero. So the first equation is satisfied if either of the two equations (4a) (av) is satisfied. So both critical point equations (2) are satisfied if one of (3a), (3b) is satisfied and in addition one of (4), (4) is satisfied, There are four possibilities: (Ba) and (4a) are satisfied if and only if 2 = + (3a) and (4b) are satisfied if and only if y =0, 52+ 2y=15 <=> y=0, 3r=15 ¢ (3b) and (4a) are satisfied if and only if 10r4y=15, 2=0 = y=15, r=0 ‘¢ (3b) and (4b) are satisfied if and only if 10x +y = 15, 5x +2y — 15. We can use, for ‘example, the second of these equations to solve for a in terms of ye ar When we substitute this into the first equation we get 2(15 — 2y) + y can solve for y. This gives —3y = 15 — 30 or y =5 and then x = (15-25) = 1. In conclusion, the critieal points are (0,0), (3,0), (0, 15) and (1,5). A more compact way to write what we have just done is fe(e.y) =0 and = y0r+y—15)=0 and <> fy=0orl0r+y=15} and <= {r=y=0} or {y=0, r=3} or {x pa} Ina certain community, there are two breweries in competition, so that sales of each nega tively affect the profits of the other. If brewery A produces « litres of beer per month and brewery B produces y litres per month, then the profits of the two breweries are given by Qe +y? cry 9, wre pate 2x10" Q respectively. Find the sum of the two profits if each brewery independently sets its own production level to maximize its own profit and assumes that its competitor does likewise, Find the sum of the two profits if the two breweries cooperate so as to maximize that sum, Solution, If A adjusts x to maximize P (for y held fixed) and B adjusts y to maximize Q (for x held fixed) then and y are determined by Pe=2-8-0 = Qu =2— gage =O = => On the other hand if (A,B) adjust (z, y) to maximize P+ Q = 2 + y) — ge (3x? +3) then x and y are determined by (PAQe=2- a0 => aah! (P+Q=2-{e=0 => y= j10" = P+Q=%Ur+y)—gelbr? +37) = = 18(t4 2-2-1) =o! U {(Exanaple T}- J antes 1 Equal angle bends are made at equal distanees from the two ends of a 100 metre long fence s0 the resulting three segment fence ean be placed aloug an existing wall to make an enclosure of trapezoidal shape. What is the largest possible area for such an enclosure? Solution. Hero is a figure of the fence. sind) ou 10a \ ) ‘The area that it encloses is A(x.) (100 — 22)25in 0 +2-4-a5in -arc0s0 (100r — 22°) sind + 2?sin(20) ‘The maximize the area, we need to solve O= A, = (100—4r)siné +rsin(Q0) => (100 — 42) + 20 cas =0 Ag = (10x ~ 22") 080 + 27cos(28) + (100 2r) e080 + x c0s(20) Hore we have nsed that the fence of maximim area cannot have sin — 0 or = 0. ‘The fs extuation forces cas = —!82 and hence cos(24) = 20s? 0—1 — 00-12" 1, Substituting ‘these into the second equation gives (100-25)! Ae , fH =A] _g == (100 2r)(100 ~ 4x) + (100 ~ 4)? — 22" = 0 = — 200 = 0 — 00 loos ~ rag 200/38 and the maximum area enclosed is 100 100%) vF__ 1100" ¥F 2500 (oP 255) + ae U (Example 8} Example § Banned An experiment yields data points (x;,y,), i= 1,2,-++ .n, We wish to find the straight line y=ma-+b which “best” fits the data, The definition of “best” is “minimizes the root mean square error”, ic. minimizes E(an,b) = (mex + bw)? Find m and &. Solution. We wish to choose rm and b so that FE Sato hdr =m Sa] +H Z 20] ~ [Fa 0 [E>] ‘There are a lot of symbols here, But remember that all of the 2,’s and y's are given constants. ‘The only unknowns are m and 6. To emphasize this, and to save some writing, define the constants Fe —PpMenevsd—w) =m[ Hae] «of 5a Bx Lm Se Sat Say Soe ‘The equations are (after dividing by two) Sam+S.b=S., (6a) S, (ob) S,m+nb ‘These are two linear equations on the unknowns m and 6. They may be solved in any of the usial ways, One is to use (5b) to solve for b in terms of rm b= (5) Sim) (6) and then substitute this into (5a) to get the equation Same ts, (S)—Sen) = Sy > (nSps — $2) = Sey — Sey for m. We can then solve this equation for m and substitute back into (6) to get 6. This gives Antrwy t sv the tins i nla) 8465): [uSie— 8] t —S.(6a) + S.0(50): [nSi»— $2] nite gives he same solution, ‘The Second Derivative Test Now let's start thinking about how to tell ifa critical point is @ local minimum or maximam, First here is an example which shows that sometines critical points are neither local muiuiua, ‘The first partial derivatives of f(x,y) = 2” — y? are fo(x,y) = 2e and fy(x,y) = —2y. So the only critical point of this fimetion is (0,0). Is this a local minimum or maxinmanr? Well Jet's start with (x, y) at (0,0) and then move (x,y) away frou (0,0) and see if f(x,y) gets Digger or smaller. At the origin f(0,0) = 0. Of course we ean mave (2,y) away from (0,0) in many different directions. Lot's start by moving (2,y) along the z-axis. ‘Then (x,y) = (2,0) and f(x,y) (2.0) So when we start with x = 0 and then Inerease x, the value of the function f increases — which means that: (0,0) cannot be a local maximum for f. © Now let's move (,y) away from (0,0) along the y-axis. ‘Then (x,y) = (0,y) and Flo.) = F(0,y) = —y*. So when we start with y = and then inerease y, the value of the function f decreases — which means that (0,0) cannot be a local minimum for f. So (0,0) is neither a local minimum or maximum for J. It is called a saddle point, because the graph of f looks like a saddle. (The full definition of “saddle point” is given immediately after this example.) Here are some figures showing the graph of f. J and the level curves of J. Observe from the level curves that # F increases as you leave (0,00) walking along the x axis F docreases as you leave (0,0) walking along the yy axis fs) s-1\ 4-1) \ Example 10 ‘The point (a, 4) is called a saddle point for the function f(x,y) if, for each r > 0, ¢ there is at least one point (x,y), within a distance r of (a,6), for which f(e.y) > (a,b) and © there is at least one point (x,y), within a distance r of (a,0), for which S(a.y) < f(a,b). So how do you tell if a critical point is a local minimum, local maximum or saddle point? ‘Well let's remember what. happens for functions of one variable. Suppose that « is a critical point of the function f(x). Auy (sufficiently smooth) function is well approximated, when 2 is clow to a, by Sle) = fla) + f(a) (e— a) +45") (2 — a? + £f (a) (— a) + As wis a critical point, /'(a) =0 and F(x) = fla) + $f"a) (2a)? + $f(a) (ea) + Tf f(a) £0, f(x) is going to look a lot Hike f(a) + 4f"(a) (x — a)® when «is really close to «a, In particular if /"(a) > 0, then we will have f(2) > f(a) when » is clase ta (but not equal to) a, so that a will be a Jocal aninimurn aud 2 if f(a) <0, then we will have f(x) < f(a) when 2 is close to (but not equal to) a, so that a will be a local maximum, but + if f%(a) =0, then we cannot draw any conclusions without more work. bles. Define A similiar, but messier, analysis is possible for functions of two va D(x,y) = fesltsy) Sayles) — foylesy? 1 is called the discriminant of J. ‘Then the second derivative test for functions of two variables is ‘Theorem 12 (Second Derivative Test). Let r > 0 and assume that all second order derivatives of the function f(x,y) are continions at all points (x,y) that are within a distance r of (a,5). Assume that ‘fr(a.b) = f,(a,b) =0. Then # if D(o,P) > and fax(a,2) > 0, then f(x,y) has a local minimmam at (a,b), if D(a,b) > Oand f,,(a,6) <0, then f(x,y) has a local maximum at (a,b), # if D(a,0) <0, then f(x,y) has a saddle point at (a, 6), but ¢ if D(a,b) =0, then we cannot draw any conclusions without more work. You might wonder why, in the local maximum /loeal minimum cases of this theorem, f,(a,6) appears rather than fyy(a,d). The answer is only that « is before y in the alphabet. You ean se fiy(a,b) just as well as fer(a,b). ‘The reason is that if D(a, 6) > 0 (as in the first ‘two bullets of the theorem), then because D(a,8) = fee(a.6) fyy(a,5) — fey(a,b)? > 0, we necessarily have fre(a,B) fyy(asb) > 0 90 that fap(a,0) and fyy(a, 6) must have the same sign — either both are positive or both are negative. You might also wonder why we cannot draw any conclusions when D(a, happens then. The second derivative test for functions of two variables is derived in precisely the same way as the second derivative test for functions of one variable is derived — you approximate the function by a polynomial that is of degree two in (x —a), (y— 6) and then you analyze the behaviour of the quartatic polynomial near (a,}), For this to work, the contributions to f(x,y) ftom terms that are of degree two in (x — a), (y— 6) had better be bigger than the contributions to f(r,y) from terms that are of degree three and higher in (x— a), (y—8) when (x — a), (y 8) are really small. If this is not the case, for example when the terms in f(x,y) that are of degree two in (x — a), (y ~ 6) all have coefficients that are exactly zero, the analysis will certainly break down, That's exactly what happens when D(a,b) =0. Here are some examples, The finetions Ailey) By filey)= at yt all have (0,0) as the only critical point. The first, f has its minimum there. The second, fs, has its maximum there, ‘The third and fourth have a saddle point there. fay fry) = Sy! falru) (—{aanmple 18. (P(e) = 2 By 6+ 49)) Find and classify all critical points of f(x,y) = 2x” — Gry + y? + dy. Solution. The partial derivatives, of order up to two, are fae" — bry + y? dy fe= Or? — by fo fy= Ort 244 fyy ae Sy Sur (Of course, fey and fis have to be the same, It is still useful to compute both, as a way to cateh some mechanical errors.) We have already found, in Example 5, that the critieal po are (1,1) The classification is iat SS tev [fn [re (11) [12%2-(6P <0 saddle point (2.4) [24x 2— (62 >0] 24 | local min t (Frampie 13} J ew (Example 14 (fe, y) = aye ty — )) Find and classify all eritieal points of f(x,y) = zy(S2 + y — 15) Solution. We have already computed the first order partial derivatives Sola.) = y(10r + y ~ 15) of f(x,y) in Example 6. ‘The secoud order derivatives are fex(z,y) = 10y 1)(10r + y— 15) + y(1): 10r 4 2y— 15 I)(Gx + 2y — 15) + 2(5)= Wr + 2y— 15 (Once again, we have computed both fay aud fye tO guard against uiechanieal errors.) We have already fond, in Example 6, that the critical points are (00), (0,15), (3,0) and (1,5). ‘The classification is ee | fefw-F [ fee | type (0,0) | 0x 0-(-15)? <0 saddle point (0.15) | 150% 0— 15 <0 saddle point (8.0) | 0x61 <0 saddle pt (5) | 5x2 #50 local min Example 14

You might also like