2
$\begingroup$

Is Solve[] very inefficient in solving equations involving square roots?

The input below attempts to find out the explicit expression of either x or y in terms of other variables {x|y, a, c}, and c is the focal length, a is directrix.

F = (Sqrt[(x+c)^2+y^2]-Sqrt[(x-c)^2+y^2]==2a && x>0 && c>0 && a>0 && c>a)

Solve[F,y]

Solve[F,x]

After running on my Acer dual core laptop for over 4 hours this input is still shown in “running” state.

http://reference.wolfram.com/mathematica/ref/Solve.html

“Solve deals primarily with linear and polynomial equations.”

So is the equation above an example that Solve[] works not so well with equations involving square roots (and likely other order roots) ?

$\endgroup$

1 Answer 1

4
$\begingroup$

In this case, the main issue is that we should restrict the domain of x and y to be in the real numbers. Therefore, use the following:

Reduce[F, y, Reals] (* ==> x > 0 && 0 < a <= x && c > a && (y == -Sqrt[((a^4 - a^2 c^2 - a^2 x^2 + c^2 x^2)/a^2)] || y == Sqrt[(a^4 - a^2 c^2 - a^2 x^2 + c^2 x^2)/a^2]) *) Reduce[F, x, Reals] (* ==> c > 0 && 0 < a < c && x == Sqrt[(a^4 - a^2 c^2 - a^2 y^2)/(a^2 - c^2)] *) 

It's done in the blink of an eye.

If you prefer, Solve can also do it but gives a different formulation of the answer:

Solve[F, y, Reals] (* ==> {{y -> ConditionalExpression[-Sqrt[((a^4 - a^2 c^2 - a^2 x^2 + c^2 x^2)/ a^2)], 0 < a < x && c > a && x > 0]}, {y -> ConditionalExpression[Sqrt[(a^4 - a^2 c^2 - a^2 x^2 + c^2 x^2)/ a^2], 0 < a < x && c > a && x > 0]}} *) Solve[F, x, Reals] (* ==> {{x -> ConditionalExpression[Sqrt[(a^4 - a^2 c^2 - a^2 y^2)/( a^2 - c^2)], (0 < a < c && c > 0 && y > 0) || (0 < a < c && y < 0 && c > 0)]}} *) 
$\endgroup$
6
  • $\begingroup$ (Sqrt[(x+a)^2+y^2]-Sqrt[(x-a)^2+y^2]==c&&c>0&&a>0&&c>2a) -Sqrt[(-a+x)^2+y^2]+Sqrt[(a+x)^2+y^2]==c&&c>0&&a>0&&c>2 a Solve[%,x,Reals] {} Reduce[%%,x,Reals] False Thanks very much for your help. I did try your solution , however it worked only ONCE and gave the correct result in "ConditionalExpression"; in all subsequent runnings I got the above. $\endgroup$ Commented Jun 5, 2013 at 2:00
  • $\begingroup$ Reduce[] returns false, and Solve[] returns empty set. I cannot find an apparent error that has caused the failure. The link for the failed notebook file "hyperbola.nb" is here $\endgroup$ Commented Jun 5, 2013 at 2:05
  • $\begingroup$ Dear @Jimmy, please do not use answers to post comments to answers; if the comment box is too small, you might consider splitting into two comments, or shortening what you've written. $\endgroup$ Commented Jun 5, 2013 at 2:36
  • $\begingroup$ Thanks for doing the conversion. $\endgroup$ Commented Jun 5, 2013 at 3:40
  • $\begingroup$ You must have made a mistake, but I can only guess what it is because your syntax is wrong again. Do not use % in Solve, use a name for the equation to be solved and refer to that name in Solve. $\endgroup$ Commented Jun 5, 2013 at 4:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.