# Quick multivariable calculus help

#### Bkas

##### Member
Say you have two equations that define a position:

x^2 + y^2 + z^2 - 6 =0.
xyz = -2.

How would you go about finding, say, the maximum value of x as defined by the two equations? There has to be a way, but I can't figure it out (every way I do is either too long or complicated or just doesn't make sense). I have to do it by hand, too, so no cheating with mathematica.

Anyone?

#### Storm

##### Diamond Member
Man... its been a while heh I forget but I suppose you've tried regular substitution for variables x, y, z?
ie if x = 2 then (x^2) + (y^2) + (z^2) - 6 = 0
4+(z^2)+(y^2)= 6
so that would leave z and y to possibly be equal to 1?
but to fulfill the other equation xyz = -2 one of the 1s has to be negative?

To me it seems too ez therefore I dont think its the right way of doing it

#### Einz

##### Diamond Member
Have you tried using LaGrange multipliers? This would seem fairly simple if you use that.

#### arcas

##### Platinum Member
Yes, the method of Lagrange multipliers is an acceptable method to solve this class of constraint problem.

#### Bkas

##### Member
We haven't learned how to use Lagrange multipliers yet. Is there a nother way to do this? Or, if lagrange is the easiest way, could you explain how to apply it to this?

Thanks.

#### Darien

##### Platinum Member
LaGrange multipliers are useful for finding max/min. Assuming that such values exist....:

Basic idea of LaGrange:

Given a function f(x,y,z) constrained by g(x,y,z) = k...

take the gradient of each function.

del f(x,y,z) = lambda * del g(x,y,z). lambda...think of it as a constant.

you eventually get 4 equations with 4 unknowns.

for notation purposes, del f(x,y,z) = <a, b, c> and del g(x,y,z) = <p, q, r>

a = lambda * p
b = lambda * q
c = lambda * r
g(x,y,z) = k

#### Bkas

##### Member
Yeah, but what's my function in this case? This pretty much looks like two constraints without a function. What the question is trying to get at, I think, is that there is a sphere (first equation) and the second equation is a path defined on the sphere. how would I solve this?

Bump.

#### Bkas

##### Member
One more time. Someone has to be able to help me out.

#### fornax

##### Diamond Member
I can think of two ways (they are equivalent)

1. Diffrentiate each equation with respect to X only (treating Y and Z as constants), and then solve for dX=0 from the resultant equations.

2. Solve for X from the second equation, substitute in the first (it's going to be ugly), and then differentiate the result and make it zero.

#### Bkas

##### Member
How does the first way work? Wouldn't you just get 2x = 0 and yz = 0? I feel stupid right now, so I can't really do it. Should I do it via chain rule? Could you perhaps try to give me a little more direction (or perhaps do it and help me with an answer I can check with?)? Sorry about bugging you people.

#### Bkas

##### Member
You mean partial derivatives, right?

#### Bkas

##### Member
I got a copy of mathematica. How do I solve for it in there? I've never really used Mathematica much before.

#### Bkas

##### Member
One final bump before I have ot turn this in.