On Apr 15, 3:34 am, Diravan <[email protected]> wrote:
> I need to solve a very simple equation x^2 + 1 = 0 and I don't want
> any complex solutions.
> I tried this
> x = var('x')
> assume(x,'real')
> solve(x^2 + 1 == 0)
> but the output is [x == -1*I, x == I]
> Does exist any solution in order to avoid this ?


The assumption is taken on 'x' in the equation itself to be real. So,
if x IS real, then the solution is AS SHOWN.

You are NOT telling sage to assume that the SOLUTION is real. You are
telling sage that the 'x' in the equation itself which is yet to be
solved IS real. Do you see the difference?

--Nasser
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to