# How would you integrate (x^2)(e^(x-1))?

May 22, 2015

You would need to do a bit of integration by parts here.

lets first set $f \left(x\right) = {x}^{2}$ and $g ' \left(x\right) = {e}^{x - 1}$

and use $u = f \left(x\right)$ and $v = g \left(x\right)$

then $\mathrm{du} = f ' \left(x\right) \mathrm{dx}$ and $\mathrm{dv} = g ' \left(x\right)$

and we use the integral by parts formula:

$\int u \mathrm{dv} = u v - \int v \mathrm{du}$

Now let us get the values:

$u = {x}^{2}$ and $v = {e}^{x - 1}$

$\mathrm{du} = 2 x$ and $\mathrm{dv} = {e}^{x - 1}$

Thus:

$\int {x}^{2} {e}^{x - 1} \mathrm{dx} = {x}^{2} {e}^{x - 1} - \int 2 x {e}^{x - 1} \mathrm{dx}$

$\int {x}^{2} {e}^{x - 1} \mathrm{dx} = {x}^{2} {e}^{x - 1} - 2 \int x {e}^{x - 1} \mathrm{dx}$

now lets solve for $\textcolor{red}{\int x {e}^{x - 1} \mathrm{dx}}$

$\textcolor{red}{u = x}$ and $\textcolor{red}{v = {e}^{x - 1}}$

$\textcolor{red}{\mathrm{du} = 1}$ and $\textcolor{red}{\mathrm{dv} = {e}^{x - 1}}$

Thus:

color(red)( int xe^(x-1) = xe^(x-1) - int 1e^(x-1)

which equals:

color(red)( int xe^(x-1) = xe^(x-1) - e^(x-1)

Now we can substitute that back into our first problem, and get:

$\int {x}^{2} {e}^{x - 1} \mathrm{dx} = {x}^{2} {e}^{x - 1} - 2 \int x {e}^{x - 1} \mathrm{dx}$

is equal to, $\int {x}^{2} {e}^{x - 1} \mathrm{dx} = {x}^{2} {e}^{x - 1} - 2 \left(x {e}^{x - 1} - {e}^{x - 1}\right)$

where we can simplify to:

$\int {x}^{2} {e}^{x - 1} = {e}^{x - 1} \left({x}^{2} - 2 x + 2\right)$