Factor Theorem in Unique Factorization Domain

To Prove: Suppose $r \in R$ and $P(x)$ a polynomial in $R[x]$ where R is a unique factorization domain. Prove that $x-r$ divides $P(x)$ iff $P(r)=0.$ I am able to prove this if R is a field because I can use the Division Algorithm but I am really stuck on this. Help would be greatly appreciated

Theorem: Let $D$ be an integral domain with unity, and let $a(x)$, $b(x)$ be polynomials with coefficients in $D$, where $q(x)$ is monic. Then there exist polynomials $q(x)$, $r(x)$ with coefficients in $D$ such that $a(x)=q(x)b(x)+r(x)$, where $r(x)$ is the zero polynomial or has degree less than the degree of $b(x)$.
The proof is basically the same as the proof for $D$ a field. For example we can consider the collection $P$ of all polynomials over $D$ of the form $a(x)-f(x)b(x)$, and let $r(x)$ have smallest degree among these. It is easy to show that if the degree of $r(x)$ is greater than or equal to the degree of $b(x)$, there is a polynomial in $P$ of degree smaller than the degree of $r(x)$. It is at this stage where the fact that $b(x)$ is monic is needed.
• I have added to the answer. In particular, there is a $q(x)$ and constant polynomial $c$ such that $P(x)=q(x)(x-r)+c$. Put $x=r$. We get $c=P(r)=0$. Dec 4, 2015 at 16:00
• Theorem: Let $R[x]$ be a polynomial ring over an integral domain R. Let $f(x), g(x) \in R[x]$ be polynomials of degree m and n respectively, then if we let $k = max(m-n+1, 0)$, and if a is the leading coefficient of $g(x)$, then there exists unique polynomials $q(x), r(x) \in R[x]$ such that $a^kf(x) = q(x)g(x) + r(x)$, where $r(x) = 0$ or has degree less than n. Dec 4, 2015 at 16:16