I need to extract several variables from multivariate polynomials.
Here's an example.
Suppose I want to express
p = w^3*z^2*x^4*y + w^3*z^2 - 3*w^2*z*x^3 + 2*w^2*z*x
as a polynomial in w. Then I can call
(z^2*y*x^4 + z^2)*w^3 + (-3*z*x^3 + 2*z*x)*w^2
But for me it's not always enough to extract a single variable. I
need to be able to call something like
(y*x^4 + 1)*w^3*z^2 + (-3*x^3 + 2*x)*w^2*z
It's clear that I could call polynomial() repeatedly to accomplish
this, but if there's already some machinery that makes this easy I'd
like to use it. So what is the best approach?
Thanks in advance for the help.
Sorry for the noise - I realized this is utterly trivial.
BTW, sage is one of the best tools I have ever used. You guys have
done a huge service to the mathematics community.