I have an expression as: 1/(x+1)+4*x/(x-1)+3-4*x**2+10*x**2
1/(x+1)+4*x/(x-1)+3-4*x**2+10*x**2
What I need is a list that contain the terms in this expression. i.e. [1/(x+1), 4*x/(x
[1/(x+1), 4*x/(x
In this case it is very easy:
>>> expr = 1/(x+1)+4*x/(x-1)+3-4*x**2 >>> expr.args ⎛ 1 2 4⋅x ⎞ ⎜3, ─────, -4⋅x , ─────⎟ ⎝ x + 1 x - 1⎠