Sum of $\frac{z^{k+1}}{(1-z)^2}$ over the roots of $x^n+1=0$ equals $\frac{n}{2}(k-\frac{n}{2})$ The problem is to show that for every $k \in \{1,2,...,n\}$ if we sum $\frac{z^{k+1}}{(1-z)^2}$ over the roots $z$ of $x^n+1=0$, we obtain the result $\frac{n}{2}(k-\frac{n}{2})$.
One idea I had is to consider the polynomial $P(t)=(1-t)^n+1$. We can easily calculate the sum of roots of $P$ and the sum of their squares. By considering the polynomial $Q(t)=t^nP(1/t)$ we can easily compute the the sum of the reciprocals and sum of the squares of the reciprocals. Hence for $k=0,1,2$ we can compute the sum in question quite easily and we get the intended result. However this method doesn't really generalise because the formulas for the symmetric sums lead to really messy computations.
 A: We have with
$$f(z) = \frac{z^{k+1}}{(1-z)^2} \frac{nz^{n-1}}{z^n+1}
= \frac{1}{(z-1)^2} \frac{nz^{n+k}}{z^n+1} $$
and $\zeta_{n,q} = \exp(\pi i/n+ 2\pi i q/n)$
$$\sum_{x^n+1=0} \frac{x^{k+1}}{(1-x)^2}
= \sum_{q=0}^{n-1} 
\mathrm{Res}_{\large z=\zeta_{n,q}} f(z).$$
This is also given by (residues sum to zero)
$$-\mathrm{Res}_{z=1} f(z)
-\mathrm{Res}_{z=\infty} f(z).$$
For the first of these we differentiate to obtain
$$\frac{n(n+k) z^{n+k-1}}{z^n+1}
- \frac{nz^{n+k}}{(z^n+1)^2} n z^{n-1}$$
Evaluate at $z=1$ to get
$$\frac{1}{2} n(n+k) - \frac{1}{4} n^2
= \frac{1}{2} nk + \frac{1}{4} n^2.$$
For the residue at infinity we get
$$-\mathrm{Res}_{z=0} \frac{1}{z^2}
\frac{1}{(1/z-1)^2} \frac{n/z^{n+k}}{1/z^n+1}
\\ = -\mathrm{Res}_{z=0}
\frac{1}{(1-z)^2} \frac{n}{z^{n+k}+z^k}
\\ = -\mathrm{Res}_{z=0} \frac{1}{z^k}
\frac{1}{(1-z)^2} \frac{n}{z^{n}+1}$$
This is 
$$-[z^{k-1}] \frac{1}{(1-z)^2} \frac{n}{z^{n}+1}.$$
With $k\le n$ only the constant term from $\frac{n}{z^{n}+1}$
contributes and we get
$$-[z^{k-1}] \frac{n}{(1-z)^2} = -nk.$$
Adding the contributions from the residues at one and at infinity
and flipping the sign we thus obtain
$$-\left(\frac{1}{2} nk + \frac{1}{4} n^2
- nk\right)
= -\left(-\frac{1}{2} nk + \frac{1}{4} n^2\right)
= -\frac{1}{2} n \left(\frac{1}{2}n - k\right).$$
This is 
$$\bbox[5px,border:2px solid #00A000]{
\frac{1}{2} n \left(k - \frac{1}{2} n\right)}$$
as claimed.
A: If we use that the summation over the roots of unity stays invariant under replacement of $z$ by $z^{-1}$ we can avoid having to consider the residue at infinity. Since:
$$\frac{z^{-k-1}}{\left(\frac{1}{z}-1\right)^2} = \frac{z^{-k+1}}{\left(z-1\right)^2}$$
we can replace $k$ by $-k$ without that affecting the summation. This means that  the contour integral:
$$\frac{1}{2\pi i}\oint_C n\frac{z^{n-1}}{z^n+1}\frac{z^{-k+1}}{(z-1)^2}dz$$
for a counterclockwise contour encircling the unit circle yields the desired summation plus the residue at $z = 1$, and for $k\geq 0 $ the integral tends to zero if the radius of the contour tends to infinity. Therefore, all we need to do is evaluate minus the residue of the integrand at $z = 1$. This amounts to expanding the function
$$n\frac{z^{n-k}}{z^n+1}$$
around $z = 1$ and computing the first order term. If we put $z = 1+t$ and expand in powers of $t$, we obtain:
$$\frac{n}{2}\left[1+\left(\frac{n}{2}-k\right)t+\mathcal{O}(t^2)\right]$$
The summation equals minus the residue which is minus the coefficient of $t$, this is thus equal to:
$$\frac{n}{2}\left(k-\frac{n}{2}\right)$$
For $k<0$ we can proceed as we did above but without changing the sign of $k$, so we then end up with the same result, except that the sign of $k$ is changed, therefore the general formula for the summation is:
$$\frac{n}{2}\left(|k|-\frac{n}{2}\right)$$
