Show that $(x-1)^2$ is a factor of $x^n -nx +n-1$ 
Show that $(x-1)^2$ is a factor of $x^n -nx +n-1$

By factor theorem we know that $(x-a)$ is a factor of $f(x)$ if $f(a)=0$. 
In this case, $f(x)=x^n -nx +n-1 \implies f(1)=0$
Hence we conclude that $(x-1)$ is a factor. From hereon, how can I say that $(x-1)^2$ is a factor?  
Can we approach the problem without calculus approach? This problem was taken from a book of pre-calculus algebra.
 A: Here is another elementary way using the binomial theorem


*

*$(1+y)^n = \sum_{k=0}^n\binom{n}{k}y^k$
Set $\boxed{y=x-1}$ and note that


*

*$(x-1)^2$ is a factor of $p(x) = x^n -nx +n-1$ if and only if $y^2$ is a factor of $p(y+1)$
Hence,
\begin{eqnarray*} p(y+1)
& = & (1+y)^n - (1+y)n + n-1\\
& = & 1+ny +\sum_{k=2}^n\binom{n}{k}y^k -n-ny+n-1 \\
& = & y^2\sum_{k=2}^n\binom{n}{k}y^{k-2}
\end{eqnarray*}
Done.
A: Hint
$$x^n -nx +n-1=(x^n-1) -n(x -1)=(x-1)(x^{n-1}+x^{n-2}+...+x+1-n)$$
now, write 
$$p(x)=x^{n-1}+x^{n-2}+...+x+1-n$$
and check that $p(1)=0$.
A: $$x^n-nx+n-1=(x^n-1)-n(x-1)$$
In precalculus algebra one should know the extremely useful fact that
$$1+x+..+x^{n-1}=\frac{x^n-1}{x-1},$$
for $x$ not $1$. Then, multiplying by $1-x$ on both sides one gets
$$(1+x+..+x^{n-1})(x-1)=x^n-1$$
and this holds for all $x$ (expand the lhs to see this). So
$$x^n-nx+n-1=(x-1)(1+x+..+x^{n-1}-n)$$.
Now write $n=1+...+1$ $n$ times. Then we can rewrite
$$1+x+..+x^{n-1}-n=(1-1)+(x-1)+..+(x^{n-1}-1).$$
But each of the summands is divisible by $x-1$ because of the argument above with the geometric series! In fact, writing 
$$x^k-1=1+x+..+x^{k-1}$$
for each $k$ appearing in the summand, by dividing $1+x+..+x^{n-1}-n$ by $x-1$ one gets
$$n-1+(n-2)x+(n-3)x^2+...+x^{n-2}$$
since every term $x^j$ will  appear in 
$\frac{x^k-1}{x-1}$ with $k\leq n-1$ exactly when
$j<k$and there are $n-1-j$ such terms. Putting everything together we get the polynomial in your question is
$$(x-1)^2((n-1)+(n-2)x+...+x^{n-2}).$$
This is the most elementary solution I could think of. 
A: $f(1)=f'(1)=0$ implies that $(x-1)^2$ divides $f$.
A: Since calculus and double root test are not  known, we can instead divide by $\,x\!-\!1\,$ twice as follows.
Note that  $\,x\!-\!1$ divides $f(x)=(\color{#c00}{x^n-1})-\color{#0a0}n(x-1)\ $ by $\, f(1)= 0\,$ and the Factor Theorem. 
$x\!-\!1$ divides $g(x) := \dfrac{f(x)}{x\!-\!1} = (\color{#c00}{x^{n-1}+\cdots+1})-\color{#0a0}n\ $ by $\ g(1) =n-n=0\,$ similarly.
So we infer $\,\ g(x) = \dfrac{f(x)}{x\!-\!1} = (x\!-\!1)\,h(x)\,$ for some polynomial $\,h(x).$
Hence  we conclude $\ \ f(x)\, = (x\!-\!1)^2h(x)\ $ by scaling above by $\,x\!-\!1.$
A: By division theorem we have:
$$x^n -nx +n-1 = k(x)(x-1)^2+ax+b $$
So for $x=1$ we have $0 = 0+a+b$ so $a=-b$, so $$x^n -nx +n-1 = k(x)(x-1)^2+a(x-1) $$
$$(x-1)(x^{n-1}+...+x^2+x+1) -n(x-1)= k(x)(x-1)^2+a(x-1) $$
so, after dividing by $x-1$ we get $$(x^{n-1}+...+x^2+x+1) -n= k(x)(x-1)+a $$
Now puting $x=1$ again we have $$\underbrace{1+1+...+1}_n -n = 0+a\implies a=0$$
