Are the rings $\mathbb{Q}[x]$ and $\mathbb{Q}[x,y]$ principal ideal domains? Are the rings $\mathbb{Q}[x]$ and $\mathbb{Q}[x,y]$ principal ideal domains?
I understand what an integral domain is. I know the definitions of ideal and principal but have not ever dealt with principal ideal domains. I know that from the discussion here, $\mathbb{Z}[x]$ is not a principal ideal domain, but I'm not sure if the example with the ideal $(2,x)$ should extend to the polynomials with rational coefficients and would like some help.
 A: If $k$ is a field, then $k[x]$ is a PID, for essentially the same reason that $\mathbb{Z}$ is -- in both, we have Euclidean algorithm for division.
On the other hand, $k[x, y]$ is not a PID: consider ideal $I = (x, y)$. Supposed that $I$ is principal, $I = (f)$. Then $x = fg$, $y = fh$ for some $g, h \in k[x, y]$. Since $x = fg$, degree of $f$ in variable $y$ must be $0$. Considering $y = fh$, we conclude the same about degree of $f$ in variable $x$. Thus $f \in k$, which contradicts $I = (f) = (x, y)$.
A: $\mathbb{Q}[X]$ is a principal since $\mathbb{Q}$ is a field and you can divide. An ideal is generated by an element of lowest degree. But $\mathbb{Q}[X,Y]$ is not principal. The ideal generated by $(X,Y)$ does not have a single generator.
A: It is known that $R[x]$ is a PID if and only if $R$ is a field. (Here $R$ is a commutative ring with a multiplicative identity.) This applies to $\mathbb Q[x,y]$ because $\mathbb Q[x,y] = \mathbb Q[y][x]$ is a polynomial ring over $R = \mathbb Q[y]$.
When $R$ is a field, this follows from the Euclidean algorithm:

If $f(x), g(x)$ are non-zero polynomials with coefficients in a field, then we can divide $g(x)$ into $f(x)$ with quotient $q(x)$ and remainder $r(x)$. I.e. we can write $$ f(x) = g(x)q(x) + r(x) $$ where $r(x) = 0$ or $\deg r < \deg g$.

If $I$ is a non-zero ideal of $R[x]$ and $R$ is a field then you can show by contradiction that $I = (g)$ where $g \in I$ is non-zero and of minimal degree.
Conversely, if $R$ is not a field then there is an element $a \in R$ which is neither zero nor invertible. Then you can show that $(a,x)$ is a non-principal ideal of $R[x]$ in exactly the same way that one shows that the ideal $(2,x)$ of $\mathbf Z[x]$ is non-principal.
