If $R$ is a UFD, $p(x)\in R[x]$ and $a/b$ is a root of $p(x)$ in the fraction field, then we have $p(x)=(bx-a)q(x)$ for $q(x)\in R[x]$.

Suppose $$R$$ is a UFD and $$p(x)\in R[x]$$ a polynomial of degree $$\ge 1$$. Suppose $$\frac ab$$ is in the fraction field $$K$$ of $$R$$, with $$a$$ and $$b\in R$$ and $$\text{gcd}(a,b)=1$$, and such it is a root of $$p(x)$$, so $$p(\frac ab)=0$$.

Question: Is it true that then we have $$p(x)=(bx-a)q(x)$$ with $$q(x)\in R[x]$$?

It is clear that $$q(x)\in K[X]$$ exists and it is unique. Since the highest degree coefficient of $$p(X)$$ is divisible by $$b$$ and the constant term is divisible by $$a$$ (e.g. the rational root theorem ) one can easily show that the highest degree coefficient and the constant term of $$q(x)$$ are in $$R$$. This shows the case $$p(x)$$ has degree 2.

A suspect it should a consequence of the so called Gauss Lemma, but I was not able to find a convincing argument.

Note: $$\,p(x) = (bx\!-\!a)q(x) = (bx-a)\frac{c}d\bar q(x)\,$$ by Factor Theorem in $$K[x],\,$$ $$\color{#0a0}{{\rm primitive} \ \bar q}\in R[x]$$

thus $$\, d p(x) = (bx\!-\!a)\, c\,\color{#0a0}{\bar q(x)},\,$$ so taking $$C =$$ content of this

$$\Rightarrow\, d\,C(p(x))\ =\ 1\cdot c\cdot\color{#0a0} 1,\,$$ i.e. $$\,d\mid c\,$$ in $$\,R,\,$$ so $$\,q = \frac{c}d \bar q\in R[x].\ \$$ QED

Or by nonmonic Division: $$\, b^k p(x) = (bx\!-\!a) q(x) + r,\ r\in R,\,$$ so $$\,r = 0\,$$ by eval at $$\,x = a/b.\,$$ Note $$\color{#c00}{(b,bx\!-\!a)}=(b,a)=\color{#c00}1,\,$$ so $$\,\color{#c00}{b\mid (bx\!-\!a)}q(x)\,\overset{\rm Euclid}\Longrightarrow\,b\mid q(x),\,$$ thus $$\,b^k\mid q(x)\,$$ by induction [or we can use localization or the AC method as described in the link].

• The "nonmonic division" answer is the best because it makes clear that this only depends on the root $a/b$ in question having a gcd between $a$ and $b$; the answer does not depend on any global property of $R$. – Badam Baplan May 21 at 16:18
• @Badam Indeed, that was part of my motivation for adding that method even though the OP leaned towards Gauss. A warm welcome back to you. – Gone May 21 at 16:23
• Thank you Bill, I appreciate that! Warm regards to you as well. As for the comment, I only meant it as an endorsement of your answer, which I feel is the pedagogically 'right' one. – Badam Baplan May 22 at 2:50

By the Factor Theorem, since $$f(a/b)=0$$, we have $$f(x)=\left(x-{\small{\frac{a}{b}}}\right)v(x)$$ for some $$v\in K[x]$$.

Letting $$g(x)=v(x)/b$$, we have $$f(x)=(bx-a)g(x)$$ where $$g\in K[x]$$.

Our goal is to show $$g\in R[x]$$.

Letting $$d\in R$$ be the least common multiple of the denominators of the fractionally reduced coefficients of $$g$$, it follows that $$g(x)=G(x)/d$$ where $$G\in R[x]$$ is primitive.

Then from $$f(x)=(bx-a)g(x)$$, we get $$d{\,\cdot}f(x)=(bx-a)G(x)$$.

By Gauss' lemma, since $$bx-a$$ and $$G$$ are primitive in $$R[x]$$, the product $$(bx-a)G(x)$$ is primitive in $$R[x]$$.

Hence $$d{\,\cdot}f(x)$$ is primitive in $$R[x]$$, so $$d$$ is a unit of $$R$$.

Finally, since $$G\in R[x]$$ and $$d$$ is a unit of $$R$$, the equation $$g(x)=G(x)/d$$ implies $$g\in R[x]$$, as was to be shown.