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?
 A: One has for $f(X)=\frac{X^n-1}{X-1}=\prod\limits_{k=1}^{n-1}(X-e^{\frac{2ik\pi}{n}})$
$$\frac{f'(X)}{f(X)}=\sum\limits_{k=1}^{n-1}\frac{1}{X-e^{\frac{2ik\pi}{n}}}$$
So we have $\sum\limits_{k=1}^{n-1}\frac{1}{1-e^{\frac{2ik\pi}{n}}}=\frac{f'(1)}{f(1)}$
Now let us compute $\frac{f'(X)}{f(X)}=\frac{(n-1)X^{n-2}+(n-2)X^{n-3}+\cdots+2X+1}{X^{n-1}+\cdots+1}$ so we have
$$\frac{f'(1)}{f(1)}=\frac{(n-1)+(n-2)+\cdots+2+1}{n}=\frac{n^2-\frac{n(n+1)}{2}}{n}=n-\frac{n+1}{2}=\frac{n-1}{2}$$
A: 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$$
A: Note that if you add your sum with $k=1\ldots (n-1)$ with the same sum with $k=(n-1)\ldots 1$, you get $2\sum_1^{n-1} a_k = \sum_1^{n-1}a_k + \sum_1^{n-1}a_{n-k} = \sum_1^{n-1}(a_k+a_{n-k})$.
Here $a_k = \frac1{1-b_k}$ with $b_k = e^{2i\pi k/n}$ and $b_{n-k} = e^{2i\pi(k-n)/n} = e^{2i\pi}e^{-2i\pi k/n} = e^{-2i\pi k/n} = 1/b_k = \bar{b_k}$.
So $a_k + a_{n-k} = \frac1{1-b_k} + \frac1{1-b_{n-k}} = \frac{1-b_{n-k}+1-b_k}{(1-b_{n-k})(1-b_k)} = \frac{2-(b_k+\bar{b_k})}{1+|b_k|^2-(b_k+\bar{b_k})} = 1$ since $|b_k| = 1$.
Finally $2\sum_1^{n-1} a_k = \sum 1 = (n-1)$, QED :)
A: We have $$\left(e^{\frac{2k\pi i}n}\right)^n=1$$ where $k$ is any integer
If $y_k=\dfrac1{1-e^{\frac{2k\pi i}n}},$ where $k\equiv1,2,\cdots, n-1\pmod n$
$\iff e^{\frac{2k\pi i}n}=\dfrac{1-y_k}{y_k}$
$$\implies\left(\dfrac{1-y_k}{y_k}\right)^n=1\iff\binom n1 y_k^{n-1}-\binom n2y_k^{n-2}+\cdots+(-1)^{n-1}=0$$
Using Vieta's formula, $\displaystyle\sum_{k=1}^{n-1}y_k=\dfrac{\binom n2}{\binom n1}$
A: One  more way:
Let $$S=\sum_{k=1}^{n-1} \frac{1}{1-e^{2i\pi k/n}}......(1)$$
Change $k\to n-k$, then
$$S=\sum_{k=1}^{n-1} \frac {1}{1-e^{2i\pi} e^{-2i\pi k/n}}=\sum_{k=1}^{n-1} \frac{1}{1-e^{-2i\pi k/n}}..... (2)$$
Adding (1) and (2), we get
$$2S=\sum_{k=1}^{n-1} \left(\frac{1}{1-e^{2i\pi k/n}}+\frac {1}{1-e^{-2i\pi k/n}}\right)=\sum_{k=1}^{n-1} 1=n-1$$
$$\implies S=\frac{n-1}{2}.$$
A: Another solution:
$z^n=1$ has roots as1 and  $e^{2i\pi k/n}, k=1,...,n-1$.
Let us transform $z$-Eq. to $y$-Eq, as $y=\frac{1}{1-z} \implies z=\frac{y-1}{y}$, so we have the new Eq. as $$(y-1)^n=y^n \implies -ny^{n-1}+\frac{n(n-1)}{2!}y^{n-2}-...$$
Next we get sum of the roots of $y$-Eq. as $$y_1+y_2+y_3+....+y_{n-1}=-\frac{n(n-1)/2}{-n}=\frac{n-1}{2}$$
