Calculate a sum $1+4e+9e^2+...+n^2e^{n-1}$, where e is nth root of unity Its similar to Calculate a sum involving nth root of unity
I dont get how to do it when $e$ is not $1$.
Please help!

Start with: $1 + x + x^2 +...+ x^n = \dfrac{1 - x^{n+1}}{1-x}$, differentiate both sides with respect to $x$:
$1 + 2x + 3x^2 + ...+ nx^{n-1} = \dfrac{nx^{n+1} - (n+1)x^n + 1}{(1 - x)^2}$, multiply $x$ both sides again:
$x + 2x^2 + 3x^3 + ...+ nx^n = \dfrac{nx^{n+2} - (n+1)x^{n+1} + x}{(1 - x)^2}$, and differentiate again both sides with respect to $x$, and substitute $x = e$, and $e^n = 1$ to get:
$1 + 4e + 9e^2 +...+ n^2e^{n-1} = n^2e - 2ne^2$
