1 | initial version |
sage: var('u')
u
sage: solve(u==x^2+1, x)
[x == -sqrt(u - 1), x == sqrt(u - 1)]
So you could use [1]
instead of [0]
to get the "positive" one.
I don't know how you got the r1
from this example, but the documentation for solve says, among other things:
If there is a parameter in the answer, that will show up as a new
variable. In the following example, "r1" is a real free variable
(because of the "r"):
sage: solve([x+y == 3, 2*x+2*y == 6],x,y)
[[x == -r1 + 3, y == r1]]
Hope this helps!