How do I evaluate the integral of $$\int { \frac { x^{ 2 } }{ (x\sin x+\cos x)^{ 2 } } dx } $$ in a simple way? The way I could do the question, was by multiplying and dividing the fraction by $\cos x$ - and it was my professor who gave that clue.
Is there an alternate way to solve this? And, if I were facing this question for the first time in an exam, how could I tackle it?
Here's an alternative approach:
If you see an integral which is made of a fraction with a squared term in the denominator and you have serious hopes that the integral is elementary then you might think of the quotient rule. Note that this tells you that $\int \frac{u'v-uv'}{v^2} dx=\frac{u}{v}+C$. So in this case you clearly have $v(x)=x\sin x+\cos x$ and you want to solve the following (differential) equation for $u$: $$x^2=(x\sin x+\cos x)u'-ux\cos x$$ Now using standard undetermined coefficients, it's reasonable to attempt a solution of the form $u(x)=(Ax+B)\sin x+(Cx+D)\cos x$. Plugging this into the DE and comparing coefficients you obtain $B=0, C=-1$ and $A=D$. So the easiest solution is $u(x)=\sin x-x\cos x$ and so you obtain $$\int \frac{x^2}{(x\sin x+\cos x)^2}=\frac{\sin x-x\cos x}{x\sin x+\cos x}+C$$