Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To get the coefficient of each monomial, try using

R.<A> = QQ[]
R.<x,y> = PolynomialRing(QQ[A],order='deglex')
f3 = A*x^2 + x^2 + A^2*x + 2*x + x*y+3*x^2*y
list(f3)

This gives:

[(3, x^2*y), (A + 1, x^2), (1, x*y), (A^2 + 2, x)]

I'm not sure if this is exactly what you want, though.

To get the coefficient of each monomial, try usingusing the list command.

R.<A> = QQ[]
R.<x,y> = PolynomialRing(QQ[A],order='deglex')
f3 = A*x^2 + x^2 + A^2*x + 2*x + x*y+3*x^2*y
list(f3)

This gives:

[(3, x^2*y), (A + 1, x^2), (1, x*y), (A^2 + 2, x)]

I'm not sure if this is exactly what you want, though.