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.