How to expand $(x^{n-1}+\cdots+x+1)^2$ (nicely) sorry if this is a basic question but I am trying to show the following expansion holds over $\mathbb{Z}$:
$(x^{n-1}+\cdots+x+1)^2=x^{2n-2}+2x^{2n-3}+\cdots+(n-1)x^n+nx^{n-1}+(n-1)x^{n-2}+\cdots+2x+1$.
Now I can show this in by sheer brute force, but it wasn't nice and certainly wasn't pretty. So I am just wondering if there are any snazzy ways to show this? If it helps, I am assuming $x^m=1$ for some $m>n-1$.

Induction is the best way to do it:
Base case: $(x+1)^2 = x^2 + 2x + 1$.
Assume $(x^{n-1} + ... + 1)^2= x^{2n-2} + 2 x^{2n-3} + 3 x^{2n-4} + .... +nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1$
Then $(x^{n} + ... + 1)^2= [ x^{n} + (x^{n-1} + ... 1)]^2=$
$x^{2n} + 2x^n(x^{n-1} + ... 1) + (x^{n-1} + ... 1)^2] =$
$x^{2n} +[2x^{2n-1} + 2x^{2n-1} +..... + 2x^n] + (x^{2n-2} + 2 x^{2n-3} + 3 x^{2n-4} + .... +nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1)= 
$x^{2n} +2x^{2n-1} + [2x^{2n-2} +..... + 2x^n] + [x^{2n-2} + 2 x^{2n-3} + 3 x^{2n-4} + .... (n-1)x^n] + [nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1] = $
$x^{2n}+ 2x^{2n-1} + [(1+2)x^{2n-2} + ....+(n-1+2)x^n]+ [nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1] = $
$x^{2n} + 2x^{2n-1} + [3x^{2n-1} + ... + (n+1) x^n] +[nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1] = $
$x^{2n} + 2x^{2n-1} + 3x^{2n-1} + ... + (n+1) x^n +nx^{n-1} + (n-1)x^{n-2} +.....+3x^2 + 2x + 1 $
So by induction thepattern holds.
