# Use integration by parts to find  int xsin(pix) dx?

Jul 12, 2017

$\int \setminus x \sin \left(\pi x\right) \setminus \mathrm{dx} = \sin \frac{\pi x}{\pi} ^ 2 - \frac{x \cos \left(\pi x\right)}{\pi} + C$

#### Explanation:

We could use integration by parts or try a bit of guess work by trying some suitable function to differentiate and seeing if we can find the solution.

Consider how the product rule works:

$\frac{d}{\mathrm{dx}} \left(u v\right) = u \frac{\mathrm{dv}}{\mathrm{dx}} + \frac{\mathrm{du}}{\mathrm{dx}} v$

So if we tried $y = x \cos \left(a x\right)$ we will end up with something close to what we need:

$y = x \cos \left(a x\right)$

Differentiate wrt $x$:

$\frac{\mathrm{dy}}{\mathrm{dx}} = x \left(\frac{d}{\mathrm{dx}} \cos \left(a x\right)\right) + \frac{d}{\mathrm{dx}} \left(x\right) \left(\cos \left(a x\right)\right)$
$\frac{\mathrm{dy}}{\mathrm{dx}} = - a x \sin \left(a x\right) + \cos \left(a x\right)$

So we have:

$\frac{d}{\mathrm{dx}} \left(x \cos \left(a x\right)\right) = \cos \left(a x\right) - a x \sin \left(a x\right)$

In other words (by FTOC):

$\int \setminus \cos \left(a x\right) - a x \sin \left(a x\right) \setminus \mathrm{dx} = x \cos \left(a x\right) + c$

$\therefore \int \setminus \cos \left(a x\right) \setminus \mathrm{dx} - \int \setminus a x \sin \left(a x\right) \setminus \mathrm{dx} = x \cos \left(a x\right) + c$

$\therefore \frac{1}{a} \sin \left(a x\right) - \int \setminus a x \sin \left(a x\right) \setminus \mathrm{dx} = x \cos \left(a x\right) + c$

$\therefore \int \setminus a x \sin \left(a x\right) \setminus \mathrm{dx} = \frac{1}{a} \sin \left(a x\right) - x \cos \left(a x\right) - c$

$\therefore \int \setminus x \sin \left(a x\right) \setminus \mathrm{dx} = \sin \frac{a x}{a} ^ 2 - \frac{x \cos \left(a x\right)}{a} - \frac{c}{a}$

$\therefore \int \setminus x \sin \left(a x\right) \setminus \mathrm{dx} = \sin \frac{a x}{a} ^ 2 - \frac{x \cos \left(a x\right)}{a} + C$

Hence:

$\int \setminus x \sin \left(\pi x\right) \setminus \mathrm{dx} = \sin \frac{\pi x}{\pi} ^ 2 - \frac{x \cos \left(\pi x\right)}{\pi} + C$