AP Calculus BC
Integral of x^2 e^x: Answer, Proof, and Steps
The integral of x^2 e^x is e^x(x^2 - 2x + 2) + C. You get it by integration by parts done twice: each pass lowers the power of x by one, from x^2 to 2x to a constant, until the exponential integrates on its own.
First pass of integration by parts
Integration by parts, , trades a hard integral for an easier one. Differentiating the polynomial is what makes progress, so let and .
That leaves a new integral with only to the first power.
Second pass and the result
Apply parts again to with and , so and .
Substitute back and factor out .
Differentiating by the product rule returns , confirming the answer.
The mistake students make
The frequent slip is a sign error on the second pass, dropping the minus in front of and writing . Track the leading minus carefully, since both terms inside the parentheses change sign when the bracket is expanded.
Alternating signs, one power at a time
For , parts applied times gives times a polynomial whose signs alternate, here . A tabular (DI) layout keeps those alternating signs organized.
Every answer on this page is machine checked
An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.
Frequently asked questions
Why choose u = x^2 and not dv = x^2 dx?
Because differentiating drives its power down toward a constant, which ends the process, while integrates to itself and never gets worse. Letting would raise the power and make the integral harder.
How many times do I apply integration by parts?
Twice, matching the exponent on . Each pass lowers constant. In general needs applications.
Is there a faster way than writing out both passes?
Yes, tabular integration (the DI method) lists derivatives of beside integrals of and reads off the answer with alternating signs. It gives the same with less writing.