<s>[INST] Calculate $\int\frac{2e^{2x}-e^x}{\sqrt{3e^{2x}-6e^x-1}}dx$ The question is to evaluate I, which is defined as follows:
$$
I \equiv \int\frac{2e^{2x}-e^x}{\sqrt{3e^{2x}-6e^x-1}}dx
$$
The first thing I did was simplify the numerator of the integrand by factoring out an $e^x$ to get
$$
\int\frac{e^x(2e^x-1)}{\sqrt{3e^{2x}-6e^x-1}}dx
$$
We then let $u = e^x$, then $dx = e^{-x}du$, and this enables us to rewrite $I$ as follows after some simplification
$$
\int\frac{2u - 1}{\sqrt{3(u^2-2u)-1}}du
$$
We can then split the integrand as follows by rewriting the numerator as $2u - 2 + 1$
$$
\int\frac{2u-2}{\sqrt{3(u^2-2u)-1}}+\frac{1}{\sqrt{3(u^2-2u)-1}}du
$$
We can then apply the sum rule to split the integral as follows
$$
\int\frac{2u-2}{\sqrt{3(u^2-2u)-1}}du + \int\frac{1}{\sqrt{3(u^2-2u)-1}}du
$$
Then factoring out a 2 from the first integral gives
$$
2\int\frac{u-1}{\sqrt{3(u^2-2u)-1}}du + \int\frac{1}{\sqrt{3(u^2-2u)-1}}du
$$
I'm not sure how to solve these integrals from here though, so any help would be great.
 [/INST] We need one substitution not two which is $e^x-1=\frac{2}{\sqrt{3}}\sec t$.
Then, with $e^xdx=\frac{2}{\sqrt{3}}\sec t\tan t dt$ and $2e^x-1=\frac{4}{\sqrt{3}}\sec t+1$ we have
$$I=\int\frac{e^x(2e^x-1)}{\sqrt{3(e^x-1)^2-4}}dx=\int\frac{\frac{4}{\sqrt{3}}\sec t+1}{2\tan t}\frac{2}{\sqrt{3}}\sec t\tan t dt=\int (\frac{4}{3}\sec^2 t+\frac{1}{\sqrt{3}}\sec t)dt$$
and
$$I=\frac{4}{3}\tan t +\frac{1}{\sqrt{3}}\ln|\sec t+\tan t|+c.$$
in terms of $x$,
$$I=\frac{2}{3}\sqrt{3e^{2x}-6e^x-1} +\frac{1}{\sqrt{3}}\ln|\sqrt{3}(e^x-1)+\sqrt{3e^{2x}-6e^x-1}|+c.$$
Finally, https://www.wolframalpha.com/input?i=integral+e%5Ex%282e%5Ex-1%29%2Fsqrt%283e%5E%282x%29-6e%5Ex-1%29 I have to check myself.
</s>