<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] A somewhat simpler approach using contour integration is to first notice that  $$ \begin{align} \int_{-\infty}^{\infty} \frac{\operatorname{sech}^{2}\left(\frac{\pi x}{2}\right)}{\left(x+i \right)^{2}} \,  \mathrm dx  &=   \int_{-\infty}^{\infty} \frac{x^{2}-1}{(1+x^2)^{2}} \operatorname{sech}^{2} \left(\frac{\pi x}{2} \right) \, \mathrm dx - i\int_{-\infty}^{\infty} \frac{2x}{(1+x^2)^2} \operatorname{sech}^{2} \left(\frac{\pi x}{2} \right)   \, \mathrm dx  \\ &= \int_{-\infty}^{\infty} \frac{x^{2}-1}{(1+x^2)^{2}} \operatorname{sech}^{2} \left(\frac{\pi x}{2} \right) \, \mathrm dx.\end{align} $$
Integrating by parts, we get $$\int_{-\infty}^{\infty} \frac{\operatorname{sech}^{2} \left(\frac{\pi x}{2} \right)}{(x+i)^2} \, \mathrm dx = \frac{4}{\pi}\int_{-\infty}^{\infty} \frac{\tanh \left(\frac{\pi x}{2} \right)}{(x+i)^3} \, \mathrm dx.  $$
Now let's integrate the function $$ f(z) =\frac{\tanh \left(\frac{\pi z}{2} \right)}{(z+i)^3} $$ around a square contour with vertices at $ \pm N$, $\pm N + 2iN,$ where $N$ is some positive integer.
Since $\tanh \left(\frac{\pi z}{2} \right) $ is $2$- periodic in the imaginary direction and tends to $\pm 1$ as $\Re(z) \to \pm \infty$, the magnitude of $\tanh \left(\frac{\pi x}{2} \right)  $ remains bounded on the contour as $N \to \infty$ through the positive integers since the contour stays away from the poles on the imaginary axis.
We can therefore use the estimation lemma to argue that the integral vanishes on the vertical sides of the contour and the upper side of the contour as $N \to \infty$.
Inside the contour there are simple poles at $z= i(2n+1), n \in \mathbb{N}_{\ge 0}$.
Therefore, we have $$\begin{align} \int_{-\infty}^{\infty} \frac{\tanh \left(\frac{\pi x}{2} \right)}{(x+i)^3} \, \mathrm dx &= 2 \pi i \sum_{n=0}^{\infty}\operatorname{Res} [f(z), i(2n+1)] \\ &= 2 \pi i \sum_{n=0}^{\infty} \lim_{z \to i(2n+1)} \frac{\sinh \left(\frac{\pi z}{2} \right)}{\frac{\mathrm d}{\mathrm dz}\left((z+i)^3 \cosh \left(\frac{\pi z}{2} \right)\right)} \\ &= -2 \pi i \sum_{n=0}^{\infty} \frac{1}{4 \pi i (n+1)^3}  \\ &= -\frac{\zeta(3)}{2}, \end{align}$$
from which it follows that  $$\begin{align} \int_{0}^{\infty} \frac{1-x^2}{(1+x^2)^{2}} \operatorname{sech}^{2} \left(\frac{\pi x}{2} \right) \, \mathrm dx &= -\frac{1}{2} \int_{-\infty}^{\infty} \frac{x^2-1}{(1+x^2)^{2}} \operatorname{sech}^{2} \left(\frac{\pi x}{2} \right) \, \mathrm dx \\ &= -\frac{2}{\pi} \int_{-\infty}^{\infty} \frac{\tanh \left(\frac{\pi x}{2} \right)}{(x+i)^3} \, \mathrm dx \\ &=- \frac{2}{\pi} \left(-\frac{\zeta(3)}{2}  \right) \\ &= \frac{\zeta(3)}{\pi}. \end{align}$$
</s>