Solution
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 »).
The integral becomes
∫xe−xdx=(x⋅(−e−x)−∫(−e−x)⋅1dx)=(−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:
−xe−x−∫(−e−x)dx=−xe−x−(−∫e−xdx)
Let u=−x.
Then du=(−x)′dx=−dx (steps can be seen »), and we have that dx=−du.
Thus,
−xe−x+∫e−xdx=−xe−x+∫(−eu)du
Apply the constant multiple rule ∫cf(u)du=c∫f(u)du with c=−1 and f(u)=eu:
−xe−x+∫(−eu)du=−xe−x+(−∫eudu)
The integral of the exponential function is ∫eudu=eu:
−xe−x−∫eudu=−xe−x−eu
Recall that u=−x:
−xe−x−eu=−xe−x−e(−x)
Therefore,
∫xe−xdx=−xe−x−e−x
Simplify:
∫xe−xdx=(−x−1)e−x
Add the constant of integration:
∫xe−xdx=(−x−1)e−x+C