Dear list,
Observe the following behavior. Why is it that once the denominator
of g becomes not 1, solve seems to hiccup? Does it do some internal
simplification first? In particular, is there a flag we should be
setting? (Yes, I realize that to_poly_solve will do these, but it uses
the %union notation, which is superfluous here.)
(%i2) assume(h>0);
(%o2) [h > 0]
(%i3) solve(sqrt(x+g)=h,x);
2
(%o3) [x = h - g]
(%i4) solve(sqrt(x+1)=h,x);
2
(%o4) [x = h - 1]
(%i5) solve(sqrt(x+2.0)=h,x);
rat: replaced 2.0 by 2/1 = 2.0
2
(%o5) [x = h - 2]
(%i6) solve(sqrt(x+1/4)=h,x);
sqrt(4 x + 1)
(%o6) [------------- = h]
2
(%i7) solve(sqrt(x+2.5)=h,x);
rat: replaced 2.5 by 5/2 = 2.5
sqrt(2 x + 5)
(%o7) [------------- = h]
sqrt(2)
This was particularly perplexing. See
http://ask.sagemath.org/question/940/solve-gives-1-2-or-3-answers-depending-if-one
for the original context.
(%i9) solve(sqrt(4*x+1)/2=h,x);
2
4 h - 1
(%o9) [x = --------]
4
Thanks for any ideas! Or I'll file a bug report if this is one - but
the answers aren't *wrong*, so I hesitate to call it a bug per se.