## Decide if a given polynomial is irreducible

Find all values of $n \in \mathbb{Z}$ such that the following polynomial is irreducible: $p(x) = 3x^2+2nx+12$.

Suppose $p(x)$ is reducible. Then it factors as a product of linear polynomials. By Gauss’ lemma, we can assume without loss of generality that these factors are in $\mathbb{Z}[x]$. Since the leading coefficient of $p(x)$ is prime, we can say (again without loss of generality) that $3x^2 + 2nx + 12 = (3x+a)(x+b) = 3x^2 + (3b+a)x + ab$. Comparing coefficients, we have $ab = 12$ and $3b+a = 2n$. the first equation has 12 solutions in the integers: $(\pm 1, \pm 12)$, $(\pm 12, \pm 1)$, $(\pm 2, \pm 6)$, $(\pm 6, \pm 2)$, $(\pm 3, \pm 4)$, and $(\pm 4, \pm 3)$. Reducing the second equation mod 2, we see that $a \equiv b$ mod 2. This reduces our set of candidate solutions to four. If $(a,b) = (2,6)$, then $n = 10$ and indeed $p(x) = (3x+2)(x+6)$. If $(a,b) = (-2,-6)$, then $n = -10$ and indeed $p(x) = (3x-2)(x-6)$. If $(a,b) = (6,2)$, then $n = 6$ and indeed $p(x) = (3x+6)(x+2)$. If $(a,b) = (-6,-2)$, then $n = -6$, and indeed $p(x) = (3x-6)(x-2)$.

For all other $n$, $p(x)$ is irreducible.