When a prime ideal in polynomial ring over integers is principal 
While dealing with a question about a prime ideal $I\subset\mathbb{Z}[x]$ (with $0$ as the only constant polynomial in $I$) I was asked to show that there exists $f(x)\in\mathbb{Z}[x]$ such that $I=\left<f(x)\right>$ and got stuck.

How do I know that some ideal is generated by only one element?
What have i tried:
i) Looked at $I$ and tried to adapt the proof that integers is a principal ideal domain and and so as $I$ is an ideal of itself I'd be done, but no success.
ii) Ignored one operation and tried to see I as a subgroup, but that was a rather unsuccessful strategy.
I appreciate any hints and book references where i can find proper explanations.
 A: This is a long and messy proof, and I don't think there is any easier way to deal with it unless some additional knowledge about commutative algebra is available. If I made a mistake somewhere please let me know... If you prefer to prove it yourself just read the claims and the lemma and try to prove them yourself without reading my proof (which is actually better...)

Definition: A polynomial $p(x)\in \mathbb{Z}[x]$, i.e. $p(x)=n_dx^d+\cdots+ n_0$ is called a primitive polynomial if
  $\mathrm{gcd}(n_0, \cdots, n_d)=1$.

Now suppose $I\subset \mathbb{Z}[x]$ is a prime ideal in which the only constant polynomial is zero. Take any polynomial $I\ni f(x)=a_\ell x^\ell+\cdots+ a_0$. Let $c=\mathrm{gcd}(a_0, \cdots, a_\ell)$. Then $a_i = c \tilde{a}_i$. Then the polynomial $\tilde{f}(x)=\tilde{a}_\ell x^\ell+\cdots+ \tilde{a}_0$ is primitive. Moreover $f(x)=c\tilde{f}(x)\in I$. Since $I$ is prime and $0\neq c\notin I$ we have $\tilde{f}(x)\in I$. Hence

Claim: If $f(x)\in I$ then the primitive polynomial $\tilde{f}(x)$ corresponding to it is also in $I$.

Now 

Claim Let $p_1(x), p_2(x)\in I$ be two non-zero primitive polynomials in $I$ of minimal degree. Then $p_1(x)=p_2(x)$.

Proof: Suppose $\deg p_1=\deg p_2=D$.


*

*Suppose $\deg (p_1(x)-p_2(x))=D$. If $p_i(x)= b_{iD}x^D+\cdots+b_{i0}$ for $i=1,2$. Let $m=\mathrm{lcm}(b_{1D}, b_{2D})$. Let $q_1, q_2\in \mathbb{Z}$ be such that $p_1q_1=m$ and $p_2q_2=m$. Then
$$
mx^D+q_ib_{i,D-1}x^{D-1}+\cdots+q_ib_{i0}\in I, \quad
$$
for $i=1,2$. As a result $(q_1b_{1,D-1}-q_2b_{2,D-1})x^{D-1}+\cdots+(q_1b_{10}-q_2b_{20})\in I$. Suppose this polynomial is non-zero. Let $Q(x)$ be the primitive polynomial corresponding to this polynomial. Then $Q(x)$ is a primitive polynomial of lower degree than $D$, contrary to assumption. So we must have $q_1p_1(x)=q_2p_2(x)$, but then since $p_1, p_2$ are primitive $q_1=q_2$.

*Suppose $\deg (p_1-p_2)<D$. If $p_1(x)\neq p_2(x)$, denote by $0\neq P(x)$ the primitive polynomial corresponding to $p_1(x)-p_2(x)$, then $\deg P(x)<D$ contrary to $p_1, p_2$ being primitive of minimal degree, which again means $p_1(x)=p_2(x)$.



Claim Denote by $p(x)$ the unique primitive polynomial of least degree in $I$. Then $I=\langle p(x)\rangle$.

Proof: First of all note that if $x\in I$, then $I=\langle x\rangle$ since the only constant polynomial in $I$ zero and $I$ is prime. So suppose $x\notin I$. Given any $g(x)\in I$ now we can write $g(x)=x^r g'(x)$ for some $r\geq 0$ and $g'(x)\in \mathbb{Z}[x]$ such that $x$ does not divide $g'(x)$. But then since $I$ is prime and $x\notin I$ we have $g'(x)\in I$.
So without loss of generality consider only primitive polynomials of the form $I\ni g(x)=a_Nx^N+\cdots+a_0$ with $a_0\neq 0$. Also write $p(x)= b_Dx^D+\cdots+b_0$ with $b_0\neq 0$ too (this is because of minimality and $x\notin I$). We either have $g(x)=p(x)$ or $\deg g>\deg p$ by uniqueness. In the former case there is nothing to prove. So assume the latter. Let $m=\mathrm{lcm}(a_0, b_0)$ and $q_1, q_2$ such that $a_0q_1=m$ and $b_0q_2=m$. Then $q_1g(x)-q_2p(x)\in I$ and $x$ divides it, i.e.
$$
q_1g(x)-q_2p(x) = x^r g_1(x)
$$
with $r>0$ some power. But then $g_1(r)\in I$ too, which means the primitive polynomial corresponding to it $\tilde{g}_1$ is also in $I$. Now $\deg \tilde{g}_1(x)=\deg g_1(x)<\deg g(x)$. Due to this relation of between degrees one possibility is $\tilde{g}_1(x)=p(x)$. In which case $g_1(x)=c\tilde{g}_1(x)$ for some $c\in \mathbb{Z}$ and
$$
q_1g(x)=[q_2+cx^r]p(x)
$$
Now by the lemma I prove at the end $g(x)\in \langle p(x)\rangle$. So consider the case where $\tilde{g}_1(x)\neq p(x)$. Then by repeating the process for the pair $\tilde{g}_1, p(x)$ we another primitive polynomial $\tilde{g}_2(x)$ such that $\deg \tilde{g}_2< \deg \tilde{g}_1$. Then either $\tilde{g}_2=p(x)$ or $\tilde{g}_2\neq p(x)$. The fomer case gives us the assertion again. Assuming the latter case we get (inductively) a chain of primitive polynomials $g(x), \tilde{g}_1(x), \tilde{g}_2(x), \cdots$ all in $I$ such that the degree is strictly decreasing. So eventually you will have a case $\tilde{g}_n(x)=p(x)$. And the is finishes the job.

Lemma Let $f(x), g(x), h(x)$ be polynomials in $\mathbb{Z}[x]$ such that $f(x)=g(x)h(x)$. Then if $\tilde{f}(x), \tilde{g}(x),
 \tilde{h}(x)$ are the primitive polynomials corresponding to them, we
  have $\tilde{f}(x)=\tilde{g}(x)\tilde{h}(x)$.

Proof: This basically boils down to the fact that the product of two primitive polynomials is primitive. For a simple proof see here.
A: let $P$ and $Q$ are in $I$ of minimum degree so $degP=degQ$. in
the case one is unitary  for example $P$, then $I=(P)$ this by
Euclidean division and end. so we suppose that all $P$,for which
degree are the  minimum  degree of element in $I$,  are not
unitary.
so we suppose  $P$ and $Q$ are not unitary but primitive because
we can always  write $P=gcd(a_i,i=0,...n)P_1$ with $P_1$ primitive
(hypothesis that $I$ prime and no constant polynomial  other zero
in $I$).
so we prove that $P=Q$ and $I=(P)$ .
the polynomial $b_nP-a_nQ$ is
in $I$ where $a_i$ and $b_i$ are the coefficient of $P$ and $Q$
respectively. so this polynomial must be zero (by minimal degree
of element of $I$) and so $ P=Q$ this prove that each element  $Q$
in $I$ s.t   $degre Q= deg P$ that $ Q=cP$ for some constant c.
Now we prove by recurrence on degree of  $Q$ that $Q= C(X)P(X)$.
so suppose $degQ=(degP)+1=n+1$.
$Q=b_{n+1}X^{n+1}+...+b_0\in I$ so $a_nQ-b_{n+1}XP\in I $ of degre
n (note: if equal to zero then $a_nb_0=0$ and $Q=XL$ with
$degrL=n$ so $L=cP$, because $X$ unitary so $X$ is not in $I$ ) so
is of form $cP$, by substitution $X=0$, we conclude that
$a_nb_0=ca_0$ and this applique $b_0=a_0b'_0$ ($a_0, a_n$ are
coprime numbers ). so $Q-b'_0P=c'XP$ and this applique $Q=AP$.
suppose that each $R\in I$ of degree $i$,  $n< i< m$ is in the
forme $AP$. (also we use the same technique as in the case $i=n+1$
we obtain the result).
let $Q\in I$ s.t $degrQ=m$, then
$a_nQ-b_mXP\in I $ of degree $m-1$ (suppose not zero as in the
above case) and so is of the  forme $C(X)P(X)$; by tacking $X=0$,
we have $a_nb_0=c_0a_0$ so $b_0=a_0b'_0$ and
$Q(X)-b_0P(X)=XL(X)\in I$, so $L=bP$ and $Q=AP$.
