# Homework Help: Very Frustrating (or Easy) Lagrange Multipliers Problem

1. Jun 7, 2010

### number0

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

Find the extrema of the given function subject to the given constraint:

f(x,y)=x2-2xy+2y2, subject to x2+y2=1

2. Relevant equations

Lagrange Multipliers

3. The attempt at a solution

First, I defined the constraint to be g(x,y)=0, that is,

g(x,y)=x2+y2-1

I then set up the usual basic system of equations (I did not show my work for this part because I find it unnecessary):

x-y=$$\lambda$$x

-x+2y=$$\lambda$$y

x2+y2-1=0

(*Note: I reduced the first two equations by a factor of 2 for the sake of easier computing).

So now, I have three sets of equation and the MOST algebraic manipulation I could

do is the following:

y=x(1-$$\lambda$$)

x=y(2-$$\lambda$$)

x^2+y^2=1

_________________________________________

Another path I took was combining the first two equations, which got me:

$$\lambda$$(x+y)=y

Which got me no where.
_________________________________________

And now, I am stuck! Oh yes, I forgot to mention that I am not allowed to use polar

coordinates at all (since the constraint is a unit circle...) - I am only allowed to use Lagrange Multipliers. On another note, the answer is

very, very ugly (it is in decimals). Can anyone please show me how to figure this problem

out? Thanks!

Last edited: Jun 7, 2010
2. Jun 7, 2010

### cronxeh

Global max is at (-0.525731,0.850651) and (0.525731,-0.850651)
f(x,y)=x^2-2xy+2y^2, subject to x^2+y^2=1

Fx = 2*x - 2*y = lambda*2*x
Fy = -2*x + 4*y = lambda*2*y
x^2 + y^2 = 1

lambda=(2*x-2*y)/(2*x)
lambda=(-2*x+4*y)/(2*y)
x^2+y^2 = 1

(2*x-2*y)/(2*x) - (-2*x+4*y)/(2*y) = 0
x^2 + y^2 = 1

2 equations, 2 unknowns. algebra.

Last edited: Aug 21, 2010
3. Jun 7, 2010

### number0

Wow, so my algebra is that bad... Is this what you did? - You set the lambadas equal to

each other for both equations and attempt to solve it for x or y? I cannot believe I overlooked that possibility.

4. Jun 7, 2010

### cronxeh

Its the same lagrange multiplier. Just a variable. You can generalize the whole optimization by looking at the Lagrangian L defined as:

L(x,y,lambda) = f(x,y) + lambda*g(x,y), and solving grad L = 0.

L(x,y,lambda) = x^2-2*x*y+2*y^2 + lambda*(x^2+y^2-1)

In the algebra below you will find 4 points in that plot, you have to plug in your (x,y) point into the f(x,y) and determine which pair gives you the maximum. The global maximum is reached at (-0.525731,0.850651) and (0.525731,-0.850651) and is equal to 2.61803

Oh and to address your question, there is only 1 lagrange multiplier per 1 constraint. If you had multiple constraints like g1(x,y) and g2(x,y) you would have 2 lagrange multipliers lambda1 and lambda2

5. Jun 7, 2010

### number0

Okay, the silly part that I am struggling with is the algebra. I mean that I do not know how to use the two lambdas equation to find the constraint values. Like, how am I suppose to solve for:

"lambda=(2*x-2*y)/(2*x)
lambda=(-2*x+4*y)/(2*y)
x^2+y^2 = 1

(2*x-2*y)/(2*x) - (-2*x+4*y)/(2*y) = 0
x^2 + y^2 = 1

2 equations, 2 unknowns. algebra."

Any tips?

6. Jun 7, 2010

### cronxeh

(2*x-2*y)/(2*x) - (-2*x+4*y)/(2*y) = 0
x^2 + y^2 = 1

Expand (2*x-2*y)/(2*x) - (-2*x+4*y)/(2*y).

(2*x-2*y)/(2*x) - (-2*x+4*y)/(2*y) = x/y - y/x - 1

Now your set of equations is:

x/y - y/x = 1 ->> x1=1/2*(y-sqrt(5)*y) and x2=1/2*(1+sqrt(5))*y ; y1=-1/2*(1+sqrt(5)*x and y2=1/2*(sqrt(5)-1)*x ->> plug x into bottom and solve for y, then plug y back in and solve for x.
x^2 + y^2 = 1

Do you need more help?

Last edited: Jun 7, 2010
7. Jun 7, 2010

### cronxeh

I'm sure you having a difficulty with x/y - y/x = 1 its a tough bear. Multiply it out by xy

xy*(x/y) - xy*(y/x) = xy

x^2 - y^2 = xy
x^2 = xy + y^2
x=sqrt(xy+y^2) this yields 2 roots, x1 and x2..

do same for y.

Now you can see the solution easier

x^2 - y^2 = xy
x^2 + y^2 = 1

8. Jun 7, 2010

### number0

Yes! This is exactly what I got and got stuck on. Thanks I am seeing the picture much clearer. However, how did you get:

"x/y - y/x = 1 ->> x1=1/2*(y-sqrt(5)*y) and x2=1/2*(1+sqrt(5))*y ; y1=-1/2*(1+sqrt(5)*x and y2=1/2*(sqrt(5)-1)*x"

Or in other words, how do you find the root for:

"x=sqrt(xy+y^2)"

Sorry if I am asking away cronxeh, but, I am starting to understand much clearer :)

Last edited: Jun 7, 2010
9. Jun 7, 2010

### cronxeh

x^2 - y^2 = xy
x^2 + y^2 = 1

x*(x-y^2/x = y)
x*(x+y^2/x = 1/x)

x-y^2/x = y
x+y^2/x = 1/x

Do you see it?

10. Jun 7, 2010

### vela

Staff Emeritus
There's a more straightforward way to get through the algebra. Your three original equations are:

(1): y = x(1-λ)
(2): x = y(2-λ)
(3): x2+y2 = 1

Note that x=0 or y=0 won't yield a solution, so you can assume these variables are not equal to 0. Substitute equation (2) into (1) and divide out y to get

1 = (1-λ)(2-λ)

Use the quadratic equation to solve for λ.

Substitute equation (1) into the constraint equation (3) to get

x2 + (1-λ)2x2 = 1

You can easily solve this for x in terms of λ. Now plug in the values of λ you found before to find x of the extrema, and then use equation (1) to get the corresponding value of y.

Last edited: Jun 7, 2010
11. Jun 7, 2010

### number0

Alright! Thank you guys. I finally understand how to approach this problem!