A closed form for the infinite series $\sum_{n=1}^\infty (-1)^{n+1}\arctan \left( \frac 1 n \right)$

It is known that $$\sum_{n=1}^{\infty} \arctan \left(\frac{1}{n^{2}} \right) = \frac{\pi}{4}-\tan^{-1}\left(\frac{\tanh(\frac{\pi}{\sqrt{2}})}{\tan(\frac{\pi}{\sqrt{2}})}\right). $$

Can we also find a closed form for the value of $$\sum_{n=1}^{\infty} (-1)^{n+1} \arctan \left(\frac{1}{n} \right)? $$

Unlike the other infinite series, this infinite series only converges conditionally.


Solution 1:

I have found a closed form expression for the series but it is sort of ugly, it involves gamma functions evaluated at complex arguments.

Regrouping the series into units of two, we have

$$\sum_{n=1}^\infty (-1)^{n-1}\tan^{-1}\frac{1}{n} = \sum_{k=1}^\infty a_k \quad\text{ where }\quad a_k = \tan^{-1}\frac{1}{2k-1} - \tan^{-1}\frac{1}{2k}.$$ Notice $\tan^{-1}(x) = \Im\log(1+i x)$ for real $x$, we can rewrite $a_k$ as

$$a_k = \Im\left\{\log\frac{1+\frac{i}{2k-1}}{1+\frac{i}{2k}}\right\} = \Im\left\{\log\frac{1+\frac{-1+i}{2k}}{1+\frac{i}{2k}}\right\} = \Im\left\{\log\frac{\left(1+\frac{-1+i}{2k}\right)e^{-\frac{-1+i}{2k}}}{\left(1+\frac{i}{2k}\right)e^{-\frac{i}{2k}}}\right\} $$ This implies up to some integer multiples of $2\pi$, we have

$$ \sum_{k=1}^\infty a_k = \Im\left\{ \log\frac{ e^{\gamma\frac{-1+i}{2}} \prod_{k=1}^\infty \left(1+\frac{-1+i}{2k}\right)e^{-\frac{-1+i}{2k}} }{ e^{\gamma\frac{i}{2}}\prod_{k=1}^\infty \left(1+\frac{i}{2k}\right)e^{-\frac{i}{2k}} } \right\} + 2N\pi $$ Using the infinite product expansion of Gamma function $$\frac{1}{\Gamma(z)} = z e^{\gamma z}\prod_{k=1}^\infty \left(1 + \frac{z}{k}\right) e^{-\frac{z}{k}} $$ and notice the $a_k$ are so small which forces $\displaystyle \left|\sum_{k=1}^\infty a_k\right| < 1$, we find the corresponding $N = 0$ and arrived at following closed form expression of the series.

$$\sum_{n=1}^\infty (-1)^{n-1}\tan^{-1}\frac{1}{n} = \Im\left\{\log\Gamma\left(1+\frac{i}{2}\right) - \log\Gamma\left(\frac12+\frac{i}{2}\right) \right\}\\ \approx 0.506670903216622981985255804783581512472843547347020582920002... $$

Solution 2:

In the same spirit as this answer, note that $$ \log\left(\frac{n+i}n\right)=\frac12\log\left(1+\frac1{n^2}\right)+i\arctan\left(\frac1n\right) $$ Furthermore, using Gautschi's Inequality $$ \begin{align} \prod_{k=1}^{n-1}\frac{k+x}{k} &=\frac{\Gamma(n+x)}{\Gamma(1+x)\Gamma(n)}\\ &\sim\frac{n^x}{\Gamma(1+x)} \end{align} $$ Therefore, we get $$ \begin{align} \sum_{k=1}^{2n}(-1)^{k-1}\arctan\left(\frac1k\right) &=\mathrm{Im}\left(\log\left(\frac{1+i}{1}\frac{2}{2+i}\frac{3+i}{3}\frac{4}{4+i}\cdots\frac{2n}{2n+i}\right)\right)\\ &=\mathrm{Im}\left(\log\left(\frac{1+i}{1}\frac{2+i}{2}\frac{3+i}{3}\frac{4+i}{4}\cdots\frac{2n+i}{2n}\right)\right)\\ &-2\,\mathrm{Im}\left(\log\left(\frac{2+i}{2}\frac{4+i}{4}\cdots\frac{2n+i}{2n}\right)\right)\\ &=\mathrm{Im}\left(\log\left(\frac{1+i}{1}\frac{2+i}{2}\frac{3+i}{3}\frac{4+i}{4}\cdots\frac{2n+i}{2n}\right)\right)\\ &-2\,\mathrm{Im}\left(\log\left(\frac{1+\frac i2}{1}\frac{2+\frac i2}{2}\cdots\frac{n+\frac i2}{n}\right)\right)\\ &\sim\mathrm{Im}\left(\log\left(\frac{(2n)^i}{\Gamma(1+i)}\right)-2\log\left(\frac{n^{i/2}}{\Gamma(1+\frac i2)}\right)\right)\\ &=\log(2)+\mathrm{Im}\left(\log\left(\frac{\Gamma(1+\frac i2)^2}{\Gamma(1+i)}\right)\right) \end{align} $$ Therefore, $$ \begin{align} \sum_{k=1}^{2n}(-1)^{k-1}\arctan\left(\frac1k\right) &=\log(2)+\mathrm{Im}\left(\log\left(\frac{\Gamma(1+\frac i2)^2}{\Gamma(1+i)}\right)\right)\\[6pt] &=\log(2)-\mathrm{Im}\left(\log\binom{i}{i/2}\right)\\[9pt] &=\log(2)-\arg\binom{i}{i/2}\\[12pt] &\doteq0.506670903216622981985255804784 \end{align} $$