INSTRUCTOR: Use the method of Lagrange multipliers to find the minimum value of the function f of x comma y comma z equal to x squared plus y squared plus z squared subject to the constraints 2x plus y plus 2z equals 9 and 5x plus 5y plus 7z equals 29. The method of Lagrange multipliers means we are going to find the gradient of f of x comma y comma z and set that equal to lambda 1 multiplied by the gradient of g of x comma y comma z plus lambda 2 multiplied by the gradient of h of x comma y comma z where g and h are out two constraints set equal to 0. So with this system, we want to solve for x, y, and z value that we can then turn to be our minimum value. The gradient of f will be equal to 2xi plus 2yj plus 2zk. And that will be equal to lambda 1 open parentheses 2i plus j plus 2k close parentheses plus lambda 2 open parentheses 5i plus 5j plus 7k close parentheses.

Setting our coefficients equal to each other, each of the i term coefficients, each of the j term coefficients, each of the k term coefficients, we have a new system of 2x equals 2 lambda 1 plus 5 lambda 2. 2y equals lambda 1 plus 5 lambda 2. And our third equation, 2z equals 2 lambda 1 plus 7 lambda 2. Now let me be clear here. When solving any system of equations, there are a nearly infinite, if not infinite, number of ways you could go about solving a system.

So the way that I'm going to solve this may not be the best. It might not be-- it's definitely not unique. So take what I do with a grain of salt here. This is the way that I solved this question as I worked it. So from this system, 2x, 2y, and 2z, I solved each of these for x, y, and z respectively.

This gives us a different system of x equals lambda 1 plus 5/2 lambda 2. y equals 1/2 lambda 1 plus 5/2 lambda 2. z equals lambda 1 plus 7/2 lambda 2. Now I'm going to take these values of x, y, and z and evaluate them into one of-- actually, both of my constraint functions. So the first constraint 2x plus y plus 2z equals 9, I'm going to replace my x, y, and z expressions for that.

And as I distribute, combine like terms, what it comes out to be for that first equation is 9 over 2 lambda 1 plus 29/2 lambda 2 equals 9. And for the second equation, 29/2 lambda 1 plus 99 over 2 lambda 2 equals 29. All right. Now I can solve this by elimination. Well, the first, I'm going to clear fractions.

So let's make this into yet another system of 9 lambda 1 plus 29 lambda 2 equals 18. And my second equation, 29 lambda 1 plus 99 lambda 2 equals 58. Now, eliminating one variable, I multiplied my first equation by negative 29 and my second equation by 9, this leads to the fact that lambda 2 is equal to 0. And using any of these relationships, you can then see that lambda 1 is equal to 2.

Now, we don't want to know lambda 1 and lambda 2 values. We want to know x, y, and z. So I'm going to go back to my equations from earlier. X equals lambda 1 plus 5/2 lambda 2. Evaluating these values I have, lambda 1 equals 2 lambda 2 equals 0, that means that x is equal to 2.

Similarly, y is equal to 1 and z is equal to 2. Since this is my only critical value, this is going to be my minimum value. And you can use the second derivative test if you'd like to go back and check that. But the minimum value is going to be f of 2 comma 1 comma 2, which is equal to 2 squared plus 1 squared plus 2 squared, which will be equal to 9. So my minimum value of this function with these constraints is equal to 9.