Solution (source code)

= Solution

<Integration by parts> with $u=x$ and $dv=e^x\,dx$ gives
$$
\boxed{\int xe^x\,dx=xe^x-\int e^x\,dx=(x-1)e^x+C.}
$$