# show $x^p−x\equiv x(x−1)(x−2)⋯(x−(p−1)) \pmod p$

I have been trying a long time figure out how to state the following congruent

show $x^p−x\equiv x(x−1)(x−2)⋯(x−(p−1)) \pmod p$

I got some hint: find all the roots of $x^p − x$ using Fermat's theorem, write x^p − x as a product of its factors and compare the coefficient of the leading term of both sides.

I know that by Fermat's Little theorem that $x^p -x$ could be factory into

$$x(x -1)(x -2)...(x -p+1)$$ and the coefficient of the leading term is $1$, but I dont know what to do next.

I do know by Wilson's theorem If p is prime then x^p−x≡x(x−1)(x−2)⋯(x−(p−1))≡xp+⋯+(p−1)!x(modp). but I dont know what to do with this got it from

Factorize $f(x)=x^p−x$ into a product of irreducibles in $\mathbb ℤ_{p}[x]$

-
Both sides have the same roots with the same multiplicies and the same leading coefficients, therefore both sides are the same polynomial. What is there left to say? That's it. –  anon Feb 23 '14 at 23:32
I dont get what does it mean by " compare the coefficient of the leading term of both sides." as the hint stated. –  user131041 Feb 23 '14 at 23:33
$x(x-1)..(x-p+1) divides x^p-x$ and they have same degry and both monic ....they must be same polynomial in $Z_p[x]$. –  mesel Feb 23 '14 at 23:33
Do you know what "coefficient of the leading term of both sides" means? Do you know that two polynomials can have the same roots and same multiplicities and be different polynomials? Do you know that if we assume in addition that the leading coefficients are the same, then they must be the same polynomial? Does it now make sense why we have to look at the leading coefficients of both sides in order to conclude they are the same polynomial? –  anon Feb 23 '14 at 23:35
Ordinarily we use the fact that the two polynomials are "obviously" the same to prove, among other things, the Wilson's Theorem, and more complicated congruences involving coefficients of $x(x-1)\cdots(x-p+1)$. –  André Nicolas Feb 23 '14 at 23:39