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}{\left(\frac{ {1-\cot{\dfrac{\pi}{\sqrt{2}}} \tanh{\dfrac{\pi}{\sqrt{2}}}} }{ {1+\cot{\dfrac{\pi}{\sqrt{2}}} \tanh{\dfrac{\pi}{\sqrt{2}}}} }\right)}$$
Could someone help me understand how this comes about?