Factoring polynomials into prime prime polynomials How can I factorize $$p(x)=x^4+1 \in \mathbb{Z_5}$$ and $$p(x)=x^4+1 \in \mathbb{Z}_3$$ into prime polynomials?
Is $(x^2+2)(x^2+3)$ correct for $\mathbb{Z}_5$? Because $2 \cdot3 = 1$ and $2+3 = 0$ in $\mathbb{Z}_5$.
And how is it done for $\mathbb{Z}_3$?

Note that  your factorisation in $\mathbf Z_5$ may as well be written as 
$$x^4+1=(x^2+2)(x^2-2),$$
which makes it more obvious.
Hint for $\mathbf Z_3$:
$$ x^4+1=(x^2-1)^2+2x^2=(x^2-1)^2-x^2. $$
