Problem 159
Evaluate the integral: I = integral x cos x dx
Evaluate the integral: $$ I = \int x\cos x\,dx. $$
Explanation of Method
Integration by parts with $u=x$, $dv=\cos x\,dx$ leaves a leftover integral of $\sin x$ alone, which is elementary.
- Choose $u=x$, $dv=\cos x\,dx$.
- Differentiate $u$ and integrate $dv$.
- Apply the integration by parts formula and integrate the remainder.
Step 1 · Set up integration by parts
Let:
$$ u = x \quad \Rightarrow \quad du = dx, \qquad dv = \cos x\,dx \quad \Rightarrow \quad v = \sin x. $$
Step 2 · Apply the formula
$$ I = x\sin x - \int \sin x\,dx. $$
Step 3 · Integrate
Since $\int \sin x\,dx = -\cos x$:
$$ I = x\sin x - (-\cos x) + C = x\sin x + \cos x + C. $$
Summary Table
| Quantity | Value |
|---|---|
| $u$ | $x$ |
| $dv$ | $\cos x\,dx$ |
| Antiderivative | $x\sin x+\cos x$ |
Additional Notes
- The integrand is defined for all real $x$.
- This is the mirror image of Problem 158, with $\sin x$ and $\cos x$ swapped throughout; note that the sign pattern flips (here $+\cos x$, there $+\sin x$) because $\int\sin x\,dx=-\cos x$ carries an extra minus sign that $\int\cos x\,dx=\sin x$ does not.
- The result can be checked by differentiating $x\sin x+\cos x$ and confirming it returns $x\cos x$.
Result
The solution to the integral is:
$$
I = x\sin x + \cos x + C.
$$