WEBVTT mathematics/multivariable-calculus/hovasapian
00:00:00.000 --> 00:00:04.000
Hello and welcome back to educator.com and Multivariable Calculus.
00:00:04.000 --> 00:00:09.000
So, the last lesson, we introduced the method of Lagrange multipliers, we did a couple of basic examples.
00:00:09.000 --> 00:00:18.000
In this lesson, we are just going to continue doing examples to develop a sense of how to handle this method of Lagrange multipliers.
00:00:18.000 --> 00:00:25.000
Again, there is nothing particularly difficult about the method, it is pretty straight-forward. The difficulty is solving the simultaneous equations.
00:00:25.000 --> 00:00:36.000
Because there is a lot going on, on the page, there are different cases when this equals 0, when this does not equal 0... so there are lots of things to keep track of.
00:00:36.000 --> 00:00:45.000
These examples are going to be slightly more complicated, they are going to be handled the same way, they are just going to look like there is a lot more going on.
00:00:45.000 --> 00:00:51.000
In some sense that is true, in some sense that is just the nature of Lagrange multiplier problems.
00:00:51.000 --> 00:00:57.000
In any case, let us just jump right on in and see what we can do.
00:00:57.000 --> 00:01:05.000
Okay. So, the first example. Example 1.
00:01:05.000 --> 00:01:30.000
Find the point on the surface z² - xy = 1, closest to the origin.
00:01:30.000 --> 00:01:37.000
Notice in this particular problem, they only gave us 1 function, and they just said closest to the origin.
00:01:37.000 --> 00:01:47.000
This is an example of a Lagrange multiplier or a max/min problem where we have to extract information, come up with another function for ourselves whether it is f or g, depending on which one.
00:01:47.000 --> 00:01:56.000
Right now, we are not quite sure which one is f and which one is g. So, find the point on the surface closest to the origin.
00:01:56.000 --> 00:02:14.000
Well, distance from the origin is just the distance function. So, distance... I will write it out, that is not a problem... so distance = x² + y² + z², all under the radical.
00:02:14.000 --> 00:02:24.000
As it turns out, we want the point that is closest to the origin, but the point has to be on this surface.
00:02:24.000 --> 00:02:36.000
As it turns out, this is f, right here, and this is g. That is the constraint. We want to minimize, in other words, this function subject to this constraint.
00:02:36.000 --> 00:02:50.000
Well, fortunately, since we are dealing with the distance function, if we minimize this square root function, it is the same as... we can also minimize the square of that: x² + y² + z².
00:02:50.000 --> 00:02:56.000
I do not want to deal with the square root, so I will just instead of minimizing this, I am just going to minimize the function.
00:02:56.000 --> 00:03:04.000
This is actually going to be my f, right here, and this is going to be my g.
00:03:04.000 --> 00:03:23.000
Let us go ahead and form what it is that we actually form. We want to form the gradient of f, we want to set it equal to λ × the gradient of g, λ is our Lagrange multiplier.
00:03:23.000 --> 00:03:33.000
Again, so we are going to have this set of equations and our constraint, which is going to be z² - xy - 1 = 0.
00:03:33.000 --> 00:03:42.000
It is always going to be the constraint as a function set equal to 0. That is our other equation.
00:03:42.000 --> 00:03:50.000
Now, we have to satisfy all of these simultaneously. Okay, let us just go ahead and take care of this.
00:03:50.000 --> 00:04:05.000
So, the gradient of f, let us see... gradient of f, that is equal to... well, gradient of f is going to be 2x, 2y, and 2z.
00:04:05.000 --> 00:04:15.000
That is going to equal... actually, let us just go ahead and do the gradient separately and then we will set it equal to each other.
00:04:15.000 --> 00:04:28.000
The gradient of g is going to equal -y, that is df/dx, -x, that is df/dy, and 2z, that is df/dz of g.
00:04:28.000 --> 00:05:06.000
Now, we set them equal to each other with the λ, so what we have is 2x, 2y, 2z is equal to... let me do this systematically, I do not want to get too far ahead of myself here... λ × -y, -x and 2z, which is equal to -λx, -λy, and 2λz.
00:05:06.000 --> 00:05:20.000
Okay. There we go. Now, let us go to blue. This and that is one equation, this and that is another equation, this and that is a third equation, and of course we have our fourth equation. Those are our four equations and four unknowns, x, y, z, and λ.
00:05:20.000 --> 00:05:28.000
Again, four equations and four unknowns. It is a bit much, but hopefully we should be able to work it out.
00:05:28.000 --> 00:05:59.000
Let us see what we have got. One thing that we want... let me actually write out the equations here so that we have them in front of us... so, 2x = -λx... I am sorry, oops, I got these reversed, my apologies... this is -y, so this is y and this is x. There we go, that is a little bit better.
00:05:59.000 --> 00:06:14.000
So, 2x = -λy. There you go, you can see it is very, very easy to go astray in these problems if you are not keeping track of every little thing.
00:06:14.000 --> 00:06:35.000
So, -y and then we have 2y = -λx, and we have 2z = λ × 2z. Let us go ahead and actually write the other equation... z² - xy - 1 = 0.
00:06:35.000 --> 00:06:53.000
Those are our four equations. Okay. So, let us just take a look at this for a second, and see how to proceed. One of the possibilities here is... well, one thing we know, we know that λ is not going to be 0. Let us exclude this possibility.
00:06:53.000 --> 00:07:19.000
λ is definitely not going to be 0 because this would imply, if λ is 0, that means 2x = 0, 2y = 0, 2z = 0, because that would imply that x, y, and z equals 0, 0, 0, but 0, 0, 0, does not satisfy this equation.
00:07:19.000 --> 00:07:34.000
If I put 0's in for here, what I get is -1 = 0, which is not true, so this particular point, if λ = 0, this particular point might work, but it does not satisfy the constraint. We can eliminate that as a possibility.
00:07:34.000 --> 00:07:49.000
So that is good, λ is not equal to 0. So, our first possibility is... let me see, let us go ahead and move to the next page and let me rewrite the equation so that we have it above us.
00:07:49.000 --> 00:08:10.000
So, 2x = -λy, 2y = λx, 2z = 2λz, and we have z² - xy - 1 = 0.
00:08:10.000 --> 00:08:20.000
These are our four equations that we need to solve simultaneously. The one possibility here is let us take the possibility where z is not equal to 0. Okay.
00:08:20.000 --> 00:08:39.000
So, when z is not equal to 0, that means we can go λ = 2z/2z, we solve this equation right over here, and we get λ = 1.
00:08:39.000 --> 00:09:00.000
When λ = 1, I can put it into this equation and this equation. Then I get 2x = -y, and I get... I have 2y = -x.
00:09:00.000 --> 00:09:16.000
Well, I am going to substitute one of these in here. I am going to take this, so I am going to rewrite this one as -2y = x, and I am going to substitute this x into that equation.
00:09:16.000 --> 00:09:34.000
I get 2 × -2y = -y. I get -4y = y. and the only way that this is true, is that y = 0.
00:09:34.000 --> 00:09:50.000
When y = 0, that means x = 0. Now, I have y = 0, and x = 0.
00:09:50.000 --> 00:10:05.000
So, let us see here. That actually is a possibility, so now if y = 0 and x = 0, now let me go ahead and take these values and put them into this equation here.
00:10:05.000 --> 00:10:22.000
Now I have got z² - 0 × 0 - 1 = 0, so I get z² = 1, I get z equals + or - 1.
00:10:22.000 --> 00:10:36.000
My possibilities... so a couple of points, are (0,0,1), and (0,0,-1), right? x and y are 0, z is + or - 1.
00:10:36.000 --> 00:10:45.000
Those are two possibilities. When I evaluate them at f, I end up with 1, and I end up with 1.
00:10:45.000 --> 00:10:52.000
So, those are a couple of possibilities. This was the case when z was not equal to 0.
00:10:52.000 --> 00:11:01.000
Now we will go ahead and do the case for z = 0, so we are just eliminating all of the possibilities here.
00:11:01.000 --> 00:11:20.000
When z = 0, what we have is, if I take this equation, the constraint equation, I get 0² - xy - 1 = 0.
00:11:20.000 --> 00:11:30.000
So, I get -xy = 1, or y = -1/x.
00:11:30.000 --> 00:11:43.000
This is 1 relation that I have got here. Now, let me go back to my other relations involving x and y. That is 2x = -λ y, 2y = -λx.
00:11:43.000 --> 00:11:52.000
I am going to divide the top and bottom equation, in other words I am going to divide the top equation by the bottom equation.
00:11:52.000 --> 00:12:05.000
I get 2x/2y = -λy/-λx, the λ's cancel, and I get y/x.
00:12:05.000 --> 00:12:21.000
So 2x/2y = y/x. The 2's actually end up cancelling, so I am just going to go ahead and cross multiply. I am going to get x² = y².
00:12:21.000 --> 00:12:48.000
Well, let us see. x² = y², well I found that y = -1/x, therefore I am going to put this y into here and I am going to get x² = -1/x², which equals 1/x². That implies that x⁴ = 1.
00:12:48.000 --> 00:12:57.000
Well, if x⁴ = 1, that implies that x = + or - 1.
00:12:57.000 --> 00:13:18.000
When x = + or - 1, I go back to any one of the equations here, and I end up with y is equal to... well, let me actually move onto the next page here... so I have got x = + or - 1.
00:13:18.000 --> 00:13:32.000
x = 1 implies that y = -1, and x = -1 implies that y = 1.
00:13:32.000 --> 00:13:38.000
Now I have a couple of other points. z was 0, and these are the x's and y's.
00:13:38.000 --> 00:13:49.000
One possibility is (1,-1,0), and the other possibility is (-1,1,0).
00:13:49.000 --> 00:14:01.000
When I evaluate these at f, I get 2.
00:14:01.000 --> 00:14:15.000
There we go. We have taken care of all of the possibilities. We had the four points, we had (0,0,1), (0,0,-1), and we have (1,-1,0), (-1,1,0).
00:14:15.000 --> 00:14:44.000
For the other points, we found that the values were actually 1. Here the values are 2, so, the mins occur at (0,0,1) and (0,0,-1), and the value of the function at those points is 1.
00:14:44.000 --> 00:15:06.000
On that given surface, on the surface z² - xy - 1 = 0, these 2 points on this surface are going to minimize the distance to the origin. That is what we have done here.
00:15:06.000 --> 00:15:25.000
Again, as you can see, there seems to be a lot going on. Lots of cases to sort of go through. I wish that there was some sort of algorithmic approach to solving these problems other than the basic equation of setting the gradient of f = λ × gradient of g + the constraint equation equal to 0.
00:15:25.000 --> 00:15:34.000
We have four equations and 4 unknowns, 5 equations and 5 unknowns. Clearly this gets more difficult. You just have lots of other cases to just sort of go through.
00:15:34.000 --> 00:15:49.000
Again, successful Lagrange multipliers is more about experience than anything else. You can be reasonably systematic, but clearly you saw just with these 4 equations and 4 unknowns there is a lot to keep track of.
00:15:49.000 --> 00:15:58.000
That is the only difficulty. Do not let the procedure actually interfere with your view of the mathematics.
00:15:58.000 --> 00:16:14.000
Okay. Let us just do another example. That is all we can do, just keep doing examples until we start to get familiar with general notions. So, example number 2. Example 2.
00:16:14.000 --> 00:16:56.000
Find the max and min of f(x,y) = x² + 2y² - x on the closed disc of radius 1 centered at the origin.
00:16:56.000 --> 00:17:15.000
Okay. So, what we want to do is... we have the unit... now, we are considering the entire region, and it is a closed region. We are considering the interior and we are considering the boundary. That is all that is happening here.
00:17:15.000 --> 00:17:35.000
So, let us see... equals 0... so this is the... our function, and we want to find the maximum and minimum values on this region.
00:17:35.000 --> 00:17:52.000
We have a couple of things going on here. One of the things that we are going to do is... so this is kind of a max/min problem, and a Lagrange multiplier problem.
00:17:52.000 --> 00:18:05.000
The Lagrange multiplier problem will usually apply to the boundary here, because we have an equation for that boundary which is x² + y² = 1, or x² + y² - 1 = 0.
00:18:05.000 --> 00:18:13.000
As far as the interior is concerned, well we just treat it like any other max/min problem. We see if we can find a critical point and take it from there.
00:18:13.000 --> 00:18:25.000
Let us go ahead and do that first. Let us deal with the interior, so, let us find the gradient of f and we will set it equal to 0 to see where the critical points are.
00:18:25.000 --> 00:18:43.000
The gradient of f is going to be 2x - 1. That is the derivative with respect to the first variable x, and then we have 2y², I am sorry, this is 2y².
00:18:43.000 --> 00:18:56.000
Our derivative with respect to y is going to be 4y. Okay. Now we want to check to see where these are equal to 0, so we have 2x - 1 = 0, and we have got 4y = 0.
00:18:56.000 --> 00:19:14.000
This implies that y = 0 and this implies that x = 1/2, so at the point (1/2,0), the point (1/2,0) is a critical point.
00:19:14.000 --> 00:19:30.000
Let us just go ahead and find the value of f at that point. When we go ahead and evaluate at that point, f(1/2,0), I go ahead and put it into f and I end up with -1/4.
00:19:30.000 --> 00:19:40.000
That is one possible value. That is a critical point, that is on the interior. Now we can go ahead and deal with the boundary.
00:19:40.000 --> 00:19:55.000
Now, let us check the boundary. So, the boundary is g(x,y) = x² + y² - 1, and that is going to be one of the equations, we will need to set that to 0.
00:19:55.000 --> 00:20:11.000
Let us go ahead and find the gradient of g. The gradient of g is equal to, well that is going to be 2x, and that is going to be 2y.
00:20:11.000 --> 00:20:43.000
So, 2x and 2y, so now we are going to go ahead and set the gradient of f = λ × gradient of g, and what we get is 2x - 1, and 4y = λ × 2x and 2y, which is equal 2λx and 2λy.
00:20:43.000 --> 00:20:54.000
The two equations that we get are... let me do this one in red actually, so that I separate the equations out that I am going to be working on, again. This is all about solving simultaneous equations.
00:20:54.000 --> 00:21:13.000
I get 2x = 2λx. I get 4y = 2λ × y. Let me make sure that I make everything clear so that we do not make the same mistake we made last time, so, this is 2λy.
00:21:13.000 --> 00:21:20.000
And, of course we have our equation x² + y² - 1 = 0. That is the constraint.
00:21:20.000 --> 00:21:26.000
Now I have got 3 equations and 3 unknowns, x, y, and λ.
00:21:26.000 --> 00:21:37.000
So, let us deal with case 1. Case 1, let us take λ = 0.
00:21:37.000 --> 00:21:49.000
So, case 1, λ = 0. Okay. When I set λ = 0, what is actually going to end up happening is I am just going to end up getting the previous answer.
00:21:49.000 --> 00:21:55.000
That is not an issue, so let us deal with case 2.
00:21:55.000 --> 00:22:07.000
case 2, where λ does not equal 0. So, one possibility for here, so, when λ does not equal to 0, now there are some sub cases that I have to consider.
00:22:07.000 --> 00:22:14.000
The first sub case that I am going to consider is y = 0.
00:22:14.000 --> 00:22:29.000
When I set y = 0, then I am going to get x² + 0² - 1 = 0. I am going to get x = + or - 1.
00:22:29.000 --> 00:22:35.000
Therefore, I am going to have the points (1,0) and (-1,0).
00:22:35.000 --> 00:22:50.000
Well, at (1,0), when I evaluate it at f, I am going to get 0, and when I evaluate it at (-1,0), when I evaluate f, I am going to get the value 2.
00:22:50.000 --> 00:23:05.000
Now I have got (1,0), (-1,0), these are the values, and I also had that other point, that (1/2,0) that I found from just working on the interior of the disc and the value was I think -1/4, or something like that, or whatever it was.
00:23:05.000 --> 00:23:20.000
Now, that is the case where λ does not = 0, and the case where y does equal 0. Now we want to consider the other case where y does not = 0.
00:23:20.000 --> 00:23:29.000
Again, it seems like there is a lot going on but usually you can make sense of it by just spending some time with it. So, y does not equal 0.
00:23:29.000 --> 00:23:55.000
Well, when y does not equal 0, 4y equals 2λ y. That means λ = 2. 4y/2y, let me go ahead and write that out actually. λ = 4y/2y = 2.
00:23:55.000 --> 00:24:14.000
When λ = 2, this implies that 2x - 1 equals... so the equation is 2λx, right?
00:24:14.000 --> 00:24:29.000
So 2x - 1 = λ = 2 = 4x, so I am going to get 2x = -1, x = -1/2.
00:24:29.000 --> 00:24:51.000
So, when x = -1/2, now when I put that into my x² + y² - 1 = 0, when I put it into here, I am going to end up with the following.
00:24:51.000 --> 00:25:00.000
It is going to be -1/2² + y² - 1 = 0.
00:25:00.000 --> 00:25:16.000
I get 1/4 + y² - 1 = 0, I get y² = 3/4, therefore y = + or - sqrt(3)/2.
00:25:16.000 --> 00:25:31.000
Okay, so, now my other points. x is -1/2, +sqrt(3)/2, and I get -1/2 - sqrt(3)/2.
00:25:31.000 --> 00:25:55.000
When I evaluate these at f, I am going to end up with 9/4 and 9/4, so we have got 9/4, 9/4, -1/2, 0, I check all of those points to see which one is the maximum, which one is the minimum.
00:25:55.000 --> 00:26:20.000
So the max takes place at the points (-1/2,sqrt(3)/2), and (-1/2,-sqrt(3)/2). Value is 9/4.
00:26:20.000 --> 00:26:50.000
The minimum takes place at the original point that we found, which was... not -1/2... at 1/2, 0 and that value was -- let me see, what was that value if we can recall -- -1/4. There we go. This is our solution. I will go ahead and put f here, when we evaluate f.
00:26:50.000 --> 00:26:58.000
So, at this point and this point, our function achieves a maximum and at this point, the function achieves a minimum. That is it.
00:26:58.000 --> 00:27:13.000
Clearly there is a lot going on. A lot of things to sort of keep track of, but we are solving several equations in several variables. This is just the nature of the problem, the nature of the best.
00:27:13.000 --> 00:27:20.000
Okay. So, in the next lesson, we are going to actually continue discussing Lagrange multipliers. We will do some more examples.
00:27:20.000 --> 00:27:25.000
We will pull back a little bit so we will discuss some of the geometry of the solutions and we will try to make sense of what is actually going on.
00:27:25.000 --> 00:27:38.000
Again, not theoretically, we just want this to seem reasonable to you, that we did not just drop this in your lap and say use this technique to find max/min for a function subject to this constraint. We still want this to make sense.
00:27:38.000 --> 00:27:42.000
Okay. Thank you for joining us here at educator.com, we will see you next time. Bye-bye.