Integral $\int\frac{2x^2}{2x\cos(2x)+(x^2-1)\sin(2x)} \mathrm d x$ 
Integrate  $\displaystyle\int\dfrac{2x^2}{2x\cos(2x)+(x^2-1)\sin(2x)} \mathrm d x$

I tried dividing by $\cos^2(x)$ and then substituting $\tan(x)=t$.

Here's a solution using @MichaelRozenberg's hint. Solution requires some careful observation and without Michael's hint, I wouldn't have noticed it. Still, it provides a quick answer. 
Using double-angle formula, we get 
$$\dfrac{2x^2}{2x\cos(2x)+(x^2-1)\sin(2x)}=\dfrac{x^2}{(x\cos x-\sin x)(x\sin x+\cos x)}.$$
Dividing the numerator and denominator by  $\cos^2x $ gives, $$\dfrac{x^2\sec^2x}{(x-\tan x)(x\tan x+1)}.$$
Now observe that $$\left(\dfrac{x-\tan x}{x\tan x+1}\right)^{'}=\dfrac{-x^2\sec^2x}{(x\tan x+1)^2}.$$
So multiply the numerator and denominator by $x\tan x+1$ and take $\dfrac{x-\tan x}{x\tan x+1}=t. $
