Solution (source code)

= Solution

An <integral domain> is a nonzero <commutative ring> with identity and no <zero divisors>. A <principal ideal domain> is an <integral domain> in which every <ideal> is generated by one element.

The <leading coefficient> of a product of nonzero real <polynomials> is nonzero, so $\mathbb R[x]$ is an <integral domain>. The <zero> <ideal> is principal. In any nonzero <ideal> $J$, choose a nonzero <polynomial> $g$ of least <degree>. Divide an arbitrary $f\in J$ by $g$: $f=qg+r$ with $r=0$ or $\deg r<\deg g$. Since $r\in J$, minimality forces $r=0$. Thus $J=(g)$ and \b[$\mathbb R[x]$ is a <principal ideal domain>].

In $\mathbb Z[x]$ consider $J=(2,x)$. If $J=(h)$, then $h$ divides the constant <polynomial> 2, so $h$ is constant, and divisibility of $x$ forces $h=\pm1$. That would give $J=\mathbb Z[x]$. But the constant coefficient of every element $2p+xq$ is even, so $1\notin J$. This contradiction proves \b[$\mathbb Z[x]$ is not a <principal ideal domain>].