Maximum along the boundary continued: Lagrange multipliers So now let's find this maximum point. Here's our function, f(x, y). And we know thatat the maximum point, this is true: The partial derivatives of f are equal to 0. And sowe're going to use this to compute where the maximum point is. So at the maximumpoint, now we have an equation: (2x - 4)y + 2x = 0. We have “lambda”, which is justa constant coefficient times “grad'” g times 2y over lambda times x. When we see an equation about vectors, it means that the first component is thesame and the second component is the same. In other words, it's really twoequations. One is 2x minus 4 equals lambda times 2x, and the second is negative 2yplus 2 equals lambda times 2y.We have two equations which involve three variables, x and y and lambda. Wewould like to find information about x and y by combining these equations into oneequation that only has x or y in it. To solve this equation, we could use the formula x+ y = 4 to eliminate the lambda variable. Then we can plug that into xy = 5; there willbe no lambdas. We'll have only one equation about x and y.Suppose we use the first equation to solve for lambda. If we divide by 2x minus 4,we get that lambda is negative 2x over 2x minus 4. Then, we can plug that into thesecond equation, and you get something that looks a little bit messy. Negative 2yplus 2 is lambda, so that's negative 2x over 2x minus 4 times 2y.
The equation looks a little bit messy, but it's an equation about x and y. Thisinformation can be used to find x and y. We just have to simplify this thing. So thefraction is a little bit unpleasant. So we multiply both sides by that, and we get 2xminus 4 times negative 2y plus 2 is negative 2x times 2y. Then we expand andregroup all the terms. If I expand out this product, the one term we get is (2x)(-2y). And that exactlymatches (-2x)(2y) over here. So when we subtract this off, those cancel. And thatleaves something simpler. And then what's left is y+4x=2, which we might as welldivide through. So y+x=2 is the equation of a line. So we drew that line and it lookslike this. The point where the line 2y + x = 2 intersects the circle of radius 2 is the maximumpoint. We can illustrate this concept with a picture. The red circle is the boundary ofthe region R, and R is inside that circle. The blue line in this picture is our line y = x +2, which we just graphed, and its intersection with the circle at (2, 4) is where themaximum occurs. The formula for finding the maximum point is y = 2x + 2. This equation will besatisfied when x equals 4. The maximum point will also be on the boundary of R, sowe have two equations and two unknowns. Solving them, we find (x, y) = (4, 2).There was a diagram that showed a circle and a line intersecting. This is the pointwhere the circle has the greatest distance above the line. We can see that the twoequations intersect at two points, where the line and boundary intersect. The first equation is a line that looks like this. The second equation is the circle. Andif we take those two equations together, we get the two intersection points: the one
here and the one there. We want to know where the maximum is. And so therefore, itmust be this point. If you didn't know that, you could plug in these two points and seewhich one is bigger. At these two points, the gradients of f and g are parallel. The gradient of g is goingthis way and the gradient of f is going that way. They're exactly opposite each otherand this point is where the function f has its minimum because everything that wesaid about maximums it's equally true for minimums and so if you had followed theexact same thought process to find the minimum you would again get these twopoints, and this is the smaller one. The method described here works for any function f in any region. The general setup is to take any function f and any curve c, and the curve happensto be the boundary of a region. Our curve happened to be a circle before but thatwasn't important. We described c as a level curve with g of (x, y) equals h. If we wantto find the maximum of f on the curve c, it happens at a point where the gradient of fis pointing in the same direction as the gradient of g. And this works just as well forany curve.