TITLE: Why use a rectangular contour to evaluate $\int_\mathbb{R}\frac{e^{-i\sigma x}}{e^{ax}+e^{-bx}}dx$
QUESTION [5 upvotes]: I am trying to tackle the following integral:
$$\int_\mathbb{R}\frac{e^{-i\sigma x}}{e^{ax}+e^{-bx}}dx$$
I am told that I should use a complex rectangular contour to evaluate this integral however I am unsure on how to proceed. 
Also I would like to know what characteristic of this integral hints on the type of contour that I must use and the type of complex integral I should consider.
Any help is appreciated.
EDIT: $a,b>0$ and $\sigma \in \mathbb{R}$

REPLY [3 votes]: I am going to assume $a,b>0$ and $\sigma\in\mathbb{R}$.
$$ \int_{\mathbb{R}}\frac{e^{-i\sigma x}}{e^{ax}+e^{-bx}}\,dx = \int_{\mathbb{R}}\frac{e^{(b-i\sigma)x}}{e^{(a+b)x}+1}\,dx $$
and the last integrand function has simple poles at $x=\frac{(2k+1)\pi i}{a+b}$ for any $k\in\mathbb{Z}$. If we consider a rectangle countour $R(M)$ with vertices at $-M,M,M+\frac{2\pi i}{a+b},-M+\frac{2\pi i}{a+b}$ we have that
$$ \oint_{R(M)}\frac{e^{(b-i\sigma)x}}{e^{(a+b)x}+1}\,dx = 2\pi i\,\text{Res}\left(\frac{e^{(b-i\sigma)x}}{e^{(a+b)x}+1},x=\frac{\pi i}{a+b}\right)$$
equals $-\frac{2\pi i}{a+b}\exp\left(\frac{\pi(\sigma+ib)}{a+b}\right).$ On the other hand the contribute given by the integral over the left and right sides of $R(M)$ is negligible for large values of $M$, and the integral over the upper side is just a multiple of the integral over the bottom side. It follows that:
$$ \int_{\mathbb{R}}\frac{e^{-i\sigma x}}{e^{ax}+e^{-bx}}\,dx = -\frac{2\pi i}{a+b}\,\exp\left(\frac{\pi(\sigma+ib)}{a+b}\right)\cdot\frac{1}{1-\exp\left(\frac{2\pi i(b-i\sigma)}{a+b}\right)}.$$
I leave to you to suitably simplify this expression and get:
$$\boxed{ \int_{\mathbb{R}}\frac{e^{-i\sigma x}}{e^{ax}+e^{-bx}}\,dx = \color{red}{\frac{\pi}{(a+b) \sin\frac{\pi(b-i\sigma)}{a+b}}}}$$