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?
 A: 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.
A: 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$
A: I think expand $sin(\frac{\pi}{2} -2)$ and $cos(\frac{\pi}{2} -2)$ by using sine rule and cosine rule will make it clearer and easier to integrate.
A: 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}} $$
