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?

As an alternate solution : why not to start using $\cos(2x)=1-2\sin^2(x)$ and $\sin(2x)=2 \sin(x)\cos(x)$. So, $$I=\int {\sin^2x \over 1 + \sin x\cos x}dx=\int \frac{1-\cos(2x)}{2+\sin(2x)}dx$$ Now, use the tangent half-angle substitution $t=\tan(x)$ to get $$I=\int\frac{4 t^2}{t^4+t^3+2 t^2+t+1}dt$$ Using partial fraction decomposition $$\frac{4 t^2}{t^4+t^3+2 t^2+t+1}=\frac{4 t}{t^2+1}-\frac{4 t}{t^2+t+1}$$ noticing that $$\frac{2 t}{t^2+t+1}=\frac{2 t+1-1}{t^2+t+1}=\frac{2 t+1}{t^2+t+1}-\frac{1}{t^2+t+1}$$
I am sure that you can take from here.
