Factorize $f$ as product of irreducible factors in $\mathbb Z_5$ Let $f = 3x^3+2x^2+2x+3$, factorize $f$ as product of irreducible factors in $\mathbb Z_5$.
First thing I've used the polynomial reminder theorem so to make the first factorization:
$$\begin{aligned} f = 3x^3+2x^2+2x+3 = (3x^2-x+3)(x+1)\end{aligned}$$ 
Obviously then as second step I've taken care of that quadratic polynomial, so:
$x_1,x_2=\frac{-b\pm\sqrt{\Delta}}{2a}=\frac{1\pm\sqrt{1-4(9)}}{6}=\frac{1\pm\sqrt{-35}}{6}$
my question is as I've done calculations in $\mathbb Z_5$, was I allowed to do that:
as $-35 \equiv_5 100 \Rightarrow \sqrt{\Delta}=\sqrt{-35} = \sqrt{100}$ 
then $x_1= \frac{11}{6} = 1 \text { (mod 5)}$, $x_2= -\frac{3}{2} = 1 \text { (mod 5)}$,
therefore my resulting product would be $f = (x+1)(x+1)(x+1)$. 
I think I have done something illegal, that is why multiplying back $(x+1)(x+1)$ I get $x^2+2x+1 \neq 3x^2-x+3$. 
Any ideas on how can I get to the right result?

If $f(X) = aX^2 + bX + c$ is a quadratic polynomial with roots $x_1$ and $x_2$ then $f(X) = a(X-x_1)(X-x_2)$ (the factor $a$ is necessary to get the right leading coefficient). You found that $3x^2-x+3$ has a double root at $x_1 = x_2 = 1$, so $3x^2-x+3 = 3(x-1)^2$. Your mistakes were


*

*You forgot to multiply by the leading coefficient $3$.

*You concluded that a root in $1$ corresponds to the linear factor $(x+1)$, but this would mean a root in $-1$. The right linear factor is $(x-1)$.

