ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 08 Oct 2012 05:43:35 -0500eliminating fractions and roots from equationshttp://ask.sagemath.org/question/9400/eliminating-fractions-and-roots-from-equations/I'm trying to solve the following equations for $a$ and $c$, where all numbers are real, $0\leq a < 1$ and $0 < c$:
[sqrt(abs((b - 1)*(a + 1)/sqrt(c^2 + abs(b - 1)^2) + a)^2 + abs((a +
1)*c/sqrt(c^2 + abs(b - 1)^2))^2) == a + 1, sqrt(abs(-(b + 1)*(a -
1)/sqrt(c^2 + abs(b + 1)^2) + a)^2 + abs(-(a - 1)*c/sqrt(c^2 + abs(b +
1)^2))^2) == -a + 1]
$$\sqrt{\left|\frac{(b-1)\cdot(a+1)}{\sqrt{c^2+|b-1|^2}+a}\right|^2+\left|\frac{(a+1)\cdot c}{\sqrt{c^2+|b-1|^2}}\right|^2}=a+1$$
$$\sqrt{\left|\frac{-(b+1)\cdot(a-1)}{\sqrt{c^2+|b+1|^2}+a}\right|^2 + \left|\frac{-(a-1)\cdot c}{\sqrt{c^2+|b+1|^2}}\right|^2}=-a+1$$
Now solve itself seems to take forever on this without coming up with a result. On the other hand, I as a human have a pretty good idea how I'd solve such beasts: square both sides to get rid of the outer square roots, then multiply both sides with the common denominator, then move the single remaining square root to one side and all the rest to the other side and square again.
I know that these steps *might* introduce additional solutions, which are valid solutions of the modified system but not of the original one. Nevertheless, I'd like to be able to get at them, probably with some indication how good they are.
I wrote a bit of code to massage my equations for me:
def massage(e):
e = e.simplify().simplify_radical().full_simplify()
e = e.power(2).simplify()
e = e.multiply_both_sides(e.lhs().denominator()).simplify()
e = e.subtract_from_both_sides(e.rhs()).simplify()
e = e.subtract_from_both_sides([
term for term in e.lhs().operands() if 'sqrt' in str(term)][0])
e = e.simplify().power(2).simplify()
e = e.subtract_from_both_sides(e.rhs()).expand()
e = e.simplify().simplify_radical().full_simplify()
return(e)
But this sequence is highly specific to the equations at hand. And the part about how to identify which operand contains the nested square root is plain ugly. **So what better methods are there to perform this kind of equation simplification?** Preferrably in a much more automated way.
*Just for your information:* If I modify my equations using the code above, I am able to get 9 solutions. I'm not sure whether I actually trust them, as I would have expected something else, but there might be something wrong with either my expectation or the way I obtained the euqations.Mon, 08 Oct 2012 05:43:35 -0500http://ask.sagemath.org/question/9400/eliminating-fractions-and-roots-from-equations/