TITLE: Prove that all ideals in $\mathbb{Z}[x]$ are generated by two elements.
QUESTION [7 upvotes]: I was trying to prove that $\mathbb{Z}[x]$ is noetherian, so every ideal in $\mathbb{Z}[x]$ is finitely generated.
I feel that all ideals in $\mathbb{Z}[x]$ are essentially generated by two elements - a polynomial and the smallest integer belonging to the ideal.
Let $a(x) \in I$, where $I$ is an ideal in $\mathbb{Z}[x]$, be a polynomial whose degree is the least. Let $b(x)$ be another polynomial whose degree is more than $a(x)$ then $r(x)=a(x)-b(x)q(x) \in I$ becomes the polynomial of the smallest degree (we first assume that $r(x)$ is a non constant polynomial). So $r(x)$ has to be zero.
If $r(x)$ is a constant in $\mathbb{Z}$ and  let $r $ be the least positive integer in $\mathbb{Z}[x]$. If $r(x) \in (r)$ then we are done, or let $d=(r(x),r)$ then I will be generated by $(a(x),d)$. What I think is that I am going wrong in the last paragraph. Can someone point out my mistake.

REPLY [6 votes]: As Angina Seng pointed out, your mistake is that you think you can do polynomial division as if you were working over a field. You cannot reduce $a(x)$ modulo $b(x)$ and expect a low degree remainder. If the leading coefficient of $a(x)$ is not divisible by that of $b(x)$ you are dismounted at the first obstacle: what choice of $q(x)$ would give a low degree $r(x)$ when for example
$$
r(x)=(4x^5+7)-q(x)(3x^3+5)?
$$
You see what the problem is? The leading coefficient of the product $q(x)(3x^3+5)$ will be divisible by three, and hence cannot be equal to four, which is what you would need to cancel the term $4x^5$.

You can (and arguably should) use a general proof of Hilbert basis theorem. The following minor shortcut is available in $\Bbb{Z}[x]$. Leaving the steps as exercises :-)
Let $I$ be a non-zero ideal of $\Bbb{Z}[x]$.

Let $J\subseteq\Bbb{Z}$ be the set of leading coefficients of polynomials of $I$. Prove that $J$ is an ideal of $\Bbb{Z}$. Warning: Proving that $J$ is closed under addition requires a bit of care.
Why does there exist an integer $m$ such that $J=m\Bbb{Z}$? Why does there exist a polynomial $b(x)\in I$ such that the leading coefficient of $b(x)$ is equal to $m$?
Fix a polynomial $b(x)\in I$ as in the previous step. Let's denote $n=\deg b(x)$.
If $a(x)\in I$ is arbitrary, why does the polynomial division work well enough to allow us to conclude that there exists a polynomial $q(x)\in\Bbb{Z}[x]$ such that
$$r(x)=a(x)-q(x)b(x)$$
has degree $<n$?
Consider the set
$$I_n=\{a(x)\in I\mid \deg a(x)<n\}.$$
Why is it a finitely generated free abelian group?
Prove that $b(x)$ together with a $\Bbb{Z}$-basis of $I_n$ generates $I$ as an ideal of $\Bbb{Z}[x]$.