# Thread: Maximizing/Minimizing a function with a nonlinear constraint

1. ## Maximizing/Minimizing a function with a nonlinear constraint

Hi
I am trying to find the maximum or minimum for the following function with a constrain.

f(x,y,z)=x^2+y^2+z^2 s.t. 3x^2+4y^2+z^2=12.

I set up a Lagrangian, however when I take my first order conditions. I only get that lambda must be equal to zero and all values are zero.

dL/dx=2x+3lx=0
dL/dy=2y+8ly=0
dL/dz=2z+2lz=0

Should I set up a bordered hessian?
Thanks

2. ## Re: Maximizing/Minimizing a function with a nonlinear constraint

1) In general, yes, you can use a bordered hessian to determine LOCAL maximum and minimums.

2) When seeking the GLOBAL maximum and minimum, it's easier just to identify the *possible* places where they could occur, and then just plug in values. Those possible places are stationary points (via Lagrange multipliers), places where the function isn't differentiable, and domain borders.

3. In this case, it's possible to solve the problem without doing hardly anything. You can solve it by inspection. The constraint says you're on an ellipsoid. That f has a very natural geometric meaning. Think about it for a minute, and you can just say - no work at all - what the global maximum and minimum are, and all the points where they occur.

3. ## Re: Maximizing/Minimizing a function with a nonlinear constraint

I am not unable to prove it with algebra, but I believe the constrained maximum occurs at (0,0,12^(0.5)). Is that correct?

4. ## Re: Maximizing/Minimizing a function with a nonlinear constraint

Yes
Q: Where is that ellipsoid farthest from the origin (= where does it maximize f, which is the square of the distance)?
A: At the tip of its longest axis, so at (0, 0, sqrt(12)) and (0, 0, -sqrt(12)).

5. ## Re: Maximizing/Minimizing a function with a nonlinear constraint

Oh yeah, I forgot the negative.
Thanks for the help.