Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Lagrange Multipliers

  1. Jul 30, 2010 #1
    I have been reading about Lagrange Multipliers, my book along with wiki and other resources I have read use an intuitive argument on why the max/min contour lines end up tangent to the constraint equation.
    I don't really understand it, especially considering the obvious flaw as shown by the below,

    F(x,y) = sin(x*y),

    subject to, x^2 + y^2 = 6

    The picture is the graph of the contour lines of F(x,y) along with the constraint.

    The max and min values of F(x,y) are obviously not at the places the contour lines are tangent to the constraint.

    So I was wondering if anyone could explain whats going?
     

    Attached Files:

  2. jcsd
  3. Jul 30, 2010 #2

    HallsofIvy

    User Avatar
    Science Advisor

    ??? The maxima and minima of F(x,y), subject to the contstraint [itex]x^2+ y^2= 6[/itex] are [itex](\sqrt{3}, \sqrt{3})[/itex], [itex](-\sqrt{3}, -\sqrt{3})[/itex] (the maxima), [itex](\sqrt{3}, -\sqrt{3})[/itex], and [itex](-\sqrt{3}, \sqrt{3})[/itex] (the minima) obviously are where the level curves of F(x, y), specifically, sin(xy)= sin(3) and sin(xy)= -sin(3), are tangent to the graph of [itex]x^2+ y^2= 6[/itex].

    I suspect that your graph just doesn't show the specific level curve sin(xy)= sin(3) or sin(xy)=-sin(3) which are the same as the graphs of xy= 3 and xy= -3. What sort of iteration did you use to graph the level curves?
     
  4. Jul 30, 2010 #3
    Uh point (2, sqrt(2)) produces a bigger maxima.
     
  5. Jul 30, 2010 #4

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    Both of you seem to have forgotten that the system:
    [tex]\cos(xy)=0(1)[/tex]
    [tex]x^{2}+y^{2}=6(2)[/tex] can have real solutions.

    The first is equivalent of saying:
    [tex]xy=(2n+1)\frac{\pi}{2}[/tex] for some integer n

    We may convert that system of equation into, for example:
    [tex]x^{2}+y^{2}=6[/tex]
    [tex](y-x)^{2}=\pm\sqrt{6-(2n+1)\pi}[/tex]

    Or,
    [tex]y=x+\pm\sqrt{6-(2n+1)\pi}[/tex]

    Inserting in (2), we get:
    [tex]2x^{2}\pm{2x}\sqrt{6-(2n+1)\pi}+6-(2n+1)\pi=6[/tex]
    which can be simplified as:
    [tex](x\pm\frac{\sqrt{6-(2n+1)\pi}}{2})^{2}=\frac{(2n+1)\pi}{2}+\frac{6-(2n+1)\pi}{4}[/tex]
    which simplifies to:
    [tex](x\pm\frac{\sqrt{6-(2n+1)\pi}}{2})^{2}=\frac{6+(2n+1)\pi}{4}[/tex]
    Taking the squar root, remembering that the "plus-minuses" may vary independently of each other, we get:
    [tex]x=\pm\frac{\sqrt{6-(2n+1)\pi}}{2}\pm\frac{\sqrt{6+(2n+1)\pi}}{2}[/tex]

    Thus, we see that only n=0 and n=-1 are acceptable values.

    Thus, we have:
    [tex]x=\pm\frac{\sqrt{6+\pi}}{2}\pm\frac{\sqrt{6-\pi}}{2}[/tex]

    This can be simplified as:
    [tex]x=\pm(\frac{\sqrt{6+\pi}}{2}+\frac{\sqrt{6-\pi}}{2}[/tex]
    OR
    [tex]x=\pm(\frac{\sqrt{6+\pi}}{2}-\frac{\sqrt{6-\pi}}{2}[/tex]
    For each of these 4 solutions, y can be either of the 2 from the OTHER set, so that we have 8 solutions all in all.
     
    Last edited: Jul 30, 2010
  6. Jul 30, 2010 #5
    arildno, you can also easily see by the contour plot that there are 4 mins and 4 maxes, my example of (2, sqrt(2)) wasn't to indicate it was even a max or min, only to show that HallsofIvy was incorrect.

    A more simple example showing the intuitive argument for the use of Lagrange multipliers is wrong can be seen through.

    F(x,y) = sin(x) + 0y,

    x^2+y^2 = 6

    The highest level curve cuts through the constraints graph, it isn't tangent to it.

    The intuitive argument works if the function is increaseing or decreasing throughout the "region" of the constraint but not otherwise, not if there is a max or min level curve on the constraints graph(which cuts through it).
     

    Attached Files:

    Last edited: Jul 30, 2010
  7. Jul 30, 2010 #6

    Mute

    User Avatar
    Homework Helper

    No, it doesn't. [itex]\sin(2\sqrt{2}) \approx 0.049[/itex],while [itex]\sin(\sqrt{3}\sqrt{3}) \approx 0.05233[/itex].

    Uh, the problem isn't about that system of equations, it's a Lagrange multiplier problem, i.e., minimize the function F(x,y) = sin(xy) subject to the constraint c(x,y) = x^2 +y^2 - 6, which amounts to minimizing

    [tex]G(x,y) = F(x,y) - \lambda c(x,y)[/tex]

    I'm not sure where your system of equations comes from, because the minimization procedure yields

    [tex]\frac{\partial G}{\partial x} = y\cos(xy) - 2\lambda x = 0 [/tex]
    [tex]\frac{\partial G}{\partial y} = x\cos(xy) - 2\lambda y = 0 [/tex]
    which gives x^2 = y^2 when lambda isn't zero, which gives the [itex]\pm \sqrt{3}[/itex] solutions.
     
    Last edited: Jul 30, 2010
  8. Jul 30, 2010 #7

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    What about the solutions corresponding to when lambda is zero?


    You're running into an issue of degeneracy. Roughly speaking, at the maximum, every unit vector points in a direction in which the objective function remains constant.
     
    Last edited: Jul 30, 2010
  9. Jul 30, 2010 #8

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    And why cannot lambda be zero?

    The case of lambda=0 just means that the max/min under the constraint happens to be max/min WITHOUT the constraint as well.

    Which is, in fact, the case here.
     
  10. Jul 30, 2010 #9
    I am using radians, sin(2*sqrt(2)) > sin(3).

    I don't understand your explanation.
     
  11. Jul 30, 2010 #10

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If you're at the maximum, then no matter what direction you point, the graph of the objective function is level in that direction.

    In particular, this implies that the tangent line to the constraint function points in a direction in which the objective function is neither increasing nor decreasing. It just so happens that, in the degenerate case, there are lots of other directions with that property as well.

    (Why is it degenerate? Well, for most points, all but 2 unit tangent vectors will be pointing in a direction where the function is either increasing or decreasing)


    That the maximum is not isolated -- there is an entire curve of points that are maxima -- is another source of degeneracy. You probably wouldn't have noticed the first kind of degeneracy if it weren't also for the second kind of degeneracy to make it graphically obvious.

    (Why is it degenerate? The maxima occurs inside the solution set to two equations in two variables -- usually such sets are a discrete set of points)
     
  12. Jul 30, 2010 #11

    Mute

    User Avatar
    Homework Helper

    I thought I was using radians too! Turns out the calculator in Linux was in degree mode! My bad.

    It was an oversight on my part to not check what system of equations lambda = 0 gave.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook