2

I was trying to empirically estimate the very slowly convergent series $\sum_{n=1}^\infty \frac{\cos(n)}{n}$ and it seems like it converges to $e^{-\pi}$ or $\pi^{-\pi}$. Does anyone know of any theoretical answer to summing this series?

Troy McClure
  • 804
  • 4
  • 12

1 Answers1

11

Using the power series for $\log(1+x)$ and $\operatorname{Re}(\log(z))=\log\left(\left|z\right|\right)$, we get $$ \begin{align} \sum_{n=1}^\infty\frac{\cos(n)}n &=\operatorname{Re}\left(\sum_{n=1}^\infty\frac{e^{in}}n\right)\\ &=\operatorname{Re}\left(-\log\left(1-e^i\right)\right)\\[6pt] &=-\log\left(\sqrt{2-2\cos(1)}\right)\\[6pt] &=-\log\left(2\sin(1/2)\right)\\[9pt] &\doteq0.0420195 \end{align} $$ whereas $e^{-\pi}\doteq0.0432139$.

As achille hui mentions in a comment, the convergence of the series is guaranteed by Abel's Test.

robjohn
  • 345,667
  • 1
    How do you justify the second equality? – Wojowu Jan 14 '16 at 15:26
  • @Wojowu: the power series for $\log(1+x)$ – robjohn Jan 14 '16 at 15:28
  • Woops, I meant the third equality. – Wojowu Jan 14 '16 at 15:29
  • +1 for you. Note that Mathematica's answer can actually be simplified to this with just a couple of steps. I'm surprised Mathematica left it in the form it gave. – MPW Jan 14 '16 at 15:31
  • Personally, I will use Abel's theorem to justify the summation of series equal to $\Re(-\log(1-e^{i}))$ for points on the circle of convergence. – achille hui Jan 14 '16 at 15:32
  • 1
    so, sum(cos(n))=1/2? note that realpart(1/(1-exp(i*x)))=1/2 for all x – Troy McClure Jan 14 '16 at 18:09
  • 1
    @TroyMcClure: $\sum\limits_{n=0}^\infty\cos(nx)$ does not converge. However, $$\begin{align} \lim_{r\to1^-}\sum_{n=0}^\infty r^n\cos(nx) &=\lim_{r\to1^-}\operatorname{Re}\left(\sum_{n=0}^\infty r^ne^{inx}\right)\ &=\lim_{r\to1^-}\operatorname{Re}\left(\frac1{1-re^{ix}}\right)\ &=\operatorname{Re}\left(\frac1{1-e^{ix}}\right)\ &=\frac12 \end{align}$$ – robjohn Jan 15 '16 at 07:54