# How do you find the antiderivative of int (xsinxcosx) dx?

##### 1 Answer
Nov 7, 2016

$: \int \left(x \sin x \cos x\right) \mathrm{dx} = \frac{1}{8} \sin \left(2 x\right) - \frac{1}{4} x \cos \left(2 x\right) + C$

#### Explanation:

If you are studying maths, then you should learn the formula for Integration By Parts (IBP), and practice how to use it:

$\int u \frac{\mathrm{dv}}{\mathrm{dx}} \mathrm{dx} = u v - \int v \frac{\mathrm{du}}{\mathrm{dx}} \mathrm{dx}$, or less formally $\int u \mathrm{dv} = u v - \int v \mathrm{du}$

I was taught to remember the less formal rule in word; "The integral of udv equals uv minus the integral of vdu". If you struggle to remember the rule, then it may help to see that it comes a s a direct consequence of integrating the Product Rule for differentiation.

Essentially we would like to identify one function that simplifies when differentiated, and identify one that simplifies when integrated (or is at least is integrable).

Firstly we need to chage the integrand to simplify it to a product of two functions whereas currently we have a product of three;

Using, $\sin \left(2 x\right) = 2 \sin x \cos x$ we can write
$\int \left(x \sin x \cos x\right) \mathrm{dx} = \int \frac{1}{2} x \sin \left(2 x\right) \mathrm{dx} = \frac{1}{2} \int x \sin \left(2 x\right) \mathrm{dx}$

So for the integrand $x \sin \left(2 x\right)$, hopefully you can see that $x$ simplifies when differentiated and sin(2x) changes to $A \cos \left(2 x\right)$.

Let $\left\{\begin{matrix}u = x & \implies & \frac{\mathrm{du}}{\mathrm{dx}} = 1 \\ \frac{\mathrm{dv}}{\mathrm{dx}} = \sin \left(2 x\right) & \implies & v = - \frac{1}{2} \cos \left(2 x\right)\end{matrix}\right.$

Then plugging into the IBP formula givs us:
$\int \left(u\right) \left(\frac{\mathrm{dv}}{\mathrm{dx}}\right) \mathrm{dx} = \left(u\right) \left(v\right) - \int \left(v\right) \left(\frac{\mathrm{du}}{\mathrm{dx}}\right) \mathrm{dx}$
$\therefore \int \left(x\right) \left(\sin \left(2 x\right)\right) \mathrm{dx} = \left(x\right) \left(- \frac{1}{2} \cos \left(2 x\right)\right) - \int \left(- \frac{1}{2} \cos \left(2 x\right)\right) \left(1\right) \mathrm{dx}$
$\therefore \int \left(x\right) \left(\sin \left(2 x\right)\right) \mathrm{dx} = - \frac{1}{2} x \cos \left(2 x\right) + \frac{1}{2} \int \cos \left(2 x\right) \mathrm{dx}$
$\therefore \int \left(x\right) \left(\sin \left(2 x\right)\right) \mathrm{dx} = - \frac{1}{2} x \cos \left(2 x\right) + \frac{1}{2} \left(\frac{1}{2} \sin \left(2 x\right)\right)$
$\therefore \int \left(x\right) \left(\sin \left(2 x\right)\right) \mathrm{dx} = - \frac{1}{2} x \cos \left(2 x\right) + \frac{1}{4} \sin \left(2 x\right) + C '$

So then,
$\int \left(x \sin x \cos x\right) \mathrm{dx} = \frac{1}{2} \left\{- \frac{1}{2} x \cos \left(2 x\right) + \frac{1}{4} \sin \left(2 x\right)\right\} + C$
$\therefore \int \left(x \sin x \cos x\right) \mathrm{dx} = \frac{1}{8} \sin \left(2 x\right) - \frac{1}{4} x \cos \left(2 x\right) + C$