Answer
$$-\frac{2}{e}+1$$
Work Step by Step
Given $$\int_{0}^{1} x e^{-x} d x$$
Let
\begin{align*}
u&= x\ \ \ \ \ \ \ \ dv= e^{-x}dx\\
du&= dx\ \ \ \ \ \ \ \ v=-e^{-x}
\end{align*}
Then
\begin{align*}
\int_{0}^{1} x e^{-x} d x&= -xe^{-x} \bigg|_{0}^{1} +\int_{0}^{1} e^{-x} d x \\
&= -xe^{-x} -e^{-x}\bigg|_{0}^{1} \\
&= -\frac{2}{e}+1
\end{align*}