# How do you integrate (x^2e^(x/2))dx?

Jan 23, 2017

$\int {x}^{2} {e}^{\frac{x}{2}} \mathrm{dx} = 2 {e}^{\frac{x}{2}} \left({x}^{2} - 4 x + 8\right) + C$

#### Explanation:

$I = \int {x}^{2} {e}^{\frac{x}{2}} \mathrm{dx}$

Use the substitution $t = \frac{x}{2}$. This implies that:

$\left\{\begin{matrix}2 t = x \\ 2 \mathrm{dt} = \mathrm{dx} \\ 4 {t}^{2} = {x}^{2}\end{matrix}\right.$

Then:

$I = \int {x}^{2} {e}^{\frac{x}{2}} \mathrm{dx} = \int \left(4 {t}^{2}\right) \left({e}^{t}\right) \left(2 \mathrm{dt}\right) = \int 8 {t}^{2} {e}^{t} \mathrm{dt}$

Now use integration by parts. This takes the form $\int u \mathrm{dv} = u v - \int v \mathrm{du}$. For the current integral, let:

$\left\{\begin{matrix}u = 8 {t}^{2} \text{ "=>" "du=16tdt \\ dv=e^tdt" "=>" } v = {e}^{t}\end{matrix}\right.$

So:

$I = u v - \int v \mathrm{du} = 8 {t}^{2} {e}^{t} - \int 16 t {e}^{t} \mathrm{dt}$

Again perform integration by parts with a knew $u$ and $\mathrm{dv}$:

$\left\{\begin{matrix}u = 16 t \text{ "=>" "du=16dt \\ dv=e^tdt" "=>" } v = {e}^{t}\end{matrix}\right.$

Hence:

$I = 8 {t}^{2} {e}^{t} - \left(u v - \int v \mathrm{du}\right)$

$I = 8 {t}^{2} {e}^{t} - 16 t {e}^{t} + \int 16 {e}^{t} \mathrm{dt}$

Note that $\int 16 {e}^{t} \mathrm{dt} = 16 \int {e}^{t} \mathrm{dt} = 16 {e}^{t}$:

$I = 8 {t}^{2} {e}^{t} - 16 t {e}^{t} + 16 {e}^{t} + C$

$I = 8 {e}^{t} \left({t}^{2} - 2 t + 2\right) + C$

Returning to $x$ from the substitution $t = \frac{x}{2}$:

$I = 8 {e}^{\frac{x}{2}} \left({x}^{2} / 4 - x + 2\right) + C$

$I = 2 {e}^{\frac{x}{2}} \left({x}^{2} - 4 x + 8\right) + C$