# Recitation video: Lagrange multipliers with 3 variables

Topics: Calculus

## Recitation video: Lagrange multipliers with 3 variables

Lagrange multipliers can be used to optimize a function of several variables subject
to a constraint.
Find the maximum and minimum values of the function
f(x,y,z)=x^2+x+2y^2+3z^2
as (x,y,z)
varies on the unit sphere x^2+y^2+z^2=1
We have a function of the variables xv. equals × squared plus x plus 2y squared
plus 3z squared. What we'd like you to do is find the maximum and minimum values
that this function takes as the point x.

v. moves around the unit sphere- squared
plus y squared plus z squared equals 1. To optimize this function, given the
constraint that x2 + 2 + z2 = 1.
Lagrange multipliers are used to find maxima and minima of functions subject to
constraints. To determine the points at which a given function is maxed out or mined
out, you first look for points at which the gradient of your objective function is parallel
to that of your constraint function.

When you take partial derivatives of the function fx, fy and fz, the resulting equations
must be equal to the appropriate value of lambda times gx, gy and gz. Then you
solve that system of equations with the constraint equation. The points that give you
solutions to that system are your points to check for whether or not they are the
maximum or minimum. And sometimes you have some boundary to your region, so
you have to check that as well.
So in this case, the sphere's surface has no boundary.

Get quality help now
writer-Charlotte
Verified

Proficient in: Calculus

4.7 (348)

“ Amazing as always, gave her a week to finish a big assignment and came through way ahead of time. ”

+84 relevant experts are online

So we don't have any
boundary conditions to check. So we're going to have a really straightforward
problem to solve, where we just have to look at the partial derivatives. So let's write
down that system of equations that we have to solve. The partial derivative of
function f with respect to x is equal to 2x plus 1. We must solve the system 2x plus 1
= c. and the partial derivative of our constraint with respect to y is 2x. So this
equation has to hold: 2x plus 1 = lambda x.
2x+1=λ*2x
The derivative of the function f with respect to x is given by the partial derivative of y.
The derivative of y with respect to x is 4y; therefore, lambda must equal 4y. The
constraint equation can be differentiated with respect to y as 2y; therefore, lambda
equals 2y.
4y = λ*2y
The z partial derivative of the constraint function is 2z. SO 6z must equal lambda
times 2z.
6z = x * 2z
Lambda times 2z. And we have the last equation × squared plus y squared plus z
squared equals 1.
x^2+y^2+z^2=1
We get 4 equations with variables x, v. and z plus a new parameter, lambda. We
want to solve these equations to find points at which they're all satisfied. Once we
get those points, we have to test them to see whether they're the maximum or
minimum (or neither).
We can solve this system of equations by factoring the second and third equations.
The second equation contains a term with y squared in it, while the third equation
has a term with y cubed. This means that either y is equal to 0, or we can divide by
it. In other words, y is equal to O or lambda is equal to 2.
y=0 or λ=2
Similarly, from the third equation, either z is equal to 0 or we can divide by z and we
get lambda equals 3. So from the third equation, either z is equal to O or lambda
equals 3.
z=0 or λ=3
We have several possibilities. Either y equals O and z equals 0, or y equals 0,
lambda equals 3, or lambda equals 2, z equals O. The other possibility is lambda
equals 2. lambda equals 3; however, that can't happen. So, we have three
possibilities: Case A, in which y equals z, or 0; Case B, in which y is greater than z
but less than or equal to 1; and Case C, in which y equals 1.
y = z = 0
Equal to zero when y is equal to z is O, we can solve the constraint equation for x.
When y equals z equals O, we have x squared equals 1. There are two possibilities:
The point (1,0,0) and the point (-1,0,0). This gives us x equals 1 or x equals minus 1.
Thus, there are two points: (1,0,0) and (-1, 0, 0).
y=z=0->x=1 or x =- 1
(1,0,0), (-1,0,0)
The second case is that y could equal 0, and lambda could equal 3.
y =0.λ=3
In this case, let's go back to our equations again. So from lambda equals 3, we have
in our first equation that 2x plus 1 equals 6x. So 1 equals 4x or x equals 1/4.
y =0.λ=3->x= 1
So, this implies that x equals 1/4. And now we still need to find z. So if we go back to
our constraint equation here, we have the x equal to 1/4 and y is O. So that means
1/16 plus z squared equals 1. So z has to be the square root of 15 over 4. And z is
equal to plus or minus.
y=0, λ=3->λ = 1/4Z =+- sqrt15/4
As a result, we have two points to check: (1/4, O, square root of 15 over 4), and (1/4,
O, minus square root of 15 over 4).
(1/4, 0, sqrt15/4) (1/4, 0, -sqrt15/4)
Finally, we have our third case. In this situation, lambda is equal to 2 and z is equal
to 0.
λ=2,z=0
So again, returning to our equation, when lambda equals 2 in the first equation, we
have 2x plus 1 equals 4x. Therefore, 2x equals 1 or x is 1/2. This gives us x equals
1/2.
λ=2,z=0->x=1/2
Now if vou take z equals O and y equals 1/2, we can take that down to our constraint
equation and we get y squared equals 1. So we get y is a square root of 3/4. So y
equals plus or minus the square root of 3 over 2.
λ=2,z=0->x= 1/2y=+- sqrt3/2
Thus, this gives us two points: (1/2, sqrt3/2, 0), and (1/2, -sqrt3/2, 0):
We have three cases from which to choose. We have solved each of them and found
the points that lead to their solutions. Now we need to check these SiX points for
boundaries. We must consider the values of f at each of these six points and figure
out where is maximized and minimized. These six points are the only points where
that could happen, where could be maximized or minimized. So we just have to
evaluate our objective function, f, at these six points and find the largest value and
the smallest value.
Let us now seek the solution to our original equation, x squared plus x, plus 2y
squared plus 3z squared. Let's evaluate the function at those points: x squared plus
x plus 2y squared plus 3z squared. At the point (1,0,0), it is equal to 2; we will write
this on the side of the graph. So we have a value a of 2 here. I'll circle that. And then at
(-1, 0,0) we have x squared is 1 + × is -1; y and z terms are both 0. So for this point
we have a function value of O: we'll circle this one as well.
2->(1,0,0)
0->(-1,0,0)
To get the value of the function at (1/4, O), we will look at what we've already written
down. To find the value of the function at (1/4, O) when a equals 1/4 and b equals 0,
we need to use the formula fla, b) = ab^2 + (b^2)a^2. When a=1/4 and b=0, this
becomes f(1/4, 0)=25 over 8.
25/8->(1/4,0,sqrt15/4) (1/4,0,-sqrt15/4)
We will not do the arithmetic here and now. And at these last two points, the points
(1/2, root 3 over 2, 0) and (1/2, minus root 3 over 2, 0)-the function has the same
value of both those points. That value is 9/4.
The value of 25 over 8 is equal to the value of 9/4 at both points (0, 0) and (1, 0).
Now, to find the maximum value of f(x) and the minimum value of f(x), we just look at
the values that we got and say which of these are biggest and which of these are
smallest. Because all values except O are positive, it's easy to see that O is the
minimum. So our maximum value off is O at the point (-1, 0).
of fis O at (- 1, 0, 0)
If you compare the values of f(2) and f(25/8), 25/8 is larger than 3. Both are less than
3, but 25/8 is greater than 3. For example, it can be shown that the maximum value
off occurs at the points (1/4, 0, plus or minus square root of 15 over 4).
of f is 25/8 at (1/4, 0, +-sqrt15/4)
We've just covered the method of Lagrange multipliers. To reiterate, you start out
with an objective function and a constraint function, and then you come up with a
system of equations by writing down their partial derivatives and solving for x.
One must take care to solve the system of equations that results when setting fx
equal lambda gx, fy equal lambda gy, fz equal lambda gz, and equal some
constant. This can be a challenge because solving systems of equations is often
difficult even for experienced mathematicians.
In this case, there were several observations that we could make from the second
and third equations that made it relatively straightforward to do. And that gave us
some cases. In each of those cases, we were able to completely solve for the points
x, y, and z.
We can also solve for the associated values of lambda, but iS lambda is not important
to us. Once we find x, y, and z, we can forget about lambda because it does not
affect f.
In this case, we got six points of interest. We then looked at the value of our
objective function at those points. The maximum value of the objective function is
found when its value is largest in any one of these six points.
Now, in some problems you will check for possible maxima and minima on the
boundary of the region. However, in this case there is no boundary on a sphere, so
we do not have to worry about that. That's how we apply the method of Lagrange
multipliers to this problem and how you can apply it to other problems as well.