I asked this question. Now I am trying to factor the same polynomial, $f(x)=x^5+2x^4+3x^3+5$, in $\mathbb{Z}_3[x]$.
So, we have that $f(x)=x^5+2x^4+2$ in $\mathbb{Z}_3[x]$. Like in my previous question I start by considering the roots, which gives $f(0)=2, f(1)=2$, but $f(2)=32+32+2=66=0$. Hence the polynomial has a root at $2$. This would mean $f(x)=(x+2)g(x)$ for some $g(x)\in \mathbb{Z}_3[x]$. I could not find such $g(x)$. Instead I went to the an online calculator that shows the answer, namely $(x^3+2x+2)(x+1)^2$ (which is correct).
Furthermore, $(x+1)^2=x^2+2x+1$ has a root at $2$. Why trying to factor using $(x+2)$ does not work, and how could one have come up with the $(x+1)^2$ term knowing that the polynomial has a root at $2$?
Basically, I have the answer, but I'd like to know how to derive it.