The correct option is D −xcosx+sinx
The given function is a product of two functions. For functions u and v,
∫uvdx=u∫vdx−∫(dudx∫vdx)dx
Here, according to ILATE, we should take the algebraic function, x, as the first function and integrate
⇒∫ xsinxdx=x∫sinxdx−∫[ddx(x)∫sinxdx]dx
=x(−cosx)−∫[(1)(−cosx)]dx
=−xcosx+∫cosxdx
=−xcosx+sinx