math expression

u = x2 dv = e-x dx
du = 2x dx v = -e-x

math expression

math expression

Now, the integral we are left with cannot be found immediately. We need to perform integration by parts again, for this integral.

u = x dv = e-x dx
du = dx v = -e-x

math expression

math expression

So putting this answer together with the answer for the first part, we have the final solution:

math expression