Integrate using residue theorem This was a question on my complex analysis take home final. Since the semester is over and grades have been posted I believe I can post it now. 
Let $a > 0$ and $b > 0$. Verify that
$$\int_{-\infty}^{\infty} \frac{dx}{e^{a x}+e^{-b x}} = \frac{\pi}{(a+b) \sin{\left (\frac{a \pi}{a+b} \right )}} $$
(Using Residue Theorem)
I believe we have to choose a rectangular contour which contains exactly one of the
singularities.
 A: Rewrite the integrand as
$$\frac{e^{\left (\frac{b-a}{2} x \right )}}{2 \cosh{\left (\frac{a+b}{2} x \right )}} $$
Thus consider the contour integral
$$\oint_C dz \frac{e^{\left (\frac{b-a}{2} z \right )}}{2 \cosh{\left (\frac{a+b}{2} z \right )}} $$
where $C$ is the rectangle with vertices $\pm R \pm i 2 \pi/(a+b)$.  The contour integral is then
$$\int_{-R}^R dx \frac{e^{\left (\frac{b-a}{2} x \right )}}{2 \cosh{\left (\frac{a+b}{2} x \right )}} + i \int_0^{2 \pi/(a+b)}dy \frac{e^{\left (\frac{b-a}{2} (R+i y) \right )}}{2 \cosh{\left (\frac{a+b}{2} (R+i y) \right )}} \\ + \int_{R}^{-R} dx \frac{e^{\left (\frac{b-a}{2} (x+i 2 \pi/(a+b)) \right )}}{2 \cosh{\left (\frac{a+b}{2} (x+i 2 \pi/(a+b) \right )}} + i \int_{2 \pi/(a+b)}^0 dy \frac{e^{\left (\frac{b-a}{2} (-R+i y) \right )}}{2 \cosh{\left (\frac{a+b}{2} (-R+i y) \right )}}$$
It should be clear that the second and fourth integrals vanish as $R \to \infty$, as both $a$ and $b$ are positive.  
The contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=i \pi/(a+b)$.  Thus, we have
$$\left [1+e^{i \pi (b-a)/(a+b)} \right ]\int_{-\infty}^{\infty} dx \frac{e^{\left (\frac{b-a}{2} x \right )}}{2 \cosh{\left (\frac{a+b}{2} x \right )}} = i 2 \pi \frac{e^{i \pi/2 \left (\frac{b-a}{a+b} \right )}}{(a+b) i}$$
The result follows after a little algebra.
