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 double-angle formula, we get
$$I=\int_{0}^{\frac{\pi}{2}} \frac{1-\cos 2 x}{2+\sin 2 x} d x$$
$$I\stackrel{x\mapsto\frac{\pi}{4}-x}{=} 2 \int_{0}^{\frac{\pi}{4}} \frac{1}{2+\cos 2 x} d x-\int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \frac{\sin 2 x}{2+\cos 2 x} d x$$
Since $\dfrac{1}{2+\cos 2 x}$ is even and $\dfrac{\sin 2 x}{2+\cos 2 x}$ is odd, therefore
$$ \displaystyle I=2 \int_{0}^{\frac{\pi}{4}} \frac{1}{1+2 \cos ^{2} x} d x$$
$$\displaystyle I=2 \int_{0}^{\frac{\pi}{4}} \frac{\sec ^{2} x}{\sec ^{2} x+2} d x
\displaystyle \stackrel{t=\tan x}{=} 2 \int_{0}^{1} \frac{d t}{3+t^{2}}=\dfrac{\pi}{3 \sqrt{3}} $$
