1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

X = p * y. Find x, y when both are as close to 1 as possible

  1. Mar 20, 2015 #1
    Knowing that:

    x = p * y where p = (0, 1] and x, y = (0, 2]

    find x and y in such a way that both of them be as close as possible to 1 simultaneously.

    I guess that the solution is x = 1/y = sqrt(p) but I do not know how to prove it.
  2. jcsd
  3. Mar 20, 2015 #2


    Staff: Mentor

    What does p = (0, 1] mean? What does x, y = (0, 2] mean? Does the first one mean ##x \in (0, 1]##?
    Can you pick p = 1, and then let x = y = 1?
  4. Mar 20, 2015 #3
    - Yes, x,y=(0,2] means x∈(0,2] and y∈(0,2].
    - p is a given constant. In my specific case p = 0.457.
  5. Mar 20, 2015 #4


    Staff: Mentor

    Since p is a constant, then for a given x value, the y value is y = x/p = x/.457 .
    If you let w = (x - 1)2 + (x/.457 - 1)2, you're looking for the value of x that minimizes w.

    Edited above to fix my earlier mistake.
    Last edited: Mar 21, 2015
  6. Mar 20, 2015 #5
    I believe it should be w(x) = (x - 1)^2 + (x/p - 1)^2 = minim which has the solution:
    x = p(p+1)/(p^2+1)
    It appears that x is not sqrt(p).
  7. Mar 21, 2015 #6


    Staff: Mentor

    Yes, I switched p and x due to a silly mistake on my part. I have edited my earlier post.
  8. Mar 21, 2015 #7
    I want now to minimize ## w(x) = (x - 1)^2 + (y - 1)^2 ## knowing that ## px^3+qx^2y+rxy^2+ty^3=0 ## but without solving the equation to obtain y as a function of x and then replace it in ## w(x) ## because this appears to be impractical. Is it possible?
  9. Mar 23, 2015 #8


    User Avatar
    Science Advisor

    Use "Lagrange multipliers". Since [itex]w(x,y)= (x- 1)^2+ (y- 1)^2[/itex], [itex]\nabla w= 2(x- 1)\vec{i}+ 2(y- 1)\vec{j}[/itex]. Writing the constraint as [itex]f(x,y)= px^3+ qx^2y+ rxy^2+ ty^3[/itex], [itex]\nabla f= (3px^2+ 2qxy+ ry^2)\vec{i}+ (qx^2+ 3rxy+ 3ty^3)\vec{j}[/itex]. At a max or min of w, with constraint f, those two gradient vectors must be parallel. That is, there must exist a number, [itex]\lambda[/itex] (the "Lagrange Multiplier") such that [itex]2(x- 1)\vec{i}+ 2(y- 1)\vec{j}[/itex][itex]= \lambda[(3px^2+ 2qxy+ ry^2)\vec{i}+ (qx^2+ 3rxy+ 3ty^3)]\vec{j}[/itex].

    That gives the equations [itex]2(x- 1)= \lambda (3px^2+ 2qxy+ ry^2)[/itex] and [itex]2(y- 1)= \lambda(qx^2+ 3rxy+ 3y^3)[/itex] which, together with the constraint, give three equations to solve or x, y, and [itex]\lambda[/itex]. Since a value for [itex]\lambda[/itex] is not part of the solution to this problem, I find that it is often simplest to first eliminate [itex]\lambda[/itex] by dividing one equation by the other. Dividing the first of those two equations by the second,
    [tex]\frac{2(x- 1)}{2(y- 1}= \frac{3px^2+ 2qxy+ ry^2}{qx^2+ 2rxy+ 3ty^3}[/tex].

    That is, of course, equivalent to [tex](x- 1)(qx^2+ 2rxy+ 3ty^3)= (y- 1)(3px^2+ 2qxy+ ry^2)[/tex].
  10. Mar 24, 2015 #9
    Yes, the method of Lagrange is a good idea because numeric solutions for x and y can be found with Mathcad if the parameters are known. Thank you all for your help.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook