Computing $\sum\limits_{n=1}^\infty\frac{\sin n}{n}$ with residues

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.

• I was going to post an answer, but it would be very similar to the answer I posted here. Mar 6, 2023 at 23:58
• @RV Thanks, always nice to see a generalization :) Mar 7, 2023 at 2:54

$f(z)$ does not decay fast enough to ensure that the integral along $\gamma$ goes to zero, that is all.

Besides that,

$$\sum_{n\geq 1}\frac{\sin n}{n} = \sum_{n\geq 1}\int_{0}^{+\infty}\sin(n)e^{-nx}\,dx =\text{Im}\int_{0}^{+\infty}\left(-1+\sum_{n\geq 0}e^{in}\cdot e^{-nx}\right)\,dx,$$ with a certain amount of care in proving that we are allowed to swap $\sum$ and $\int$, gives:

$$\sum_{n\geq 1}\frac{\sin n}{n} = \text{Im}\int_{0}^{+\infty}\frac{e^i}{e^x-e^i}\,dx =\text{Im}\int_{1}^{+\infty}\frac{e^i}{z(z-e^i)}\,dz$$ from which: $$\sum_{n\geq 1}\frac{\sin n}{n} = -\text{Im}\log(1-e^i) = \color{red}{\frac{\pi-1}{2}}.$$

Another nice proof comes from Fourier analysis. You may check that $$\sum_{n\geq 1}\frac{\sin(nx)}{n}$$ is the Fourier series of the sawtooth wave, a $2\pi$-periodic function that equals $\frac{\pi-x}{2}$ over $(0,2\pi)$.

Once you prove that the Fourier series pointwise converges to the function at $x=1$, you get another proof of $\sum_{n\geq 1}\frac{\sin(n)}{n}=\frac{\pi-1}{2}$. Still another chance is the limit form of the Euler-MacLaurin summation formula.

• Excuse my ignorance, but by "decay" do you mean the contour doesn't satisfy the estimation lemma? Dec 29, 2015 at 21:44
• @user170231: exactly. Dec 29, 2015 at 21:45
• Anyway, to make your argument work, you may first apply a step of summation by parts or integration by parts, in order to deal with a function that exhibits a $\frac{1}{z^2}$ decay. Dec 29, 2015 at 21:47

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$.