(1) You should visit ask.sagemath.org , a stack overflow forum for Sage users, experts, and developers! </plug>
(2) If you want to use the values of the solve () call in something, then probably the easiest way is to use the solution_dict flag:
sage: x,y = var("x, y") sage: eqn = x**4+5*x*y+3*xy==17 sage: solve(eqn,y) [y == -(x^4 + 3*x - 17)/(5*x - 1)] sage: solve(eqn,y,solution_dict=True) [{y: -(x^4 + 3*x - 17)/(5*x - 1)}]
This option provides solutions in the form of a list of dictionaries instead of a list of equations. We can access the results, like any other dictionary:
sage: sols = solve(eqn,y,solution_dict=True) sage: sols[0][y] -(x^4 + 3*x - 17)/(5*x - 1)
and then we can assign this something else if you want:
sage: z = sols[0][y] sage: z -(x^4 + 3*x - 17)/(5*x - 1)
and replace:
sage: eqn2 = y*(5*x-1) sage: eqn2.subs(y=z) -x^4 - 3*x + 17
et cetera. Although IMHO above is more convenient, you can also access the same results without a dict solution via .rhs ():
sage: solve(eqn,y)[0].rhs() -(x^4 + 3*x - 17)/(5*x - 1)
source share