# How do you resolve this integral?

## $\int \frac{{e}^{x} + \sqrt{1 + {e}^{x}}}{2 + {e}^{x} - {e}^{2 x}} \mathrm{dx}$

Jun 24, 2018

$\frac{1}{3} \log | \frac{1 + {e}^{x}}{2 - {e}^{x}} | + \frac{1}{2} \log | \frac{\sqrt{1 + {e}^{x}} - 1}{\sqrt{1 + {e}^{x}} + 1} |$
$q \quad + \frac{\sqrt{3}}{6} | \frac{\sqrt{3} + \sqrt{1 + {e}^{x}}}{\sqrt{3} - \sqrt{1 + {e}^{x}}} | + C$

#### Explanation:

Substitute $1 + {e}^{x} = {u}^{2}$. Then ${e}^{x} \mathrm{dx} = 2 u \setminus \mathrm{du}$. Thus the integral becomes

$\int \setminus \frac{{e}^{x} + \sqrt{1 + {e}^{x}}}{2 + {e}^{x} - {e}^{2 x}} \mathrm{dx} = \int \setminus \frac{{u}^{2} - 1 + u}{2 + \left({u}^{2} - 1\right) - {\left({u}^{2} - 1\right)}^{2}} \frac{2 u \setminus \mathrm{du}}{{u}^{2} - 1}$
$q \quad = \int \setminus \frac{2 u \left({u}^{2} + u - 1\right)}{\left({u}^{2} - 1\right) \left(- {u}^{4} + 3 {u}^{2}\right)} \setminus \mathrm{du}$
$q \quad = \int \setminus \frac{2 \left({u}^{2} + u - 1\right)}{u \left({u}^{2} - 1\right) \left(3 - {u}^{2}\right)} \setminus \mathrm{du}$

We will now evaluate this integral by the method of partial fractions. Consider :

$\frac{{u}^{2} + u - 1}{u \left({u}^{2} - 1\right) \left(3 - {u}^{2}\right)} = \frac{A}{u} + \frac{B}{u - 1} + \frac{C}{u + 1}$
$q \quad q \quad q \quad q \quad q \quad q \quad q \quad q \quad + \frac{D}{\sqrt{3} - u} + \frac{E}{\sqrt{3} + u}$
Thus

${u}^{2} + u - 1 = A \left({u}^{2} - 1\right) \left(3 - {u}^{2}\right) + B u \left(u + 1\right) \left(3 - {u}^{2}\right)$
$q \quad q \quad q \quad \quad + C u \left(u - 1\right) \left(3 - {u}^{2}\right) + D u \left({u}^{2} - 1\right) \left(\sqrt{3} + u\right)$
$q \quad q \quad q \quad \quad + E u \left({u}^{2} - 1\right) \left(\sqrt{3} - u\right)$

• Substituting $u = 0$, we get
$- 3 A = - 1 \implies \textcolor{red}{A = \frac{1}{3}}$
• Substituting $u = 1$, we get
$\setminus 4 B = 1 \implies \textcolor{red}{B = \frac{1}{4}}$
• Substituting $u = - 1$, we get
$4 C = - 1 \implies \textcolor{red}{C = - \frac{1}{4}}$
• Substituting $u = \sqrt{3}$, we get
$12 D = 2 + \sqrt{3} \implies \textcolor{red}{D = \frac{2 + \sqrt{3}}{12}}$
• Substituting $u = - \sqrt{3}$, we get
$- 12 E = 2 - \sqrt{3} \implies \textcolor{red}{E = - \frac{2 - \sqrt{3}}{12}}$

Thus

$\frac{{u}^{2} + u - 1}{u \left({u}^{2} - 1\right) \left(3 - {u}^{2}\right)} = \frac{1}{3 u} + \frac{1}{4 \left(u - 1\right)} - \frac{1}{4 \left(u + 1\right)}$
$q \quad q \quad q \quad q \quad q \quad q \quad q \quad q \quad + \frac{2 + \sqrt{3}}{12 \left(\sqrt{3} - u\right)} - \frac{2 - \sqrt{3}}{12 \left(\sqrt{3} + u\right)}$

Hence our integral becomes

 int\ (2(u^2+u-1))/(u(u^2-1)(3-u^2))\ du = int[2/(3u)+ 1/(2(u-1))
qquad qquad -1/(2(u+1))+(2+sqrt3)/(6(sqrt3-u))-(2-sqrt3)/(6(sqrt3+u))]du
$q \quad = \frac{2}{3} \log | u | + \frac{1}{2} \log | u - 1 | - \frac{1}{2} \log | u + 1 |$
$q \quad q \quad - \frac{2 + \sqrt{3}}{6} \log | \sqrt{3} - u | - \frac{2 - \sqrt{3}}{6} \log | \sqrt{3} + u | + C$
$q \quad = \frac{2}{3} \log | u | + \frac{1}{2} \log | \frac{u - 1}{u + 1} |$
$q \quad q \quad - \frac{1}{3} \log | 3 - {u}^{2} | + \frac{\sqrt{3}}{6} | \frac{\sqrt{3} + u}{\sqrt{3} - u} |$

Substituting $u$ back in terms of $x$, the required integral becomes

$\int \setminus \frac{{e}^{x} + \sqrt{1 + {e}^{x}}}{2 + {e}^{x} - {e}^{2 x}} \mathrm{dx}$
$q \quad = \frac{1}{3} \log \left(1 + {e}^{x}\right) + \frac{1}{2} \log | \frac{\sqrt{1 + {e}^{x}} - 1}{\sqrt{1 + {e}^{x}} + 1} |$
$q \quad q \quad - \frac{1}{3} \log | 2 - {e}^{x} | + \frac{\sqrt{3}}{6} | \frac{\sqrt{3} + \sqrt{1 + {e}^{x}}}{\sqrt{3} - \sqrt{1 + {e}^{x}}} | + C$