Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Alternatively one can use the optional parameter solution_dict=True as below, so the result of the solve function is rather a list of "solutions", where each solution is a dictionary. The keys of the dictionary being the unknowns. Here we have only one unknown variable, y. (It would be better to use the right name for the right object, so fexplicit is misleading, rather solutions or solutions_list should be used.)

sage: var('x y');
....: fxy = y - 1/x + 1
....: fexplicit = fxy.solve(y, solution_dict=True)
....: # we have only one solution, but in general...
....: for sol in fexplicit:
....:     print "Solution:", sol[y]
....:     sol[y].plot(ymin=-10, ymax=10)
(x, y)
Solution: -(x - 1)/x
Launched png viewer for Graphics object consisting of 1 graphics primitive