Evaluate the integral: I = integral x²e^-x dx
Evaluate the integral: $$ I = \int x^2e^{-x}\,dx. $$
Explanation of Method
Integration by parts with $u=x^2$, $dv=e^{-x}dx$ reduces the power of $x$ by one, leaving a $\int xe^{-x}\,dx$ integral that itself requires a second application of integration by parts.
- Choose $u=x^2$, $dv=e^{-x}\,dx$ and apply integration by parts.
- Solve the leftover $\int xe^{-x}\,dx$ with a second integration by parts.
- Combine the results.
Step 1 · First integration by parts
Let:
$$ u = x^2 \quad \Rightarrow \quad du = 2x\,dx, \qquad dv = e^{-x}\,dx \quad \Rightarrow \quad v = -e^{-x}. $$
Applying the formula:
$$ I = -x^2e^{-x} + \int 2xe^{-x}\,dx. $$
Step 2 · Second integration by parts
For $\displaystyle\int 2xe^{-x}\,dx$, let $u=2x$, $dv=e^{-x}\,dx$, so $du=2\,dx$, $v=-e^{-x}$:
$$ \int 2xe^{-x}\,dx = -2xe^{-x} + \int 2e^{-x}\,dx = -2xe^{-x} - 2e^{-x}. $$
Step 3 · Combine
Substituting back:
$$ I = -x^2e^{-x} + \left(-2xe^{-x} - 2e^{-x}\right) + C. $$
Step 4 · Simplify
$$ I = -\left(x^2+2x+2\right)e^{-x} + C. $$
Summary Table
| Piece | Value |
|---|---|
| First IBP | $-x^2e^{-x}+\int2xe^{-x}\,dx$ |
| $\int2xe^{-x}\,dx$ | $-2xe^{-x}-2e^{-x}$ |
Additional Notes
- The integrand is defined for all real $x$.
- A common bookkeeping slip is forgetting that $\int e^{-x}dx=-e^{-x}$ (not $+e^{-x}$), which flips the sign of the constant term if applied inconsistently across the two rounds of integration by parts.
- The result can be checked by differentiating $-(x^2+2x+2)e^{-x}$: this gives $-(2x+2)e^{-x}+(x^2+2x+2)e^{-x}=x^2e^{-x}$, matching the integrand.
Result
The solution to the integral is: