I've been struggling to prove the general formula for how the polynomial in the title factors mod $p$, for some arbitrary prime $p$. This is how it must factors, although I should mention this "guess" wasn't formulated by factoring for some primes and then assuming any pattern notice held;
$x^4-2x^3-2x+1=Q_{1}\cdot L_{1} \cdot L_{2}$ if $p \equiv 11 \pmod{12}$
$x^4-2x^3-2x+1=Q_{1}\cdot Q_{2}$ if $p \equiv 7 \pmod{12}$
$x^4-2x^3-2x+1=Qu_{1}$ if $p \equiv 5 \pmod{12}$
$x^4-2x^3-2x+1=L_{1} \cdot L_{2} \cdot L_{3} \cdot L_{4}$ if $p = a^2+36 b^2$
$x^4-2x^3-2x+1=Q_{1}\cdot Q_{2}$ if $p=4a^2+9b^2$
Where $Q, L, Qu$ are irreducible in $\mathbb{F}_{p}$, and $Q_{i}, L_{j}, Qu_{k}$ are quadratic, linear, and quartic polynomials respectively. I'm working on various other polynomials too of varying degree as well, all with solvable Galois Groups. Any help as to how to factor them like this formula would be much appreciated.