TITLE: Random Wolfram|Alpha identity related to $\sum_{k = 1}^{\infty}{\tan^{-1}}{\frac{1}{k^2}}$
QUESTION [6 upvotes]: I was watching a Numberphile video (on how $\tan^{-1}{1} + \tan^{-1}\frac{1}{2} + \tan^{-1}\frac{1}{3} = \frac{\pi}{2}$) and I thought about whether the series
$$\sum_{k = 1}^{\infty}{\tan^{-1}}{\frac{1}{k}}$$
converges.
Turns out, it doesn't. However, it also turns out that 
$$\sum_{k = 1}^{\infty}{\tan^{-1}}{\frac{1}{k^2}}$$
does converge, to the expression
$$\tan^{-1}{\Bigg(\frac{
{1-\cot{\frac{\pi}{\sqrt{2}}} \tanh{\frac{\pi}{\sqrt{2}}}}
}{
{1+\cot{\frac{\pi}{\sqrt{2}}} \tanh{\frac{\pi}{\sqrt{2}}}}
}\Bigg)}$$
Could someone help me understand how this comes about?

REPLY [3 votes]: Use the logarithmic form $\arctan x=\frac1{2i}\ln\frac{1+ix}{1-ix}$ to rewrite the sum as
$$S=\frac1{2i}\ln\prod_{k=1}^{\infty}\frac{1+\frac{i}{k^2}}{1-\frac{i}{k^2}}$$
and combine the result with Euler's infinite product
$$\prod_{k=1}^{\infty}\left(1+\frac{a^2}{k^2}\right)=\frac{\sinh \pi a}{\pi a}.$$
This gives
$$S=\frac{1}{2i}\ln\left(e^{-i\pi/2}\frac{\sinh \pi e^{i\pi/4}}{\sinh \pi e^{-i\pi/4}}\right)=\frac{1}{2i}\ln\left(\frac{\sinh \frac{\pi}{\sqrt 2}\cos\frac{\pi}{\sqrt 2} +i\cosh \frac{\pi}{\sqrt 2}\cos\frac{\pi}{\sqrt 2}}{\cosh \frac{\pi}{\sqrt 2}\sin\frac{\pi}{\sqrt 2} +i\sinh \frac{\pi}{\sqrt 2}\cos\frac{\pi}{\sqrt 2}}\right),$$
which can be straightforwardly reduced to the quoted result.