AP Calculus BC
Integral of x cos x: Answer, Parts, Mistakes
The integral of x cos x with respect to x is cos x + x sin x + C. Integration by parts with u = x and dv = cos x dx gives x sin x minus the integral of sin x, so the answer is x sin x + cos x + C. Differentiating it with the product rule returns x cos x.
How to integrate x cos x by parts
The integrand pairs an algebraic factor with a trig factor, and neither is the derivative of the other, so substitution stalls and integration by parts takes over. Parts is the reverse of the product rule.
Let be the factor that simplifies when differentiated. Here becomes , while only cycles, so take and .
Substitute. The term is , and the new integral is elementary.
Written with the cosine first, that is .
Check it by differentiating
Differentiate : . The sine terms cancel and the integrand comes back.
Why u = x, plus a definite example
Parts pays off only when is simpler. Taking and makes and raises the power, so the leftover integral is worse than the original. LIATE confirms the choice: the algebraic outranks the trig , so .
This is a Topic 6.11 integration by parts problem in Unit 6, which weights 15 to 20 percent of the exam. Its close relative uses the same setup with the roles of sine and cosine swapped.
Common mistakes with the integral of x cos x
- Multiplying antiderivatives. There is no product rule for integrals, so is not the answer.
- Getting the sign of wrong. Antidifferentiating gives ; it is differentiating that flips the sign, not antidifferentiating.
- Dropping the minus before and writing . Differentiate to check and the error shows up at once.
- Choosing . Legal but self-defeating, since makes the remaining integral harder.
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
What is the integral of x cos x?
It is , equivalently . Integration by parts with and gives .
Why does x cos x need integration by parts?
Because it is a product of two unrelated factors. Neither nor is the derivative of the other, so substitution has nothing to cancel. Parts reverses the product rule and reduces to the elementary integral of .
What is the definite integral of x cos x from 0 to pi/2?
It equals . Evaluate : at it is , and at it is , so the difference is .