∫ [∞,0] xe^-x dx

Evaluate the improper integral
Can't figure it out been trying for the past hour

use integration by parts. FYI, that is just the chain rule in reverse.

d/(uv) = u dv + v du
∫d(uv) = ∫ u dv + ∫ v du
∫u dv = uv - ∫v du
So, for this one, let
u = x , du = dx
dv = e^-x, v = -e^-x
∫x e^-x dx = -xe^-x + ∫e^-x dx = -xe^-x - e^-x = -(x+1)e^-x
Now evaluate that at ∞ and 0
(recall that exponentials outweigh polynomials at ∞)