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

Crazy optimization/Lagrange questino

  1. Nov 4, 2004 #1
    Ok this is the question I had on a test today:

    given this constraint equation z^2-xy+1=0 find the min. distance from the origin using Lagrange method.

    so basically you use D^2=x^2+y^2+z^2 as the other equation. however, it basically goes nuts from there. especially if you set it up like you are suppose to.

    (capitals are partial derivatives)

    with f as the distance formual and g as the constraint

    this one sucks but if someone could help it would be greatly appreciated
  2. jcsd
  3. Nov 8, 2004 #2


    User Avatar
    Science Advisor
    Homework Helper

    Try not to minimize [itex]D=\sqrt{x^2+y^2+z^2}[/itex], but [itex]D^2=x^2+y^2+z^2[/itex].
  4. Nov 8, 2004 #3


    User Avatar
    Science Advisor

    1. Why was this posted under "differential equations"?

    2. You want to minimize F= x2+ y2+ z2 subject to the condition G= z^2-xy+1=0.
    Okay, grad F= 2xi+ 2yj+ 2zk= λgrad G= &lambda(-yi- xj+ 2zk)
    so 2x= -λy, 2y= -λx, and 2z= -2λz

    Divide the first equation by the second, x/y= y/x so x2= y[/sup]2[/sup] and y= x or y= -x.
    From 2z= -2λz, either z= 0 or &lambda= -1.

    With x= y, z= 0, since z^2-xy+1=0, we have -x2+ 1= 0 so x= +1 or -1:
    (1, 1, 0) and (-1,-1,0) are possible points.

    With x= -y, z= 0, since z^2-xy+1=0, we have x2+ 1=0 which is impossible.

    If z is not 0, then &lambda= -1 so 2x= -λy become 2x= y and 2y= -λx becomes 2y= x: 2y= 2(2x)= 4x= x so x= y= 0. In that case z^2-xy+1=0 becomes z2+ 1= 0 which is impossible.

    The two minimum distance points are (1,1, 0) and (-1,-1,0). The are both distance √(2) from (0,0,0).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook