Integrate the function.
∫x2exdx.
Let I=∫x2exdx
On taking x2 as first function and ex as second function and integrating by parts, we get I=x2∫exdx−∫[ddx(x2)∫exdx]dx=x2ex−∫[2xex]dx
Again, integrating by parts, we get
I=x2ex−{2x∫exdx−2∫[ddx(x)∫exdx]dx}=x2ex−2xex+2∫exdx=x2ex−2xex+2ex+C⇒I=ex(x2−2x+2)+C