Finding the integral of $(1+2^{2x})/2^x$ 
Evaluate the integral:
  $$\int\frac{1+2^{2x}}{2^x}\,dx = \int \frac{ 1 + (2^x)^2}{2^x}\,dx$$

Let $u = 2^x$.  Then $du = 2^x\ln2\,dx$, which yields $\frac{du}{2^x\ln2} = dx$ so
$$  \int \frac{ 1 + (2^x)^2}{2^x}\,dx =  \int \frac{1+u^2}{u}du =
\left( x+ \frac{u^3}{3} \right)\ln u+C$$
$$=\left(x+ \frac{(2^x)^3}{3} \right)\ln 2^x +C$$
I'm not sure if I integrated this correctly. Any help would be appreciated.
 A: Note you can do the algebraic simplification first (it's usually a good idea to see if you can simplify an integrand first):
$$
\int{1+2^{2x}\over 2^x}\,dx 
= \int{{1\over 2^x}+{2^{2x}\over 2^x}}\,dx
=  \int{{2^{-x}}+{2^{x}}}\,dx
={ -2^{-x}\over \ln 2} +{ 2^x\over \ln 2}+C.
$$
Here, we used the basic rule: $\int a^{x}\, dx={a^x\over \ln a}+C$.  From this, one sees,
$\int a^{kx}\, dx={a^{kx}\over k\ln a}+C$. 
A: Your change of variable is fine; your substitution is not quite right and your integral is not quite right. If $u=2^x$, then $du = 2^x\ln(2)\,dx = u\ln(2)\,dx$, so $dx = \frac{du}{\ln(2)u}$. So we have:
$$\begin{align*}
\int \frac{1+2^{2x}}{2^x}\,dx &= \int\frac{1 + (2^x)^2}{2^x}\,dx\\
&= \int\left(\frac{1 + u^2}{u}\right)\frac{du}{\ln(2)u}\\
&= \frac{1}{\ln(2)}\int\frac{1+u^2}{u^2}\,du\\
&=\frac{1}{\ln(2)}\int\left(u^{-2} + 1\right)\,du\\
&=\frac{1}{\ln(2)}\left(-u^{-1} + u\right) + C\\
&= \frac{1}{\ln(2)}\left(2^x - \frac{1}{2^x}\right) + C
\end{align*}$$
A: All you need is that $$\int a^x dx = \int \exp(x \log a) dx = \frac{\exp(x \log a)}{\log a} +C= \frac{a^x}{\log(a)}+C$$
$$\begin{align*}
\int \frac{1+2^{2x}}{2^{x}} dx &= \int \left(\left(\frac12 \right)^x + 2^x \right)dx\\
 &= \left( \frac{\left(\frac12 \right)^x}{\log(1/2)} + \frac{2^x}{\log(2)} \right) + C\\
 &= \left( -\frac{\left(\frac12 \right)^x}{\log(2)} + \frac{2^x}{\log(2)} \right) + C\\
 &= \frac{\left(2^x - \frac1{2^x} \right)}{\log(2)} + C\end{align*}$$
