# In $R[x]$, $f=g \iff f(x)=g(x), \forall x \in R$

Let $R$ be an integral domain and $R[x]$ the polynomial ring over $R$. Let $f,g \in R[x]$ such that $\max(\deg f, \deg g)< \#R$. Show that $f=g \iff f(x)= g(x), \forall x \in R$.

$\bf Attempt:$ Since $f,g \in R[x]$, $$f(x)=a_0+a_1x +a_2x^2+ \dots + a_nx^n \\ g(x)=b_0+b_1x+b_2x^2+\dots+b_mx^m,$$ for some $a_i,b_j \in R \ (\text{with} \ 1\leq i \leq n, 1\leq j \leq m$). WLOG, $n<m$.

Assume that $f(x) = g(x)$ for all $x \in R$. Then $$a_0+a_1x +a_2x^2+ \dots + a_nx^n = b_0+b_1x+b_2x^2+\dots+b_mx^m.$$ In particular if $x=0$, this implies $a_0 = b_0$.

So $$a_1x +a_2x^2+ \dots + a_nx^n =b_1x+b_2x^2+\dots+b_mx^m \\ (a_1-b_1)x +(a_2-b_2)x^2+ \dots + (a_n-b_n)x^n-b_{n+1}x^{n+1} \dots -b_mx^m = 0.$$

After this point, I tried to make some argument that $n=m$ but ran into the problem that I could possibly have that $x^p=x^q$ for all $x \in R.$ So I can't claim that each of the coefficients is zero. I'm certain that I need to use the condition regarding the degrees of $f$ and $g$ but I'm not sure how to.

• Do we assume $R$ is commutative? – Moya Feb 24 '15 at 1:32
• Yes, I think in the book I'm using the author assumes that – Rebekah Feb 24 '15 at 1:37
• There's a much simpler way. There is a way of defining division on $R[x]$, see [here]. From this, we conclude that if $deg\,f=n$ and $\deg\,g=n$, then $\deg\, (f+g)\leq \max\{n,m\}$, equality when $n=m$. Moreover, $f$ has at most $n$ roots, and $-g$ has at most $m$ roots since $deg\, g=deg\,(-g)$. Assume $n>m$. Then $f-g$ has at most $n$ roots if $f\neq g$. But it has many more roots than this, since $f-g=0$. If $n=m$, the same result holds. : math.stackexchange.com/questions/7990/… – Moya Feb 24 '15 at 1:47

## 1 Answer

Equivalently, $\,h := f-g = 0 \iff h(x)=0\,\ \forall x\in R.\$ If $\,h\ne 0\,$ had more roots $\,r_i$ than its degree then, by the Factor Theorem, it would be divisible by the nonassociate primes $\,x-r_i,\,$ hence also divisible by their lcm $= \prod x-r_i,\,$ a polynomial of greater degree than $\,h,\,$ a contradiction.

Remark $\$ Note that $\,x\!-\!r\,$ is prime by $\,R[x]/(x\!-\!r) \cong R\,$ is a domain.  Furthermore

Lemma $\,\ \color{#c00}{\rm nonassociate}\,$ primes $\,p_i\mid a\, \Rightarrow\ p_1\cdots p_n\mid a\ \ \$ [lcm = product]

Proof $\$ Induct on $\,n.\,$ Clear if $\,n=1.\,$ By induction $\,p_1\mid a,\ldots,p_{n-1}\mid a\,\Rightarrow\, a = p_1\cdots p_{n-1} a_1.\,$ $\,\color{#c00}{p_n\nmid p_i}\,$ for $\,i< n\$ so $\ p_n\mid p_1\cdots p_{n-1}a_1\Rightarrow\,p_n\mid a_1,\$ so $\ a_1 = p_n a_2,\,$ hence $\ a = p_1\cdots p_n a_2\ \$