Find the max and min using lagrange

1. Oct 28, 2012

Zondrina

1. The problem statement, all variables and given/known data

Find the max and min values of f(x,y,z) = x3 - y3 + 6z2 on the sphere x2 + y2 + z2 = 25.

2. Relevant equations

I will use λ to denote my Lagrange multipliers.

3. The attempt at a solution

So clearly there is no interior to examine since we are on the boundary of the sphere. Thus we form our constraint equation F = f + λg where g = x2 + y2 + z2 - 25.

After taking all the required derivatives and considering when the derivatives are zero we get the system of four equations :

x(3x + 2λ) = 0
y(-3y + 2λ) = 0
2z(6+λ) = 0
25 - x2 - z2 = y2

Solving the first and second equations immediately we get x = 0 and y = 0. Now solving the fourth equation we get z = ±5 and then solving the third equation when z = ±5 yields λ = -6. Also z = 0 is another solution to the third equation.

So I'm a bit stuck here. I have two maximum values occurring at (0,0,±5), but I'm apparently supposed to get minimum values at (-5,0,0) and (0,5,0).

So I'm guessing I would want to consider two cases? When x=0 and when y=0 to get the minimums?

Last edited: Oct 28, 2012
2. Oct 28, 2012

Zondrina

Oh waaaaait. I see how to do this now I think...

x(3x + 2λ) = 0
y(-3y + 2λ) = 0
2z(6+λ) = 0
25 - x2 - z2 = y2

Solving the first equation gives λ = -3x/2.
Solving the second gives λ = 3x/2.
Solving the third gives λ = -1.

Case : λ = 3x/2

Solving equation 1 gives us x = 0. Solving equation 2 we get y = 0. Solving equation 3 gives z = 0. Solving equation 4 we get z = ± 5

Giving us the points (0,0,0) and (0,0,±5).

Case : λ = -3x/2

Solving equation one gives nothing. Solving equation 2 gives y = 0 and y = -x or -y = x.
Solving equation 3 with y = -x we get y = -4 and z = 0. Solving equation 4 with y=0 and z = 0 gives x = ±5.

Giving us the points (±5,0,0).

Case : λ = -1

Solving equation one gives us x = 3/2 and x = 0. Solving equation two gives us y = 0 and y = -3/2. We are given z = 0 in equation 3. Solving equation 4 with x = z = 0 gives us y = ±5.

Yielding the points (0,±5,0).

Then I would simply test which points satisfy the constraint equation x2 + y2 + z2 = 25.

So for example (0,0,0) would not be a max or min because it lies in the interior of the sphere.

Is this what I was supposed to do?

3. Oct 29, 2012

Ray Vickson

Unfortunately, the equations have a total of 14 different solutions (x,y,z,λ)! To see how this can happen, note that the first equation says either x = 0 or x = -(2/3)λ. The second equation says either y = 0 or y = (2/3)λ, The third equation says either z = 0 or λ = -6. When you put all this together, along with the g=0 constraint, you get a total of 14 possibilities. There are 2 global maxima (differing by signs) and 2 global minima, along with 10 other points that are either local maxima, local minima or saddle points.

RGV

Last edited: Oct 29, 2012
4. Oct 29, 2012

Zondrina

Wow, so do I actually have to consider all 14 cases? The three cases I did there only using values of λ seem to produce the desired answers.

Also that would mean λ = -1 was not even a case to consider if I'm supposed to solve them all straight through. Also solving the last equation would give me nothing at this time, would it?

Last edited: Oct 29, 2012
5. Oct 29, 2012

Ray Vickson

I think it is more-or-less "intuitive". Look at f = x^3 - y^3 + 6z^2. To get a minimum we would like to have |z| as small as possible (because of the +6z^2 term), so z = 0. Now we would want either x<0 and y>0 or x=0 and y > 0, because we want either x^3 < 0 and y^3 > 0 or x^3 = 0 and y^3 > 0. So, either x = 0 and y = 5 or both x and y are ≠ 0 and we can use the Lagrange equations, etc. For a max, we should try to have y = 0, etc.

The real issue is to show convincingly that all of the other possibilities do not give better values of f. I did it the lazy person's way, by just asking Maple to solve the 4 equations.

RGV

6. Oct 29, 2012

Zondrina

So the system of equations is :
x(3x + 2λ) = 0
y(-3y + 2λ) = 0
2z(6+λ) = 0
25 - x2 - z2 = y2

Okay so I think I got this now. Really we only need the first two equations to solve this I believe.

Solving the first equation gives x = 0 and λ = (-3/2)x.
Solving the second eq gives y = 0 and λ = (3/2)y.

Case #1, x = 0 : Our equations reduce to :
y(-3y + 2λ) = 0
2z(6+λ) = 0
25 - z2 = y2

Solving the third equation gives us z = 0 or λ = -6 and two sub cases of x=0.

Sub case, z = 0 : Our equations reduce to :
y(-3y + 2λ) = 0
25 = y2

Solving equation two gives us y = ±5 and solving the first gives us y = 0.

Sub case, λ = -6 : Our equations reduce to :
y(-3y - 12) = 0
25 - z2 = y2

So solving the first equation gives y=0 or y=-4. Solving the third equation with y=0 gives us z = ±5 and solving it with y=-4 gives us z = ±3.

So we get the points : (0,0,0), (0,±5,0), (0,0,±5), (0,0,±3) to consider.

Now that we've gone through the cases when x=0 lets make life simple and take the case y=0.

Case #2, y=0 : Our equations reduce to :
x(3x + 2λ) = 0
2z(6+λ) = 0
25 - x2 - z2 = 0

Solving equation two once again gives z=0 and λ = -6 so we have two sub cases again.

Sub case, z=0 : Our equations reduce to :
x(3x + 2λ) = 0
25 - x2 = 0

Solving the second equation gives x = ±5 and solving the first gives x = 0.

Sub case, λ=-6 : Our equations reduce to :
x(3x - 12) = 0
25 - x2 - z2 = 0

So solving the first we get x=0 or x=4. Solving the second with x=0 gives us z = ±5 and solving it with x=4 gives z = ±3.

Therefore the only new points we get to consider are (±5,0,0).

I'm hoping that's the correct way to do something like this because I'm pretty sure considering the cases where z = 0, λ = -6, λ = (-3/2)x and λ = (3/2)y would yield no new information if I'm not mistaken? So I would have these points to consider :

(0,0,0), (±5,0,0), (0,±5,0), (0,0,±5), (0,0,±3)

Where obviously I would toss out the points (0,0,0) and (0,0,±3) because they are not on the boundary of my sphere ( Aka they don't satisfy the constraint ). Then all that's left is that I check the remaining points I believe?

7. Oct 29, 2012

Ray Vickson

You have it, almost, but you still need to check the ± parts. The argument can be tightened up a bit, and when doing so it helps to also use information about the form and values of f itself (not just its derivatives). Using u instead of λ we have:
(1) x(3x+2u)=0 --> x = 0 or x = -2u/3
(2) y(-3y+2u)=0 -> y=0 or y = 2u/3
(3) z(6+u)=0 m-> z = 0 or u=-6.
(4) x^2 + y^2 + z^2 = 25.

For a min, we want y to be as large (> 0) as possible, and x = z = 0, so y = 5 (giving u = 7/2), or x to be as small (< 0) as possible, and y = z = 0, so x = -5 (giving u = 7/2). Thus, both points (0,5,0) and (-5,0,0) satisfy the Lagrange equations, and they give f = -125. It is easy to show that we cannot do better. We obviously cannot have both x = 0 and y = 0, because that would require z = ±5, giving f = 6*25 = 150 > -125. So, if x ≠ 0 and y = 0 we want to minimize f = x^3 + 6z^2, with x^2+z^2 = 25, so f = x^3 + 6(25 - x^2), which is minimized on x in [-5,5] x = -5. If x = 0 and y ± 0 we have the mirror-image problem (except for the sign) so y = -5. If we try both x and y not 0 we must have x = -2u/3, y = 2u/3, Obviously, we can do better by putting z = 0 instead of having |z| > 0, because if z > 0 (for example), we can change it to 0 and re-distribute its value to y or x; that is, we can keep the constraint satisfied while reducing the term +6z^2 and making the term -y^3 more negative (by making y > 0 larger) or making the term x^3 more negative by making -x more negative. Ok, so we need z = 0. Thus we must have 25 = 2*(2/3)^3*u^2, or u = ±(5/2)√3. Computing x=-(2/3)u and y = (2/3)u, and substituting into f (along with z = 0) gives f = 0 > -125, so is not the minimum. We can conclude that x = (-5,0,0) or (0,5,0) are the two global minima, giving f_min = -125.

Similarly, for a max; the points (0,0 ±5) both give f_max = 150, and by arguments lile the above you can show we cannot do better.

RGV

Last edited: Oct 29, 2012
8. Oct 29, 2012

Zondrina

Ahh yes I see, I just didn't consider the other scenarios because I knew they would give me points which wouldn't be relevant, but in order to make my argument concrete, I would have to consider all possible combinations of points which I would get from my system of equations and show using f and my constraint g that I could not do better by maximizing and minimizing the scenarios ( Actually plugging in the points and seeing what's going on ).