TITLE: How to integrate $\int_0^{\infty} \frac{e^{ax} - e^{bx}}{(1 + e^{ax})(1+ e^{bx})}dx$ where $a,b > 0$.
QUESTION [12 upvotes]: This 
$$\
\int_0^{\infty} \frac{e^{ax} - e^{bx}}{(1 + e^{ax})(1+ e^{bx})}dx \text{ where } a,b > 0.
$$
is a problem that showed up on a GRE practice test. I believe you're supposed to use complex contour integration, but I'm not sure which contour to use. I think it's the keyhole contour, but I wasn't able to get anything useful.

REPLY [4 votes]: A real pedestrian approach would be as follows:
Let us define $J(c):=\int_{0}^{\infty}\frac{1}{1+e^{cx}}=\int_{0}^{\infty}\frac{e^{-cx}}{1+e^{-cx}}$, then we can apply geometric series to obtain
$$
J(c)=\int_{0}^{\infty}\frac{1}{1+e^{cx}}=\sum_{n=0}^{\infty}(-1)^n\int_{0}^{\infty}e^{-(n+1)cx}=\frac1c\sum_{n=0}^{\infty}\frac{(-1)^n}{n+1}
$$
Employing the Taylor series of $\log$ we get
$$
J(c)=\frac{\log(2)}{c}
$$
Now observe that the original integral $I(a,b)$ is given by
$$
I(a,b)=J(a)-J(b)=\log(2)\left(\frac{1}{a}-\frac{1}{b}\right)
$$
in agreement with all other answers
Contour integration is tricky here, maybe i will come up with something tomorrow