TITLE: Evaluating this integral $ \small\int \frac {x^2 dx} {(x\sin x+\cos x)^2} $
QUESTION [17 upvotes]: The question: 

Compute$$
\int \frac {x^2 \, \operatorname{d}\!x} {(x\sin x+\cos x)^2}
$$

Tried integration by parts. That didn't work.
How do I proceed?

REPLY [3 votes]: $$\int\frac{x^2}{(x\sin x+\cos x)^2}\mathrm{d}x = \int (x\sec x)\frac{x^2}{(x\sin x+\cos x)^2}\mathrm{d}x$$
Take $xsecx$ as first functions and apply integreation by parts. there you go boom!!