Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

(I'm not sure if this is the best way.)

b is a list of solutions, and you want the right hand side of the first solution.

var('x,y')
a = y - 2 == x
b = solve(a, y)
c=b[0].rhs()
print c
print type(c)
print c(x=5)

Output:

x + 2
<type 'sage.symbolic.expression.Expression'>
7