Evaluating $\int_{-\infty}^{\infty}\text{sech}^2(x)\cos(x)\,dx$

improper-integrals

I'm studying a paper where an integral of similar form to this one appears:

$$\int_{-\infty}^{\infty}\text{sech}^2(x)\cos(x)\,dx$$

The authors only show the result, which involves a hyperbolic cosecant function with a $\pi$ in its argument. So, I assume that they considered a closed path and used the residuals theorem. I know that the poles of the integrand function are $z=i\left(\frac{\pi}{2}+k\pi\right),\,k\in\mathbb{Z}$. I tried to solve the integral by myself, but I don't know which path to choose. Do you have any hints to solve it?

Best Answer

Hint:

Use $\operatorname{Re} e^{ix} =\cos x$. Then choose a contour that encircles the upper half-plane.

By using the residue theorem, we get the result $$I= \int_{-\infty}^{\infty} \frac{\cos x}{\cosh^2 x}\,dx = \operatorname{Re} \sum_{k=0}^\infty 2\pi i\,\operatorname{Res}_{x=i\pi (k+1/2)} \left(\frac{e^{ix}}{\cosh^2 x}\right).$$ We can calculate the residues as (the poles are of second order and $\cosh^{-2}(x) \approx -(x-x_0)^{-2}$ close to the pole at $x_0$.) $$\operatorname{Res}_{x=i\pi (k+1/2)} \left(\frac{e^{ix}}{\cosh^2 x}\right) = - \frac{d}{dx} e^{ix} \Big|_{x=i\pi (k+1/2)} = -i e^{-\pi(k+1/2)}\,.$$ The integral then assumes the form $$ I= 2\pi \sum_{k=0}^\infty e^{-\pi(k+1/2)} = \frac{2\pi e^{-\pi/2} }{1-e^{-\pi}} = \frac{\pi}{\sinh(\pi/2)}\,.$$