Answer
\[\frac{x\sin^2 x}{2}-\frac{1}{4}x+\frac{\sin x\cos x}{4}+C\]
Work Step by Step
Let \[I=\int x(\sin x)\cos x dx\]
Substitute $\;\sin x=t\;\;\;\ldots (1) $
\[\Rightarrow dt=\cos x dx\]
\[I=\int (\sin^{-1}t)t \:dt\]
Using integration by parts
\[I=\sin^{-1}t\int tdt-\int\left((\sin^{-1}t)'\int tdt\right)dt+C_1\]
Where $C_1$ is constant of integration
\[I=\frac{t^2}{2}\sin^{-1}t-\frac{1}{2}\int\frac{t^2}{\sqrt{1-t^2}}dt+C_1\;\;\;\ldots (2)\]
Let \[I_1=\int\frac{t^2}{\sqrt{1-t^2}}dt\]
\[I_1=\int\frac{1-(1-t^2)}{\sqrt{1-t^2}}dt\]
\[I_1=\int\frac{1}{\sqrt{1-t^2}}dt-\int\sqrt{1-t^2}dt\]
\[\left[\int\frac{dx}{\sqrt{a^2-x^2}}=\sin^{-1}\left(\frac{x}{a}\right)\right]\]
\[\left[\int \sqrt{a^2-x^2}dx=\frac{x}{2}\sqrt{a^2-x^2}+\frac{a^2}{2}\sin^{-1}\left(\frac{x}{a}\right)\right]\]
\[I_1=\sin^{-1}t-\left[\frac{t}{2}\sqrt{1-t^2}+\frac{1}{2}\sin^{-1}t\right]+C_2\]
Where $C_2$ ia constant of integration
\[I_1=\frac{1}{2}\sin^{-1}t-\frac{t}{2}\sqrt{1-t^2}+C_2\]
Using (3) in (2)
\[I=\frac{t^2}{2}\sin^{-1}t-\frac{1}{2}\left[\frac{1}{2}\sin^{-1}t-\frac{t}{2}\sqrt{1-t^2}+C_2\right]+C_1\]
\[I=\frac{t^2}{2}\sin^{-1}t-\frac{1}{4}\sin^{-1}t+\frac{t}{4}\sqrt{1-t^2}+\left(C_1-\frac{1}{2}C_2\right)\]
From (1)
\[I=\frac{x\sin^2 x}{2}-\frac{1}{4}x+\frac{\sin x\cos x}{4}+C\]
Where $C=C_1-\frac{1}{2}C_2$
Hence \[I=\frac{x\sin^2 x}{2}-\frac{1}{4}x+\frac{\sin x\cos x}{4}+C\;\;.\]