# Contour integration for a rational function of cos and cosh

$$\int^{\infty}_{-\infty} \frac{\cos(ax)}{\cosh(x)} \,dx = \pi \, \mathrm{sech} \left( \frac{\pi a}{2}\right)$$

$$\textit{proof}$$

Consider
$$f(z) = \frac{e^{iaz}}{\sinh(z)}$$

If we integrate around a contour of height $\pi$ and stretch it to infinity we get

By taking $T \to \infty$

$$\color{red}{\int^{i\pi/2+\infty}_{-i\pi/2+\infty}f(x)\,dx}+\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}f(x)\,dx}+\\\color{red}{\int^{-i\pi/2-\infty}_{i\pi/2-\infty}f(x)\,dx}+ \color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}f(x)\,dx} = 2\pi i \mathrm{Res}(f,0)$$

Consider

$$\color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}\frac{e^{iax}}{\sinh(x)}\,dx}$$

Let $x = -\pi i/2+y$

$$i e^{\frac{\pi a}{2}}\int^{\infty}_{-\infty}\frac{e^{iay}}{ \cosh(y)}\,dy$$

Similarly we have for

$$\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}\frac{e^{iax}}{\sinh(x)}\,dx}$$

By letting $x =\pi i/2+ y$

$$i e^{-\frac{\pi a}{2}}\int^{\infty}_{-\infty}\frac{e^{iay}}{ \cosh(y)}\,dy$$

The other integrals go to 0 hence

$$i \left(e^{\frac{\pi a}{2}}+e^{- \frac{\pi a}{2}} \right)\int^{\infty}_{-\infty}\frac{e^{iay}}{ \cosh(y)}\,dy =2\pi i \mathrm{Res}(f,0)$$

Calculating the residue we have

$$\mathrm{Res}(f,0) = \lim_{z \to 0} z\frac{e^{iaz}}{\sinh(z)} = \lim_{z \to 0}\frac{e^{iaz}}{\cosh(z)} = 1$$

Using that we get

$$\int^{\infty}_{-\infty}\frac{e^{iay}}{ \cosh(y)}\,dy =\frac{2\pi}{e^{\frac{\pi a}{2}}+e^{- \frac{\pi a}{2}}}$$

By taking the real part

$$\boxed{\int^{\infty}_{-\infty}\frac{\cos(ay)}{ \cosh(y)}\,dy =\pi \, \mathrm{sech}\left( \frac{\pi}{2} a\right)}$$

This entry was posted in Contour Integration and tagged , , , , , , . Bookmark the permalink.