Help with $\int \frac{e^x}{e^{2x}-9} dx$ $$\displaystyle \int \frac{e^x}{e^{2x}-9} dx$$
I can't think of ${e^{x}}$ as "$u$" and then ${e^{2x}}$ in the denominator as ${{(e^{x})}^2}$?
Like this:
$\displaystyle\int \frac{u}{u^{2}-9} \mathrm{d}u$
And from here the derivative of the denominator is $2$ times the numerator so I multiply and divide by $2$ to make it look like this:
$$\displaystyle \frac{1}{2} \int \frac{2u}{u^{2}-9} dx = \frac{1}{2}\cdot \ln|u^2-9| + C = \frac{1}{2}\cdot \ln|e^{2x}-9| + C$$
I thought this was ok but verifying it with wolfram the result of the integral is different, what did I do wrong?
 A: Your idea is fine, but if you set $u = e^x$, then $du = e^x dx$. As a consequence, your integral ought to be:
$$\int\frac{du}{u^2-9}.$$
A: I would like to point out a few mistakes. There is nothing (logically) wrong in :
$$\int\frac{u}{u^2 - 9}\color{red}{dx}$$ but you need to complete the substitution (make the integral single variable) to use the integration formulae:
We know:
$$e^x = u$$
$$\frac{d(e^x)}{dx} = \frac{du}{dx}$$
Then, $$e^x = \frac{du}{dx}$$
$$u = \frac{du}{dx}$$
$$dx = {du\over u}$$
Now putting the value, the $u$ will get cancelled, to give:
$$\color{green}{\int\frac{du}{u^2-9}}$$
Assume you had the integral :(although it is wrong now, it may be given in some other problem)
$$\int\frac{u}{u^2-9}du$$
Then your strategy would have been correct. Coming back to our original integral
$$\int\frac{du}{u^2-9}$$
Now, one can use trigonometrical substitution (although there are other formulae).
Let $u$ be the hypotenuse of a right triangle, and $3$ be the base. Then $\sqrt{u^2 - 9}$ is the perpendicular automatically. If $\theta$ is the angle, then $ u = 3sec\theta \implies du = 3sec\theta \space tan\theta \space d\theta$, and $u^2 - 9 = 9tan^2\theta$.
Thus, we have
$$\int\frac{3sec\theta \space tan\theta \space d\theta}{9tan^2\theta}$$
$$\frac13\int\frac{sec\theta}{tan\theta}d\theta$$
$$\frac13\int cosec \theta d\theta$$
$$\frac13ln(|cosec\theta - cot\theta|)+C$$
$$\frac13ln\left(\left|\sqrt{\frac{u-3}{u+3}}\right|\right)+C$$
Simplifying by logarithm rules we get:
$$\frac16\left(ln(|u-3|) - ln(|u+3|)\right)+C$$
Putting the values back:
$$\color{green}{\frac{ln(|e^x-3|) - ln(|e^x+3|)}{6}+C}$$
A: It may be out of the question, but you can also think about the integral in the following way, recalling that:
$$ \int \frac{\mathrm{d}u}{1-u^2}=\tanh^{-1} u+c$$
You obtain easily:
$$ \int \frac{e^x}{e^{2x}-9}\mathrm{d}x=-\int \frac{e^x}{9-e^{2x}}\mathrm{d}x =-\frac{1}{3}\tanh^{-1}\left(\frac{e^x}{3}\right)+k$$
You can also express the result in terms of logarithm using the fact:
$$\tanh^{-1} x =\frac{1}{2}\log (1+x)-\frac{1}{2}\log (1-x)$$
A: Your result $\int \dfrac{u}{u^2-9}\,du$ is not correct. When you substitute $e^x=u \implies e^x\,dx=du$, you must obtain
$$\int \dfrac{e^x}{e^{2x}-9}\,dx=\int \dfrac{e^x\,dx}{(e^{x})^2-9}=\int \dfrac{du}{u^2-9}$$
$$=\dfrac16\int \left(\dfrac{1}{u-3}-\dfrac{1}{u+3}\right)\,du$$
$$=\dfrac16\left(\ln\left|u-3\right|-\ln\left|u+3\right|\right)+C$$
$$=\dfrac16\ln\left|\dfrac{u-3}{u+3}\right|+C$$
$$=\dfrac16\ln\left|\dfrac{e^x-3}{e^x+3}\right|+C$$
