Say I have an expression
test = 3 x1^2 - 2 x3^-3
and I would like to decompose the expression into
{3 x1^2, -(2/x3^3)}
I can do that by using List @@ test on Mathematica.
However, the problem I face is that when the expression is test = x1^2, i get {x1, 2} and for test = (3 x1^2) i get {3, x1^2} instead of {x1^2} and {3x1^2} respectively.
The added information I have is the list of variables. For example, if test = x1^2 I have the list of variables, which is {x1}. And for test = 3 x1^2 - 2 x3^-3, I have {x1,x3}
Is there any other way to get what I want?
Thanks