# Calculate new product value from known product, distance and shift

I have $p_1 = xy$ and the distance between $x$ and $y$ is $d = |x-y|$.

I don’t know the values of $x$ and $y$ but I know the product and distance between them, I want to get new product $p_2$ after moving or shifting $x$ and $y$ by value $s$. I can solve it using quadratic equation based on equations $xy=p_1$ and $|x-y|=d$ but is there a function of $(p_1, d,s)$ to get new value $p_2$ without quadratic equation?

• Hi, welcome to Math.SE, please use MathJax to edit the formulae for easier reading – gt6989b Jun 1 '15 at 16:29
• If I saw it during review I may have edited as under. 1,2 are points along x-axis with known coordinates x1 and x2. I have $p1 = x1 x2$ and the separation distance between them is $d = |x1-x2|$. I don’t know the values of $x1$ and $x2$ but I know p1 and d. Next I want to get new product $p_2$ after moving or shifting $x1$ and $x2$ each by value $s$ along x-axis. I can solve it using quadratic equation based on above equations but is there a function of $(p_1, d,s)$ to get new value $p_2$ without using a quadratic equation? – Narasimham Jun 1 '15 at 16:59

You are looking for $$(x-s)(y-s) = xy - s(x+y) + s^2.$$ Since $xy$ and $s$ are known, the only thing you need is $x+y$. To get it, note that $$(x+y)^2 = (x-y)^2 + 4xy,$$ and again both items on the RHS are known...
Warning The quadraticity of the last equation will allow for both positive and negative values of $x+y$