<s>[INST] 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}$? 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!
 [/INST] Following K.defaoite's suggestion, I've managed to get a partial solution using the Residue Theorem. Rewriting the integrand with the Weierstrass product for $\cosh$ squared in the denominator we get
$$
f(x) =\frac{(1-x^2) \, \text{sech}^2\left(\frac{\pi x}{2} \right)}{(1+x^2)^2} = \frac{(1-x^2) }{(x+i)^4(x-i)^4 \prod_{n\ge2}\left(\frac{1}{(2n-1)^4}\left(x+i(2n-1)\right)^2\left(x-i(2n-1)\right)^2 \right)}
$$
from where we see that we have poles of order $2$ at $z = \pm i(2n-1), \ k \ge 2$ and we have poles of order $4$ at $z = \pm i$.

To calculate the residues we'll use that
$$
\lim_{z \to (2n-1)i} \frac{(z -(2n-1)i)^2}{\cosh^2\left(\frac{\pi z}{2}\right)} \overset{\text{L.H.}}{=}\frac{4}{\pi}\lim_{z \to (2n-1)i} \frac{z -(2n-1)i}{\sinh\left(\pi z\right)}\overset{\text{L.H.}}{=}\frac{4}{\pi^2}\lim_{z \to (2n-1)i} \frac{1}{\cosh\left(\pi z\right)} =-\frac{4}{\pi^2}\tag{1}
$$
as $\cosh(iz) = \cos(z)$ and $\cos(-\pi) = -1$. And also
\begin{align*}
\lim_{z \to (2n-1)i} \frac{d}{dz} \left(\frac{z-(2n-1)i}{\cosh\left( \frac{z \pi}{2}\right)}\right)&\overset{u = z/i}{=}\frac{i}{i}\lim_{u \to 2n-1} \frac{d}{du} \left( \frac{u-(2n-1)}{\cos\left( \frac{u \pi}{2}\right)}\right)\\
& = \lim_{u \to 2n-1}\frac{\cos\left( \frac{u \pi}{2}\right) +\frac{\pi}{2}u\sin\left( \frac{u \pi}{2}\right) - \frac{\pi}{2}(2n-1)\sin\left( \frac{u \pi}{2}\right)}{\cos^2\left( \frac{u \pi}{2}\right)}\\
& \overset{\text{L.H.}}{=}\lim_{u \to 2n-1}\frac{\frac{\pi^2}{4}(u-(2n-1))\cos\left( \frac{u \pi}{2}\right)}{-\pi \sin\left( \frac{u \pi}{2}\right)\cos\left( \frac{u \pi}{2}\right)}\\
& = 0\tag{2}
\end{align*}
So we get
\begin{align*}
\text{Res}\left(f, i(2n-1)\right) & =\lim_{z \to (2n-1)i}\frac{d}{dz}\left(\frac{1-z^2}{(1+z^2)^2}\cdot \frac{(z - (2n-1)i)^2}{\cosh^2\left(\frac{\pi z}{2} \right)}\right)\\
& = \lim_{z \to (2n-1)i}\frac{2z(z^2-3)}{(1+z^2)^3}\cdot\underbrace{ \lim_{z \to (2n-1)i} \frac{(z - (2n-1)i)^2}{\cosh^2\left(\frac{\pi z}{2} \right)}}_{-\frac{4}{\pi^2}} \\
&\qquad + \lim_{z \to (2n-1)i}\left(\frac{1-z^2}{(1+z^2)^2}\right)\cdot 2 \lim_{z \to (2n-1)i} \left(\frac{z-(2n-1)i}{\cosh\left( \frac{z \pi}{2}\right)}\right)\underbrace{\lim_{z \to (2n-1)i} \frac{d}{dz} \left(\frac{z-(2n-1)i}{\cosh\left( \frac{z \pi}{2}\right)}\right) }_{0}\\
& = -\frac{4}{\pi^2}\frac{2((2n-1)i)(((2n-1)i)^2-3)}{(1+((2n-1)i)^2)^3}\\
& =-\frac{i}{2\pi^2}\left(\frac{1}{n^3} + \frac{1}{(n-1)^3} \right)
\end{align*}
By a similar (yet longer) procedure we can also get that
$$
\text{Res}\left(f, i\right) = -\frac{i}{2\pi^2}
$$
as can be verified here.

So we get that the residues are:
\begin{align*}
\text{Res}\left(f, i(2n-1)\right) &= -\frac{i}{2\pi^2}\left(\frac{1}{n^3} + \frac{1}{(n-1)^3} \right), \qquad n \ge 2\\
\text{Res}\left(f, i\right) &= -\frac{i}{2\pi^2}
\end{align*}
Now we take a semicircular contour with diameter from $-a$ to $a$, where the semicircle is on the upper part of the complex plane over which to integrate. As we tend to an infinite radius said contour will engulf the singularities $z =  i(2n-1), \ k \ge 1$, which means that
\begin{align}
\lim_{a \to \infty}\oint_{C}\frac{(1-z^2) \, \text{sech}^2\left(\frac{\pi z}{2} \right)}{(1+z^2)^2} \, dz & = 2 \pi i \left(-\frac{i}{2\pi^2}+\sum_{n=2}^{\infty} -\frac{i}{2\pi^2}\left(\frac{1}{n^3} + \frac{1}{(n-1)^3} \right)\right)\\
& =\frac{2}{\pi}  \zeta(3)\\
\end{align}
But remembering that
$$\lim_{a \to \infty}\oint_{C} f = \int_{\mathbb{R}} f + \lim_{a \to \infty}\int_{\text{Arc}} f =2\int_{0}^{\infty} f + \lim_{a \to \infty}\int_{\text{Arc}} f $$
it sufficies to show that the limit of the integral over the arc goes to $0$ to finish the solution, but I haven't found a way to justify this.
</s>