TITLE: Computing $\sum\limits_{n=1}^\infty\frac{\sin n}{n}$ with residues
QUESTION [8 upvotes]: I'm running into some error in computing the sum. Since $\dfrac{\sin n}{n}$ is even, I'm considering the function $f(z)=\dfrac{\pi\sin z\cot\pi z}{z}$ and the contour integral
$$\oint_\gamma \frac{\pi\sin z\cot\pi z}{z}\,\mathrm{d}z$$
where $\gamma$ is a square centered at the origin surrounding the poles and extending off to $\infty$.
So I have the impression that the integral should be
$$0=\mathrm{Res}(f(z),0)+\sum_{k\in\mathbb{Z}\setminus\{0\}}\mathrm{Res}(f(z),k)$$
where all the poles are simple. Since $\dfrac{\sin n}{n}$ is even, the second term is twice the sum over the positive integers. At $z=0$, the residue is $1$, so I'm left with
$$0=1+2\sum_{k\ge1}\mathrm{Res}(f(z),k)=1+2\sum_{k\ge1}\frac{\sin k}{k}$$
but this would suggest the value of the sum is $-\dfrac{1}{2}$. I'm off by $\dfrac{\pi}{2}$, but I don't know where I went wrong. Am I wrong in assuming the integral disappears?
Apologies if this is a duplicate; all the questions I've run into involving this sum were just testing for convergence, not finding the exact value.

REPLY [3 votes]: If you want the residue in some way, we can use the fact that the Mellin transform identity for harmonic sums with base function $g\left(x\right)$ is $$\mathfrak{M}\left(\sum_{n\geq1}\lambda_{n}g\left(\mu_{n}x\right),s\right)=\sum_{n\geq1}\frac{\lambda_{n}}{\mu_{n}^{s}}\mathfrak{M}\left(g\left(x\right),s\right)$$ so if we consider the sum $$\sum_{n\geq1}\frac{\sin\left(nx\right)}{nx}
 $$ we have $$\lambda_{n}=1,\,\mu_{n}=n,\, g\left(x\right)=\frac{\sin\left(x\right)}{x}
 $$ and so we observe that $$\mathfrak{M}\left(g\left(x\right),s\right)=\Gamma\left(s-1\right)\sin\left(\frac{1}{2}\pi\left(s-1\right)\right)
 $$ and $$\sum_{n\geq1}\frac{\lambda_{n}}{\mu_{n}^{s}}=\zeta\left(s\right)
 $$ so $$\sum_{n\geq1}\frac{\sin\left(nx\right)}{nx}=\frac{1}{2\pi i}\int_{\mathbb{C}}\Gamma\left(s-1\right)\sin\left(\frac{1}{2}\pi\left(s-1\right)\right)\zeta\left(s\right)x^{-s}ds=\frac{1}{2\pi i}\int_{\mathbb{C}}Q\left(s\right)x^{-s}ds
 $$ now observe that $Q\left(s\right)
 $ has poles only at $s=0,1
 $, due to the zeros of the sine and the zeta function, then by residue theorem $$\sum_{n\geq1}\frac{\sin\left(nx\right)}{nx}=\textrm{Res}_{s=1}\left(Q\left(s\right)x^{-s}\right)+\textrm{Res}_{s=0}\left(Q\left(s\right)x^{-s}\right)=\frac{\pi}{2x}-\frac{1}{2}
 $$ so finally take $x=1
 $.