Find the indefinite integral
Recognise the product type and pick so the polynomial shrinks. The integrand is a polynomial times an exponential, the classic signal for integration by parts:
Choose and . The reason is that differentiating lowers its degree, while is unchanged by integration — so each application of the formula moves us strictly closer to an integral we can do. Choosing the other way round () would raise the power to and make the problem worse.
First application of the formula. With and we get and , so
The remaining integral has the same shape but with instead of : the degree has dropped by one exactly as planned.
Second application, on . Take , , so and :
In general needs passes, because the degree falls by one each time. Here , hence exactly two passes.
Substitute back and simplify. Feeding the second result into the first:
Factoring out the common gives the tidy form
Do not forget the constant : it is only added once, at the very end, not after each pass.
Verify by differentiating the answer. This is the one check that is always available for an indefinite integral. By the product rule,
The two linear pieces cancel and we recover the original integrand exactly, so the antiderivative is correct.
Note the pattern for reuse. The alternating-sign structure generalises:
For this reads , matching what we derived. Recognising this lets you write down without repeating the work three times.
Need to solve a different problem like this? Open the solver →