<s>[INST] Calculation of $\int\frac{x^2 \left(\sin 2x - \cos 2x\right)}{\left(1+\sin 2x\right)\cos^2 x}dx$ Calculation of $\displaystyle \int\frac{x^2 \left(\sin 2x - \cos 2x\right)}{\left(1+\sin 2x\right)\cos^2 x}dx$
$\bf{My\; Try}::$ We can write the given Integral as $\displaystyle \int\frac{x^2 \left\{(1+\sin 2x)-(1+\cos 2x)\right\}}{(1+\sin 2x)\cos^2 x}dx$
$\displaystyle  = \int\frac{x^2}{\cos^2 x}dx - \int \frac{2x^2}{1+\sin 2x}dx$
$\displaystyle  = \int x^2 \sec^2 xdx - \int\frac{x^2}{\cos^2 \left(\frac{\pi}{4}-x\right)}dx$
$\displaystyle = \int x^2 \sec^2 xdx - \int x^2 \sec^2 \left(\frac{\pi}{4}-x\right)dx$
Now I did not understand how can i solve that
Help Required
Thanks
 [/INST] My hint
$$\int x^2d(\tan x)+\int x^2d(\tan(\frac{\pi}{4}-x))=x^2(\tan x+\tan(\frac{\pi}{4}-x))-2\int x(\tan x+\tan(\frac{\pi}{4}-x))dx$$
$$\int x(\tan x+\tan(\frac{\pi}{4}-x))dx=\int \frac{x}{\cos x(\sin x+\cos x)}dx$$
This is the result.
</s>