I am trying to break an equation step by step by checking the arithmetic dependencies. I have tried using the sympy.simplify() and sympy.expand(), but I am not getting the desired output.
Input:
m = 10*((9*(x**3) + 2*(y**4))**3) + 3*(y**3 + z)
Expected Output: An array containing all the possibilities as mentioned below
output_list = ['10*((9*(x**3) + 2*(y**4))**3)',
'(9*(x**3) + 2*(y**4))**3',
'9*(x**3) + 2*(y**4)',
'9*(x**3)',
'x**3',
'x',
'2*(y**4)',
'y**4',
'y',
'3*(y**3 + z)',
'y**3 + z',
'y**3',
'y',
'z']
I split the equation every time by observing the main dependency to get the next possible dependent equation and finally to the dependent variables.
In the above equation, 10(9(x^3) + 2(y^4))^3, 10 is multiplied after substituting the values of x and y. So, I first removed 10. Then, I have removed the cube, followed by the addition symbol, and etc. to get the output_list.
How can I get the output_list using Python?