Polynomial remainder theorem (source code)

= Polynomial remainder theorem
{title2=$\operatorname{rem}_{X-a}f=f(a)$}
{wiki}

Dividing a <polynomial> $f$ by $X-a$ leaves the constant <polynomial remainder> $f(a)$. <Polynomial division> makes the <polynomial remainder> constant because its <polynomial degree> must be below one; <polynomial evaluation> at $a$ identifies that constant. In particular, it is zero exactly when $a$ is a <root of a polynomial> of $f$, which is the <factor theorem>.<Fields and Galois Theory by James S. Milne>[Fields and Galois Theory, version 5.10, Chapter 1, p. 10, §1.7: division by X−a and evaluation of the constant remainder]{ref}

In the worked example, division by $X-1$ leaves $6$ and division by $X+2$ leaves $12$. Division by their product leaves $-2X+8$, a <polynomial remainder> that stores both values at once. The argument also holds over a <commutative ring> for $a$ in that <ring>, because $X-a$ is a <monic polynomial>.