# How do you integrate int x^2e^-x by integration by parts method?

Jul 24, 2016

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

#### Explanation:

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

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

which by IBP means
$= - {x}^{2} {e}^{-} x - \int \setminus - {e}^{-} x \frac{d}{\mathrm{dx}} \left({x}^{2}\right) \setminus \mathrm{dx}$

$= - {x}^{2} {e}^{-} x + \int \setminus {e}^{-} x \cdot 2 x \setminus \mathrm{dx}$

setting up one more round of IBP

$= - {x}^{2} {e}^{-} x + \int \setminus \frac{d}{\mathrm{dx}} \left(- {e}^{-} x\right) \cdot 2 x \setminus \mathrm{dx}$

$= - {x}^{2} {e}^{-} x + \left(- {e}^{-} x\right) \cdot 2 x - \int \setminus - {e}^{-} x \cdot \frac{d}{\mathrm{dx}} \left(2 x\right) \setminus \mathrm{dx}$

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

$= - {x}^{2} {e}^{-} x - 2 x {e}^{-} x - 2 {e}^{-} x + C$

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

Jul 24, 2016

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

#### Explanation:

$\frac{d}{\mathrm{dx}} \left({x}^{n} {e}^{- x}\right) = n {x}^{n - 1} {e}^{- x} - {x}^{n} {e}^{- x}$

Calling ${I}_{n} = \int {x}^{n} {e}^{- x} \mathrm{dx}$ we have

${I}_{n} - n {I}_{n - 1} = - {x}^{n} {e}^{- x}$

making now ${J}_{n} = {e}^{x} {I}_{n}$ we obtain a simpler recurrence relation

${J}_{n} - n {J}_{n - 1} = - {x}^{n}$

This recurrence formulation allows us to obtain the general solution for the integral

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

Now doing $n = 2$ we have

 {(J_2-2J_1=-x^2), (J_1-J_0 = -x) :}

Multiplying the second equation by $2$ and adding with the first we obtain

${J}_{2} - 2 {J}_{0} = - {x}^{2} - 2 x$

but ${J}_{0} = {e}^{x} {I}_{0} = {e}^{x} \int {e}^{- x} \mathrm{dx} = - 1 + C$

so

${J}_{2} = {e}^{x} {I}_{2} = - {x}^{2} - 2 x - 2 + 2 C$

Finally

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