# 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.

-
Do you mean $\dfrac{1+2^{2x}}{2^x}$? –  user17762 May 18 '12 at 2:12
@Marvis yes i did –  dave5678 May 18 '12 at 2:14
$\int{1+u^2\over u}\ne\int(1+u^2)\times\int(1/u)$. Same mistake I told you about in your other question, two hours ago! –  Gerry Myerson May 18 '12 at 2:15
(i) Your substitution of $dx$ is wrong; (ii) the integral of a product is not the product of the integrals; (iii) the integral of $1$ **with respect to $u$** is $u$, not $x$. Among other problems. –  Arturo Magidin May 18 '12 at 2:28
Note that your original integrand is $2^x+2^{-x}$, which is $e^{x \ln 2}+e^{-x \ln 2}$, and if you know how to integrate $e^{ax}$ you should be able to do this without substitution. –  Mark Bennet May 18 '12 at 10:15

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*}

-
I think I see where I went wrong, Thank you for helping. –  dave5678 May 18 '12 at 2:59
@dave5678: I'm not trying to pile on, but notice that you went wrong in several places. There were at least three serious errors in your derivation, each of which is troublesome. –  Arturo Magidin May 18 '12 at 3:00

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$.

-
I honestly believe this is the best approach. Why do a substitution when life's already easy? –  000 May 18 '12 at 5:48

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*}

-
where did exp() come from?, I haven't seen this formula before, must be advanced calculus. Thanks again for editing my post I haven't gotten use to La Tex yet. –  dave5678 May 18 '12 at 2:57
@dave5678: By definition, $a^b = \exp(b\ln a)$. So $a^x = \exp(x\ln a)$. It's not "advanced calculus", it's the definition of the arbitrary exponential. –  Arturo Magidin May 18 '12 at 2:59