Ask Your Question

Revision history [back]

For your very last question:

sage: R.<x> = PolynomialRing(QQ, 'x')
sage: P = (1/2*x+3)^5
sage: P.factor()
(1/32) * (x + 6)^5
sage: len(P.factor())
1
sage: Q = P * (3*x+2)
sage: len(Q.factor())
2

This is because you may think of the result of .factor() as a unit together with a list of pairs (factor, multiplicity).