Ask Your Question

# Revision history [back]

If are dealing with polynomials only you should look into using polynomial rings.

sage: R.<x> = QQ[]
sage: y = x^2 + 6*x^3 + 3*x^4
sage: y.factor()
(3) * x^2 * (x^2 + 2*x + 1/3)
sage: list(_)
[(x, 2), (x^2 + 2*x + 1/3, 1)]