Ask Your Question

Revision history [back]

You could do this:

sage: a, x = var('a x')
sage: f = a * x^3 + 1
sage: P.<x> = SR[]
sage: ff = sum(c*x^j for (c,j) in f.coefficients(x))
sage: ff.parent()
Univariate Polynomial Ring in x over Symbolic Ring
sage: ff.variables()
(x,)