Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

An other way:

solve returns a list of equations.

You can get the value with .rhs() ( right hand side )

h(x) = x^2-9
sols = solve(h == 0, x); print sols
h(sols[0].rhs())

An other way:

solve returns a list of equations.

You can get the value with .rhs() ( right hand side )

h(x) = x^2-9
sols = solve(h == 0, x); print sols
h(sols[0].rhs())
x0 = sols[0].rhs()
h(x0)

Further you can use python dictionaries:

h(x) = x^2-9
sols = solve(h(x), x,solution_dict=True); print sols
h(sols[0][x])