Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Several variables, consider polynomail as polynomial only of X, group coefficients

Suppose I have variables d, e and x and I somehow using symbolic calculation get polynomial like this:

9*d^2*e^2*x^2 - 36*d^2*e*x^3 + 18*d*e^2*x^2

I want sage to group coefficients at x and consider my polynomial as polynomial only of x, I want other variables to be no more than just parameters. In short I want to see something like this:

9*d*e^2*(d + 2)*x^2 - 36*d^2*e*x^3

Is it possible to exploit such an approach in Sage?

P.S. I shortened my example. In real life example it is not so easy to see such a grouping by hands.

Several variables, consider polynomail as polynomial only of X, $X$, group coefficients

Suppose I have variables d, e and x and I somehow using symbolic calculation get polynomial like this:

9*d^2*e^2*x^2 

$$9d^2e^2x^2 - 36*d^2*e*x^3 36d^2ex^3 + 18*d*e^2*x^2

18de^2x^2$$

I want sage to group coefficients at x and consider my polynomial as polynomial only of x, I want other variables to be no more than just parameters. In short I want to see something like this:

9*d*e^2*(d 

$$9de^2(d + 2)*x^2 2)x^2 - 36*d^2*e*x^3

36d^2ex^3$$

Is it possible to exploit such an approach in Sage?

P.S. I shortened my example. In real life example it is not so easy to see such a grouping by hands.