How can I prove what a particular series converges to? For example, how can I prove that:
$$\sum_{n=1}^{\infty} \frac{\sin(n\theta)}{n} = \frac{\pi}{2}-\frac{\theta}{2}$$
Is there a formula I can use? Also, how can I prove this as rigorously as possible?
Thanks
 A: Hints:
1) Use the identity $\sin(t)=\frac{e^{it}-e^{-it}}{2i}\,,$ 
2) $$ \sum_{k=1}^{\infty}\frac{t^k}{k} = -\ln(1-t) . $$
A: Another way to approach this is to use Mellin transforms. To do this we need the Mellin transform of $\sin(x),$ given by
$$ \mathfrak{M}(\sin(x); s) = \int_0^\infty \sin(x) x^{s-1} dx =
\Im \left(\int_0^\infty e^{ix} x^{s-1} dx \right).$$
To compute this we integrate $$f(z) = e^{iz} z^{s-1}$$ along a square contour with vertices $(0, 0),$ $(R,0)$, $(R,R)$ and $(0, R)$ with $R$ going to infinity. Let the oriented line segments be named $\Gamma_1, \Gamma_2, \Gamma_3$ and $\Gamma_4.$
As $R$ goes to infinity, we have 
$$\int_{\Gamma_1} f(z) dz = \int_0^\infty e^{ix} x^{s-1} dx.$$
Along $\Gamma_4$ we have $z=it$ with $0\le t \le R$ and $dz = i dt$, so that
$$\int_{\Gamma_4} f(z) dz = - \int_0^\infty e^{-t} (it)^{s-1} i dt 
= - i^s \int_0^\infty e^{-t} t^{s-1} dt = - i^s \Gamma(s).$$
Along $\Gamma_2$ we have $z= R +it$ with $0\le t \le R$ and $dz = i dt,$ so that
$$\left|\int_{\Gamma_2} f(z) dz\right| =
\left|\int_0^R e^{iR-t} (R+it)^{s-1} idt\right| \\
\le \int_0^R e^{-t} (\sqrt 2 R)^{s-1} dt < (1-e^{-R}) (\sqrt 2 R)^{s-1}$$
Therefore the contribution from $\Gamma_3$ vanishes in the limit as $R$ goes to infinity as long as $\Re(s)<1.$
Finally, along $\Gamma_3$ we have $z= t +iR$ with $0\le t \le R$ and $dz = dt,$ so that
$$\left|\int_{\Gamma_3} f(z) dz\right| =
\left|-\int_0^R e^{-R+it} (t+iR)^{s-1} dt\right| \\
\le \int_0^R e^{-R} (\sqrt 2 R)^{s-1} dt = e^{-R} (\sqrt 2 R)^s$$
and this integral also vanishes as $R$ goes to infinity.
Putting it all together we have by the Cauchy residue theorem as there are no poles inside the contour that
$$\int_0^\infty e^{ix} x^{s-1} dx - i^s\Gamma(s) = 0$$ or
$$\int_0^\infty e^{ix} x^{s-1} dx = e^{i\pi s/2} \Gamma(s)$$
which allows us to conclude that
$$ \mathfrak{M}(\sin(x); s) = \sin(\pi s/2) \Gamma(s).$$ 
To answer the original question we need to introduce the harmonic sum
$$ g(x) = \sum_{n\ge 1} \frac{\sin(nx)}{nx}$$
which has the base function $$ f(x) = \frac{\sin(x)}{x}.$$
From the introduction we have that
$$ \mathfrak{M}(f(x); s) = \sin(\pi (s-1)/2) \Gamma(s-1) =
-\cos(\pi s/2) \Gamma(s-1).$$ 
Hence the Mellin transform of $g(x)$ is given by
$$ \mathfrak{M}(g(x); s) = -\cos(\pi s/2) \Gamma(s-1) \zeta(s).$$
We complete the calculation by inverting this last transform. Now the cosine term cancels the poles of the Gamma function at the negative odd integers and the Zeta term at negative even integers, so that only the two poles at zero and one remain. Their contributions to the inversion integral are
$$ \operatorname{Res}(g(x)x^{-s}; s = 1) = \frac{\pi}{2x} \quad \text{and} \quad
\operatorname{Res}(g(x)x^{-s}; s = 0) = - \frac{1}{2}.$$
The conclusion is that the original sum has the value
$$\sum_{n\ge 1}\frac{\sin(n\theta)}{n} = 
\theta g(\theta) = \frac{\pi}{2} - \frac{\theta}{2}.$$
