Optimizing a Multivariable Function with Lagrange Multipliers

  • Thread starter Thread starter Gekko
  • Start date Start date
  • Tags Tags
    Lagrange
Gekko
Messages
69
Reaction score
0
f(x,y,z)=4x^2+4y^2+z^2 subject to x^2+y^2+z^z=1

So I have:

F(x,y,z,c) = 4x^2+4y^2+z^2+L(x^2+y^2+z^2-1)

dF/dx = 8x+2xL
dF/dy = 8y+2yL
dF/dz=2z+2zL

Either x=y=0 and L=-1 OR z=0 and L=-4

For first case, z^2=1 therefore z=+/- 1 giving f(0,0,1)=1
For second case, x^2+y^2=1 2x^2=1 x=y=+/-sqrt(1/2) giving f(sqrt(1/2),sqrt(1/2),0)=4

Is this correct?
The minimum is therefore the first case giving f(0,0,1)=1?
 
Last edited:
Physics news on Phys.org
Yup, it all looks right to me.
 
Does that mean both cases are valid? One is the maximum and one is the minimum?
 
I'm assuming
Gekko said:
subject to x^2+y^2+z^z=1
is typo for
x^2+y^2+z^2 = 1.

Without using Lagrange you could subtract x^2+y^2+z^2=1 from f(x,y,z)=4x^2+4y^2+z^2 giving you 3(x2 + y2) = f - 1. As this LHS contains only squares it cannot be less than 0. Which is f=1. That is your minimum.

For the maximum looking at the form of f and your constraint you see that so to speak, x, y and z contribute indifferently to your constraint, but taking stuff away from z and investing it in x or y yields you more f. So z=0 will maximise f. The constraint is a sphere round the origin, but the the maximum of f is along a circle z=0, x2 + y2 = 1.
I think it is everywhere along that circle. From this you still get the maximum of f=4, but if I am not mistaken :rolleyes: your answer is not unique but all points satisfying this x2 + y2 = 1 are solutions to the maximum problem.

It is necessary to know the Lagrange method but surprisingly often you can solve problems without it - use the constraint to solve or simplify your problem and use symmetry between variables.
 
Thanks for your replies. Very helpful
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top