I’ve previously discussed various aspects of the “trigonometric harmonic series” $\sum_{n=1}^\infty\cos n/n$, and in particular showed that the series is conditionally convergent. However, we haven’t found the actual value it converges to; our argument only shows that the value must be smaller than about $2.54$ in absolute value. In this post, I’ll give a closed-form expression for the exact value that the series converges to.
Writing $\sum_{n=1}^\infty\cos n/n$ in terms of an integral
Our analysis starts off with the Calc 1 identity
\[ \newcommand{\d}{\,\mathrm{d}} \int \sin(nx)\d x = \frac{-\cos(nx)}{n} . \]
From this and the fundamental theorem of calculus, we find that
\[ \int_1^\pi\sin(nx)\d x = \frac{\cos n}{n}-\frac{\cos(n\pi)}{n} = \frac{\cos n}{n}-\frac{(-1)^n}{n} . \]
Rearranging and summing over all $n\geq1$ we get that
\begin{align*}
\sum_{n=1}^\infty \frac{\cos n}{n} &= \sum_{n=1}^\infty\biggl(\frac{(-1)^n}{n}+\int_1^\pi\sin(nx)\d x\biggr) \\
&= \sum_{n=1}^\infty\frac{(-1)^n}{n}+\sum_{n=1}^\infty\int_1^\pi\sin(nx)\d x ,
\end{align*}
assuming that $\sum_{n=1}^\infty(-1)^n/n$ converges—which it does; this series is known as the (negative) alternating harmonic series and is well-known to converge to $-\ln2$. The second is trickier but we have that
\[ \lim_{m\to\infty}\sum_{n=1}^m\int_1^\pi\sin(nx)\d x = \lim_{m\to\infty}\int_1^\pi\sum_{n=1}^m\sin(nx)\d x \]
by the sum rule in integration. By the sum of sines lemma I previously proved the integral on the right simplifies to
\[ \int_1^\pi\frac{\sin(mx)-\sin((m+1)x)+\sin x}{4\sin(x/2)^2}\d x \]
which we now split into a sum of three integrals and deal with them individually.
The third integral $I_3:=\int_1^\pi{\sin x}/({4\sin(x/2)^2})\d x$
The third integral does not depend on $m$ and can be dealt with directly. We use the double-angle formula $\sin x=2\sin(x/2)\cos(x/2)$ and the substitution $u:=\sin(x/2)$ to show that
\[ \int\frac{\sin x}{4\sin(x/2)^2}\d x = \int\frac{\cos(x/2)}{2\sin(x/2)}\d x = \int\frac{\mathrm{d}u}{u} = \ln u , \]
and then
\[ I_3 = \int_1^\pi\frac{\sin x}{4\sin(x/2)^2}\d x = \Bigl[\ln(\sin(x/2))\Bigr]_1^\pi = -\ln(\sin(1/2)) . \]
The first integral $I_1:=\int_1^\pi{\sin(mx)}/({4\sin(x/2)^2})\d x$
We won’t exactly evaluate the value of $I_1$, but we will show that
\[ I_1 = \int_1^\pi\frac{\sin(mx)}{4\sin(x/2)^2}\d x \to 0 \]
as $m\to\infty$. First, we’ll split the integral into integrals over intervals of length $2\pi/m$, which is the period of the numerator $\sin(mx)$. Letting $l$ be some number between $1$ and $\pi-2\pi/m$, we’ll consider the integral
\[ \int_l^{l+2\pi/m}\frac{\sin(mx)}{4\sin(x/2)^2}\d x \tag{1} . \]
Note that the varying denominator is what makes the integral cumbersome to evaluate—if denominator was constant, the integral would be easy to evaluate, e.g.,
\[ \int_l^{l+2\pi/m}\frac{\sin(mx)}{4\sin(l/2)^2}\d x = 0 \tag{2} \]
because $\sin(mx)=-\sin(m(x+\pi/m))$ for all $x$. Thus we may subtract (2) from (1) without changing its value, and after doing this (1) becomes equal to
\[\int_l^{l+2\pi/m}\frac{\sin(mx)}{4}\biggl(\frac{1}{\sin(x/2)^2}-\frac{1}{\sin(l/2)^2}\biggr)\d x . \tag{3} \]
We now examine the absolute value of the parenthesized expression in (3). Finding a common denominator and using the difference of squared sines identity we find that the the parenthesized expression has absolute value
\[ \frac{\lvert\sin(l/2)^2-\sin(x/2)^2\rvert}{(\sin(x/2)\sin(l/2))^2} = \frac{\lvert\sin((l+x)/2)\sin((l-x)/2)\rvert}{(\sin(x/2)\sin(l/2))^2} . \]
Since $1\leq l\leq x\leq\pi$ the denominator has value at least $\sin(1/2)^4$. Using that $\lvert\sin x\rvert\leq\lvert x\rvert$ and $\lvert\sin x\rvert\leq1$, the numerator has value at most $\lvert l-x\rvert/2$. Since $x-l\leq 2\pi/m$, the parenthesized expression has absolute value at most
\[ \frac{\pi}{m\sin(1/2)^4} . \]
By the M-L inequality the integral (3) has absolute value at most
\[ \frac{2\pi}{m}\cdot\frac{\pi}{4m\sin(1/2)^4} = \frac{\pi^2}{m^2\sin(1/2)^4} . \tag{4} \]
We’re now ready to bound the value of the first integral $I_1$. As motivated above, we split this into pieces by splitting up the interval $[1,\pi]$ via
\[ \int_1^\pi = {\int_1^{(2\pi/m)\lceil m/(2\pi)\rceil}} + {\sum_{k=\lceil m/(2\pi)\rceil}^{\lfloor m/2\rfloor-1}\int_{(2\pi/m)k}^{(2\pi/m)(k+1)}} + {\int_{(2\pi/m)\lfloor m/2\rfloor}^\pi} . \]
The first and last intervals each have length at most $2\pi/m$, whereas each of the middle intervals have length exactly $2\pi/m$. Furthermore, each of the integrals whose intervals have length exactly $2\pi/m$ are of the form of (1), and therefore we may use the expression in (4) to bound their value. The integrals over the first and last intervals may be bounded by a direct application of the M-L inequality, and our final bound on $I_1$ becomes
\[ \begin{gathered} 2\cdot\frac{2\pi}{m}\cdot\frac{1}{4\sin(1/2)^2} + \sum_{k=\lceil2\pi/m\rceil}^{\lfloor m/2\rfloor-1}\frac{\pi^2}{m^2\sin(1/2)^4} \\ \leq \frac{\pi}{m\sin(1/2)^2} + \frac{\pi^2}{2m\sin(1/2)^4} . \end{gathered} \]
This goes to zero as $m$ goes to infinity, so we have that $\lim_{m\to\infty}I_1=0$.
The second integral $I_2:=-\int_1^\pi{\sin((m+1)x)}/({4\sin(x/2)^2})\d x$
Since $\lim_{m\to\infty}f(m+1)=\lim_{m\to\infty}f(m)$ and $I_2$ is simply $-I_1$ with $m$ replaced by $m+1$, we have that
\[ \lim_{m\to\infty}I_2 = -\lim_{m\to\infty}I_1 = 0 . \]
Putting it all together
Continuing from the expression found for $\sum_{n=1}^\infty\cos n/n$ back in the first section, we find that
\[ \sum_{n=1}^\infty\frac{\cos n}{n} = -\ln2 + \lim_{m\to\infty}(I_1+I_2+I_3) = -\ln2-\ln(\sin(1/2)) . \]
This value is approximately $0.042$, and as a nice “double-check” of the above work one finds that this indeed corresponds with the value one gets by adding up many terms of $\sum_{n=1}^\infty\cos n/n$.
Acknowledgements
The argumentation was brought to my attention in an answer to a Dr. Math question, though the above presentation is mine.