AP Calculus BC
Integral of x^2 cos x: Answer, Proof, and Steps
The integral of x^2 cos(x) is x^2 sin(x) + 2x cos(x) - 2 sin(x) + C. You get it by integration by parts applied twice, lowering the power of x each pass until only sine and cosine terms remain.
First pass of integration by parts
With , differentiate the polynomial: let and , so .
Second pass and the result
Integrate by parts with and , so .
Subtract this whole result from the first pass, distributing the minus sign across both terms.
The mistake students make
Distributing the outer minus sign is where answers go wrong. The second pass produces , and subtracting the whole thing flips both terms to . Dropping the parentheses and subtracting only the first term is the classic slip.
Subtract the whole bracket
Integration by parts leaves . When is itself a two-term result, the minus applies to every term inside, not just the first.
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 does the answer end with -2 sin x, unlike the sine version?
Because integrates to with no sign flip on the first pass, the signs propagate differently. The companion integral ends with instead.
Do I ever need a third pass?
Not for . Two passes drop the power from to to a constant coefficient, and a constant multiple of or integrates directly.
Is tabular integration reliable here?
Yes. The DI table pairs derivatives of with integrals of and alternates signs, giving without tracking brackets by hand.