How to prove that $ \sum_{k=1}^{n-1} \frac{1}{1-e^{2 \pi i k/n}} = \frac{n-1}{2}$? I came across the fact that
$$ \sum_{k=1}^{n-1} \frac{1}{1-e^{2 \pi i k/n}} = \frac{n-1}{2}.$$
How can we prove this identity?

The $1-e^{\frac{2ik\pi}n}$, for $k=1,\dots,n-1$, are the roots of the polynomial $P(X)=\sum_{k=0}^{n-1}(1-X)^k$. Thus the product $\prod_{k=0}^{n-1}(1-e^{\frac{2i\pi}n})$ is equal to the constant term of $P$, i.e.
$$\prod_{k=1}^{n-1}(1-e^{\frac{2ik\pi}n})=n$$
and
$$\sum_{l=1}^{n-1}\;\prod_{k\neq l}(1-e^{\frac{2i\pi}n})=-(\text{coefficient of }X)=\frac{n(n-1)}2$$
And then
$$\frac1{1-e^{\frac{2il\pi}n}}=\frac{\prod_{k\neq l}(1-e^{\frac{2i\pi}n})}{\prod_{k=1}^{n-1}(1-e^{\frac{2ik\pi}n})}=\frac{\prod_{k\neq l}(1-e^{\frac{2i\pi}n})}{n},\quad\text{thus}\quad\sum_{l=0}^{n-1}\frac1{1-e^{\frac{2il\pi}n}}=\frac{n-1}2$$
