Let p(x) = 1 + 4x + 2x^2 + 2x^3 in Z5[x]. Find all roots of p(x), and

write p(x) as a product of irreducible polynomials.

Mod 5 there are only 5 numbers to try, zero is not a solution, so you only have to try ±1 and ±2. A more formal way would be to try some manipulations. If you write the constant term 1 as -4, you can divide the polynomial by 2:

[-4 + 4 x + 2 x^2 + 2 x^3]/2 =

-2 + 2 x + x^2 + x^3 (1)

Then since x is not zero, we have by Fermat's little theorem that x^4 = 1. So, you can replace the -2 by -2 x^4. If you then divide by x, (allowed snce x is not zero), you get:

-2 x^3 + 2 + x + x^2

Using this trick again by replacing the 2 by 2 x^4 and dividing by x, you get:

-2 x^2 + 2 x^3 + 1 + x

If you multiply this by 2 and add this to (1) you get

4 x -3 x^2 + 5 x^3

Then dividing by x and using that
5 = 0, you get:

4 - 3 x

Equating this to zero yields

x = 4*3^(-1) = 8 = 3

To factor the polynomial you thus need to divide it by (x-3) in Z5 (just use long division and do the calculations mod 5).