# How do you integrate  1/(1+e^x)  using partial fractions?

Apr 18, 2016

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

#### Explanation:

We use substitution to put the problem into a form where we can use partial fractions.

Let $u = 1 + {e}^{x} \implies \mathrm{du} = {e}^{x} \mathrm{dx}$. Then:

int1/(1+e^x)dx = inte^x/(e^x(1+e^x)dx

=int1/(u(u-1)du

Decomposing $\frac{1}{u \left(u - 1\right)}$, we find

$\frac{1}{u \left(u - 1\right)} = \frac{1}{u - 1} - \frac{1}{u}$

$\implies \int \frac{1}{u \left(u - 1\right)} \mathrm{du} = \int \frac{1}{u - 1} \mathrm{du} - \int \frac{1}{u} \mathrm{du}$

$= \ln | u - 1 | - \ln | u | + C$

$= \ln | {e}^{x} + 1 - 1 | - \ln | {e}^{x} + 1 | + C$

$= \ln \left({e}^{x}\right) - \ln \left({e}^{x} + 1\right) + C$

$= x - \ln \left({e}^{x} + 1\right) + C$

Rather than using partial fractions, we can also solve this with a little algebraic manipulation and substitution.

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

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

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

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

Focusing on the remaining integral, let $u = \left(1 + {e}^{x}\right) \implies \mathrm{du} = {e}^{x} \mathrm{dx}$

Substituting, we have

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

$= \ln | u | + C$

$= \ln \left(1 + {e}^{x}\right) + C$

Plugging this into the equation above, we can get our result:

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