TITLE: Why doesn't the polynomial factor theorem hold for polynomials in a non-field ring?
QUESTION [5 upvotes]: I was reading in a book that the Factor Theorem only holds over fields (not rings). Why would that be true? No where in the proof of the factor theorem is a multiplicative inverse taken, so the proof should be as valid for polynomials in rings as it is for polynomials in fields, right?

REPLY [6 votes]: The single factor theorem holds over any commutative ring. But multiple factors need not, e.g.
Bifactor Theorem $\ $ Suppose that $\rm\,a,b\,$ are elements of a commutative ring $\rm\,R\,$ and $\rm\:f\in R[x]\,$ is a polynomial with coefficient in $\rm\,R.\,$ If $\rm\ \color{#C00}{a\!-\!b}\ $ is cancelable in $\rm\,R\,$ then
$$\rm f(a) = 0 = f(b)\ \iff\ f\, =\, (x\!-\!a)(x\!-\!b)\ h\ \ for\ \ some\ \ h\in R[x]$$
Proof $\,\ (\Leftarrow)\,$ clear. $\ (\Rightarrow)\ $ Applying  Factor Theorem twice, while canceling $\rm\: \color{#C00}{a\!-\!b},$
$$\begin{eqnarray}\rm\:f(b)= 0 &\ \Rightarrow\ &\rm f(x)\, =\, (x\!-\!b)\,g(x)\ \ for\ \ some\ \ g\in R[x]\\
\rm f(a) = (\color{#C00}{a\!-\!b})\,g(a) = 0 &\Rightarrow&\rm g(a)\, =\, 0\,\ \Rightarrow\,\ g(x) \,=\, (x\!-\!a)\,h(x)\ \ for\ \ some\ \ h\in R[x]\\
&\Rightarrow&\rm f(x)\, =\, (x\!-\!b)\,g(x) \,=\, (x\!-\!b)(x\!-\!a)\,h(x)\end{eqnarray}$$
Beware $\ $ The theorem  may fail when $\rm\ a\!-\!b\ $ is not cancelable (i.e. is a zero-divisor), e.g.
$\rm mod\ 8\!:\,\ f(x)=x^2\!-1\,\Rightarrow\,f(3)\equiv 0\equiv f(1)\,$ $\rm but\ \  x^2\!-1\not\equiv (x\!-\!3)(x\!-\!1)\equiv x^2\!-4x+3$