Let \(D=x\sin x+\cos x\); then \(\frac{dD}{dx}=x\cos x\) and \(\int\frac{x\cos x}{D^2}dx=-\frac{1}{D}\).
\(\int\frac{x^2}{D^2}dx=\int (x\sec x)\cdot\frac{x\cos x}{D^2}dx=-\frac{x\sec x}{D}+\int\frac{\sec x+x\sec x\tan x}{D}dx\).
Now \(\sec x+x\sec x\tan x=\frac{\cos x+x\sin x}{\cos^2x}=\frac{D}{\cos^2 x}\), so the last integral is \(\int\sec^2x\,dx=\tan x\).
Hence the integral \(=\tan x-\frac{x\sec x}{x\sin x+\cos x}+C\).
Answer: (4) \(\tan x-\frac{x\sec x}{x\sin x+\cos x}+C\)