TITLE: Improper integral of $\int_0^\infty \frac{dx}{(x^2+{\pi}^2)\cosh(x)}$
QUESTION [7 upvotes]: I want to compute the integral
  $$
\int_0^\infty \frac{dx}{(x^2+{\pi}^2)\cosh(x)}
$$

I tried to use "rectangle" contour $(0 \to R \to R+i\pi \to i\pi+\varepsilon \to i\pi - i\varepsilon \to 0)$, but this is useless because the integral on the upper side is not expressed (it didn’t work out for me) through the original integral.  
Also, representing a fraction as a sum of simple fractions (probably) does not facilitate the task.
And representing the integral as an integral on $\mathbb{R}$ does nothing, since the imaginary axis has a countable number of poles...
Please tell me what kind of substitution in the integral I need to do or which one to choose the contour???

REPLY [6 votes]: here is a simple approach, but only with real function method
$$\int_{0}^{\infty} {e^{-bt}\cos(at)\,\mathrm{d}t} = \frac{b}{a^2+b^2}$$
we write
$$\begin{aligned}
\int_{0}^{\infty} \frac{\mathrm{d}x}{(x^2+\pi^2)\cosh x} & = \frac1{\pi} \int_{0}^{\infty} \left(\int_{0}^{\infty} {e^{-\pi t}\cos(tx)\,\mathrm{d}t}\right) \frac{\mathrm{d}x}{\cosh x}\\
& = \frac1{\pi} \int_{0}^{\infty} \left(e^{-\pi t} \int_{0}^{\infty} {\frac{\cos(tx)}{\cosh x} \mathrm{d}x} \right) \mathrm{d}t\\
& = \frac1{2} \int_{0}^{\infty} e^{-\pi t} \operatorname{sech}\left(\frac{\pi t}{2}\right) \mathrm{d}t = \int_{0}^{\infty} \frac{e^{-\pi t}}{e^{\pi t/2} + e^{-\pi t/2}} \mathrm{d}t\\
(\text{let } z=e^{-\pi t/2}) \quad
& = \frac2{\pi} \int_{0}^{1} \frac{z^2}{1+z^2} \mathrm{d}z = \frac2{\pi}-\frac1{2}
\end{aligned}$$
where recalling this famous integral
$$\int_{0}^{\infty} {\frac{\cos(\alpha x)}{\cosh(\beta x)}\mathrm{d}x} = \frac{\pi}{2\beta} \operatorname{sech}\left(\frac{\pi\alpha}{2\beta}\right)$$