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

#### Solutions Collecting From Web of "A closed form for the infinite series $\sum_{n=1}^\infty (-1)^{n+1}\arctan \left( \frac 1 n \right)$"

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

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}

Let $\displaystyle S(a) = \sum_{n=1}^{\infty}(-1)^{n-1} \arctan \left(\frac{a}{n} \right)$.

Since $\displaystyle \sum_{n=1}^{\infty} (-1)^{n-1} \frac{n}{n^{2}+a^{2}}$ converges uniformly on $\mathbb{R}$,

\begin{align} S'(a) &= \sum_{k=1}^{\infty} (-1)^{n-1} \frac{n}{a^{2}+n^{2}} \\ &= \frac{1}{2} \sum_{n=1}^{\infty} (-1)^{n-1} \left(\frac{1}{n-ia} + \frac{1}{n+ia} \right) \\ &= \frac{1}{2} \sum_{n=0}^{\infty} (-1)^{n} \left(\frac{1}{n+1-ia}+ \frac{1}{n+1+ia} \right). \end{align}

Then using the fact $$\sum_{k=0}^{\infty} \frac{(-1)^{k}}{z+k} = \frac{1}{2} \Big[\psi\left( \frac{z+1}{2}\right) – \psi \left(\frac{z}{2} \right) \Big]$$ (where $\psi(z)$ is the digamma function), we have

$$S'(a) = \frac{1}{4} \left[\psi \left(1- \frac{ia}{2} \right) – \psi\left(\frac{1}{2}- \frac{ia}{2} \right) + \psi\left(1+ \frac{ia}{2} \right) -\psi\left(\frac{1}{2}- \frac{ia}{2} \right)\right].$$

Integrating back we find

$$S(a) = \frac{i}{2} \left[\log \Gamma \left(1-\frac{ia}{2} \right) – \log \Gamma \left(\frac{1}{2}-\frac{ia}{2} \right) – \log \Gamma \left(1+\frac{ia}{2} \right) + \log \Gamma \left(\frac{1}{2}+\frac{ia}{2} \right)\right] + C.$$

But since $S(0) = 0$, the constant of integration is $0$.

Therefore,

\begin{align} S(1) &= \sum_{n=1}^{\infty}(-1)^{n-1} \arctan \left(\frac{1}{n} \right) \\ &= \frac{i}{2} \left[\log \Gamma \left(1-\frac{i}{2} \right) – \log \Gamma \left(\frac{1}{2}-\frac{i}{2} \right) – \log \Gamma \left(1+\frac{i}{2} \right) + \log \Gamma \left(\frac{1}{2}+\frac{i}{2} \right)\right] \\ &\approx 0.5066709032. \end{align}

The answer can be put in the same form as the answer given by achille hui by using the Schwarz reflection principle.

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{\sum_{n = 1}^{\infty}\pars{-1}^{n + 1}\arctan\pars{1 \over n}:\ {\large ?}}$

$\ds{\Gamma\pars{z}}$ and $\ds{\Psi\pars{z}}$ are the Gamma and Digamma Functions, respectively. We’ll use well known properties of them.

\begin{align}
&\color{#00f}{\large\sum_{n = 1}^{\infty}\pars{-1}^{n + 1}\arctan\pars{1 \over n}}
=\sum_{n = 1}^{\infty}\pars{-1}^{n + 1}\int_{0}^{1}{n\,\dd x \over x^{2} + n^{2}}
\\[3mm]&=\int_{0}^{1}\bracks{\sum_{n = 1}^{\infty}
\pars{-1}^{n + 1}\,{n \over n^{2} + x^{2}}}\,\dd x
=\Re\int_{0}^{1}\bracks{\sum_{n = 1}^{\infty}{\pars{-1}^{n + 1} \over n + x\ic}}
\,\dd x
\\[3mm]&=\Re\int_{0}^{1}\bracks{\sum_{n = 0}^{\infty}\pars{%
{1 \over 2n + 1 + x\ic} – {1 \over 2n + 2 + x\ic}}}\,\dd x
\\[3mm]&={1 \over 4}\Re\int_{0}^{1}\bracks{\sum_{n = 0}^{\infty}
{1 \over \pars{n + 1/2 + x\ic/2}\pars{n + 1 + x\ic/2}}}\,\dd x
\\[3mm]&={1 \over 4}\Re\int_{0}^{1}
2\bracks{\Psi\pars{1 + {x \over 2}\,\ic} – \Psi\pars{\half + {x \over 2}\,\ic}}
\,\dd x
\\[3mm]&=\half\Re\bracks{%
-2\ic\ln\pars{\Gamma\pars{1 + {x \over 2}\,\ic}}
+ 2\ic\ln\pars{\Gamma\pars{\half + {x \over 2}\,\ic}}}_{0}^{1}
\\[3mm]&=\Im\bracks{\ln\pars{\Gamma\pars{1 + \half\,\ic}}
-\ln\pars{\Gamma\pars{\half + \half\,\ic}}}
\\[3mm]&=\color{#00f}{\large%
\Im\ln\pars{\Gamma\pars{1 + \ic/2} \over \Gamma\pars{1/2 + \ic/2}}}
\approx 0.5067
\end{align}

This is just a possible way to proceed, and doesn’t provide in any way a complete solution to the problem, thus I will put it as community wiki, and pray you to contribute if you have any insights.

The series converges (check!), inserting the Taylor series for $\arctan(x)$:
$$\begin{array}{ll}\sum_{n=1}^\infty(-1)^{n+1}\arctan\left(\frac{1}{n}\right)&=\sum_{n=1}^\infty(-1)^{n+1}\sum_{k=0}^\infty\frac{(-1)^k}{2k+1}\frac{1}{n^{2k+1}}\\&=\sum_{k=0}^\infty\frac{(-1)^k}{2k+1}\sum_{n=1}^\infty(-1)^{n+1}\frac{1}{n^{2k+1}}\\&=\sum_{k=0}^\infty\frac{(-1)^k(1-2^{-2k})}{2k+1}\zeta(2k+1)\end{array}$$
where in the second equality we have used the fact that everything converges, and in the third we noticed that the second series in the second line is the Dirichlet eta function.

I don’t know if this leads anywhere, but since the zeta function has been studied pretty heavily maybe there’s some results somewhere that we can use to finish from here.

This is not an answer, but a useful way to transform the expression and link it to another, more simple sum:

$$\sum_{n=1}^{\infty} (-1)^{n+1} \arctan \frac{1}{n}=\frac{\pi}{4}-\sum_{n=1}^{\infty} \left( \arctan \frac{1}{2n}-\arctan \frac{1}{2n+1}\right)$$

$$\arctan \frac{1}{2n}-\arctan \frac{1}{2n+1}=\arctan \frac{1}{4n^2+2n+1}$$

$$\sum_{n=1}^{\infty} (-1)^{n+1} \arctan \frac{1}{n}=\frac{\pi}{4}-\sum_{n=1}^{\infty} \arctan \frac{1}{4n^2+2n+1}$$

From this question (ananswered by the way) we have an identity:

$$\sum_{n=0}^{N} \arctan \frac{1}{n^2+n+1}=\arctan(N+1)$$

Which means

$$\sum_{n=1}^{\infty} \arctan \frac{1}{n^2+n+1}=\frac{\pi}{2}-\frac{\pi}{4}=\frac{\pi}{4}$$

Considering:

$$(2n-1)^2+2n-1+1=4n^2-2n+1$$

We get another identity (separating even and odd terms):

$$\sum_{n=1}^{\infty} \arctan \frac{1}{n^2+n+1}=\sum_{n=1}^{\infty} \arctan \frac{1}{4n^2+2n+1}+\sum_{n=1}^{\infty} \arctan \frac{1}{4n^2-2n+1}$$

And now we have:

$$\sum_{n=1}^{\infty} (-1)^{n+1} \arctan \frac{1}{n}=\sum_{n=1}^{\infty} \arctan \frac{1}{4n^2-2n+1}$$

The convergence of these two sums is slightly better than the original

If we take geometric mean of the last two expressions, it gives excellent convergence.