For more information, please see full course syllabus of Multivariable Calculus
For more information, please see full course syllabus of Multivariable Calculus
Lagrange Multipliers, Continued
 To find the maximum and minimum for a multivarible function f subject to two functions g and h we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y) = 0 h(x,y) = 0  Now ∇f = (2, − 5), ∇g = (2x,2y) and ∇h = (1, − 1) so that our system of equations is
(2, − 5) = l_{1}(2x,2y) + l_{2}(1, − 1) x^{2} + y^{2} − 1 = 0 x − y = 0  Note that x0 or y0 since g and h will not be satisfied, nor if x = y = 0.
 We can obtain x and y by solving
x^{2} + y^{2} − 1 = 0 x − y = 0  Hence x = ±[1/(√2 )] = y. Our two value points are f( [1/(√2 )],[1/(√2 )] ) = − [3/(√2 )] and f( − [1/(√2 )], − [1/(√2 )] ) = [3/(√2 )].
 Should we check that l_{1} and l_{2} are defined? No, this is not necessary as g and h are a circle and line that intersect only at two points. As such f obtains extrema only at two points.
 These two points must be ( [1/(√2 )],[1/(√2 )] ) and ( − [1/(√2 )], − [1/(√2 )] ) and so we can confidently state that l_{1} and l_{2} are defined (because the points exist). This will not be the case with intersecting surfaces.
 To find the maximum and minimum for a multivarible function f subject to two functions g and h we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y) = 0 h(x,y) = 0  Now ∇f = (0,3), ∇g = (2x,2y) and ∇h = (2,1) so that our system of equations is
(0,3) = l_{1}(2x,2y) + l_{2}(2,1) x^{2} + y^{2} − 1 = 0 2x + y = 0  Note that x0 or y0 since g and h will not be satisfied, nor if x = y = 0.
 We can obtain x and y by solving
x^{2} + y^{2} − 1 = 0 2x + y = 0  Hence x = ±[1/(√5 )] with y = − 2( [1/(√5 )] ) = − [2/(√5 )] and y = − 2( − [1/(√5 )] ) = [2/(√5 )]. Our two value points are f( [2/(√5 )], − [2/(√5 )] ) = − [6/(√5 )] and f( − [2/(√5 )],[2/(√5 )] ) = [6/(√5 )].
 Should we check that l_{1} and l_{2} are defined? No, this is not necessary as g and h are a circle and line that intersect only at two points. As such f obtains extrema only at two points.
 These two points must be ( [2/(√5 )], − [2/(√5 )] ) and ( − [2/(√5 )],[2/(√5 )] ) and so we can confidently state that l_{1} and l_{2} are defined (because the points exist). This will not be the case with intersecting surfaces
 To find the maximum and minimum for a multivarible function f subject to two functions g and h we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y) = 0 h(x,y) = 0  Now ∇f = (8x, − 1), ∇g = (1, − 3) and ∇h = (4x,2y) so that our system of equations is
(8x, − 1) = l_{1}(1, − 3) + l_{2}(4x,2y) x − 3y = 0 y^{2} + 2x^{2} = 1  Note that x0 or y0 since g and h will not be satisfied, nor if x = y = 0.
 We can obtain x and y by solving
x − 3y = 0 y^{2} + 2x^{2} = 1  Hence y = ±[1/(√{19} )] with x = 3( [1/(√{19} )] ) = [3/(√{19} )] and y = 3( − [1/(√{19} )] ) = − [3/(√{19} )]. Our two value points are f( [3/(√{19} )],[1/(√{19} )] ) = [36/19] − [1/(√{19} )] and f( − [3/(√{19} )], − [1/(√{19} )] ) = [36/19] + [1/(√{19} )].
 Should we check that l_{1} and l_{2} are defined? No, this is not necessary as g and h are an ellipse and line that intersect only at two points. As such f obtains extrema only at two points.
 These two points must be ( [3/(√{19} )],[1/(√{19} )] ) and ( − [3/(√{19} )], − [1/(√{19} )] ) and so we can confidently state that l_{1} and l_{2} are defined (because the points exist). This will not be the case with intersecting surfaces.
 To find the maximum and minimum for a multivarible function f subject to two functions g and h we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y,z) = 0 h(x,y,z) = 0  Now ∇f = (2x,2y,2z), ∇g = (1,0,1) and ∇h = (1, − 1,0) so that our system of equations is
(2x,2y,2z) = l_{1}(1,0,1) + l_{2}(1, − 1,0) x + z − 1 = 0 x − y − 2 = 0  Note that if x = 0 then z = 1 and y = − 2 and f(0,1, − 2) = √5 . If x = z = 0 we have − 1 = 0, a contradiction. Similarly if x = y = 0 we obtain − 2 = 0.
 We now verify if the value point (0,1, − 2) satisfies (
2x 2y 2z 1 0 1 1 − 1 0 0 2 − 4 1 0 1 1 − 1 0  The second component gives l_{2} = − 2 while the third component gives l_{1} = − 4. According to the first component 0 = l_{1} + l_{2} = − 4 − 2 = − 6 but 0 − 6. Hence our value point (0,1, − 2) is not an extrema.
 If y = 0 then x = 2 and z = − 1 and f(2,0, − 1) = √5 . If y = z = 0 we have x = 14 and x = 2, a contradiction.
 We now verify if the value point (2,0, − 1) satisfies (
2x 2y 2z 1 0 1 1 − 1 0 4 0 − 2 1 0 1 1 − 1 0  The second component gives l_{2} = 0 while the third component gives l_{1} = − 2. According to the first component 4 = l_{1} + l_{2} = − 2 + 0 = − 2 but 4 − 2. Hence our value point (2,0, − 1) is not an extrema.
 If z = 0 then x = 1 and y = − 1 and f(1, − 1,0) = √2 .
 We now verify if the value point (1, − 1,0) satisfies (
2x 2y 2z 1 0 1 1 − 1 0 2 − 2 0 1 0 1 1 − 1 0  The second component gives l_{2} = 2 while the third component gives l_{1} = 0. According to the first component 2 = l_{1} + l_{2} = 0 + 2 = 2 so our value point (1, − 1,0) is an extrema.
 We now assume that x0, y0 and z0. (2x,2y,2z) = l_{1}(1,0,1) + l_{2}(1, − 1,0) is equivalent to
2x = l_{1} + l_{2} 2y = − l_{2} 2z = l_{1}  We now have the system
x + y − z = 0 x + z − 1 = 0 x − y − 2 = 0  Our only extrema is then f(1, − 1,0) = √2 .
 
 

 Computing ∇f = l_{1}∇g + l_{2}∇h gives (z, − z,x − y) = l_{1}(2x, − 1, − 1) + l_{2}(2y,1,1) which is equivalent to
z = 2xl_{1} + 2yl_{2} − z = − l_{1} + l_{2} x − y = − l_{1} + l_{2}
 
 
 
 

 
 

 Computing ∇f = l_{1}∇g + l_{2}∇h gives (2x,2y,2z) = l_{1}(2x,2y, − 1) + l_{2}( − 1,2y,2z) which is equivalent to
2x = 2xl_{1} − l_{2} 2y = 2yl_{1} + 2yl_{2} 2z = − l_{1} + 2zl_{2}
 
 
 
 

 
 

 Computing ∇f = l_{1}∇g + l_{2}∇h gives ( [2x/9],2y, − [z/8] ) = l_{1}(1, − 2, − 2z) + l_{2}(1,1,1) which is equivalent to
[2x/9] = l_{1} + l_{2} 2y = − 2l_{1} + l_{2} − [z/8] = − 2zl_{1} + l_{2}
 
 
 
 

 To find the maximum and minimum for a multivarible function f subject to two functions g and h we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y,z) = 0 h(x,y,z) = 0  Now ∇f = (yz,xz,xy), ∇g = (3, − 1,0) and ∇h = (0,1, − 3) so that our system of equations is
(yz,xz,xy) = l_{1}(3, − 1,0) + l_{2}(0,1, − 3) 3x − y − 1 = 0 y − 3z − 1 = 0  Note that if x = 0 then y = − 1 and z = − [2/3] and f( 0, − 1, − [2/3] ) = 0. If x = z = 0 we have y = − 1 and y = 1, a contradiction. Similarly if x = y = 0 we obtain − 1 = 0.
 We now verify if the value point ( 0, − 1, − [2/3] ) satisfies (
yz xz xy 3 − 1 0 0 1 − 3 2 \mathord / phantom 2 33 0 0 3 − 1 0 0 1 − 3  The third component gives l_{2} = 0 and so the second component gives l_{1} = 0. According to the first component [2/3] = 3l_{1} = 3(0) = 0 but [2/3]0. Hence our value point ( 0, − 1, − [2/3] ) is not an extrema.
 If y = 0 then x = [1/3] and z = − [1/3] and f( [1/3],0, − [1/3] ) = 0. If y = z = 0 we have − 1 = 0, a contradiction.
 We now verify if the value point ( [1/3],0, − [1/3] ) satisfies (
yz xz xy 3 − 1 0 0 1 − 3 0 − 1 \mathord / phantom 1 99 0 3 − 1 0 0 1 − 3  The third component gives l_{2} = 0 and the first component gives l_{1} = 0. According to the second component − [1/9] = − l_{1} + l_{2} = − (0) + 0 = 0 but − [1/9]0. Hence our value point ( [1/3],0, − [1/3] ) is not an extrema.
 If z = 0 then y = 1 and x = [2/3] and f( [2/3],1,0 ) = 0.
 We now verify if the value point ( [2/3],1,0 ) satisfies (
yz xz xy 3 − 1 0 0 1 − 3 0 0 2 \mathord / phantom 2 33 3 − 1 0 0 1 − 3  The third component gives l_{2} = − [2/9] and the first component gives l_{1} = 0. According to the second component 0 = − l_{1} + l_{2} = − (0) + ( − [2/9] ) = 0 but 0 − [2/9]. Hence our value point ( [2/3],1,0 ) is not an extrema.
 We now assume that x0, y0 and z0. Our strategy is to solve for x and y in terms of z.
 Note that 3x − y − 1 = 0 is equivalent to x = [(y + 1)/3] and y − 3z − 1 = 0 is equivalent to y = 1 + 3z, so x = [(y + 1)/3] = [((1 + 3z) + 1)/3] = z + [2/3].
 Now (yz,xz,xy) = l_{1}(3, − 1,0) + l_{2}(0,1, − 3) is equivalent to
yz = 3l_{1} xz = − l_{1} + l_{2} xy = − 3l_{2}  Using 3xz = − yz − xy and our equalities x = z + [2/3], y = 1 + 3z we can substitute x and y in order to have a quadratic equation in terms of z, z^{2} + [2/3]z + [2/27] = 0.
 The quadratic formula gives us the solutions z = [( − 3 ±√3 )/9].
 Then x = z + [2/3] = ( [( − 3 + √3 )/9] ) + [2/3] = [(3 + √3 )/9] and y = 1 + 3z = 1 + 3( [( − 3 + √3 )/9] ) = [(√3 )/3] gives f( [(3 + √3 )/9],[(√3 )/3],[( − 3 + √3 )/9] ) = [( − 2√3 )/81].
 Also x = z + [2/3] = ( [( − 3 − √3 )/9] ) + [2/3] = [(3 − √3 )/9] and y = 1 + 3z = 1 + 3( [( − 3 − √3 )/9] ) = − [(√3 )/3] gives f( [(3 − √3 )/9], − [(√3 )/3],[( − 3 − √3 )/9] ) = [(2√3 )/81].
 Our possible extrema are f( [(3 + √3 )/9],[(√3 )/3],[( − 3 + √3 )/9] ) = [( − 2√3 )/81] and f( [(3 − √3 )/9], − [(√3 )/3],[( − 3 − √3 )/9] ) = [(2√3 )/81].
 To find the maximum of f subject to two functions g:x + y + z − 1 = 0 and h:x^{2} + y^{2} − 1 = 0 we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y,z) = 0 h(x,y,z) = 0  Now ∇f = (2, − 5,1), ∇g = (1,1,1) and ∇h = (2x,2y,0) so that our system of equations is
(2, − 5,1) = l_{1}(1,1,1) + l_{2}(2x,2y,0) x + y + z − 1 = 0 x^{2} + y^{2} = 1 2 = l_{1} + 2xl_{2} − 5 = l_{1} + 2yl_{2} 1 = l_{1} x + y + z − 1 = 0 x^{2} + y^{2} = 1  Now, since l_{1} = 1 then 2 = l_{1} + 2xl_{2} = 1 + 2xl_{2} or x = [1/(2l_{2})]. Also − 5 = l_{1} + 2yl_{2} = 1 + 2yl_{2} or y = − [3/(l_{2})].
 Substituting into x^{2} + y^{2} = 1 gives ( [1/(2l_{2})] )^{2} + ( − [3/(l_{2})] )^{2} = 1 that results in l_{2} = ±[(√{37} )/2].
 Then x = [1/(2l_{2})] = [1/2]( [2/(√{37} )] ) = [1/(√{37} )] and y = − [3/(l_{2})] = − 3( [2/(√{37} )] ) = − [6/(√{37} )]. Using x + y + z − 1 = 0 yields z = [(5 + √{37} )/(√{37} )] thus f( [1/(√{37} )], − [6/(√{37} )],[(5 + √{37} )/(√{37} )] ) = 1 + √{37} .
 Also x = [1/(2l_{2})] = [1/2]( − [2/(√{37} )] ) = − [1/(√{37} )] and y = − [3/(l_{2})] = − 3( − [2/(√{37} )] ) = [6/(√{37} )]. Using x + y + z − 1 = 0 yields z = [( − 5 + √{37} )/(√{37} )] thus f( − [1/(√{37} )],[6/(√{37} )],[( − 5 + √{37} )/(√{37} )] ) = 1 − √{37} .
 To find the minimum of f subject to two functions g:x^{2} + y^{2} − z = 0 and h:z − 1 = 0 we apply the Lagrange multipliers
∇f = l_{1}∇g + l_{2}∇h g(x,y,z) = 0 h(x,y,z) = 0  Now ∇f = (2x,2y,2z), ∇g = (2x,2y, − 1) and ∇h = (0,0,1) so that our system of equations is
(2x,2y,2z) = l_{1}(2x,2y, − 1) + l_{2}(0,0,1) x^{2} + y^{2} − z = 0 z − 1 = 0 2x = 2xl_{1} 2y = 2yl_{1} 2z = − l_{1} + l_{2} x^{2} + y^{2} − z = 0 z − 1 = 0  We know that z = 1. If x = 0, then y = ±√z = ±1 and obtain the value points (0,1,1) and (0, − 1,1). Note that x = 0 = y yields the contradiction 0 = z = 1. Hence both x and y cannot be zero.
 Now we check if (0,1,1) satisfies (
2x 2y 2z 2x 2y − 1 0 0 1 0 2 2 0 2 − 1 0 0 1  Our second component gives l_{1} = 1 and so our third component gives 2 = − 1 + l_{2} or l_{2} = 3. Since l_{1} and l_{2} are defined, our value point f(0,1,1) = 2 is an extrema.
 Also, we check if (0, − 1,1) satisfies (
2x 2y 2z 2x 2y − 1 0 0 1 0 − 2 2 0 − 2 − 1 0 0 1  Our second component gives l_{1} = 1 and so our third component gives 2 = − 1 + l_{2} or l_{2} = 3. Since l_{1} and l_{2} are defined, our value point f(0, − 1,1) = 2 is an extrema.
 If y = 0, then x = ±√z = ±1 and obtain the value points (1,0,1) and ( − 1,0,1).
 Now we check if (1,0,1) satisfies (
2x 2y 2z 2x 2y − 1 0 0 1 2 0 2 2 0 − 1 0 0 1  Our first component gives l_{1} = 1 and so our third component gives 2 = − 1 + l_{2} or l_{2} = 3. Since l_{1} and l_{2} are defined, our value point f(1,0,1) = 2 is an extrema.
 Also, we check if ( − 1,0,1) satisfies (
2x 2y 2z 2x 2y − 1 0 0 1 − 2 0 2 − 2 0 − 1 0 0 1  Our first component gives l_{1} = 1 and so our third component gives 2 = − 1 + l_{2} or l_{2} = 3. Since l_{1} and l_{2} are defined, our value point f( − 1,0,1) = 2 is an extrema.
 It is interesting that four of our value points are extrema and give the value 2. In fact if x0 and y0. We obtain the same results: l_{1} = 1 and l_{2} = 3 and all points (x,y,1) satisfying x^{2} + y^{2} = 1 as extrema with value 2.
*These practice questions are only helpful when you work on them offline on a piece of paper and then use the solution steps function to check your answer.
Answer
Lagrange Multipliers, Continued
Lecture Slides are screencaptured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
 Intro 0:00
 Lagrange Multipliers 0:42
 First Example of Lesson 20
 Let's Look at This Geometrically
 Example 1: Lagrange Multiplier Problem with 2 Constraints 8:42
 Part 1: Question
 Part 2: What We Have to Solve
 Part 3: Case 1
 Part 4: Case 2
 Part 5: Final Solution
Multivariable Calculus
Transcription: Lagrange Multipliers, Continued
Hello and welcome back to educator.com and multivariable calculus.0000
In today's lesson we are going to continue our discussion of Lagrange multipliers.0004
I am going to start by revisiting a previous example and describing the geometry of the solution.0008
The reason that I want to do that is so that you can see why it is that this criterion of gradient f equals some λ × the gradient of g, why it actually makes sense.0013
I just wanted you to see what the geometry actually looks like, so it does not look like it just fell out of the sky.0025
I encourage you to look at the proofs, or some of the explanations in your textbooks if you want something a little bit more rigorous and a little bit more accurate, but I do want it to make sense geometrically what it is that is happening.0031
So, let us go ahead and get started. Let us see, in the first example of the last lesson, we found... so let me just write all of this out... in the first example of lesson 20, we found the max and the min... you know what, let me not call them max and min, let me call them extrema.0044
We found the extrema values of f(x,y), and if you recall that function was equal to x × y subject to the constraint that the point (x,y) must also satisfy.0080
This function g(x,y), which was x^{2}/8 + y^{2}/2 = 1. We were maximizing or minimizing this function subject to the constraint that the x's and y's that actually go into this that maximize it and minimize it also happen to lie on this ellipse. That is what we were doing... equals 1.0121
Okay. We found four points that satisfied... okay, we had the point (2,1), (2,1), (2,1), and (2,1).0144
The respective f values, in other words when we put these points into x, y, the respective f values, I am just going to write them underneath... we had 2, 2, 2, and 2.0170
These two were the points where the function achieved a maximum, and these two were the points where it achieved a minimum. 0185
Let us take a look at what this looks like geometrically. So, let us look at this geometrically.0193
What you have  I am just going to draw a little x, y plane here  and again we are looking for points (x,y) in the x, y, plane that actually maximize this function x, y but also happen to lie on the ellipse.0209
Well, x, y, if you do the level curves of x, y... in other words x, y, equals some constant, x,y = 3, x, y = 2, x, y = 5/2, whatever. You are going to get a series of hyperbolas. That is what you are going to end up getting.0222
I am going to go ahead and draw a few. First we want to make sure that x and y actually satisfy this equation. In other words, that they lie on this ellipse.0238
Let me just go ahead and draw an ellipse here... I am not very good at drawing at ellipses, but again, the drawing itself is not that important. 0249
So, this is x^{2} + y^{2} = 2. Where you have this right here is the distance from the center to this vertex is going to be sqrt(8), and this one is going to be sqrt(2).0258
The points x,y, that lie on here, which ones are the ones that actually maximize? Well, we found these points right here. 0271
(2,1), there was one, (2,1), (2,1), and (2,1), so here is actually what it looks like geometrically... oops, not very good, let us make it a little bit better than that... here is that... here is another point.0277
So, in other words, if you were to look at this at the point (2,1), (2,1), (2,1), and (2,1), these are the points that maximize the function. These are also the points that happen to lie on this ellipse, so the constraint is satisfied. Those are the points that we found.0300
Well, geometrically, what it is, take a look at this as it turns out at this point if I were to actually take the tangent line to both curves as it turns out, they correspond. 0323
In other words, if I were to take this tangent line at this point happens to be the same for this curve, g, and for this curve, f.0338
What ends up happening is the following: the gradient, at those points, looks like this. The gradient of f will be this way, the gradient of g will be this way.0351
Because the tangent lines correspond, the gradient vector is perpendicular to the tangent line, so as it turns out they're moving in the same direction.0360
Well, one is going to be either the same length or it is going to be longer than the other. That is what the Lagrange multiplier is. It is just a scalar multiple of the gradient vector.0369
When we say that the gradient of f equals some multiplier λ × the gradient g, what we are saying is they are either moving in the same direction or the opposite direction depending on whether λ is positive or negative.0380
In other words the gradient vector g or the gradient vector of f is a scalar multiple of the gradient vector g.0394
The gradient vector g right here looks something like this. Here, so this was the max and this was a max. Notice the gradient vectors are in the same direction.0402
In the case of the mins, the gradient vectors are actually pointing in opposite directions, but it is still just a scalar multiple of the other.0413
In other words, they have the same direction either this way or this way, but they are part of the same line and they are on the same line because the tangent plane, or the tangent line itself to the curves at that point that satisfies the max and min, they are the same for both curves.0421
So, the gradient are multiples of each other. The gradient vectors are multiples of each other, and that is what is happening. That is what this actually says.0443
I just wanted to demonstrate geometrically what it is that is going on.0452
Again, it is a good idea to see that to get an idea of where it comes from, but again, it is the algebra that matters, because when you move on to higher dimensions, you are not going to quite have the geometric intuition that you can get.0456
For example, this works in 2 dimensions. If we were working with a 3dimensional example, a function of 3 variables, we would have x, y, and z, and then we would be talking about surfaces.0470
Where you have one surface and then another surface, the point p that happens to be an extremum is going to be the point where those 2 surfaces actually touching, and the tangent plane to those surfaces is going to be the same. 0480
So the gradient vector is going to be perpendicular to that tangent plane and the gradient vector, they're either going to be in the same direction, or they are going to be in opposite directions, but they are going to lie along the same line.0491
That is it, that is all that I wanted to demonstrate. We are going to do one last example for Lagrange multipliers, except this time what we are going to do is we are going to have 2 constraints instead of 1.0502
So, we are going to try to maximize or minimize a function subject not just to 1 constraint, but another. Let us go ahead and do that example. Okay. Example 1.0512
So, let us see. A Lagrange multiplier problem with 2 constraints, so I am just going to describe how it is that we actually deal with it before we start the example.0533
A Lagrange multiplier problem with 2 constraints, we introduce 2 multipliers, that is it. The number of constraints, you just introduce another multiplier and the equation actually ends up being the same, but just with another multiplier.0561
You end up having just another equation to solve. So, introduce 2 multipliers, we will call them λ1 and λ2, so, we must solve the following system.0574
Our problem comes down to solving the gradient of f at... let me actually write it all out here, a little further to the left so that I do not have to squeeze anything in.0603
The gradient of f at the extrema = λ × the gradient of g1 at p, so now we have 2 constraints, g1 and g2 + λ2 × gradient of g2 at p. That is it.0616
We basically just add one more thing. This is the normal one, gradient f = λ × gradient g, but now since we have 2 constraints, g1 and g2, we just add one more term.0635
We also solve g1 of x, y, z. I am just going to call it point g1 of x, y, z, and again I am just using a 3dimensional example = 0, and g2 of x, y, z = 0.0647
This system right here is the system we end up having to solve. That is it, just one more equation, and this is our one more equation and this is our one extra term.0670
So, now we will go ahead and start the problem.0680
The cone z^{2} = x^{2} + y^{2} is cut by the plane z = 1 + x + y in a conic section.0684
Hopefully you remember from your algebra and precalculus days, and perhaps even in singlevariable calculus, when you have a cone in 3space and you slice through that cone, you are going to end up getting the conic section graphs.0709
You are either going to get a circle, you are going to get an ellipse, or you are going to get a hyperbola.0725
Or, in certain, special cases, depending you are going to get a straight line. Okay... conic section, alright.0732
So, we want to find the points on this conic section, and notice we have not said anything about what this conic section is. We just know that it is a conic section.0739
We do not know whether it is a conic section, ellipse, or hyperbola.0754
So, conic section that are nearest and farthest from the origin.0758
We have this cone in space, we slice it with a plane, and there are going to be points that are on this conic section that are going to satisfy both the equation for the cone and the equation for the plane.0776
A couple of those points, or one of those points, however many, some are going to be furthest from the origin, some are going to be closest to the origin, so, that is what we are doing. 0791
Now, we need to find the function that we are going to maximize in this particular case notice this actually ends up saying nothing about.. it set it in a different form.0799
It did not give us the function that we are trying to maximize or minimize explicitly, we have to be able to extract it from the problem itself.0808
Well, since we are finding the nearest and furthest point from the origin, we are going to look to the distance function, but we are not going to deal with the distance function as it is with the radical sign. 0815
We are just going to square that distance function because if you minimize the distance, you are also minimizing the square of that distance, because again, we do not want to deal with radical signs, we want to make the math as tractable as possible.0827
Okay. SO the function that we are going to be dealing with, f itself, is going to be a function of 3 variables, and it is going to be the distance function, so x^{2} + y^{2} + z^{2}, 0839
But again, we do not want to deal with the radical, so minimizing or maximizing this is the same as minimizing or maximizing this, just the square of it. x^{2} + y^{2} + z^{2}, so that is our f.0853
Now our g1 of x, y, z, that is going to be x^{2} + y^{2}  z^{2}... basically what we do is we take this equation and we move everything over to one side and set it equal to 0...  z^{2} = 0. That is the other equation that we have to satisfy.0863
Then of course we have a second constraint, so we also have to satisfy this equation. g(x,y,z) = 1 + x + y z = 0. That is of course, this equation, again, with everything moved over to 1 side, set equal to 0. 0884
It always a good idea to write the equation that you are actually dealing with. The f and the particular g's, in this case we have 2 g's that we also need to satisfy.0905
Now, we have to solve the gradient of f = λ1 × the gradient of g1 + λ2 × gradient of g2... and I apologize if I kind of keep writing things over and over again.0916
I think that it is important to do that because often time in mathematics there is so much going on, we try to take shortcuts by not writing everything down and that is a bad idea.0940
Take the couple of extra seconds. If you have to rewrite an equation 2 or 3 times, that is not a problem. It is a good way to solidify it in your mind, to get a good grasp on it. You need to get in the habit of writing things out. The more shortcuts you take, the more chance that you are going to make a mistake.0948
Again, as you have already noticed with the last two lessons, these Lagrange multiplier problems, they are not difficult, there is just a lot going on, on the page, so you want to keep track of everything.0965
Okay. So, we have to solve this, that is the one equation, so we have to solve g1 = 0, and g2 = 0, so let us go ahead and come up with this one here. 0975
When we take the gradient of f, we are going to get 2x, 2y, 2z, and again, just a personal taste for me, I tend to write them in terms of column vectors instead of row vectors  your choice, whatever works best for you  equals λ1 × the gradient of g1, which is 2x, 2y, and 2z + λ2 × 1, 1, and 1.0986
These are the 5 equations that we are going to have to solve simultaneously.1018
The first equation, let me do this in blue. We have this equation from the first row, from the second row, and from the third row... so we have... and I am actually going to number these, I am going to refer to them as numbers instead of continuously writing them down.1022
So, equation 1, we have 2x = 2λ1x + λ2.1036
Equation 2 we have 2y = 2λ1y + λ2.1046
Then we have the third equation which is 2z = 2 × λ1z  λ2.1056
Then, of course, we have the g1 and g2, so we have x^{2} + y^{2}  z^{2} = 0, and we have 1 + x + y z = 0.1064
These are the... this is the system that we have to solve simultaneously, solve simultaneously 1086
So, let us just get started. Again, when you are dealing with this many simultaneous equations, there really is no algorithmic approach to this.1097
You just have to sort of use all of the resources that you have at your disposal, try a bunch of different things... we do not want to give you the impression that just by looking at this I automatically know what to do. 1106
I mean, I have already worked this out. When I look at this on a page, I just automatically know do this, do this, do this, do this... it is not like that. We do not want to give you that impression.1118
It takes time. It takes some time, it takes some experience. I still struggle with these myself, because, again, you have got 5 equations to solve. You have different cases to consider, different things to look at... so by all means do not worry about the time that it takes and do not worry that it is difficult. 1128
On an exam of course, it is not going to be something like this. You are going to have something a little bit simpler to work with. These are just bigger problems so that you have a bigger sense of what is going on and more deep practice.1144
So, let us see. In this particular case, I am going to go ahead and put equation 1 and equation 2 together, so I am going to take equation 1.1155
When I take number 1  number 2, I get the following... I get x  y = λ1 × x  y, okay?1169
When I take equation 2 and I add it to equation number 3, I end up with y + z = λ1 × y  z.1183
In this case what I have done is I have essentially reduced this so that now all I have is λ1 and I do not have to worry about λ2.1201
Okay. So let us take a look at the first one. So, x  y = λ1 × x  y is satisfied in 2 cases. Excuse me.1209
It is satisfied in 2 cases. The 2 cases are when x does not equal y, λ1 = 1, and the other case is when x = y, and λ1 does not equal 1. Let us take these cases individually and see what we can do.1223
Okay. So, let us do case 1 first when x is not equal to y. So, case 1.1249
So, x does not equal y. When x does not equal y, then this implies that λ = 1, right? You are just taking x  y/x  y, you are getting λ1 = 1.1257
Okay. If we put this in for one... okay, now let us take the second equation. So, put this into y + z = λ1 × y  z.1274
We get y + z equals y  z, which implies that 2z = 0, which implies that z = 0. Now, since z = 0, let us go ahead and use equation number 4. 1303
That gives x^{2} + y^{2} = 0, which implies that x = 0 and that y = 0.1322
Okay. So, now we have 0, 0, 0. We found a certain point. However, the point (0,0,0) does not satisfy equation number 5. 1338
Again, all of the equations have to be satisfied, so, we have taken these three equations, we have taken 1, 2, 3, & 4, we have managed to satisfy 1, 2, 3, & 4, but it does not satisfy equation 5.1355
So, (0,0,0) is not a viable point here. So, (0,0,0) is not a viable point to consider, so we have taken care of that case. Now, let us go ahead and deal with case 2.1367
In case 2, we said that x actually equals y, and that λ1 does not equal 1. 1382
If we put equations 4 and 5 together, let me see here, so if x = y what we end up with is the following.1393
We get z^{2} = x^{2} + y^{2}, that is the equation 4, and z is equal to 1 + 2x, because it is 1 + x + y, y = x, therefore it is 1 + 2x.1408
Now, let me go ahead and square this, so when I square this and put this into here, I end up with 1 + 2x^{2} = x^{2} + y^{2}, but x = y, so it equals x^{2} + x^{2}, so I am going to get 1 + 4x + 4x^{2} = 2x^{2}.1427
Then, I am going to move everything over and basically end up with a quadratic here, so I am going to end up with 2x^{2} + 4x + 1 = 0.1460
Notice, in this case I have used both equation 4 and equation 5 so that is satisfied, and this case of x = y, λ1 not equal to 1, that comes from the other equations so all of the other equations are satisfied here.1475
When I solve this, I cannot factor it so I have to use the quadratic equation. I am going to end up with x = 4 + or  sqrt(8)/4, which equals 1 + or  sqrt(2)/2. That equals x.1486
Well, it also equals y, so, y = the same thing because x = y. Alright.1510
Then, when we go ahead and we put in for z, when we put this, this x value up into this equation to solve for z, we are going to end up with the following z value.1519
You are going to get z = 1 + or  sqrt(2). I will not go ahead and do that arithmetic, but that is how I go ahead and get it. 1532
So, I have x, I have y, and we have z. Now let us go ahead and finish this up, so let us see here.1543
Let us write it this way. x = 1 + sqrt(2)/2, and it also equals 1  sqrt(2)/2.1552
y is equal to the same thing. 1 + sqrt(2)/2, and 1  sqrt(2)/2.1569
Our z value is equal to 1 + sqrt(2)  1  sqrt(2), so these are our 2 points that we found, okay? These are our 2 points. Let us call this one p1, and p2, these (x,y,z), these (x,y,z), these 2 points satisfy all of the conditions.1578
Now, okay. Now let us go ahead and write out the conclusions for this. Now, we are looking at either an ellipse or a hyperbola.1602
Statistically, when you do this you are going to get an ellipse or a hyperbola. The chances of getting a circle are kind of... you know... that would just mean a plane that is straight across like that, you have a cone and it just cuts across and cuts it in a circle. 1627
That is not what is happening here so you are definitely looking at either an ellipse or a hyperbola, okay?1642
Now, if it is an ellipse, if we have an ellipse, then, p1 is the nearest point  in other words, it is the minimum of the function f  is the nearest point, and p2 is the farthest point.1648
The way you get that  again, once you get your points, you put these points back into x. Well, our function x, our function I am sorry was x^{2} + y^{2} + z^{2}. 1677
You put in this squared + this squared + this squared, and then you get a certain value for f at this point, then you put in this squared + this squared + this squared. 1685
When you do that you will find out that this number is less than this number. That is how we do it... is farthest because f(p1) is less than f(p2).1696
So, if this is an ellipse, this is the farthest point, this is the nearest point. Okay.1709
If a hyperbola  there is a lot to consider here, it is kind of interesting, it would be nice if we could just plug our numbers in and get a number and be done, but we have to actually consider what is happening.1716
If a hyperbola, then there is no furthest point, then there is no farthest point, because a hyperbola is asymptotic.1728
In other words, it goes on into  you know  a particular direction infinitely asymptotic.1756
So, p1 and p2 are the two nearest points. This is why earlier on I decided to use the word extrema instead of max/min because you never know what situation you are dealing with.1767
It is not that you are maximizing or minimizing a function, yes, within a given situation you might be maximizing or minimizing, but in this case we do not know whether we are dealing with an ellipse or a hyperbola.1784
If it is an ellipse, then yes, we have a max value and a min value, in other words a farthest point and a nearest point. 1792
If it is a hyperbola, we do not have a maximum value. What we have is 2 points that satisfy all of the conditions, but they happen to be the two points that are nearest to the origin. 1800
There are physical things to consider, there are other things to consider than just max/min, it is not just max/min  the two nearest points. Okay.1809
Now, so, that is it. This was just an example of a Lagrange multiplier example using 2 constraints, using 2 particular functions that had to be satisfied. 1820
In this case our function that had to be satisfied was our distance function, and it had to satisfy the equation of a cone, and it had to satisfy the equation of the plane. That is it.1830
Everything else was exactly the same. You are solving the series of simultaneous equations. Once you actually get to a point where you get your points, you have to stop and actually think about what it is that is actually going on.1839
This is why we did this final analysis. We have the possibility of an ellipse, we have the possibility of a hyperbola, I am actually going to leave it to you to actually think about which one it actually is.1851
To see if you can actually use the equations that are given, the g1, the g2, and the f to figure out are you getting an ellipse, or are you getting a hyperbola.1862
So, I will leave it with this: see if you can figure out which  and I will give you a hint, try converting the functions into cylindrical coordinates, if you happen to be familiar with cylindrical coordinates.1872
If not, do not worry about it. It is not a big deal. We do not actually have to figure out, all we wanted to do was find out which was furthest, which was closest, we found our two points, the actual problem itself is satisfied.1892
Okay. Thank you very much for joining us here at educator.com. We will see you next time. Byebye.1903
1 answer
Last reply by: Jae Choi
Fri Nov 18, 2016 12:26 AM
Post by Joel Fredin on March 2, 2014
I want to find out if it was an ellipse or a hypurbola, but how do you spell that word, you gave a hint. you said "*something* coordinates".
Would be really glad if you replied to this post :)
1 answer
Last reply by: Professor Hovasapian
Thu Aug 1, 2013 1:27 AM
Post by michael Boocher on July 31, 2013
Wow... 6:30 you really should open this section with that point. Total clarity, I was lost until now. Now I don't even need the equations, can logically deduce the requisite operations.
Thnx
1 answer
Last reply by: Professor Hovasapian
Sat Sep 1, 2012 4:23 PM
Post by Mohammed Alhumaidi on September 1, 2012
Can we setup a matrix here to solve all these 5 equations ? To make it simpler ?