import sympy sympy.init_printing()
x, y, z = sympy.symbols('x y z')
x**2 + y
a = x * (x - 3) + 1 a
sympy.solve(a, x)
sympy.solve(x * (x - y) + z, x)
b = x * y + 1 b
sympy.solve(b, x)