Sum of the reciprocal of sine squared

From my answer here: Proving $\frac{1}{\sin^{2}\frac{\pi}{14}} + \frac{1}{\sin^{2}\frac{3\pi}{14}} + \frac{1}{\sin^{2}\frac{5\pi}{14}} = 24$

Convert this to the problem of finding

$$\sum_{n=1}^N \frac{1}{1 - \cos \frac{2\pi n}{N}}$$

Convert this to the problem of getting a Chebyshev polynomial of which the roots are $\cos \frac{2\pi n}{N}$ (perhaps after using $\cos \frac{2 \pi (N-n)}{N} = \cos \frac{2 \pi n}{N}$ and getting a polynomial for a subset)

And using the fact the for any polynomial $P(x)$ with roots $r_i$ we have that

$$ \sum_{j=1}^{n} \frac{1}{x - r_j} = \frac{P'(x)}{P(x)}$$

Another (very similar approach) would be to start with

$$\frac{2}{\sin^2 x} = \frac{1}{1+\cos x} + \frac{1}{1-\cos x}$$ Note: I haven't worked out the details, but I am pretty sure this would work.


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}$$


Here it is another approach, just for fun. We may notice that $\cos\frac{\pi}{n+1},\cos\frac{2\pi}{n+1},\ldots,\cos\frac{n\pi}{n+1}$ are the roots of the polynomial $$ U_n(x) = \sin((n+1)\arccos x)/\sqrt{1-x^2} $$ hence $$ S_n=\sum_{k=1}^{n-1}\frac{1}{\sin^2\frac{\pi k}{n}}=\frac{1}{2\pi i}\oint \frac{1}{1-z^2}\cdot\frac{U_{n-1}'(z)}{U_{n-1}(z)}\,dx $$ where the integral is performed along a simple contour enclosing $[-1+\varepsilon,1-\varepsilon]$.
By enforcing the substitution $z=\cos\theta$ we are left with $$ S_n = -\frac{1}{2\pi i}\oint \frac{\cot\theta-n\cot(n\theta)}{\sin^2\theta}\,d\theta $$ where the integral is performed along a simple contour enclosing $[\varepsilon,\pi-\varepsilon]$. Due to the periodicity of the integrand function and the fact that the sum of the residues of such meromorphic function has to be zero we have $$ S_n = \operatorname*{Res}_{z=0}\frac{\cot z-n\cot(n z)}{\sin^2 z} = [z^{2}]\frac{z\cot z-nz\cot(n z)}{\left(\frac{\sin z}{z}\right)^2}=(1-n^2)\cdot[z^2]z\cot z$$ and we may finish be considering that in a neighbourhood of the origin, up to a term $O(z^3)$, $$ z\cot z = \frac{z\cos z}{\sin z} \equiv \frac{z\left(1-\frac{z^2}{2}\right)}{z\left(1-\frac{z^2}{6}\right)}\equiv 1-\frac{z^2}{3} $$ such that $S_n = \frac{n^2-1}{3}$.