Mutiple root of a polynomial modulo $p$ In my lecture notes of algebraic number theory they are dealing with the polynomial $$f=X^3+X+1, $$ and they say that 

If f has multiple factors modulo a prime $p > 3$, then $f$ and $f' = 3X^2+1$ have a common factor modulo this prime $p$, and this is the linear factor $f − (X/3)f'$.

Please could you help me to see why this works? And moreover, how far can this be generalized?

*

*If $f$ has a multiple factor, say $h$ (in any field containing the current base field), then with appropriate $g$, we have
$$f(x)=h(x)^2\cdot g(x)$$
If you take its derivative, it will be still a multiple of $h(x)$, so it is a common factor of $f$ and $f'$.


If polynomials $u$ and $v$ have common factors, then all of their linear combinations will have that as common factor.
Now in your particular example, note that the written $f-(X/3)f'$ is already linear (hence surely irreducible), so, if there is a common factor, it must be this one.
