Integrating by parts (with v = x and dudx=e−x), we get:
−xe−x−∫−e−x dx (since ∫e−x dx=−e−x)
=−xe−x−e−x+constant
We can also sometime use integration by parts when we want to integrate a function that cannot be split into the product of two things. The trick we use in such circumstances is to multiply by 1 and take dudx=1