# How do you use partial fraction decomposition to decompose the fraction to integrate 1/(1+e^x) ?

Oct 17, 2015

$\int \frac{1}{1 + {e}^{x}} \setminus \mathrm{dx} = x - \ln \left(1 + {e}^{x}\right) + C$.

#### Explanation:

This is not really a partial fraction problem, but instead it's just a trick. Write:

$\frac{1}{1 + {e}^{x}} = \frac{1 + {e}^{x} - {e}^{x}}{1 + {e}^{x}}$

$= \frac{1 + {e}^{x}}{1 + {e}^{x}} - {e}^{x} / \left(1 + {e}^{x}\right) = 1 - {e}^{x} / \left(1 + {e}^{x}\right)$

This means

$\int \frac{1}{1 + {e}^{x}} \setminus \mathrm{dx} = \int \left(1 - {e}^{x} / \left(1 + {e}^{x}\right)\right) \setminus \mathrm{dx}$

$= x - \int {e}^{x} / \left(1 + {e}^{x}\right) \setminus \mathrm{dx}$.

For this last integral, let $u = 1 + {e}^{x}$ so that $\mathrm{du} = {e}^{x} \setminus \mathrm{dx}$ and we get

$\int {e}^{x} / \left(1 + {e}^{x}\right) \setminus \mathrm{dx} = \int \setminus \frac{\mathrm{du}}{u} = \ln | u | + C = \ln \left(1 + {e}^{x}\right) + C$ (note that $1 + {e}^{x} > 0$ for all $x$).

Therefore,

$\int \frac{1}{1 + {e}^{x}} \setminus \mathrm{dx} = x - \ln \left(1 + {e}^{x}\right) + C$.