<s>[INST] Find $\int \frac{x^2}{(x \cos x - \sin x)(x \sin x + \cos x)}dx $ Find $$\int \frac{x^2}{(x \cos x - \sin x)(x \sin x + \cos x)}dx $$
Any hints please?
Could'nt think of any approach till now...
 [/INST] Let $$I = \int\frac{x^2}{(x\sin x+\cos x)(x\cos x-\sin x)}dx$$
Now Put $x=2y\;,$ Then $dx = 2dy$
So $$I = \int \frac{2y^2}{(2y\sin 2y+\cos 2y)(2y\cos 2y-\sin 2y)}dy$$
So $$I = \int\frac{2y^2}{(y^2-1)\sin 2y+2y \cos 2y}dy$$
$$\bullet\; (y^2-1)\sin 2y+2y\cos 2y = (y^2+1)\left[\cos 2y\cdot \frac{2y}{1+y^2}+\sin 2y\cdot \frac{y^2-1}{1+y^2}\right]$$
$$\displaystyle = (y^2+1)\cos \left(2y-\alpha\right) = (y^2+1)\cos \left(2y-\tan^{-1}\left(\frac{y^2-1}{2y}\right)\right)$$
So $$I = \int \sec \left(2y-\tan^{-1}\left(\frac{y^2-1}{2y}\right)\right)\cdot \frac{2y^2}{1+y^2}dy$$
Now Put $\displaystyle \left(2y-\tan^{-1}\left(\frac{y^2-1}{2y}\right)\right)=z\;,$ Then $\displaystyle \frac{2y^2}{y^2+1}dy = dz$
So $$I = \int \sec z dz = \ln \left|\sec z+\tan z\right|+\mathcal{C} = \ln \left|\tan \left(\frac{\pi}{4}+\frac{z}{2}\right)\right|+\mathcal{C}$$
</s>