# 009B Sample Midterm 1, Problem 4 Detailed Solution

Evaluate the indefinite and definite integrals.

(a)   ${\displaystyle \int x^{2}e^{x}~dx}$

(b)   ${\displaystyle \int _{1}^{e}x^{3}\ln x~dx}$

Background Information:
1. Integration by parts tells us that
${\displaystyle \int u~dv=uv-\int v~du.}$
2. How would you integrate  ${\displaystyle \int x\ln x~dx?}$

You could use integration by parts.

Let  ${\displaystyle u=\ln x}$  and  ${\displaystyle dv=x~dx.}$

Then,  ${\displaystyle du={\frac {1}{x}}dx}$  and  ${\displaystyle v={\frac {x^{2}}{2}}.}$

${\displaystyle {\begin{array}{rcl}\displaystyle {\int x\ln x~dx}&=&\displaystyle {{\frac {x^{2}\ln x}{2}}-\int {\frac {x}{2}}~dx}\\&&\\&=&\displaystyle {{\frac {x^{2}\ln x}{2}}-{\frac {x^{2}}{4}}+C.}\end{array}}}$

Solution:

(a)

Step 1:
We proceed using integration by parts.
Let  ${\displaystyle u=x^{2}}$  and  ${\displaystyle dv=e^{x}dx.}$
Then,  ${\displaystyle du=2xdx}$  and  ${\displaystyle v=e^{x}.}$
Therefore, we have
${\displaystyle \int x^{2}e^{x}~dx=x^{2}e^{x}-\int 2xe^{x}~dx.}$
Step 2:
Now, we need to use integration by parts again.
Let  ${\displaystyle u=2x}$  and  ${\displaystyle dv=e^{x}dx.}$
Then,  ${\displaystyle du=2dx}$  and  ${\displaystyle v=e^{x}.}$
Building on the previous step, we have
${\displaystyle {\begin{array}{rcl}\displaystyle {\int x^{2}e^{x}~dx}&=&\displaystyle {x^{2}e^{x}-{\bigg (}2xe^{x}-\int 2e^{x}~dx{\bigg )}}\\&&\\&=&\displaystyle {x^{2}e^{x}-2xe^{x}+2e^{x}+C.}\end{array}}}$

(b)

Step 1:
We proceed using integration by parts.
Let  ${\displaystyle u=\ln x}$  and  ${\displaystyle dv=x^{3}dx.}$
Then,  ${\displaystyle du={\frac {1}{x}}dx}$  and  ${\displaystyle v={\frac {x^{4}}{4}}.}$
Therefore, we have

${\displaystyle {\begin{array}{rcl}\displaystyle {\int _{1}^{e}x^{3}\ln x~dx}&=&\displaystyle {\left.\ln x{\bigg (}{\frac {x^{4}}{4}}{\bigg )}\right|_{1}^{e}-\int _{1}^{e}{\frac {x^{3}}{4}}~dx}\\&&\\&=&\displaystyle {\left.\ln x{\bigg (}{\frac {x^{4}}{4}}{\bigg )}-{\frac {x^{4}}{16}}\right|_{1}^{e}.}\end{array}}}$

Step 2:
Now, we evaluate to get
${\displaystyle {\begin{array}{rcl}\displaystyle {\int _{1}^{e}x^{3}\ln x~dx}&=&\displaystyle {{\bigg (}(\ln e){\frac {e^{4}}{4}}-{\frac {e^{4}}{16}}{\bigg )}-{\bigg (}(\ln 1){\frac {1^{4}}{4}}-{\frac {1^{4}}{16}}{\bigg )}}\\&&\\&=&\displaystyle {{\frac {e^{4}}{4}}-{\frac {e^{4}}{16}}+{\frac {1}{16}}}\\&&\\&=&\displaystyle {{\frac {3e^{4}+1}{16}}.}\end{array}}}$

(a)     ${\displaystyle x^{2}e^{x}-2xe^{x}+2e^{x}+C}$
(b)     ${\displaystyle {\frac {3e^{4}+1}{16}}}$