Ask Your Question

Revision history [back]

If i understand correctly, you are looking for a polynomial in the indeterminate x whose coefficients belong to the polynomial ring with indeterminates d and e. You can define this as follows (assuming the numeral coefficients are rational numbers):

sage: R.<d,e> = PolynomialRing(QQ)
sage: R
Multivariate Polynomial Ring in d, e over Rational Field

sage: S.<x> = PolynomialRing(R)
sage: S
Univariate Polynomial Ring in x over Multivariate Polynomial Ring in d, e over Rational Field

sage: P = 9*d^2*e^2*x^2-36*d^2*e*x^3+18*d*e^2*x^2
sage: P
-36*d^2*e*x^3 + (9*d^2*e^2 + 18*d*e^2)*x^2