# Evaluate the following: $\int\limits_0^\pi x\sin x\cos^2xdx$

Toolbox:
• Method of integration by parts
• $\int udv=uv-\int vdu$
• $\sin ^3x=3\sin x-4 \sin ^3x$
Step 1:
Let $I=\int\limits_0^\pi x\sin x\;\cos^2xdx$
$\cos ^2 x=1-\sin ^2x$
Hence $\int\limits_0^\pi x\sin x(1-\sin ^2x)dx$
$=\int\limits_0^\pi (x\sin x-x \sin ^3 x) dx$
$=\int\limits_0^\pi x\sin x dx-\int\limits_0^\pi x\sin ^3x dx$
$\sin 3x=3 \sin x-4 \sin ^3 x$
Therefore $sin ^3 x=\large\frac{3 \sin x-\sin 3x}{4}$
$I=\int\limits_0^\pi x\sin x dx- \int\limits_0^\pi x \bigg[\large\frac{3 \sin x-\sin 3x}{4}\bigg]$$dx On simplifying we get, =\int\limits_0^\pi x\sin x dx-\frac{3}{4}\int\limits_0^\pi x\sin x +\frac{1}{4} \int\limits_0^\pi x\sin 3x dx I=\large\frac{1}{4}$$\int\limits_0^\pi x\sin x dx+\frac{1}{4}\int\limits_0^\pi x\sin 3x dx$
Step 2:
Let us take as $I=\large\frac{1}{4}$$[I_1+I_2] I_1=\int\limits_0^\pi x\sin x dx This can be solved by the method of integration by parts \int udv=uv-\int vdu Here let u=x, on differentiating with respect to x we get, du=dx Let dv=\sin x dx , on integrating we get v=-\cos x Now substituting for u,v,du and dv we get, \int\limits_0^\pi x\sin x dx=x(-\cos x)-\int\limits_0^\pi -\cos x dx =-(x \cos x)_0^{\pi}+\int\limits_0^\pi \cos x dx On integrating we get, I_1=-[x \cos x]_0^{\pi}+[\sin x]_0^{\pi} On applying limits we get I_1=-[\pi. \cos \pi -0]+[\sin \pi -\sin 0] \sin \pi=0\;and\;\cos \pi=-1\;and\; \sin 0=0 Therefore I_1=-[\pi(-1)]+0 I_1=\pi Step 3: Consider I_2 =\int\limits_0^\pi x \sin 3x dx Similarly, let us solve this by the method of integration. Let u=x, on differentiating we get du=dx Let dv=\sin 3xdx, on integrating we get v=\frac{-1}{3} \cos 3x Now substituting for u,v,du and dv we get, \int\limits_0^\pi x\sin 3x dx=x(-\frac{1}{3}\cos x)_0^{\pi}+\frac{1}{3}\int\limits_0^\pi \cos 3x dx On integrating we get, =\large-\frac{1}{3}$$[x \cos 3x]_0^{\pi}+$$\large\frac{1}{3}[\frac{1}{3}$$\sin 3x]_0^{\pi}$
$=\large-\frac{1}{3}$$[x \cos 3x]_0^{\pi}+$$\large\frac{1}{9}$$[\sin 3x]_0^{\pi} On applying limits we get, I_2=-\frac{1}{3} [\pi \cos 3 \pi -0]+\frac{1}{9}[\sin 3 \pi-\sin 0] \sin 3\pi=\sin 0=0 and \cos 3 \pi =-1 Therefore I_2 =\large-\frac{1}{3}$$[\pi(-1)]+0$
$=\large\frac{1}{3} \pi$
Step 4: