<s>[INST] Proving $\sum\limits_{r=1}^n \cot \frac{r\pi}{n+1}=0$ using complex numbers Let $x_1,x_2,...,x_n$ be the roots of the equation $x^n+x^{n-1}+...+x+1=0$.

The question is to compute the expression $$\frac{1}{x_1-1} + \frac{1}{x_2-1}+...+\frac{1}{x_n-1}$$
  Hence to prove that $$\sum_{r=1}^n \cot \frac{r\pi}{n+1}=0$$ 

I tried rewriting the expression as $$\sum_{i=1}^n \frac{\bar{x_i}-1}{|x_i-1|^2}$$
I then used the fact that $$x^{n+1}-1=(x-1)(x^n+x^{n-1}+...+x+1=0$$ so $x_i$ are the complex nth roots of unity.Using cosine formula I found that $$|x_i-1|^2=2-2\cos(\frac{2i\pi}{n+1})=4(\sin \frac{\pi}{n+1})^2$$
After substituting this I couldn't simplify the resulting expression.Any ideas?Thanks.
 [/INST] Let's do it without any tricks using standard results from the usual theory of polynomial equations. If $\alpha$ is a root of $f(x) =0$ then $\beta=\alpha-1$ is a root of $f(x+1)=0$. Thus it follows that $y_{i} =(x_{i} - 1)$ are the roots of equation $$(y+1)^{n}+(y+1)^{n-1}+\dots+(y+1)+1=0$$ ie $$y^{n} +(n+1)y^{n-1}+\dots+(1+2+\cdots+n)y+ (n+1)=0$$ ie $$y^{n} +(n+1)y^{n-1}+\dots+\frac{n(n+1)}{2}y+(n+1)=0$$ Further note that if $\alpha$ is a root of $f(x) =0$ then $\gamma=1/\alpha$ is a root of $x^{n} f(1/x)=0$. And therefore $z_{i} =1/y_{i}=1/(x_{i}-1)$ are the roots of $$(n+1)z^{n}+\frac{n(n+1)}{2}z^{n+1}+\dots+(n+1)z+1=0$$ and hence the sum of its roots is $$-\frac{n(n+1)/2}{n+1}=-\frac{n}{2}$$ which answers your first question.
The answer to your second question is based on the fact that the given equation can be written as $$\frac{x^{n+1}-1}{x-1}=0$$ and the roots of the equation $x^{n+1}-1=0$ are given as $$\cos\left(\frac{2k\pi} {n+1} \right)+i\sin\left(\frac{2k\pi}{n+1}\right), \, k=0,1,2,\dots,n$$ The root $x=1$ corresponds to $k=0$ and hence the roots $x_{k} $ of the original equation are given by $$x_{k} =\cos\left(\frac{2k\pi}{n+1}\right)+i\sin\left(\frac{2k\pi}{n+1}\right), \, k=1,2,\dots,n$$ Further we have $$\frac{1}{x_{k}-1}=-i\cdot\frac{1}{2}\cot\left(\frac{k\pi}{n+1}\right)-\frac{1}{2} $$ Since the sum of these roots is $-n/2$ it follows that $$\sum_{k=1}^{n}\cot\left(\frac{k\pi}{n+1}\right)=0$$
</s>