squaring both sides of an equation often produces extraneous
"solutions" as you've illustrated.
Maxima's solve program produces the illustrated form when it cannot
solve any better. It is presumably a feature.

Also a feature:  It does not produce extraneous solutions and check
them afterwards, at least by default.

If you want solve to do something else, you are free to do something
else which such a result, including calling other methods.

I'm not sure that this is an appropriate thread for "sage-devel" since
it has the form of a "bug report". Even if the
result is kind of expected.

RJF

On May 15, 2:35 am, achrzesz <achrz...@wp.pl> wrote:
> Maybe the following workaround attempt
> will be helpful?
>
> var('x,mp,me')
> eq=mp-sqrt(x^2+me^2)==x
> assume(mp>0)
> solve(eq^2,x)
> [x == 1/2*(me^2 - mp^2)/mp, x == -1/2*(me^2 - mp^2)/mp]
>
> On 15 Maj, 01:34, Dox <o.castillo.felis...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi again list,
>
> > This time I come with a problem of solving an algebraic expression, the
> > solution has the variable x on it!
>
> > sage: reset()
> > sage: var('x')
> > sage: var('mp', latex_name=r"m_\pi")
> > sage: var('me', latex_name=r"m_e")
> > sage: f(x) = mp - sqrt(x^2 + me^2) - x
> > sage: solve(f(x)==0, x)
> > [x == mp - sqrt(me^2 + x^2)]

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to