# How do you integrate int x^2e^(x-1)dx using integration by parts?

Jun 30, 2018

The answer is $= {e}^{x - 1} \left({x}^{2} - 2 x + 2\right) + C$

#### Explanation:

The integral is

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

Perform an integration by parts

$\int u v ' = u v - \int u ' v$

Here,

$u = {x}^{2}$, $\implies$, $u ' = 2 x$

$v ' = {e}^{x}$, $\implies$, $v = {e}^{x}$

The integral is

$I = \frac{1}{e} \left({x}^{2} {e}^{x} - 2 \int x {e}^{x} \mathrm{dx}\right)$

Apply the integration by parts once more

$u = x$, $\implies$, $u ' = 1$

$v ' = {e}^{x}$, $\implies$, $v = {e}^{x}$

Therefore,

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

Finally,

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

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

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