Show that $(x-1)^2$ is a factor of $x^n-nx+n-1$
Here's my approach:- Letting $P(x)=x^n-nx+n-1$ I tried putting $P(1)=0$ but it would only prove for $,(x-1)$
Here's what I can think of, $x^n-1-nx+n=(x^n-1)-(nx-n)=(x-1)(x^{n-1}+x^{n-2}+x^{n-3}................+x+1)-n(x-1)$
Because $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+x^{n-3}y^{n+1}................+xy^{n-2}+y^{n-1})$
$=(x-1)[x^{n-1}+x^{n-2}+x^{n-3}................+x+1-n]$
But I am not able to proceed any further neither I am able to get $(x-1)^2$ as common factor.