Mellin transform of sine is, for $-1<\Re(s)<1$:
$$
G_1(s) = \mathcal{M}_s(\sin(x)) = \int_0^\infty x^{s-1}\sin(x) \mathrm{d} x =\Im \int_0^\infty x^{s-1}\mathrm{e}^{i x} \mathrm{d} x = \Im \left( i^s\int_0^\infty x^{s-1}\mathrm{e}^{-x} \mathrm{d} x \right)= \Gamma(s) \sin\left(\frac{\pi s}{2}\right) = 2^{s-1} \frac{\Gamma\left(\frac{s+1}{2}\right)}{\Gamma\left(1-\frac{s}{2}\right)} \sqrt{\pi}
$$
And Mellin transfom of $(1+x^2)^{-1}$ is, for $0<\Re(s)<2$:
$$
G_2(s) = \mathcal{M}_s\left(\frac{1}{1+x^2}\right) = \int_0^\infty \frac{x^{s-1}}{1+x^2}\mathrm{d} x \stackrel{x^2=u/(1-u)}{=} \frac{1}{2} \int_0^1 u^{s/2-1} (1-u)^{-s/2} \mathrm{d}u = \frac{1}{2} \operatorname{B}\left(\frac{s}{2},1-\frac{s}{2}\right) = \frac{1}{2} \Gamma\left(\frac{s}{2}\right) \Gamma\left(1-\frac{s}{2}\right) = \frac{\pi}{2} \frac{1}{\sin\left(\pi s/2\right)}
$$
Now to the original integral, for $0<\gamma<1$:
$$
\int_0^\infty \frac{\sin(x)}{1+x^2}\mathrm{d}x = \int_{\gamma-i \infty}^{\gamma+ i\infty} \mathrm{d} s\int_0^\infty \sin(x) \left( \frac{G_2(s)}{2 \pi i} x^{-s}\right) \mathrm{d}s = \frac{1}{2 \pi i} \int_{\gamma-i \infty}^{\gamma+i \infty} G_2(s) G_1(1-s) \mathrm{d}s =\\ \frac{1}{4 i} \int_{\gamma-i \infty}^{\gamma+i \infty} \Gamma(1-s) \cot\left(\frac{\pi s}{2}\right) \mathrm{d} s = \frac{2\pi i}{4 i} \sum_{n=1}^\infty \operatorname{Res}_{s=2n} \Gamma(1-s) \cot\left(\frac{\pi s}{2}\right) = \sum_{n=1}^\infty \frac{\psi(2n)}{\Gamma(2n)} = \sum_{n=1}^\infty \frac{1+(-1)^n}{2} \frac{\psi(n)}{\Gamma(n)}
$$
Since
$$
\sum_{n=1}^\infty z^n \frac{\psi(n)}{\Gamma(n)} = \mathrm{e}^z z \left(\Gamma(0,z) + \log(z)\right)
$$
Combining:
$$
\int_0^\infty \frac{\sin(x)}{1+x^2} \mathrm{d}x = \frac{\mathrm{e}}{2} \Gamma(0,1) - \frac{1}{2 \mathrm{e}} \Gamma(0,-1) - \frac{i \pi }{2 \mathrm{e}} = \frac{1}{2e} \operatorname{Ei}(1) - \frac{\mathrm{e}}{2} \operatorname{Ei}(-1)
$$
Integrals of the form
$$\int_{-\infty}^\infty \frac{p(x)}{\cosh x}\,dx,$$
where $p$ is a polynomial can be evaluated by shifting the contour of integration to a line $\operatorname{Im} z \equiv c$. We first check that the integrals over the vertical segments connecting the two lines tend to $0$ as the real part tends to $\pm\infty$:
$$\lvert \cosh (x+iy)\rvert^2 = \lvert \cosh x\cos y + i \sinh x\sin y\rvert^2 = \sinh^2 x + \cos^2 y,$$
so the integrand decays exponentially and
$$\left\lvert \int_{R}^{R + ic} \frac{p(z)}{\cosh z}\,dz\right\rvert
\leqslant \frac{K\,c}{\sinh R}\left(R^2+c^2\right)^{\deg p/2} \xrightarrow{R\to \pm\infty} 0.$$
Since $\cosh \left(z+\pi i\right) = -\cosh z$, and the only singularity of the integrand between $\mathbb{R}$ and $\mathbb{R}+\pi i$ is a simple pole at $\frac{\pi i}{2}$ (unless $p$ has a zero there, but then we can regard it as a simple pole with residue $0$) with the residue
$$\operatorname{Res}\left(\frac{p(z)}{\cosh z};\, \frac{\pi i}{2}\right) = \frac{p\left(\frac{\pi i}{2}\right)}{\cosh' \frac{\pi i}{2}} = \frac{p\left(\frac{\pi i}{2}\right)}{\sinh \frac{\pi i}{2}} = \frac{p\left(\frac{\pi i}{2}\right)}{i},$$
the residue theorem yields
$$\begin{align}
\int_{-\infty}^\infty \frac{p(x)}{\cosh x}\,dx
&= 2\pi\, p\left(\frac{\pi i}{2}\right) + \int_{\pi i-\infty}^{\pi i+\infty} \frac{p(z)}{\cosh z}\,dz\\
&= 2\pi\, p\left(\frac{\pi i}{2}\right) - \int_{-\infty}^\infty \frac{p(x+\pi i)}{\cosh x}\,dx\\
&= 2\pi\, p\left(\frac{\pi i}{2}\right) - \sum_{k=0}^{\deg p} \frac{(\pi i)^k}{k!}\int_{-\infty}^\infty \frac{p^{(k)}(x)}{\cosh x}\,dx.\tag{1}
\end{align}$$
Since $\cosh$ is even, only even powers of $x$ contribute to the integrals, hence we can from the beginning assume that $p$ is an even polynomial, and need only consider the derivatives of even order.
For a constant polynomial, $(1)$ yields
$$\int_{-\infty}^\infty \frac{dx}{\cosh x} = 2\pi - \int_{-\infty}^\infty \frac{dx}{\cosh x}\Rightarrow \int_{-\infty}^\infty \frac{dx}{\cosh x} = \pi.$$
For $p(z) = z^2$, we obtain
$$\begin{align}
\int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx &= 2\pi \left(\frac{\pi i}{2}\right)^2 - \int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx - (\pi i)^2\int_{-\infty}^\infty \frac{dx}{\cosh x}\\
&= - \frac{\pi^3}{2} - \int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx + \pi^3,
\end{align}$$
which becomes
$$\int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx = \frac{\pi^3}{4}.$$
Best Answer
Hint:
Use $\operatorname{Re} e^{ix} =\cos x$. Then choose a contour that encircles the upper half-plane.