Show that $\int_0^\infty \frac{e^{ax}-e^{bx}}{\left(1+e^{ax}\right)\left(1+e^{bx}\right)}dx = \frac{a-b}{ab}\log 2$

I am trying to evaluate the following integral

$$\int_0^\infty \frac{e^{ax}-e^{bx}}{\left(1+e^{ax}\right)\left(1+e^{bx}\right)}dx.$$

After multiplying the numerator and denominator of the integrand by $$e^{-\frac{1}{2}(a+b)}$$ and using partial fractions decomposition, I arrived at two other the equivalent expressions:

$$\int_0^\infty \frac{\sinh\left[\frac 12(a-b)x\right]}{\cosh\left(\frac 12ax\right)\cosh\left(\frac12bx\right)}dx = \int_0^\infty \frac{\sinh\left(\frac 12ax\right)}{\cosh\left(\frac 12ax\right)} - \frac{\sinh\left(\frac 12bx\right)}{\cosh\left(\frac12bx\right)}dx.$$

The expression with the difference of hyperbolic tangents looks promising because the antiderivative of $$\tanh ax$$ is $$a^{-1}\log(\cosh ax)$$. Is this on the right track?

• Mathematica confirms (for $\{ a, b \} \in \mathbb{R}$ and $\{ a,b \}>1$): $$\log (2) \left(\frac{1}{b}-\frac{1}{a}\right)$$ Commented Aug 18, 2021 at 0:06
• Yes, now use the definition of $\cosh$ to get large $x$ (real $a\neq 0$) approximation of $\log\cosh ax\approx \frac12\lvert a\rvert x-\log 2$ (with estimate of error term). Commented Aug 18, 2021 at 0:14
• No need for approximations. Commented Aug 18, 2021 at 0:40

$$\int_0^\infty \frac{1+e^{ax}-1-e^{bx}}{(1+e^{ax})(1+e^{bx})}\;dx = \int_0^\infty \frac{1}{1+e^{bx}}-\frac{1}{1+e^{ax}}\:dx$$
$$= -\frac{1}{b}\log(1+e^{-bx})+\frac{1}{a}\log(1+e^{-ax})\Biggr|_0^\infty = \left(\frac{1}{b}-\frac{1}{a}\right)\log 2$$
• Clean and elegant ($+1$). Commented Aug 18, 2021 at 0:18
The original form you gave can immediately be written by partial fractions as $$I = \int_0^\infty \Big[\frac{1}{1+e^{bx}}-\frac{1}{1+e^{ax}}\Big]dx.$$ One can use u-substitution to obtain $$I = \frac{1}{a}\log\big|1+e^{a x} \big|-\frac{1}{b}\log\big|1+e^{a x} \big| \Bigg |_{x=0}^\infty.$$ Evaluating the limits provides $$I = \Big(\frac{1}{b}-\frac{1}{a}\Big)\log(2)$$ as quoted.