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.

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.
