TITLE: How to prove $\int_{0}^{\infty} \frac{(1-x^2) \, \text{sech}^2\left(\frac{\pi x}{2} \right)}{(1+x^2)^2}\, dx = \frac{\zeta(3)}{\pi}$?
QUESTION [15 upvotes]: I was recently searching for interesting looking integrals. In my search, I came upon the following result:

$$ \int_{0}^{\infty} \frac{(1-x^2) \, \text{sech}^2\left(\frac{\pi x}{2} \right)}{(1+x^2)^2}\, dx = \frac{\zeta(3)}{\pi}$$

and I wanted to try and prove it.

Inspired by this answer by Jack D'Aurizio, I took the Weierstrass product for $\cosh(x)$ to obtain
$$
\cosh\left(\frac{\pi x}{2} \right) = \prod_{n \ge 1}\left(1 + \frac{x^2}{(2n-1)^2} \right)
$$
And by logarithmically differentiating twice we get
$$
\frac{\pi^2}{4}\text{sech}^2\left(\frac{\pi x}{2} \right)  = \sum_{n \ge 1} \frac{4(2n-1)^2}{\left(x^2 + (2n-1)^2\right)^2} - \frac{2}{x^2 + (2n-1)^2}
$$
Which means we get
\begin{align*}
\int_{0}^{\infty} \frac{(1-x^2) \, \text{sech}^2\left(\frac{\pi x}{2} \right)}{(1+x^2)^2}\, dx & =\frac{4}{\pi^2}\sum_{n\ge 1} \int_{0}^{\infty}  \frac{(1-x^2)}{(1+x^2)^2}\left( \frac{4(2n-1)^2}{\left(x^2 + (2n-1)^2\right)^2} - \frac{2}{x^2 + (2n-1)^2}\right)\, dx
\end{align*}
However, after this, I couldn't figure out how to evaluate the resulting integral.
Does anyone know how I could continue this method? Or alternatively, does anyone know another way in which the result can be proven? Thank you very much!!
Edit:
Per jimjim's request, I'll add that I found this integral on the Wikipedia article for $\zeta(3)$. I believe the reference is to this text where the following formula is given
$$
(s-1) \zeta(s) = 2\pi \int_{\mathbb{R}}\frac{\left(\frac{1}{2} + xi \right)^{1-s}}{\left(e^{\pi x} +e^{-\pi x} \right)^2}\, dx
$$
which for the case of $s=3$ reduces to the surprisingly concise
$$
\int_{\mathbb{R}}\frac{\text{sech}^2(\pi x)}{(1+2xi)^2} \, dx = \frac{\zeta(3)}{\pi}
$$
And I presume that one can modify the previous equation to get to the original integral from the question, but it is not apparent to me how this may be done.
Edit 2:
Random Variable has kindly posted in the comments how to go from $\int_{\mathbb{R}}\frac{\text{sech}^2(\pi x)}{(1+2xi)^2} \, dx$ to $ \int_{0}^{\infty} \frac{(1-x^2) \, \text{sech}^2\left(\frac{\pi x}{2} \right)}{(1+x^2)^2}\, dx$. Thank you very much!

REPLY [3 votes]: $\color{brown}{\textbf{Partial fractions representation for the hyperbolic cosine.}}$
From the known partial fractions representation
$$\csc^2z=\sum_{k=-\infty}^\infty \dfrac1{(z-k\pi)^2}\tag1$$
should
$$\operatorname{sec}^2\dfrac\pi2z=\csc^2\left(\dfrac\pi2(1-z\right)
=\dfrac4{\pi^2}\sum_{k=-\infty}^\infty \dfrac1{\left(z+2k-1\right)^2}$$
$$=\dfrac4{\pi^2}\left(\sum_{k=-\infty}^0 \dfrac1{\left(z+2k-1\right)^2}
+\sum_{k=1}^\infty \dfrac1{\left(z+2k-1\right)^2}\right)$$
$$=\dfrac4{\pi^2}\sum_{k=0}^\infty\left(\dfrac1{\left(2k+1+z\right)^2}
+\dfrac1{\left(2k+1-z\right)^2}\right),$$
$$\sec^2\dfrac\pi2z=\dfrac8{\pi^2}\sum_{k=0}^\infty\dfrac{(2k+1)^2+z^2}{\left((2k+1)^2 -z^2\right)^2},$$
$$\operatorname{sech^2}\dfrac\pi2z=\sec^2\left(\dfrac\pi2iz\right)
=\dfrac8{\pi^2}\sum_{k=0}^\infty\dfrac{(2k+1)^2-z^2}{\left((2k+1)^2 +z^2\right)^2}.\tag2$$
$\color{brown}{\textbf{Splitting of the given integral.}}$
Applying $(2),$ easily to get
$$I=\int\limits_0^\infty \dfrac{1-x^2}{(1+x^2)^2}\operatorname{sech}^2\left(\dfrac\pi2\,x\right)\,\text dx
=\dfrac8{\pi^2}\sum_{k=0}^\infty I_k,\tag3$$
where
$$I_k=\int\limits_0^\infty \dfrac{1-x^2}{(1+x^2)^2}\dfrac{(2k+1)^2-x^2}{((2k+1)^2+x^2)^2}\,\text dx.\tag4$$
$\color{brown}{\mathbf{Case\ k=0.}}$
Taking in account that
$$2\dfrac{x^2-a^2}{(x^2+a^2)^2} = \dfrac1{(x+ia)^2}+\dfrac1{(x-ia)^2},$$
$$\int_0^\infty\dfrac{\text dx}{(a^2+x^2)^2}=\pi i\underset{ai}{\operatorname{Res}}\dfrac1{(a^2+z^2)^2}
=\pi i\lim\limits_{z\to ai}\left(\dfrac1{(z+ai)^2}\right)'$$
$$=-2\pi i\lim\limits_{z\to ai}\dfrac1{(z+ai)^3}=\dfrac\pi{4a^3},$$
$$J(a)=\int_0^\infty\dfrac{\text dx}{(a^2+x^2)^2} =\dfrac\pi{4a^3},\tag5$$
easily to get
$$I_0=\int\limits_0^\infty\dfrac{(1-x^2)^2}{(1+x^2)^4}\,\text dx
=\dfrac14\int\limits_0^\infty\left(\dfrac1{(x+i)^4}+\dfrac2{(1+x^2)^2} +\dfrac1{(x-i)^4}\right)\,\text dx$$
$$=-\dfrac1{12}\left(\dfrac1{(x+i)^3}+\dfrac1{(x-i)^3}\right)\bigg|_0^\infty+\dfrac\pi8,$$
$$I_0 = \dfrac\pi8.\tag6$$

$\color{brown}{\mathbf{Case\ k>0.}}$
Function under the integral $(4)$ can be decomposed to the partial fractions in the form of
$$\dfrac{1-x^2}{(1+x^2)^2}\dfrac{(2k+1)^2-x^2}{((2k+1)^2+x^2)^2}
=\dfrac{k^2+(k+1)^2}{4(k^2+k)^2} \left(\dfrac1{(1+x^2)^2}+\dfrac{(2k+1)^2}{((2k+1)^2+x^2)^2}\right)$$
$$-\dfrac{k^4+(k+1)^4}{8(k^2+k)^3}\left(\dfrac1{1+x^2}-\dfrac1{(2k+1)^2+x^2}\right)$$
(see also Wolfram Alpha test).
Taking in account $(5)$,
$$I_k=\dfrac{k^2+(k+1)^2}{4(k^2+k)^2}\dfrac\pi4\left(1+\dfrac1{2k+1}\right)-\dfrac{k^4+(k+1)^4}{8(k^2+k)^3}\dfrac\pi2\left(1-\dfrac1{2k+1}\right)$$
$$=\dfrac{k^2+(k+1)^2}{(k^2+k)^2}\dfrac{2k+2}{2k+1}\dfrac\pi{16}
-\dfrac{k^4+(k+1)^4}{(k^2+k)^3}\dfrac{2k}{2k+1}\dfrac\pi{16},$$
$$I_k=\dfrac\pi{8(k+1)^3}\tag7$$
(see also Wolfram Alpha calculation).

$\color{brown}{\textbf{Summation.}}$
From $(3),(6),(7)$ should
$$I=\dfrac1\pi\sum\limits_{k=0}^\infty \dfrac1{(k+1)^3}
\color{green}{\mathbf{=\dfrac{\zeta(3)}\pi.}}$$