Evaluate ∫₀^π xsinx dx using integration by parts

hard CBSE JEE-MAIN 3 min read

Question

Evaluate 0πxsinxdx\displaystyle\int_0^{\pi} x\sin x \, dx using integration by parts.


Solution — Step by Step

Integration by parts formula:

udv=uvvdu\int u \, dv = uv - \int v \, du

Using the ILATE rule (Inverse trig → Logarithmic → Algebraic → Trigonometric → Exponential), we choose the function that comes first in ILATE as uu.

Here we have xx (Algebraic) and sinx\sin x (Trigonometric). Algebraic comes before Trigonometric in ILATE.

So: u=xu = x, dv=sinxdxdv = \sin x \, dx

u=x    du=dxu = x \implies du = dx dv=sinxdx    v=sinxdx=cosxdv = \sin x \, dx \implies v = \int \sin x \, dx = -\cos x xsinxdx=uvvdu\int x\sin x \, dx = uv - \int v \, du =x(cosx)(cosx)dx= x(-\cos x) - \int (-\cos x) \, dx =xcosx+cosxdx= -x\cos x + \int \cos x \, dx =xcosx+sinx+C= -x\cos x + \sin x + C

Now evaluate from 00 to π\pi:

[xcosx+sinx]0π\left[-x\cos x + \sin x\right]_0^{\pi}

At x=πx = \pi:

πcosπ+sinπ=π(1)+0=π-\pi\cos\pi + \sin\pi = -\pi(-1) + 0 = \pi

At x=0x = 0:

0cos0+sin0=0+0=0-0 \cdot \cos 0 + \sin 0 = 0 + 0 = 0 0πxsinxdx=π0=π\therefore \int_0^{\pi} x\sin x \, dx = \pi - 0 = \boxed{\pi}

Why This Works

Integration by parts is derived from the product rule for differentiation:

ddx(uv)=udvdx+vdudx\frac{d}{dx}(uv) = u\frac{dv}{dx} + v\frac{du}{dx}

Rearranging and integrating both sides:

udvdxdx=uvvdudxdx\int u\frac{dv}{dx} dx = uv - \int v\frac{du}{dx} dx

The key idea is that we “transfer” the differentiation burden from one factor to another. By choosing u=xu = x (which simplifies to a constant when differentiated) and dv=sinxdxdv = \sin x \, dx (easy to integrate), we reduce the problem from “integrate xsinxx \sin x” to “integrate cosx\cos x” — much simpler.


Alternative Method — King’s Property

For this particular integral, there’s an elegant shortcut using the King’s property of definite integrals:

0af(x)dx=0af(ax)dx\int_0^a f(x) \, dx = \int_0^a f(a-x) \, dx

Let I=0πxsinxdxI = \int_0^{\pi} x\sin x \, dx

Apply King’s property with a=πa = \pi, replacing xx with (πx)(\pi - x):

I=0π(πx)sin(πx)dx=0π(πx)sinxdxI = \int_0^{\pi} (\pi - x)\sin(\pi - x) \, dx = \int_0^{\pi} (\pi - x)\sin x \, dx

(since sin(πx)=sinx\sin(\pi - x) = \sin x)

Adding both expressions:

2I=0πxsinxdx+0π(πx)sinxdx=0ππsinxdx2I = \int_0^{\pi} x\sin x \, dx + \int_0^{\pi} (\pi - x)\sin x \, dx = \int_0^{\pi} \pi\sin x \, dx 2I=π[cosx]0π=π(cosπ+cos0)=π(1+1)=2π2I = \pi \left[-\cos x\right]_0^{\pi} = \pi(-\cos\pi + \cos 0) = \pi(1 + 1) = 2\pi I=πI = \pi

Same answer — but this method avoids integration by parts entirely.

In JEE Main, King’s property (sometimes called the “mirror property”) is one of the most time-saving tricks for symmetric definite integrals. Whenever you see 0π\int_0^{\pi} with expressions involving xx and sinx\sin x or cosx\cos x, check if King’s property simplifies it before reaching for integration by parts.


Common Mistake

The most common error: forgetting the negative sign when integrating sinx\sin x. Students write sinxdx=cosx\int \sin x \, dx = \cos x instead of cosx-\cos x. This flips the sign of the entire solution. Always double-check: ddx(cosx)=sinx\frac{d}{dx}(-\cos x) = \sin x — yes, the negative sign is correct.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next