Answer
\[x\sin x+\cos x+C\]
Where $C$ is constant of integration
Work Step by Step
Let \[I=\int x\cos x dx\]
Using integration by parts
\[I=x\int \cos xdx-\int\left[ (x)'\int\cos xdx\right]dx\]
\[I=x(\sin x)-\int \sin x\:dx\]
\[I=x\sin x-(-\cos x)+C\]
\[I=x\sin x+\cos x+C\]
Where $C$ is constant of integration
Hence ,
\[I=x\sin x+\cos x+C\]