Evaluate the Integral: $\int\frac{e^{2x}}{e^{2x}+3e^x+2}\mathrm{d}x$ $$\int\frac{e^{2x}}{e^{2x}+3e^x+2}\mathrm{d}x$$
Step one- Factor the denominator
${e^{2x}+3e^x+2}$
$e^x\quad\quad\quad +1$ $=1e^x$
$e^x\quad\quad\quad +2$ $=2e^x$
$\quad\quad\quad\quad\quad\quad\quad3e^x$
$(e^x+1)(e^x+2)$
Step two: Further Decomposition: 
$\frac{A}{e^x+1}+\frac{B}{e^x+2}$
$\frac{A(e^x+2)+B(e^x+1)}{(e^x+1)(e^x+2)}$
$e^2x=A(e^x+2)+B(e^x+1)$
I am stuck at this point
The book says I should use u substitution. 
Also, how is $e^{2x}=(e^x)^2$

Set $e^x=t$, we then have that $e^xdx = dt$. This gives us that
$$I=\int \dfrac{e^{2x}}{e^{2x}+3e^x+2} dx = \int \dfrac{t}{t^2+3t+2}dt = \int\dfrac{2dt}{t+2} - \int\dfrac{dt}{t+1}=2\ln(t+2)-\ln(t+1) + c$$
Hence,
$$I = 2\ln(2+e^x) - \ln(1+e^x) + c$$
