I am given a polynomial $$ f = 2x^{2} + 4x + 6$$
and I have to determine in which of the rings, $\mathbb{Z}[x]$, $\mathbb{Q}[x]$, or $\mathbb{Z}_{5}[x]$, $f$ is a primitive polynomial, and I have to compute the content $C(f)$ in each case.
For $\mathbb{Z}[x]$, I was able to calculate $C(f)$ by using the Euclidean algorithm on the coefficients $2,4,6$, and found it to be $2$. Since $2$ is not a unit in $\mathbb{Z}$, I determined that $f$ is NOT primitive there.
For $\mathbb{Z}_{5}[x]$, I reduced all the coefficients $\mod 5$ and then found $C(f)$ to be equal to $1$, again, via the Euclidean algorithm. Since $1$ is a unit in $\mathbb{Z}_{5}$, I determined that $f$ is primitive there.
My question is what to do in the case of $\mathbb{Q}[x]$. Of course, all integers are also rationals, but can I use the same Euclidean algorithm to find the same $C(f)$, and then determine that because $2$ is a unit in $\mathbb{Q}$ that $f$ is primitive in $\mathbb{Q}[x]$? Or is there a different way to calculate the $\gcd$ of rational numbers?
Thanks.