Proving that $$\sum_{n=1}^\infty \frac{\sin^2 n}{n^2}=\frac{\pi -1}{2}$$
I've known a similar conclusion $$ \sum_{n=1}^\infty \frac{\sin nx}{n}= \begin{cases} \dfrac{\pi - x}{2} & x \in (0, 2\pi),\\ \quad 0 & x = 0, \\ f(x+2\pi) & x \in \Bbb{R}. \end{cases} $$ And one of my classmates found the equation mentioned above by mathematica.
I was amazed by the equation
$$ \sum_{n=1}^\infty \frac{\sin^2 n}{n^2}=\sum_{n=1}^\infty \frac{\sin n}{n} $$
My attempt
\begin{align} \sum_{n=1}^\infty \frac{\sin^2 n}{n^2} & = \sum_{n=1}^\infty \frac{1-\cos 2n}{2n^2} \\ & = \sum_{n=1}^\infty \int_0^1 \frac{\sin 2n\theta}{n} d\theta \\ & = \int_0^1 \sum_{n=1}^\infty \frac{\sin 2n\theta}{n} d\theta \\ & = \int_0^1 \frac{\pi}{2}-\theta \,d\theta \\ & = \frac{\pi-1}{2} \end{align}
Oh. Actually I hadn't solved it before I edited this question, but I seemed to have worked it out.
So is there any other method to solve this problem? And deeper insights?
I've heard that it can be worked out via complex analysis and fourier analysis.
Thanks in advance!
Added
Thanks for your comments!
Here is another possible generalization
$$ \sum_{n \in \mathbb{Z} } \left[\frac{\sin (n \alpha + \theta) }{ n \alpha + \theta} \right]^2 = \frac{\pi}{\alpha} \,\, \forall \alpha , \theta \in \mathbb{R} $$
I got stuck on it. For $\theta=0$ we can use the following equation $$ \sum_{n \in \mathbb{Z} } \frac{\cos n\theta}{n^2} = \frac{\pi^2}{6}-\frac{\pi \theta}{2} + \frac{\theta^2}{4} \,\, \theta \in [0,2\pi] $$ But how to deal with the situation that $\theta \ne 0$?
Can you give me some hints? Thanks in advance!