Proving a trig infinite sum using integration How can I prove the following using integration and elementary functions?
Prove that:
$$\sum_{n=1}^{\infty} \frac{\sin(n\theta)}{n} = \frac{\pi}{2} - \frac{\theta}{2}$$
$0 <  \theta <  2\pi$

Let,
$$S_1 = \sum_{n=1}^{\infty}\frac{\cos n\theta}{n}\\
S_2 = \sum_{n=1}^{\infty}\frac{\sin n\theta}{n}$$
Then $$S_1 + iS_2 = \sum_{n=1}^{\infty}\frac{\cos(n\theta)+i\sin(n\theta)}{n}=\sum_{n=1}^{\infty}\frac{e^{in\theta}}{n}$$
Now, from the Taylor expansion, $\ln (1+x) = x -\frac{x^2}{2}+\frac{x^3}{3} ...$
$$\implies -\ln(1-x) = x+ \frac{x^2}{2}+\frac{x^3}{3} ... = \sum_{n=1}^{\infty}\frac{x^n}{n}$$
$$\begin{align} \therefore S_1+iS_2 &= -\ln(1-e^{i\theta})
\\&=-\ln(1-\cos\theta-i\sin \theta)
\\
&=-\ln(2\sin^2\theta/2 - 2i\sin(\theta/2)\cos(\theta/2))
\\
&=-\ln(2\sin\theta/2)-\ln(\sin\theta/2-i\cos\theta/2)
\\
&=-\ln(2\sin\theta/2)+\ln(\sin\theta/2+i\cos\theta/2)
\\
&=-\ln(2\sin\theta/2)+\ln(e^{i(\pi/2-\theta/2)})
\\
&=-\ln(2\sin\theta/2)+i(\pi/2-\theta/2)
\end{align}
$$
Taking the imaginary part of both sides,
$$S_2 = \frac{\pi}{2} - \frac{\theta}{2}$$
