<s>[INST] How to integrate this : $\int \frac{x^2+\cos^2 x}{1+x^2}\csc^2xdx$ How to integrate : 
$\int \frac{x^2+\cos^2x}{1+x^2}\csc^2xdx$ 
I am not getting any clue how to move further, request you to please provide hint, will be of great help. 
Thanks..
 [/INST] Before integrating, let's do some changes
$$\frac{(x^2+\cos^2 x)\csc^2x}{1+x^2}=\frac{x^2\csc^2x+\cos^2 x\csc^2x}{1+x^2}=\frac{x^2\csc^2x+\cot^2 x}{1+x^2}=\frac{x^2\csc^2x+\csc^2 x-1}{1+x^2}=\frac{-1+(1+x^2)\csc^2x}{1+x^2}=-\frac{1}{1+x^2}+\csc^2x.$$
But 
$$\int -\frac{1}{1+x^2}dx=-\arctan x+C$$
and
$$\int \csc^2xdx=-\cot x+C.$$
So 
$$\int \frac{(x^2+\cos^2 x)\csc^2x}{1+x^2}dx=-\arctan x-\cot x+C.$$
</s>