i want to disable automatic simplification in sympy, for example solving the equation x*y-x
i want to get x/x
instead of 1
import sympy
from sympy.abc import x,y,z
expr = x*y-x
sympy.solve(expr,y)
=> 1 # i want unsimplified x/x instead of 1
From the sympy manual, i found UnevaluatedExpr for this purpose, but it returns empty list for the example given
from sympy import UnevaluatedExpr
expr1 = UnevaluatedExpr(x)*UnevaluatedExpr(y)-UnevaluatedExpr(x)
sympy.solve(expr1,y)
=> []
my question is
- what is wrong with the example given?
- how can i keep expressions not-evaluated/not-simplified?