# 009B Sample Final 1, Problem 4

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Compute the following integrals.

a) $\int e^{x}(x+\sin(e^{x}))~dx$ b) $\int {\frac {2x^{2}+1}{2x^{2}+x}}~dx$ c) $\int \sin ^{3}x~dx$ Foundations:
Recall:
1. Integration by parts tells us that $\int u~dv=uv-\int v~du$ .
2. Through partial fraction decomposition, we can write the fraction  ${\frac {1}{(x+1)(x+2)}}={\frac {A}{x+1}}+{\frac {B}{x+2}}$ for some constants $A,B$ .
3. We have the Pythagorean identity $\sin ^{2}(x)=1-\cos ^{2}(x)$ .

Solution:

(a)

Step 1:
We first distribute to get
$\int e^{x}(x+\sin(e^{x}))~dx\,=\,\int e^{x}x~dx+\int e^{x}\sin(e^{x})~dx.$ Now, for the first integral on the right hand side of the last equation, we use integration by parts.
Let $u=x$ and $dv=e^{x}dx$ . Then, $du=dx$ and $v=e^{x}$ .
So, we have
${\begin{array}{rcl}\displaystyle {\int e^{x}(x+\sin(e^{x}))~dx}&=&\displaystyle {{\bigg (}xe^{x}-\int e^{x}~dx{\bigg )}+\int e^{x}\sin(e^{x})~dx}\\&&\\&=&\displaystyle {xe^{x}-e^{x}+\int e^{x}\sin(e^{x})~dx}.\\\end{array}}$ Step 2:
Now, for the one remaining integral, we use $u$ -substitution.
Let $u=e^{x}$ . Then, $du=e^{x}dx$ .
So, we have
${\begin{array}{rcl}\displaystyle {\int e^{x}(x+\sin(e^{x}))~dx}&=&\displaystyle {xe^{x}-e^{x}+\int \sin(u)~du}\\&&\\&=&\displaystyle {xe^{x}-e^{x}-\cos(u)+C}\\&&\\&=&\displaystyle {xe^{x}-e^{x}-\cos(e^{x})+C}.\\\end{array}}$ (b)

Step 1:
First, we add and subtract $x$ from the numerator.
So, we have
${\begin{array}{rcl}\displaystyle {\int {\frac {2x^{2}+1}{2x^{2}+x}}~dx}&=&\displaystyle {\int {\frac {2x^{2}+x-x+1}{2x^{2}+x}}~dx}\\&&\\&=&\displaystyle {\int {\frac {2x^{2}+x}{2x^{2}+x}}~dx+\int {\frac {1-x}{2x^{2}+x}}~dx}\\&&\\&=&\displaystyle {\int ~dx+\int {\frac {1-x}{2x^{2}+x}}~dx}.\\\end{array}}$ Step 2:
Now, we need to use partial fraction decomposition for the second integral.
Since $2x^{2}+x=x(2x+1)$ , we let ${\frac {1-x}{2x^{2}+x}}={\frac {A}{x}}+{\frac {B}{2x+1}}$ .
Multiplying both sides of the last equation by $x(2x+1)$ ,
we get $1-x=A(2x+1)+Bx$ .
If we let $x=0$ , the last equation becomes $1=A$ .
If we let $x=-{\frac {1}{2}}$ , then we get  ${\frac {3}{2}}=-{\frac {1}{2}}\,B$ . Thus, $B=-3$ .
So, in summation, we have  ${\frac {1-x}{2x^{2}+x}}={\frac {1}{x}}+{\frac {-3}{2x+1}}$ .
Step 3:
If we plug in the last equation from Step 2 into our final integral in Step 1, we have
${\begin{array}{rcl}\displaystyle {\int {\frac {2x^{2}+1}{2x^{2}+x}}~dx}&=&\displaystyle {\int ~dx+\int {\frac {1}{x}}~dx+\int {\frac {-3}{2x+1}}~dx}\\&&\\&=&\displaystyle {x+\ln x+\int {\frac {-3}{2x+1}}~dx}.\\\end{array}}$ Step 4:
For the final remaining integral, we use $u$ -substitution.
Let $u=2x+1$ . Then, $du=2\,dx$ and  ${\frac {du}{2}}=dx$ .
Thus, our final integral becomes
${\begin{array}{rcl}\displaystyle {\int {\frac {2x^{2}+1}{2x^{2}+x}}~dx}&=&\displaystyle {x+\ln x+\int {\frac {-3}{2x+1}}~dx}\\&&\\&=&\displaystyle {x+\ln x+\int {\frac {-3}{2u}}~du}\\&&\\&=&\displaystyle {x+\ln x-{\frac {3}{2}}\ln u+C}.\\\end{array}}$ $\int {\frac {2x^{2}+1}{2x^{2}+x}}~dx\,=\,x+\ln x-{\frac {3}{2}}\ln(2x+1)+C.$ (c)

Step 1:
First, we write $\int \sin ^{3}x~dx=\int \sin ^{2}x\sin x~dx$ .
Using the identity $\sin ^{2}x+\cos ^{2}x=1$ , we get $\sin ^{2}x=1-\cos ^{2}x$ .
If we use this identity, we have
$\int \sin ^{3}x~dx=\int (1-\cos ^{2}x)\sin x~dx$ .
Step 2:
Now, we proceed by $u$ -substitution. Let $u=\cos x$ . Then, $du=-\sin xdx$ .
So we have
${\begin{array}{rcl}\displaystyle {\int \sin ^{3}x~dx}&=&\displaystyle {\int -(1-u^{2})~du}\\&&\\&=&\displaystyle {-u+{\frac {u^{3}}{3}}+C}\\&&\\&=&\displaystyle {-\cos x+{\frac {\cos ^{3}x}{3}}+C}.\\\end{array}}$ (a)  $xe^{x}-e^{x}-\cos(e^{x})+C$ (b)  $x+\ln x-{\frac {3}{2}}\ln(2x+1)+C$ (c)  $-\cos x+{\frac {\cos ^{3}x}{3}}+C$ 