# How do you integrate (1 + e^x )/(1 - e^x)?

Apr 19, 2018

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

#### Explanation:

Substitute:

$t = {e}^{x}$

$\mathrm{dt} = {e}^{x} \mathrm{dx}$

$\mathrm{dx} = \frac{\mathrm{dt}}{t}$

so:

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

Use partial fractions decomposition:

$\frac{1 + t}{t \left(1 - t\right)} = \frac{A}{t} + \frac{B}{1 - t}$

$\frac{1 + t}{t \left(1 - t\right)} = \frac{A \left(1 - t\right) + B t}{t \left(1 - t\right)}$

$1 + t = A - A t + B t$

$\left\{\begin{matrix}A = 1 \\ - A + B = 1\end{matrix}\right.$

$\left\{\begin{matrix}A = 1 \\ B = 2\end{matrix}\right.$

so:

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

$\int \frac{1 + {e}^{x}}{1 - {e}^{x}} \mathrm{dx} = \ln \left\mid t \right\mid - 2 \ln \left\mid 1 - t \right\mid + C$

and undoing the substitution:

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