How can I prove the following equality I have the following equality :
$$I_1=-\frac{ab}{2\pi}\int_0^\pi \frac{\cos(2t)}{a^2\sin^2(t)+b^2\cos^2(t)}dt=\frac{a}{a+b}-\frac{1}{2}$$
$$I_2=-\frac{ab}{2\pi}\int_0^\pi \frac{\sin(2t)}{a^2\sin^2(t)+b^2\cos^2(t)}dt=0$$
where $0 <b \leq a$.
I used the residues but I could not prove this equality

One trick to facilitate analysis is to write
$$\sin^2x=\frac{1-\cos 2x}{2}$$
and
$$\cos^2x=\frac{1+\cos 2x}{2}$$
Thus, 
$$a^2\sin^2(t)+b^2\cos^2(t)=\frac{b^2+a^2}{2}+\frac{b^2-a^2}{2}\cos 2t$$
For the integral of interest, we can write
$$\begin{align}
I_1&=-\frac{ab}{2\pi}\int_0^{\pi} \frac{\cos(2t)}{a^2\sin^2(t)+b^2\cos^2(t)}dt\\\\
&=-\frac{ab}{4\pi}\int_0^{2\pi}\frac{\cos t}{\frac{b^2+a^2}{2}+\frac{b^2-a^2}{2}\cos t}dt\\\\
&=-\frac{ab}{2\pi(b^2-a^2)}\int_0^{2\pi}\frac{\cos t}{\frac{b^2+a^2}{b^2-a^2}+\cos t}dt\\\\
&=-\frac{ab}{(b^2-a^2)}+\frac{ab(b^2+a^2)}{2\pi(b^2-a^2)^2}\int_0^{2\pi}\frac{1}{\frac{b^2+a^2}{b^2-a^2}+\cos t}dt
\end{align}$$
Can you finish now?
SPOLIER ALERT
SCROLL OVER SHADED AREA TO SEE ANSWER

Starting with the last term $I_1=-\frac{ab}{(b^2-a^2)}+\frac{ab(b^2+a^2)}{2\pi(b^2-a^2)^2}\int_0^{2\pi}\frac{1}{\frac{b^2+a^2}{b^2-a^2}+\cos t}dt$, we move to the complex plane by letting $z=e^{it}$.  Then, $I_1$ becomes $$\begin{align}I_1&=-\frac{ab}{(b^2-a^2)}+\frac{ab(b^2+a^2)}{2\pi(b^2-a^2)^2}\oint_C \frac{-2i}{z^2+2\frac{b^2+a^2}{b^2-a^2}\,z+1}dz\\\\&=-\frac{ab}{(b^2-a^2)}+\frac{ab(b^2+a^2)}{2\pi(b^2-a^2)^2}\left(2\pi i \frac{-2i}{-2\frac{2ab}{a^2-b^2}}\right)\\\\&=-\frac{ab}{(b^2-a^2)}-\frac{a^2+b^2}{2(a^2-b^2)}\\\\&=\frac12 -\frac{a}{a+b}\end{align}$$which differs from the posted answer by a factor of $-1$.  For $a=2$ and $b=1$, Wolfram Alpha confirms the value of the integral as $-1/6$ agreeing with the answer herein, whereas the posted answer is $+1/6$.


For $I_2$, enforce the substitution $t= \pi -x$.  Then, we see 
$$\begin{align}
I_2&=\int_0^{\pi} \frac{\sin(2t)}{a^2\sin^2(t)+b^2\cos^2(t)}dt\\\\
&=\int_{\pi}^{0} \frac{\sin 2(\pi-x)}{a^2\sin^2(\pi-x)+b^2\cos^2(\pi-x)}(-1)dx\\\\
&=\int_{0}^{\pi} \frac{-\sin (2x)}{a^2\sin^2(x)+b^2\cos^2(x)}dx\\\\
&=-I_2
\end{align}$$
Thus, we have $I_2=-I_2$ which, of course, implies $I_2=0$ as expected!
