$\sum_{k=1}^n\frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2n}\right)}$ How to calculate this sum 
$$S_n = \sum_{k=1}^n\frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2n}\right)} ?$$ 
Note : 
1) 
$$S_n = n+\sum_{k=1}^n{\rm cotan}^2\left(\frac{(2k+1)\pi}{2n}\right)$$
2) $S_n$ seems to be equal to $\frac{n^2}{4}$.
3) I kwow how to calculate 
$$\sum_{k=1}^n\frac{1}{\sin^2\left(\frac{k\pi}{2n}\right)}$$
with the roots of $(X+1)^{2n} - (X-1)^{2n}$.

Take a polynomial $P(t)=t^n$ and consider the function $$F_t(z)=\frac{P(tz)-P(t)}{z-1}=t^n\frac{z^n-1}{z-1}.$$
Lagrange interpolation of $F_t$ with basis points on the roots $z_0,z_1,...,z_{n-1}$ of $z^n+1$ (so that $z_k=e^{\frac{\pi(1+2k)}{n}}$) gives:
$$
F_t(z)=\sum_{k=0}^{n-1} F_t(z_k)\frac{z^n+1}{nz_k^{n-1}(z-z_k)}=-\frac{1}{n}\sum_{k=0}^{n-1}t^n\frac{z_k^n-1}{z_k-1}\frac{z^n+1}{z-z_k}z_k=\\
=-\frac{1}{n}\sum_{k=0}^{n-1}t^n\frac{2}{z_k-1}\frac{z^n+1}{z_k-z}z_k.
$$
On one hand $F_t(1)=tP'(t)=nt^n$ and on the other $F_t(1)=-\frac{1}{n}\sum_{k=0}^{n-1}t^n\frac{4z_k}{(z_k-1)^2}$.
Thus
$$
n^2=-4\sum_{k=0}^{n-1}\frac{z_k}{(z_k-1)^2}=\sum_{k=0}^{n-1}\frac{1}{\sin^2\left(\frac{\pi(1+2k)}{2n}\right)}
$$
since $\frac{e^{i\phi}}{(e^{i\phi}-1)^2}=-\frac{1}{4\sin^2 \phi/2}$.
