# How do you integrate int xcosx by parts from [0,pi/2]?

Nov 21, 2016

${\int}_{0}^{\frac{\pi}{2}} x \cos x \mathrm{dx} = \frac{\pi}{2} - 1$

#### Explanation:

Parts formula.

$\int u \frac{\mathrm{dv}}{\mathrm{dx}} \mathrm{dx} = u v - \int v \frac{\mathrm{du}}{\mathrm{dx}} \mathrm{dx}$

${\int}_{0}^{\frac{\pi}{2}} x \cos x \mathrm{dx}$

$u = x \implies \frac{\mathrm{du}}{\mathrm{dx}} = 1$

$\frac{\mathrm{dv}}{\mathrm{dx}} = \cos x \implies v = \sin x$

$I = {\left[x \sin x - \int \left(\sin x\right) \mathrm{dx}\right]}_{0}^{\frac{\pi}{2}}$

$I = {\left[x \sin x + \cos x\right]}_{0}^{\frac{\pi}{2}}$

now substitute the limits in

$I = \left[\left(\frac{\pi}{2}\right) \sin \left(\frac{\pi}{2}\right) + \cos \left(\frac{\pi}{2}\right)\right] - \left[0 \times \sin 0 + \cos 0\right]$

$I = \left[\left(\frac{\pi}{2}\right) {\cancel{\sin \left(\frac{\pi}{2}\right)}}^{1} + {\cancel{\cos \left(\frac{\pi}{2}\right)}}^{0}\right] - \left[{\cancel{0 \times \sin 0}}^{0} + {\cancel{\cos 0}}^{1}\right]$

${\int}_{0}^{\frac{\pi}{2}} x \cos x \mathrm{dx} = \frac{\pi}{2} - 1$