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?