# Easier way to do an integral

1. Oct 25, 2008

### eof

Hi,

I friend of mine gave me the following integral to calculate:

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

This can de done by first doing partial fractions which gives you

$$\int_0^\infty \frac{1}{1+e^{bx}}-\frac{1}{1+e^{ax}}$$

then we can calculate each one by substituting $$t=1+e^{ax}$$ (and similarly for the other term). Hence

$$dx=\frac{dt}{a(t-1)}$$,

and finally after doing partial fraction again after the substitution, it boils down to

$$\frac{(a-b)\ln 2}{ab}+\lim_{x\rightarrow\infty}\ln\frac{(1+e^{ax})^b}{(1+e^{bx})^a} =\frac{(a-b)\ln 2}{ab}$$

where the second term disappears. The calculation is straightforward, though quite messy. This had been on an actuarial exam a few years ago where they were actually expecting you to calculate it in under 2 minutes.

I've been trying to figure out if there is an "easier" way to see the answer, but haven't come up with anything useful. I can't convert it into any known integral from Fourier analysis or see how to apply the calculus of residues or something similar. Any ideas?

2. Oct 25, 2008

### arildno

There's no particulr reason for why there should exist a quicker way of doing this

3. Oct 25, 2008

### eof

Yeah, I've been thinking about the same thing and that is puzzling me. :)

EDIT: There were some extra conditions given (to ensure that it really converges), but I can't come up with an assumption that would do any good either.

4. Oct 25, 2008

### Mute

For the first partial fraction separation, you don't actually need to the full partial fractions alculation. Notice that you can add 0 = 1 -1 to the numerator, which gives you (1 + e^(ax)) - (1 + e^(bx)), so you can split it up within seconds to get to your second line.

For the second partial fraction expansion, you can probably just look at it and guess what the coefficients need to be instead of working them out. You have A/t + B/(t-1), so looking at that, A = -1, B = 1 should do the job, as you can check pretty quickly.

If you cut corners like that instead of doing the full calculation of the partial fraction separation, it should really cut down on the time taken to do that integral.

5. Nov 2, 2008

### Gib Z

How do you know it was under 2 minutes? That seems a bit difficult.