# How do you evaluate the integral int x^2e^x?

Jun 1, 2017

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

#### Explanation:

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

Explanation:
Integrate by parts :
$\int {x}^{2} {e}^{x} \mathrm{dx}$
Let $u = {x}^{2}$, $v = {e}^{x}$. You will get $\left(d v\right) = {e}^{x} \cdot \mathrm{dx}$, $\left(\mathrm{du}\right) = 2 x \cdot \mathrm{dx}$, .

To reduce the power of $x$ in the integral, you may rewrite it in this form $\int u \cdot d v$. This new expression is equivalent to the original one. (by replacing ${x}^{2}$ with u and ${e}^{x} \cdot \mathrm{dx}$ with $\left(d v\right)$.)

$\int u \cdot d v = u \cdot v - \int \mathrm{du} \cdot v$
$\int {x}^{2} {e}^{x} \mathrm{dx} = {x}^{2} \cdot {e}^{x} - \int 2 x \cdot {e}^{x}$

Now, let's do the partial integration again with $m = 2 \cdot x$ this time. In this case $d m = 2 \cdot \mathrm{dx}$

$\int m \cdot d v = m \cdot v - \int \mathrm{dm} \cdot v$
$\int 2 x \cdot {e}^{x} = 2 \cdot x \cdot {e}^{x} - \int 2 \cdot {e}^{x} = 2 \cdot x \cdot {e}^{x} - 2 \cdot {e}^{x} + C$
(include the arbritary constant $C$ in the expression)