<s>[INST] Splitting polynomials I have a polynomial ${\frac{{{{({z^2})}^p} \pm {p^p}}}{{{z^2} \pm p}}}$ where $p$ is an odd prime number, and I know it splits into two factors $$ \sum_{i = 0}^{p - 1} a_i z^i \text{ and } \sum_{i = 0}^{p - 1} ( - 1)^i  a_i z^i $$
For example, when $p=5$
$$
\begin{eqnarray*}
\frac{x^{10}-5^5}{x^2-5} &=& x^8+5x^6+25x^4+125x^2+625\\  
&=& (x^4 + 5x^3+15x^2+25x+25)(x^4-5x^3+15x^2-25x+25)
\end{eqnarray*}
$$
Does anyone know a nice method for determining these two factoring polynomials? 
 [/INST] Here is the solution I found, which to me is unsatisfactory.
This solution uses Table 24 from Riesel’s “Prime Numbers and Computer Methods for Factorization”. Look up the number you are interested in in the n column, and note down the two sets of coefficients given there: they are $U_n(x)$ and $V_n(x)$. Multiply each coefficient in $U_n(x)$ by $p^0$, $p^1$, $p^2$, …, $p^{p-1}$, and those in $V_n(x)$ by $p^1$, $p^2$, … $p^{p-1}$. Then take a coefficient from each list alternately and you have your factor. Do the same for the other factor after multiplying $V_n(x)$ by $-1$.
Example for $p=11$:
$U_n(x)=1, 5, -1, -1, 5, 1$
$V_n(x)=1, 1, -1, 1, 1$
Multiplying by powers of $11$:
$U_n = 1, 55, -121, -1331, 73205, 161051\\
V_n = 11, 121, -1331, 14641, 161051$
Taking the coefficients one at a time from each list one factor is
$$x^{10} + 11x^9 +55x^8 +121x^7 -121x^6 -1331x^5 -1331x^4 +14641x^3 +73205x^2 +161051x +161051$$
and the other factor is
$$x^{10} - 11x^9 +55x^8 -121x^7 -121x^6 +1331x^5 -1331x^4 -14641x^3 +73205x^2 -161051x +161051$$
</s>