Show that $x^{12} - 18x^6 + 82$ is irreducible over $\mathbb{F}_p$ I'm going through some code that implements finite field arithmetic. There for a fixed prime $p$ the extensions fields $\mathbb{F}_{p^2}$ and $\mathbb{F}_{p^{12}}$ are implemented by forming the quotient ring of $\mathbb{F}_p$ modulo certain polynomials. This only works when the polynomials are irreducible over $\mathbb{F}_p$.
Let $p \equiv 3 \pmod{4}$, then I know that the polynomial $x^2 + 1$ is irreducible over the finite field $\mathbb{F}_p$, so we can form the quadratic extension $\mathbb{F}_{p^2} = \mathbb{F}_p/(x^2 +1)$. This part I understand. Now, with $p$ being the same prime number how can we deduce that $x^{12} - 18x^6 + 82$ is irreducible over $\mathbb{F}_p$? I already figured out that $x^{12} - 18x^6 + 82 = (x^6 - 9)^2 + 1$ So by setting $u := x^6 - 9$ we can write the polynomial as $u^2 + 1$. Can we deduce from this that it is irreducible in the same way as $x^2 + 1$?
 A: Let $p\ne 3$ be a prime $\equiv 3\bmod 4$.
Let $i$ be a root of $x^2+1$ in $\Bbb{F}_{p^2}$. We get $$(x^6-9)^2+1=(x^6-9-i)(x^6-9+i)$$
Let $\zeta_6$ be a primitive $6$-th root of unity in $\Bbb{F}_{p^2}$.

$x^6-9-i$ is irreducible over $\Bbb{F}_{p^2}$ iff $(9+i)^{(p^2-1)/2}\ne 1,(9+i)^{(p^2-1)/3}\ne 1$

(This condition is not hard to check even for your very large prime)
Proof: let $a$ be a root of $x^6-9-i$ so that
$$x^6-9-i=\prod_{m=1}^6 (x-a \zeta_6^m)$$
An irreducible factor of is of the form $f(x)=\prod_{l=1}^L (x-a\zeta_6^{c_l})$ its constant coefficient is $f(0)=a^L (-1)^L \prod_{l=1}^L \zeta_6^{c_l}$.
So $a^L\in\Bbb{F}_{p^2}$. As $a^6\in \Bbb{F}_{p^2}$ we get $a^{\gcd(6,L)}\in \Bbb{F}_{p^2}$, which implies that $(9+i)^{(p^2-1)/(6/\gcd(6,L))}=1$.

If $x^6-9-i$ is irreducible over $\Bbb{F}_{p^2}$ then $(x^6-9-i)(x^6-9+i)$ is irreducible over $\Bbb{F}_p$.

A: A counterexample.-I'm afraid it's not true for all prime $p\equiv3\pmod4$. In fact we have
$$x^{12}-18x^6+82=(x^6+2x^3+4)(x^6+9x^3+4)\pmod{11}$$
Proof:$(x^6+2x^3+4)(x^6+9x^3+4)=x^{12}+11x^9+26x^6+44x^3+16$ which is obviously equivalent modulo $11$ to
$$x^{12}+4x^6+5$$ so we have
$$x^{12}-18x^6+82\equiv x^{12}+4x^6+5\pmod{11}$$
