# Lagrange multiplier question

1. Feb 4, 2012

### ibysaiyan

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

The question is : Find the maximum and minimum lengths of the radius vector contained in an ellipse
$$5x^2 +6xy+5y^2$$

2. Relevant equations

3. The attempt at a solution
Hi

I seem to be at a loss here because usually along with an equation a constraint is also given but in this case there is just an equation or I maybe waffling along since I missed the lecture. Anyhow.. can anyone guide on how to solve this one ?
$$\nabla f = \lambda\nabla g$$

Usually questions have a constraint which makes life much easier.. then however doesn't seem to have one :/
Or maybe the above equation is the constraint.. and the actual f(x,y) would be the equation of an ellipse ?

2. Feb 4, 2012

### vela

Staff Emeritus
Is that expression supposed to be equal to 1? You can't have the equation for an ellipse without an equal sign somewhere.

You're trying to find the "maximum and minimum lengths of the radius vector." That means f, the function you're trying to maximize, is the length of the radius vector. The constraint is that the position vector's tip must lie on the given ellipse, so that should be reflected in g.

3. Feb 4, 2012

### ibysaiyan

Hi vela , 8 was mean't to be on the R.H.S

I am sorry but I still don't get it.. I know for one that If I find the maximum and minimum points then to get respective distances I could simply use the following relations: (x-x1)^ 2 + (y-y1)^2 ....
Also one more thing... what's the whole purpose of Lagrange multipliers... Is it to do with saddle points or something totally irrelevant to what I am thinking ?
Thanks!

4. Feb 4, 2012

### vela

Staff Emeritus
5. Feb 4, 2012

### Ray Vickson

I f I am reading the problem correctly, the radius vector has length $\sqrt{x^2 + y^2},$ which is to be maximized or minimized among all (x,y) that satisfy the equation $5x^2 + 6xy + 5y^2 = 8.$ (I would call that curve a circle, not an ellipse, but anyway, that is the problem.) Of course, maximizing or minimizing the radius vector's length is the same as maximizing or minimizing the square of the length, so you need to optimize $x^2 + y^2.$ In other words, your problem is
$$\begin{eqnarray*} \max \mbox{ or } \min&&x^2 + y^2\\ \mbox{subject to}&&5x^2 + 6xy + 5y^2 = 8. \end{eqnarray*}$$
This has the form max/min f(x,y), subject to g(x,y) = 0. If you use the Lagrange multiplier method, this will give you three equations $\nabla f(x,y) = \lambda \nabla g(x,y)$ (two equations---one for the x-component and one for the y-component) and $g(x,y) = 0$ (one equation). Altogether, you have three equations for the three unknowns x, y and λ.

RGV

6. Feb 4, 2012

### ibysaiyan

AH THANKS A GAZILLION vela , ray.. THAT BIT (IN bold) was a bit sketchy to me.. now it makes absolute sense. I will post the solution in the follow up post.
=]

Last edited: Feb 4, 2012
7. Feb 4, 2012

### epenguin

However isn't this Lagrange a bit overpowered for this particular problem?

The radius formula 1 is contained inside the ellipse formula 2.

8. Feb 5, 2012

### epenguin

Maybe I should say more.

You could think , let's say I go around the circle x2 + y2 = 8, so that part is fixed, and I am looking at the distance from centre to the ellipse: the only thing that varies is xy. Well if it's not evident anything about what that will do, as I'm going round a circle it is natural to express in polar coordinates, xy is then cosθsinθ. That's (sin2θ)/2. Not hard to know when that is max and min.

Another way to see the same thing is you can see you don't change your expression if you interchange x and y. Do you see that means your curve must be symmetric about the line x=y? And that that means an extremum for your distance must lie on that line. And that that gives you an easy calculation for your distance?

Since we know something about the ellipse we know there is another axis of symmetry. Guided by this knowledge we can get the other distance. I'll leave you to that, just saying that if we call the curve

f(x, y) = 0 (or 8 if you prefer) what we said above was

f(x, y) = f(y, x) .

There are other such relations for this curve.

I don't say you shouldn't use the Lagrange method, both give you something extra.

9. Feb 5, 2012

### vela

Staff Emeritus
I think the point of the exercise is to learn how to use Lagrange multipliers.

I don't think this reasoning is correct because you're assuming r2=8. As you go around the ellipse both r and xy vary.

10. Feb 5, 2012

### epenguin

Yes, but I am saying go around that circle - a curve of constant radius. The length from the centre to the ellipse will be the circle radius (√8) plus a variable amount (positive or negative) which is 6xy. You need minimise only that.

The point may be to learn Lagrange multipliers. But for learning I agree with the Polya prescription 'when you have the answer the job's not finished.' IMHO if you only give the numbers that come out of the calculation without seeing the geometrical reasonableness and sense you have missed something. If you only give the geometrical one you have maybe done something tricksy and special and you miss out on something more general. (Except it is useful to always have symmetry in mind whenever applicable.) So to do both is better than either.

11. Feb 5, 2012

### Ray Vickson

The Lagrange multiplier method is absolutely, 100% "geometrical", although it might not have been taught that way to the OP. Basically, it says that the gradient of the objective f must be parallel to the gradient of the constraint function g--that is, must be perpendicular to the tangent line of the constraint at the optimum p* = (x*,y*). (If it were not, there would be a non-zero component of the gradient of f along the tangent line, and that would mean that we could increase or decrease f a bit by moving a short distance away from p* along the constraint curve.) Of course, this is "geometrical" in the sense of calculus rather than in the sense of Euclid, but it is still geometrical.

RGV

12. Feb 6, 2012

### epenguin

Ah, yes that unifies the general idea with the special example nicely. The greatest and least radius lengths are just where the ellipse tangent is parallel to the circle tangent.

It might, as you say, not have been taught that way to the OP - it wasn't to me. Possibly for many others too it is first pulled out of a hat in a formal way when deriving the Boltzmann distribution in stat mech. And you think - brilliant! - I could never have thought of that. And this is following on the Stirling approximation, which you also think you would never have thought of. It is possible to do better didactically.

Many years after this first exposure I did myself return to conditional extrema and work out a more logical approach, don't remember if I got quite your focus. It seems to me this 'undetermined multiplier' name is almost misleading, at least wrong emphasis.

13. Feb 6, 2012

### Ray Vickson

Well, before retiring I used to teach a grad course in Applied Optimization in an Operations Research program, and I always tried to link the geometry with the algebra and calculus when talking about things like Lagrange, Karush-Kuhn-Tucker, etc. The textbooks I used did that, too.

RGV

14. Feb 7, 2012

### ibysaiyan

Thanks everyone for your input. Some interesting stuff was posted.