Factor theorem (source code)

= Factor theorem
{wiki}

For a <polynomial> $f$ over a <field>, $f(a)=0$ exactly when $X-a$ divides $f(X)$. <Polynomial division> by the monic linear factor gives
$$
f(X)=(X-a)q(X)+f(a).
$$
The constant <polynomial remainder> is thus the value obtained by evaluation. For $p(X)=X^3-3X^2+4$, the <root of a polynomial> $2$ gives factor $X-2$ and <polynomial quotient> $X^2-X-2$. The latter also vanishes at $2$, explaining the repeated factor. This provides a practical way to move between evaluation and factorization.