Integrating $\int_0^{\pi/2} {\sin^2x \over 1 + \sin x\cos x}dx$ We need to evaluate $\displaystyle \int_0^{\pi/2} {\sin^2x \over 1 + \sin x\cos x}dx$
and some solution to this starts as,
$\displaystyle\int_0^{\pi/2} {\sin^2x \over 1 + \sin x\cos x}dx = 
\int_0^{\pi/2} {\{\sin(\pi/2 -x)\}^2 \over 1 + \sin (\pi/2 -x)\cos (\pi/2 -x)}dx$.
We fail to understand how this step has been carried out. Even variable substitution
does not seem to work.
Do you think that you could give us a hint?

Using $\displaystyle\int_a^bf(x)\ dx=\int_a^bf(a+b-x)\ dx,$
$\displaystyle I=\int_0^\frac\pi2\frac{\sin^2x}{1+\sin x\cos x}dx=\int_0^\frac\pi2\frac{\cos^2x}{1+\sin x\cos x}dx$
$\displaystyle2I=\int_0^\frac\pi2\frac1{1+\sin x\cos x}dx=\int_0^\frac\pi2\frac{\sec^2x}{1+\tan^2x+\tan x}dx$
Setting $\tan x=u$
$\displaystyle2I=\int_0^\infty\frac{dt}{1+t+t^2}=4\int_0^\infty\frac{dt}{(2t+1)^2+(\sqrt3)^2}$
Set $2t+1=\sqrt3\tan\theta$
