Welcome to a lesson on lagrange multipliers with two independent variables.
The goal this video is to determine extrema using the method of lagrange multipliers.
So we're trying to maximize or minimize f with the constraint g.
If they are both differentiable on a specified region.
And the gradient of g does not equal the zero vector.
On the curve g of x, y equals zero.
Will follow the following two step to locate the max and min
of f.
Will determine x, y and lambda based upon the equation
the gradient of f is equal to
lambda times the gradient of g and
the constraint g equals zero.
So the result is going to be the following system of equations
where the first two involve
the partial derivatives of f and g
and the third will be the constraint.
So the idea behind lagrange multipliers
will have a max or min value
when the gradient of f
is the multiple of the gradient of g
meaning these two vectors will be parallel
where a max or min value occurs.
So if we determine x, y, and lambda
step two will be determined
which of the above solutions produce a maximum or minimum function value.
Let's take a look at the geometry though behind this before we look at an example.
So on the right side we see the graph of f.
And in red we see the constraint g.
And right now we're looking for a minimum value
and you can see that the minimum values are going to occur
near the center of this surface.
But based upon the constraint g
the minimum value would occur right here
which is also right here
on the level curves.
So the idea here is
the minimum maximum values will occur
when these two vectors
where one is the gradient of f.
And one is the gradient of g.
Are parallel to each other.
Meaning they are scalar multiples.
And watch as I move the point closer to the minimum
we'll see that happening geometrically.
As we move closer they become parallel.
And right at that minimum value those two vectors are parallel.
And the same thing will occur
or looking for a maximum value.
So now the maximum values over here.
Based upon the constraint in red.
And as this point moves closer to that maximum.
We'll see those two vectors which are the gradients become parallel once again.
So this is the idea behind lagrange multipliers.
Let's go and take a look at an example.
Here we want to determined the maximum value of f.
Based upon the constraint g.
So were gonna create a system of equations
By setting the gradient of f equal to lambda times the gradient of g.
And the result will be these two equations and then we have the constraint.
So the partial derivative of f with respect to x would be two x.
This is gonna be equal to lambda.
Times the partial derivative of g with respect to x that will give us negative two x.
The second equation we have the partial of f with respect to y that will be negative two y.
Must equal lambda.
Times the partial of g with respect to y.
And that would just be one.
And the third equation will be our constraint.
Y minus x squared equal zero.
Now see if we can solve this system.
By using equation one if we divided both sides by negative two x.
Well two x divided by negative two x would be negative one.
So lambda would be equal to negative one.
So now using equation two.
If lambda is equal to negative one we're gonna have negative two y.
Is equal to
negative one
Well if we divide both sides by negative two we know that y is equal to one half.
And then finally using equation three.
If y is equal to one half we'll have one half.
Let's go ahead and move the x squared over we'll have one half equal x squared.
Square root both sides of the equation.
And we have x equals plus or minus one over the square root of two.
So this tells us we have two points to consider.
To determine the maximum value of this function.
Based upon this constraint.
So one of the points would be positive one square root two.
Comma one half.
And the second point to consider would be negative one over square root two.
Let's go and determine these function values on the next slide.
Okay so for the first function value.
This would be one half
minus one fourth that's gonna be one fourth.
And for the second point we're gonna have the same function value we're gonna have one half
minus one fourth.
So this tells us the maximum function value.
Based upon the given function and the constraint
is equal to one fourth.
It occurs at two places.
At one over square root two one half.
And
negative one square root two
one half.
Let's take a look at this result graphically.
So what we're seeing here in purple.
Is a surface generated by f.
And then in red we have the constraint.
And you can see that when those two surfaces intersect.
It produces this yellow curve here.
And the maximum value along this curve would be at this blue points here.
And if we rotate this around you can see there would be another
maximum function value.
Right in here which I did not plot.
So again we have the function in purple.
And the constraint would be in red.
So were looking for the maximum function value
that satisfy both of these along this yellow curve.
Let's take a look at another example.
It's a little bit more involved.
So were trying to determine the maximum values of this function based upon the given constraint.
So for this problem were gonna let g of x, y.
Equal x squared plus y squared.
Minus one equal zero.
So we set the gradient of f equals to lambda times the gradient of g.
Which will result in these first two equations.
So the partial derivative of f with respect to x that will give us one equals lambda.
Times the partial derivative of g with respect to x.
Which would give us two x.
So the second equation we'll take the partial f with respect to y that will be two.
It's gonna be equal lambda times a partial
derivative of g with respect to y that will be two y.
Then lastly we have our constraint.
Now we have to solve this system to determine lambda x and y.
Using equation one we can solve for lambda
Lambda will be one over two x.
And then using equation two.
We can solve for lambda and lambda would be one over y.
Using these two equations we know that one over two x.
Must equal one over y.
To cross multiply here we would have y
equals two x.
Now we can use this to rewrite equation three in terms of one variable.
So again we're gonna replace y with two x were gonna have x squared.
Plus
instead of y squared we'll have two x squared that will be four x squared.
Let's go ahead and move this one to the right side.
So we have equals ones so we have five x squared.
Equals one.
So we divide both sides by five.
Well x squared equals one fifth.
We square root both sides here.
So we have x equals plus or minus one over square root of five.
And now that we know x we can find y from this equation here.
Y is equal to two times x so y is gonna be equal to plus or minus
two over the square root of five.
So were gonna have to consider four different points
based upon the value of x and y
and plug those values into our function f of x, y equals x plus two y.
Let's do that on the next slide.
Okay for the second time I've already set this up notice it resulted in four different points to consider.
Here were gonna have one plus four that's five over square root five.
Here were gonna have negative one plus four
that will be three over square root five.
Here were gonna have one plus negative four that will be negative three over square root five.
Here were gonna have negative one
plus negative four negative
five over square root five.
So the largest value here will be the maximum.
So this is our maximum function value.
And
this would be our minimum function value.
If we rationalize this, this will be the square root of five.
Again this is our max.
And this would be negative square root five.
And this would be our minimum.
Let's go and take a look at this graphically as well.
So the function is the purple plain and the constraint
is the red cylinder.
So we're considering
the function values along this intersection which is in green.
And we can see here in blue that would be the minimum
function value based upon this constraint that's negative square root five.
And on the other side here.
This high point here would be the maximum function value
of positive square root five.
Okay that's going to have to do it for this video.
I hope you found these examples helpful.