I was doing an exercise in Brzezinski's Galois Theory Through Exercises and needed to factor the polynomial $x^6+5x^2+x+1=x^6+x+1$ in $\mathbb{F}_5[x]$. Is there a quick way to do this?
I can see it has no roots and therefore no linear factors, so it must either factor as the product of a quadratic and a quartic or two cubics, but listing the irreducible quadratics and cubics mod $5$ is laborious. I found all of the irreducible quadratics, which are \begin{multline} x^2\pm 2, \, x^2+x+1, \, x^2+x+2, \, x^2+2x-2, \, x^2+2x-1, \\ x^2-2x+2, \, x^2-2x-2, \, x^2-x+1, x^2-x+2 \end{multline} and checked that none of these are factors, so it must factor as the product of two cubics, which I know I could find either by finding all irreducible cubics or by writing $$ x^6+x+1 = (x^3+ax^2+bx+c)(x^3+dx^2+ex+f) $$ and then equating coefficients.
I used a computer to perform the Berlekamp algorithm which yielded the factorisation $$ x^6+5x^2+x+1 = (x^3-2x^2-1)(x^3+2x^2-x-1) $$ but it would take me a very long time to do this by hand. Can anyone suggest any tricks that could be applied here?
The observation made by user8268 is the key to the following paper and pencil factorization. Not ruling out the existence of other possibilities — that trick simply works like charm.
Let $\alpha$ be a root of $p(x)=x^6+x+1$ in some extension field of $\Bbb{F}_5$. By Galois theory it follows that $$ \alpha^5=\frac{\alpha^6}{\alpha}=-\frac{\alpha+1}{\alpha}=-1-1/\alpha $$ is another root. The projective linear trasformation (aka a Möbius transformation) $$f(t)=-1-1/t$$ is "famous" for having order three. Meaning that its third iterate is the identity: $f(f(f(t)))=t$. It follows that the Frobenius automorphism $\alpha\mapsto \alpha^5$ cycles back to $\alpha$ after three rounds. Therefore the minimum polynomial of $\alpha$ is (a factor of) $$ m(x)=(x-\alpha)(x-f(\alpha))(x-f(f(\alpha)))=(x-\alpha)(x+1+\frac1\alpha)(x+\frac1{1+\alpha}). $$ Here I used the fact that $f(f(t))=-1/(1+t)$.
Expanding $m(x)$ gives $$ m(x)=x^3+Ax^2+Bx-1, $$ where $A=(1+3\alpha-\alpha^3)/(\alpha+\alpha^2)$ and $B=(1-3\alpha^2-\alpha^3)/(\alpha+\alpha^2).$
How does this help the factorization? The key is that, upon inspection, we see that $A-B=3$. This narrows down the family of putative factors to those of the form $$ x^3+Ax^2+(A-3)x-1. $$
All of the above, together with the OPs observation that the polynomial has no roots in $\Bbb{F}_5$, implies that we are looking for a factorization of the form $$ x^6+x+1=(x^3+Ax^2+(A-3)x-1)(x^3+Cx^2+(C-3)x-1)\qquad(*) $$ with $A,C\in\Bbb{F}_5$. Looking at the terms of degree five (or the linear terms) on the R.H.S. of $(*)$ tells us that $A+C=0$, so $C=-A$. Expanding further, and looking at the quadratic terms we get the equation $$ 0=-A+(A-3)(C-3)-C=AC-4(A+C)+9=AC-1=-A^2-1. $$ This has two solutions $A=\pm2$ in $\Bbb{F}_5$. It is straight forward to check that this gives the desired factorization.
The same observation allows us to factor for example $g(x)=x^8+x+1$ in $\Bbb{F}_7[x]$. Testing shows that $g(2)=0=g(4)$. The above process, this time starting from $\alpha^7=f(\alpha)$, leads to a full factorization $$g(x)=(x-2)(x-4)(x^3-3x-1)(x^3-x^2+3x-1).$$ We see the same difference of three in the coefficients of the quadratic and linear terms of the two cubic factors.
See this older question and its answers for an earlier incarnation of this projective linear transformation in this context. There was no need to identify the cubic factors there. I only posted this because I had never noticed that difference of three. Undoubtedly that is a known fact given that this particular Möbius transformation appears regularly.