<s>[INST] Sum of the reciprocal of sine squared I encountered an interesting identity when doing physics homework, that is,
$$ \sum_{n=1}^{N-1} \frac{1}{\sin^2 \dfrac{\pi n}{N} } = \frac{N^2-1}{3}. $$
How is this identity derived? Are there any more related identities?
 [/INST] Let's denote  $ S_N=\sum_{n=1}^{N-1} \frac{1}{\sin^2 \dfrac{\pi n}{N} } $
Consider an equality:  
$$\frac{\pi^2}{\sin^2(\pi s)}=\int_0^{\infty}\frac{x^{s-1}}{1-x}\ln\frac{1}{x}dx;0<s<1$$  
Because of $0<\frac{n}{N}<1$, the integral form applies. Thus:  
$$S_N=\frac{1}{{\pi}^2} \int_0^{\infty}\frac{\ln\frac{1}{x}}{1-x}\sum_{n=1}^{N-1}x^{\frac{n}{N}-1}dx=$$  
$$= \frac{1}{{\pi}^2} \int_0^{\infty}\frac{\ln\frac{1}{x}}{1-x}\frac{x^{\frac{1}{N}-1}-1}{1-x^{\frac{1}{N}}}dx=$$  
$$=\frac{N^2}{{\pi}^2} \int_0^{\infty}\frac{\ln\frac{1}{x}}{1-x}\frac{1-x^{N-1}}{1-x^{N}}dx=$$  
$$=2\frac{N^2}{{\pi}^2} \int_0^{1}\frac{\ln\frac{1}{x}}{1-x}\frac{1-x^{N-1}}{1-x^{N}}dx= \frac{N^2-1}{3} $$  
because of $$\int_0^{1}\frac{\ln\frac{1}{x}}{1-x}\frac{1-x^{N-1}}{1-x^{N}}dx= \frac{N^2-1}{N^2}\frac{{\pi}^2}{6}$$
</s>