The correct option is D −xcosx+sinx
We want to find the integral of x sinx. This is a product of two functions. We will use integration by parts to solve this. For two functions of x, u and v, the integral of product of these two functions is given by
∫uvdx=u∫vdx−∫(dudx∫vdx)dx
That is, the integral of the product of two functions = (first function) × (integral of the second function) – Integral of the product of [(derivative of the first function) and (integral of the second function)]
How do we decide the order of the functions we integrate? Well, there is one rule which will help us do this so that we don’t decide the wrong order and keep integrating forever or in some case get stuck inthe first step itself. It’s called the ILATE rule, which stands for Inverse, Logarithmic, Algebraic, Trigonometric and Exponential function. This is the order in which the first function should be chosen.
Here, according to ILATE rule, we should take the algebraic function, x, as the first function and integrate
⇒∫ xsin x dx=x∫sinx dx−∫[ddx(x)∫sinx dx]dx
=x(−cosx)−∫[(1)(−cosx)]dx
=−xcosx+∫cosx dx
=−xcosx+sinx