Solution
For the integral ∫x2e−xdx, use integration by parts ∫udv=uv−∫vdu.
Let u=x2 and dv=e−xdx.
Then du=(x2)′dx=2xdx (steps can be seen ») and v=∫e−xdx=−e−x (steps can be seen »).
Thus,
∫x2e−xdx=(x2⋅(−e−x)−∫(−e−x)⋅2xdx)=(−x2e−x−∫(−2xe−x)dx)
Apply the constant multiple rule ∫cf(x)dx=c∫f(x)dx with c=−2 and f(x)=xe−x:
−x2e−x−∫(−2xe−x)dx=−x2e−x−(−2∫xe−xdx)
For the integral ∫xe−xdx, use integration by parts ∫udv=uv−∫vdu.
Let u=x and dv=e−xdx.
Then du=(x)′dx=1dx (steps can be seen ») and v=∫e−xdx=−e−x (steps can be seen »).
So,
−x2e−x+2∫xe−xdx=−x2e−x+2(x⋅(−e−x)−∫(−e−x)⋅1dx)=−x2e−x+2(−xe−x−∫(−e−x)dx)
Apply the constant multiple rule ∫cf(x)dx=c∫f(x)dx with c=−1 and f(x)=e−x:
−x2e−x−2xe−x−2∫(−e−x)dx=−x2e−x−2xe−x−2(−∫e−xdx)
Let u=−x.
Then du=(−x)′dx=−dx (steps can be seen »), and we have that dx=−du.
Thus,
−x2e−x−2xe−x+2∫e−xdx=−x2e−x−2xe−x+2∫(−eu)du
Apply the constant multiple rule ∫cf(u)du=c∫f(u)du with c=−1 and f(u)=eu:
−x2e−x−2xe−x+2∫(−eu)du=−x2e−x−2xe−x+2(−∫eudu)
The integral of the exponential function is ∫eudu=eu:
−x2e−x−2xe−x−2∫eudu=−x2e−x−2xe−x−2eu
Recall that u=−x:
−x2e−x−2xe−x−2eu=−x2e−x−2xe−x−2e(−x)
Therefore,
∫x2e−xdx=−x2e−x−2xe−x−2e−x
Simplify:
∫x2e−xdx=(−x2−2x−2)e−x
Add the constant of integration:
∫x2e−xdx=(−x2−2x−2)e−x+C