<s>[INST] 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$.
 [/INST] After substituting $\cos(2x)=\cos^2x-\sin^2x$ and $\sin(2x)=2\sin x\cos x$ and doing a bit of algebra, we find that
$$2x\cos(2x)+(x^2-1)\sin(2x)=2(x\sin x+\cos x)(x\cos x-\sin x)$$
and thus
$$\begin{align}{2x^2\over 2x\cos(2x)+(x^2-1)\sin(2x)}
&={x^2\over(x\sin x+\cos x)(x\cos x-\sin x)}\\
&={x\cos x\over x\sin x+\cos x}+{x\sin x\over x\cos x-\sin x}\end{align}$$
The substitution $u=x\sin x+\cos x$, $du=x\cos x\,dx$ tells us
$$\int{x\cos x\over x\sin x+\cos x}\,dx=\int{du\over u}=\ln|u|+C=\ln|x\sin x+\cos x|+C$$
while the substitution $u=x\cos x-\sin x$, $du=-x\sin x$ tells us
$$\int{x\sin x\over x\cos x-\sin x}\,dx=-\int{du\over u}=-\ln|u|+C = -\ln|x\cos x-\sin x|+C$$
and thus
$$\int{2x^2\over 2x\cos(2x)+(x^2-1)\sin(2x)}\,dx=\ln\left|x\sin x+\cos x\over x\cos x-\sin x\right|+C$$
Remark: The key here was to get split the integral into two pieces, each of which is easily handled with a simple substitution. The two pieces' substitutions are similar, but not the same. It was not obvious (to me, at least) that the double-angle formulae would lead to a nice factorization, nor that "partial fractions" on the factored denominator would produce such nice results, but the individual steps seemed natural to consider. 
</s>