Skip to content
Worked Examples · Example 17

Q.Find ∫xcos⁡x dx\int x \cos x\, dx

Odisha ChseTextbookSubjective· 3mImportance★★★★★
Appeared in past exams:KEAM 2024· Set eng-2024-0609· 4mexact
40% · 150/373 Questions
✓ Free question

The integral ∫xcos⁡x dx\int x \cos x \, dx is solved using integration by parts (the product rule in reverse). Choosing u=xu = x and dv=cos⁡x dxdv = \cos x \, dx gives the result xsin⁡x+cos⁡x+Cx \sin x + \cos x + C.

Why integration by parts?

When you see a product of two different kinds of functions — here xx (algebraic) and cos⁡x\cos x (trigonometric) — there’s no simple reverse derivative. The product rule for differentiation says (uv)′=u′v+uv′(uv)' = u'v + uv', so rearranging gives:

∫u dv=uv−∫v du\int u \, dv = uv - \int v \, du

This is integration by parts. The trick is to pick uu so that dudu is simpler, and dvdv so that vv is easy to integrate.

Tip

A handy mnemonic for choosing uu is LIATE: Logarithmic, Inverse trig, Algebraic, Trigonometric, Exponential. Pick uu from the leftmost type in the product. Here xx is Algebraic, cos⁡x\cos x is Trigonometric — so u=xu = x wins.


Step-by-step solution

1. Choose uu and dvdv

Let u=xu = x and dv=cos⁡x dxdv = \cos x \, dx.

Why? Because du=dxdu = dx becomes simpler (the power drops), and v=sin⁡xv = \sin x is easy to integrate.

2. Compute dudu and vv

du=dxdu = dx

v=∫cos⁡x dx=sin⁡xv = \int \cos x \, dx = \sin x

3. Apply the integration by parts formula

∫xcos⁡x dx=xsin⁡x−∫sin⁡x dx\int x \cos x \, dx = x \sin x - \int \sin x \, dx

Note

The minus sign comes from uv−∫v duuv - \int v \, du. Don’t forget it — a common slip is to write ++ instead.

4. Integrate the remaining term

∫sin⁡x dx=−cos⁡x+C\int \sin x \, dx = -\cos x + C

So:

∫xcos⁡x dx=xsin⁡x−(−cos⁡x)+C=xsin⁡x+cos⁡x+C\int x \cos x \, dx = x \sin x - (-\cos x) + C = x \sin x + \cos x + C

5. Check by differentiating

Differentiate xsin⁡x+cos⁡xx \sin x + \cos x:

  • Derivative of xsin⁡xx \sin x: using product rule, 1⋅sin⁡x+x⋅cos⁡x=sin⁡x+xcos⁡x1 \cdot \sin x + x \cdot \cos x = \sin x + x \cos x
  • Derivative of cos⁡x\cos x: −sin⁡x-\sin x

Sum: sin⁡x+xcos⁡x−sin⁡x=xcos⁡x\sin x + x \cos x - \sin x = x \cos x — matches the integrand. Perfect.

Watch out

A common mistake is to choose u=cos⁡xu = \cos x and dv=x dxdv = x \, dx. Then du=−sin⁡x dxdu = -\sin x \, dx and v=x22v = \frac{x^2}{2}, leading to x22cos⁡x+12∫x2sin⁡x dx\frac{x^2}{2} \cos x + \frac{1}{2} \int x^2 \sin x \, dx — a harder integral. Always pick uu so that dudu is simpler.

✓Final answer

The integral is xsin⁡x+cos⁡x+C\boxed{x \sin x + \cos x + C}.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.