Answer
$$\displaystyle{{ \int _ { 0 } ^ { 1 } x e ^ { - x } - x ^ { 2 } e ^ { - x }\ dx=\frac{3}{e}-1 }} $$
Work Step by Step
${ f ( x ) = x ^ { 2 } e ^ { - x } } \\
{ g ( x ) = x e ^ { - x } }\\
{ x ^ { 2 } e ^ { - x } = x e ^ { - x } }\\
x^2=x^1\\$
This expression is true when $x=0$ and $x=1$
$\displaystyle{ I = \int _ { 0 } ^ { 1 }g(x)-f(x)}\\
\displaystyle{{ I = \int _ { 0 } ^ { 1 } x e ^ { - x } - x ^ { 2 } e ^ { - x }\ d x }} \\
\displaystyle{{ I = \int _ { 0 } ^ { 1 } e ^ { - x } \left( x - x ^ { 2 } \right)\ d x }}$
$\displaystyle \left[\begin{array}{ll} u=x-x^2 & dv=e^{-x} \\ & \\ du=1-2x & v=-e^{-x} \end{array}\right]$ Integration by parts
$\displaystyle{I = \left[ - ( x - x ^ { 2 } ) e ^ { - x } \right] _ { 0 } ^ { 1 } - \int _ { 0 } ^ { 1 } - e ^ { - x } \left( 1 - 2 x \right)\ dx}\\
\displaystyle{I =0 + \int _ { 0 } ^ { 1 } e ^ { - x } \left( 1 - 2 x \right)\ dx}\\$
$\displaystyle \left[\begin{array}{ll} u=1-2x & dv=e^{-x} \\ & \\ du=-2 & v=-e^{-x} \end{array}\right]$ Integration by parts
$\displaystyle{I = \left[ - ( 1 - 2x ) e ^ { - x } \right] _ { 0 } ^ { 1 }-\int_{0}^{1}(-2)-e ^ { -x } }\\
\displaystyle{I = \left[ - ( 1 - 2x ) e ^ { - x } \right] _ { 0 } ^ { 1 }-2\int_{0}^{1}e ^ { -x } }\\
\displaystyle{I = \left(e^{-1}+1\right)-2\left[- e ^ { -x } \right]_{0}^{1}}\\
\displaystyle{I = \left(e^{-1}+1\right)-2\left(- e ^ { -1 } \right)+2\left(-e^0\right)}\\
\displaystyle{I = e^{-1}+1+2 e ^ { -1 }-2}\\
\displaystyle{I = 3e^{-1}-1}\\
\displaystyle{I = \frac{3}{e}-1}$