TITLE: Value of $1+4\omega+9\omega^{2}+\cdot\cdot\cdot +n ^{2}\omega^{n-1}$
QUESTION [5 upvotes]: How to find the value of $$1+4\omega+9\omega^{2}+\cdot\cdot\cdot +n ^{2}\omega^{n-1}$$ where $\omega$ is a primitive $n$th root of unity? I am trying to find the value using the fact that $$1+\omega+\omega^{2}+\cdot+\cdot\cdot+\omega^{n-1}=0$$
but did't get the answer. Please suggest me how to solve it. Thanks in advance.

REPLY [4 votes]: Following the idea suggested by A.G. you may denote
$$C(x)=\sum_{k=1}^n k^2x^{k-1}$$Note that the desired term is $C(\omega)$.
You somehow want to relate this to $$A(x)=\sum_{k=1}^n x^{k-1}$$ of which you know that $A(x)=\frac{x^n-1}{x-1}$ for $x \ne 1$.
The intermediate step would be $$B(x)=\sum_{k=1}^n kx^{k-1}$$
Now, note that you have the relations $$(xA(x))'=B(x), (xB(x))'=C(x)$$
So it's easy to find a closed form for $C(x)$ by taking twice a derivative and then you find the desired value as $C(\omega)$.
Hint: The final result should be $$\frac{n^2(\omega-1)-2n}{(\omega-1)^2}$$
Edit: I will present a more detailed solution:
From $A(x)=\frac{x^n-1}{x-1}$ and $B(x)=(xA(x))'$ you easily obtain
$$B(x)=\frac{nx^n(x-1)-x^n+1}{(x-1)^2}$$
Now, using this and $C(x)=(xB(x))'$ you obtain
$$C(x)=\frac{n^2x^n(x-1)^2-2nx^n(x-1)+(x+1)(x^n-1)}{(x-1)^3}$$
Now, plugging in $x=\omega$ and using $\omega^n=1$ we obtain
$$C(\omega)=\frac{n^2(\omega-1)-2n}{(\omega-1)^2}$$