How to prove $\sum\limits_{n=1}^{\infty}\frac{\sin n}n=\frac{\pi-1}{2}$

One of my classmates challenged me to solve $\displaystyle\sum\limits_{n=1}^{\infty}\frac{\sin n}n=\;?$

With a simple c program I found that $\displaystyle\sum\limits_{n=1}^{1048576}\frac{\sin n}n\approx1.070796$. Later I found $\displaystyle1.070796\approx\frac{\pi-1}{2}$. My classmate told me I guessed right, but he ask me to prove it, and he gave me a hint that $\displaystyle e^{i\theta} = \cos\theta + i \sin\theta$, though I can't see the relationship between the question and the hint.

So how to prove $\displaystyle\sum\limits_{n=1}^{\infty}\frac{\sin n}n=\frac{\pi-1}{2}$?


Make use of the following fact: For $\vert z \vert \leq 1$ and $z \neq 1$, we have $$\log(1-z) = - \sum_{k=1}^{\infty} \dfrac{z^k}k$$ Take $z=e^i$ and look at the imaginary part.

We hence have $$\log(1-e^i) = - \sum_{k=1}^{\infty} \dfrac{e^{ik}}k \implies \text{Imag}(\log(1-e^i)) = \text{Imag}\left(- \sum_{k=1}^{\infty} \dfrac{e^{ik}}k \right)$$ which gives us $$\sum_{k=1}^{\infty} \dfrac{\sin(k)}k = - \text{Imag}(\log(1-e^i))$$ $$\log(1-e^i) = \log \left(2\sin^2(1/2) - 2i \sin(1/2) \cos(1/2)\right) = \log(2\sin(1/2)e^{-i \pi/2}e^{i/2})$$ Hence, $$\text{Imag}(\log(1-e^i)) = \dfrac{1-\pi}2$$ which gives us $$\sum_{k=1}^{\infty} \dfrac{\sin(k)}k = \dfrac{\pi-1}2$$