Finite Sum $\sum\limits_{k=1}^{m-1}\frac{1}{\sin^2\frac{k\pi}{m}}$ 
Question : Is the following true for any $m\in\mathbb N$?
  $$\begin{align}\sum_{k=1}^{m-1}\frac{1}{\sin^2\frac{k\pi}{m}}=\frac{m^2-1}{3}\qquad(\star)\end{align}$$

Motivation : I reached $(\star)$ by using computer. It seems true, but I can't prove it. Can anyone help?
By the way, I've been able to prove $\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{{\pi}^2}{6}$ by using $(\star)$.
Proof : Let 
$$f(x)=\frac{1}{\sin^2x}-\frac{1}{x^2}=\frac{(x-\sin x)(x+\sin x)}{x^2\sin^2 x}.$$
We know that $f(x)\gt0$ if $0\lt x\le {\pi}/{2}$, and that $\lim_{x\to 0}f(x)=1/3$. Hence, letting $f(0)=1/3$, we know that $f(x)$ is continuous and positive at $x=0$. Hence, since $f(x)\ (0\le x\le {\pi}/2)$ is bounded, there exists a constant $C$ such that $0\lt f(x)\lt C$. Hence, substituting $x={(k\pi)}/{(2n+1)}$ for this, we get
$$0\lt \frac{1}{\frac{2n+1}{{\pi}^2}\sin^2\frac{k\pi}{2n+1}}-\frac{1}{k^2}\lt\frac{{\pi}^2C}{(2n+1)^2}.$$
Then, the sum of these from $1$ to $n$ satisfies 
$$0\lt\frac{{\pi}^2\cdot 2n(n+1)}{(2n+1)^2\cdot 3}-\sum_{k=1}^{n}\frac{1}{k^2}\lt\frac{{\pi}^2Cn}{(2n+1)^2}.$$
Here, we used $(\star)$. Then, considering $n\to\infty$ leads what we desired.
 A: Setting $\tan mx=0$  in  Sum of tangent functions where arguments are in specific arithmetic series, 
we get $$\binom m1\tan x-\binom m3\tan^3x+\cdots=0\ \ \ \ (1)$$
Multiplying both sides by $\cot^mx,$  
$$\binom m1\cot^{m-1}x-\binom m3\cot^{m-3}x+\cdots=0\ \ \ \ (2)$$
$\tan mx=0\implies mx=n\pi$ where $n$ is any integer
$\implies$ the roots of $(2)$ are $\cot x$ where $x=\dfrac{n\pi}m$ where $1\le n\le m-1$
Using Vieta's formula, $$\sum_{r=1}^{m-1}\cot^2\dfrac{r\pi}m=\left(\sum_{r=1}^{m-1}\cot\dfrac{r\pi}m\right)^2-2\left(\sum_{r_1,r_2=1,r_1>r_2}^{m-1}\cot\dfrac{r_1\pi}m\cot\dfrac{r_2\pi}m\right)$$
$$=0-2\cdot\left(-\frac{\binom m3}{\binom m1}\right)=\cdots$$
$$\sum_{r=1}^{m-1}\frac1{\sin^2\dfrac{r\pi}m}=\sum_{r=1}^{m-1}\left(1+\cot^2\dfrac{r\pi}m\right)=m-1+\sum_{r=1}^{m-1}\cot^2\dfrac{r\pi}m=\cdots$$
Hope the steps are understandable
A: (First time I write in a math blog, so forgive me if my contribution ends up being useless)
I recently bumped into this same identity while working on Fourier transforms. By these means you can show in fact that
$$\sum_{k=-\infty}^{+\infty}\frac{1}{(x-k)^2}=\frac{\pi^2}{\sin^2 (\pi x)}.\tag{*}\label{*}$$
Letting $x=\frac13$ yields
$$\begin{align}\sum_{k=-\infty}^{+\infty}\frac{1}{(3k-1)^2}&= \sum_{k=0}^{+\infty}\left[\frac{1}{(3k+1)^2}+ \frac{1}{(3k+2)^2} \right]=\\
&=\sum_{k=1}^{+\infty} \frac{1}{k^2} - \sum_{k=1}^{+\infty}\frac{1}{(3k)^2}=\\
&=\frac{8}{9}\sum_{k=1}^{+\infty} \frac{1}{k^2}\\
&\stackrel{\eqref{*}}= \frac{4\pi^2}{27}\end{align},$$
which in the end gives
$$\sum_{k=1}^{+\infty} \frac{1}{k^2} = \frac{\pi^2}{6}.\tag{**}\label{**}$$
Now, back to \eqref{*}, we can generalize and take $x=m/n$, with $n$ and $m$ positive integers, obtaining
$$\sum_{k=0}^{+\infty}\left[\frac{1}{(nk+m)^2} + \frac{1}{(nk+n-m)^2}\right]=\frac{\pi^2}{n^2 \sin^2\left(\frac{\pi m}{n}\right)}.$$
Finally taking the sum of LHS and RHS of last equation for $m=1,2,\dots,n-1$ yields
$$\begin{align}\sum_{m=1}^{n-1}\sum_{k=0}^{+\infty}\left[\frac{1}{(nk+m)^2} + \frac{1}{(nk+n-m)^2}\right]&=\frac{\pi^2}{n^2} \sum_{m=1}^{n-1}\frac{1}{\sin^2\left(\frac{\pi m}{n}\right)}\\
\sum_{k=0}^{+\infty}\sum_{m=1}^{n-1}\left[\frac{1}{(nk+m)^2} + \frac{1}{(nk+n-m)^2}\right]&=\frac{\pi^2}{n^2} \sum_{m=1}^{n-1}\frac{1}{\sin^2\left(\frac{\pi m}{n}\right)}\\
2\sum_{k=1}^{+\infty}\frac{1}{k^2} - 2\sum_{k=1}^{+\infty}\frac{1}{(nk)^2} &=\frac{\pi^2}{n^2} \sum_{m=1}^{n-1}\frac{1}{\sin^2\left(\frac{\pi m}{n}\right)}\\
\frac{2(n^2-1)}{n^2}\sum_{k=1}^{+\infty}\frac{1}{k^2} &=\frac{\pi^2}{n^2} \sum_{m=1}^{n-1}\frac{1}{\sin^2\left(\frac{\pi m}{n}\right)}.
\end{align}$$
Using then \eqref{**} leads to the result
$$\sum_{m=1}^{n-1} \frac{1}{\sin^2\left(\frac{\pi m}{n}\right)} = \frac{n^2-1}{3}.$$
A: There not being a residue theory answer, I have copied excerpts from this answer:
$\frac{2n/z}{z^{2n}-1}$ has residue $1$ at $z=e^{\pi ik/n}$ and residue $-2n$ at $z=0$.
Thus,
$$
\begin{align}
\left(\frac{2i}{z-\frac1z}\right)^2\frac{2n/z}{z^{2n}-1}
&=\frac{-4z^2}{z^4-2z^2+1}\frac{2n/z}{z^{2n}-1}\\
&=\left(\frac1{(z+1)^2}-\frac1{(z-1)^2}\right)\frac{2n}{z^{2n}-1}
\end{align}
$$
has residue $\csc^2\left(\pi k/n\right)$ at $z=e^{\pi ik/n}$ except at $z=\pm1$. A bit of computation gives
$$
\begin{align}
\frac{2n}{z^{2n}-1}
&=\phantom{+}\frac1{z-1}-\frac{2n-1}2+\frac{(2n-1)(2n+1)}{12}(z-1)+O\!\left((z-1)^2\right)\\
&=-\frac1{z+1}-\frac{2n-1}2-\frac{(2n-1)(2n+1)}{12}(z+1)+O\!\left((z+1)^2\right)
\end{align}
$$
Therefore,
$$\newcommand{\Res}{\operatorname*{Res}}
\Res_{z=1}\left(\frac1{(z+1)^2}-\frac1{(z-1)^2}\right)\frac{2n}{z^{2n}-1}
=\frac14-\frac{4n^2-1}{12}=-\frac{n^2-1}3
$$
and
$$
\Res_{z=-1}\left(\frac1{(z+1)^2}-\frac1{(z-1)^2}\right)\frac{2n}{z^{2n}-1}
=\frac14-\frac{4n^2-1}{12}=-\frac{n^2-1}3
$$
Since the sum of the residues at all the singularities is $0$, we get that half the sum over the singularities except at $z=\pm1$ is
$$
\sum_{k=1}^{n-1}\csc^2\left(\frac{k}{n}\pi\right)=\frac{n^2-1}3
$$
A: Note that
$$\frac{1}{\sin^2(x)}=\sum_{n\in\mathbb{Z}}\frac{1}{(x+n\pi)^2}$$
using this identity we can write
$$\begin{align}\sum_{k=0}^{m-1}\frac{1}{\sin^2(\frac{x+k\pi}{m})}&=\sum_{k=0}^{m-1}\sum_{n\in\mathbb{Z}}\frac{1}{(\frac{x+k\pi}{m}+n\pi)^2}\\
&=\sum_{k=0}^{m-1}\sum_{n\in\mathbb{Z}}\frac{1}{\frac{(x+k\pi+mn\pi)^2}{m^2}}\\
&=m^2\sum_{k=0}^{m-1}\sum_{n\in\mathbb{Z}}\frac{1}{(x+k\pi+mn\pi)^2}\\
&=m^2\sum_{n\in\mathbb{Z}}\sum_{k=0}^{m-1}\frac{1}{(x+(k+mn)\pi)^2}=\frac{m^2}{\sin^2(x)}\end{align}$$
and
$$\sum_{k=1}^{m-1}\frac{1}{\sin^2(\frac{x+k\pi}{m})}=\frac{m^2}{\sin^2(x)}-\frac{1}{\sin^2(\frac{x}{m})}$$
Hence,
$$\sum_{k=1}^{m-1}\frac{1}{\sin^2(\frac{k\pi}{m})}=\lim_{x\to0}\frac{m^2}{\sin^2(x)}-\frac{1}{\sin^2(\frac{x}{m})}=\frac{m^2-1}{3}.$$
A: Consider the polynomial $S_m(x)$, satisfying $S_m(\sin^2 \theta)=\sin^2(m\theta)$. 
These are known as spread polynomials, and may easily be derived from the Chebyshev polynomials $T_m(x)$, via $$1-2S_m(\sin^2(\theta)=1-2\sin^2(m\theta)=\cos(m(2\theta))=T_m(\cos(2\theta))=T_m(1-2\sin^2 \theta)$$ so $1-2S_m(x)=T_m(1-2x)$.
Note that 
\begin{align}
&S_{m+1}(\sin^2 \theta)+S_{m-1}(\sin^2 \theta) \\
& =\sin^2(m\theta+\theta)+\sin^2(m\theta-\theta) \\
&=(\sin(m\theta)\cos \theta+\cos(m\theta)\sin \theta)^2+(\sin(m\theta)\cos \theta-\cos(m\theta)\sin \theta)^2 \\
&=2\sin^2(m \theta)\cos^2 \theta+2\cos^2(m \theta) \sin^2(m\theta) \\
&=2(1-\sin^2 \theta)S_m(\sin^2 \theta)+2\sin^2 \theta(1-S_m(\sin^2 \theta))
\end{align}
Thus $S_{m+1}(x)=2(1-2x)S_m(x)-S_{m-1}(x)+2x$.
(We could also have used the more well known recurrence $T_{n+1}(x)=2xT_n(x)-T_{n-1}(x)$ and derived the recurrence for $S_m$ from there.)
Observe that $\sin^2(\frac{k\pi}{m}), k=0, 1, \ldots, m-1$ are roots of the polynomial equation  $S_m(x)=0$. Put $S_m(x)=xP_m(x)$, so that $\sin^2(\frac{k\pi}{m}), k=1, 2, \ldots, m-1$ are roots of the polynomial equation  $P_m(x)=0$. The recurrence for $S_m$ gives $$P_{m+1}(x)=2(1-2x)P_m(x)-P_{m-1}(x)+2$$
Now if we write $P_m(x)=a_m+b_mx+x^2Q_m(x)$, it is clear by Vieta's formulas that $$\sum_{k=1}^{m-1}{\frac{1}{\sin^2(\frac{k\pi}{m})}}=\frac{\sum_{k=1}^{m-1}{\prod_{j \not =k}{\sin^2(\frac{j\pi}{m})}}}{\prod_{i=1}^{m-1}{\sin^2(\frac{k\pi}{m})}}=-\frac{b_m}{a_m}$$
We prove by induction on $m$ that $a_m=m^2, b_m=-\frac{(m^2-1)m^2}{3}$.
When $m=1$, we have $S_1(x)=x$ so $P_1(x)=1=(1^2)-\frac{(1^2-1)1^2}{3}x$ so the statement is true for $m=1$.
When $m=2$, we have $S_2(x)=4x(1-x)$ so $P_2(x)=4-4x=2^2-\frac{(2^2-1)2^2}{3}x$ so the statement is true for $m=2$.
Suppose that the statement holds for $m=i-1, i$, where $i \geq 2$. Then 
\begin{align}
P_{i+1}(x)&=2(1-2x)P_i(x)-P_{i-1}(x)+2 \\
&=2(1-2x)(a_i+b_ix+x^2Q_i(x))-(a_{i-1}+b_{i-1}x+x^2Q_{i-1}(x))+2 \\
&=(2a_i-a_{i-1}+2)+(2b_i-4a_i-b_{i-1})x+x^2(-4b_i+2Q_i(x)-Q_{i-1}(x))
\end{align}
Thus (after some algebra manipulation) 
$$a_{i+1}=2a_i-a_{i-1}+2=(i+1)^2$$ 
and 
\begin{align}
b_{i+1}=2b_i-4a_i-b_{i-1}&=-2\frac{(i^2-1)i^2}{3}-4i^2+\frac{((i-1)^2-1)(i-1)^2}{3} \\
&=-\frac{((i+1)^2-1)(i+1)^2}{3}
\end{align}
We are thus done by induction.
Now, 
$$\sum_{k=1}^{m-1}{\frac{1}{\sin^2(\frac{k\pi}{m})}}=-\frac{b_m}{a_m}=-\frac{-\frac{(m^2-1)m^2}{3}}{m^2}=\frac{m^2-1}{3}$$
A: In the spirit of this answer I will provide a slight generalization.
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,d}=\sum_{k=1}^{n-1}\frac{1}{\sin^{2d}\frac{\pi k}{n}}=\frac{1}{2\pi i}\oint \frac{1}{(1-z^2)^d}\cdot\frac{U_{n-1}'(z)}{U_{n-1}(z)}\,dx $$
where the integral is performed along the boundary of $[-1+\varepsilon,1-\varepsilon]\times[-\varepsilon,\varepsilon]$. By enforcing the substitution $z=\cos\theta$ we are left with
$$ S_{n,d} = -\frac{1}{2\pi i}\oint \frac{\cot\theta-n\cot(n\theta)}{\sin^{2d}\theta}\,d\theta $$
where the integral is performed along the boundary of $[\varepsilon,\pi-\varepsilon]\times[-\varepsilon,\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,d} = \operatorname*{Res}_{z=0}\frac{\cot z-n\cot(n z)}{\sin^{2d} z} = [z^{2d}]\frac{z\cot z-nz\cot(n z)}{\left(\frac{\sin z}{z}\right)^{2d}}$$
so by considering simple Maclaurin series we have
$$ S_{n,1}=\frac{n^2-1}{3},\qquad S_{n,2}=\frac{(n^2-1)(n^2+11)}{45},\qquad S_{n,3}=\frac{(n^2-1)(2n^4+23n^2+191)}{945} $$
as well as
$$ \zeta(2d) = \frac{\pi^{2d}}{2}\lim_{n\to +\infty}\frac{S_{n,d}}{n^{2d}}$$
as a consequence of the dominated convergence theorem.
A: Using the partial fractions identity, it's possible to split the summation into two
$$ \frac{2}{\sin^2 \theta} = \frac{1}{1-\cos \theta} + \frac{1}{1+\cos \theta}$$
Now our sum over the nth roots
$$ (\star) =\sum_{k=1}^{m-1} \frac{1}{\sin^2 \frac{\pi k }{n}}
= \frac{1}{2}\sum_{k=1}^{m-1} \frac{1}{1-\cos \frac{\pi k }{n}}
+ \frac{1}{2}\sum_{k=1}^{m-1} \frac{1}{1+\cos \frac{\pi k }{n}}
$$
If we can find the right polynomial $P(x)$, we can find our sum using the identity for the logarithmic derivative. We need to plug in $x=1$ and $x=-1$ and subtract.
$$ \frac{P'(x)}{P(x)} =\sum \frac{1}{x-r_i} \text{ then }
\sum \frac{1}{1-r_i} +  \sum \frac{1}{1+r_i} 
= \frac{P'(1)}{P(1)} - \frac{P'(-1)}{P(-1)} $$
My first guess is the Chebyshev polynomials satisfy $T_n(\cos \theta)  = \cos n \theta $.
The roots of $T_m(x) = 0$ are $x = \cos \frac{2\pi k}{m}$ with $k = 0,1,2, \dots, m-1$.
Instead, we need a polynomial with roots of $x = \cos \frac{\pi k}{m}$ which is the derivative $\boxed{P(x)=T'_m(x)}$ (Chebyshev polynomial of second kind)

In the case of the Chebyshev polynomial I got these two expressions for the values of the derivative at $x=1$:
Let $T(\cos \theta) = \cos n \theta$.  Then set $\theta = 0$:
$$ T(1) = 1 $$
If we take the derivative (whose zeros have roots exactly where we want)
$$\boxed{ \sin \theta \; T'(\cos \theta) = -n \sin n \theta} \hspace{0.25in}\text{ so that }\hspace{0.25in}
 \boxed{\displaystyle T'(\cos \theta) = -\frac{n \sin n \theta}{\sin \theta} \bigg|_{\theta=0}= -n^2}$$
and for the second derivative, try the quotient rule:
\begin{eqnarray} T''(\cos \theta) &=& n \cdot \frac{n \cos n \theta \sin \theta - \sin n \theta \cos \theta}{\sin^3 \theta}  \\
&=\bigg|_{\theta \approx 0}& n \cdot \frac{n (1 - n^2 \theta^2 /2)(\theta - \theta^3 /6) - (n \theta - (n\theta)^3/6)(1 - \theta^2 /2)}{\theta^3} \\ &=\bigg|_{\theta \approx 0}& \frac{n^2 - n^4 }{3}\end{eqnarray} 
If we set $\theta = \pi$, just get a $(-1)^n$ factor.  In general your sum is 
$$ (\star) =  \frac{T'(1)}{T''(1)} = \frac{T'(-1)}{T''(-1)} =
\frac{1}{2}\left( \frac{T'(1)}{T''(1)} + \frac{T'(-1)}{T''(-1)}\right) =  \frac{\tfrac{1}{3}(n^4 - n^2)}{n^2} = \frac{n^2 - 1 }{3}$$

COMMENTS It is surprisingly hard to pin all the details down.  See also: Sum of the reciprocal of sine squared
A: You may also use the following formula valid for $x\neq 1$:
$\sum_{k=1}^{n-1}\frac{1}{(x-1)^2+4x\sin^2(\frac{k\pi}{n})}=\frac{n(x^n+1)}{(x^2-1)(x^n-1)}-\frac{1}{(x-1)^2}$.
The left hand side of the equation can be written as $\frac{x^{n+1}(n-1)-(n+1)x^n+x(n+1)-n+1}{(x-1)^3}\cdot \frac{1}{(x^{n-1}+x^{n-2}+\ldots +1)(x+1)}$.
You may use L' Hospital rule (for the limit $x\rightarrow 1$) for the first fraction (the second one gives a result of $2n$) and deduce that $\sum_{k=1}^{n-1}\frac{1}{4\sin^2(\frac{k\pi}{n})}=\frac{n^3-n}{6}\cdot \frac{1}{2n}=\frac{n^2-1}{12}$ and you are done.
