Prime ideals in $R[x]$ that intersects $R$ trivially 
We have that $R$ is a UFD. Now, I'm trying to show that any prime ideal $P$ of $R[x]$ that intersects $R$ trivially is a principal ideal.

I'm trying to show that P has height $1.$ Is this true that P has height $1$? But I cannot prove this. If that is the case, then I can easily prove that P is in fact a principal ideal. Any suggestions would be highly appreciated. Thank you.
 A: Here's a more hands-on version Marktmeisters' excellent answer. It assumes the following fact:
Fact: Any two elements of a UFD have a $\gcd$.
Let $f\in P$ be nonzero and of minimal degree, and let $c\in R$ denote the $\gcd$ of its coefficients so that $f=cg$ for some $g\in R[x]$. Because $P$ is prime and $P\cap R=0$ it follows that $g\in P$.
Now let $h\in P$ be nonzero, and let $d=\gcd(g,h)$. Then $g=ad$ and $h=bd$ for coprime $a,b\in R[x]$. Because $P$ is prime it follows that $d\in P$ as otherwise $a,b\in P$, which implies $R[x]=(a,b)\subset P$, a contradiction.
Because $g$ is of minimal degree it follows that $\deg d=\deg g$ and $a\in R$. Then $a$ divides all coefficients of $g$, hence $a$ is a unit. It follows that $(g)=(d)$ and hence $(h)\subset(g)$. Because $h\in P$ was arbitrary it follows that $P\subset(g)$, and hence $P=(g)$ is principal.
A: Suppose that $P$ is prime in $R[x]$ and intersects $R$ trivially. We can assume that $P \neq (0)$.
Now, let $S = R \setminus \{0\}$ and denote by $K := R_S$ the localization of $R$ at $S$; i.e., $K$ is the field of fractions of $R$. Then, $R[x]_S = K[x]$; denote by $\iota \colon R[x] \hookrightarrow K[x]$ the canonical inclusion. 
Since $P$ does not intersect $S$ and $P$ is prime in $R[x]$, we obtain that $\iota(P)$ is a non-zero prime ideal of $K[x]$. In particular, since $K[x]$ is a PID, it is generated by an irreducible polynomial $f \in K[x]$. 
By assumption $P \neq (0)$, so that we will find a polynomial $0 \neq g \in P$ of minimal degree. 
Claim: We can even choose $g$ to be irreducible in $R[x]$.
Proof: Assume that all such $g$'s were reducible, $g = g_1 g_2$, where w.l.o.g. $g_1$ is irreducible of positive degree. Since $g$ was chosen to be of minimal degree in $P$, we obtain that $\deg(g_1) = \deg(g)$ and that $g_2 \in R$. Since $P$ is prime and $g_2 \notin P$, we obtain that $g_1 \in P$, a contradiction. $\Box$
In the following, we identify $\iota(g)$ with $g$ and $R[x]$ with $\iota(R[x])$. Since $g \in \iota(P) = \langle f \rangle_{K[x]}$, there is a polynomial $h \in K[x]$ such that $g = fh$. 
Claim: $g$ generates $\iota(P) = \langle f \rangle_{K[x]}$.
Proof: This is essentially Gauß' Lemma. Since $g$ was chosen to be irreducible in $R[x]$, it is a primitive polynomial. Moreover, since $f$ is irreducible in $K[x]$, by Gauß' Lemma, we obtain $h \in K$. $\Box$
Now, the assertion follows from $\iota(P) \cap R[x] = \langle g \rangle_{K[x]} \cap R[x] = P$, since this implies $P = \langle g \rangle_{R[x]}$.
So let us prove $\iota(P) \cap R[x] = P$. The inclusion "$\supset$" is clear. For the other inclusion, note that if $p \in K[x]$ is such that $gp \in R[x]$, by Gauß' Lemma, we have $p \in R[x]$.
