Integral $\int_0^\pi \frac{x\,\operatorname dx}{a^2\cos^2x+b^2\sin^2x}$ Integrate:
$$
\int_0^\pi \frac{x\,\operatorname dx}{a^2\cos^2x+b^2\sin^2x}
$$
 A: $$I=\int_0^\pi \frac{x\,\operatorname dx}{a^2\cos^2x+b^2\sin^2x}=\int_0^\pi \frac{(\pi-x)\,\operatorname dx}{a^2\cos^2x+b^2\sin^2x}$$
$$2I=\pi\int_0^\pi \frac{\operatorname dx}{a^2\cos^2x+b^2\sin^2x}=\pi\int_0^\pi \frac{\sec^2x\,\operatorname dx}{a^2+b^2\tan^2x}$$
$$\frac{2I}{\pi}=\int_0^{\pi}\frac{\operatorname d(\tan x)}{a^2+b^2\tan^2x}=\int_0^{\pi/2}\frac{\operatorname d(\tan x)}{a^2+b^2\tan^2x}+\int_{\pi/2}^{\pi}\frac{\operatorname d(\tan x)}{a^2+b^2\tan^2x}$$
$$\frac{2I}{\pi}=\frac1{ab}\arctan\left(\frac{b\tan x}{a}\right)|_0^{\pi/2}+|_{\pi/2}^{\pi}$$
$$I=\ldots\ldots$$
A: HINT:
Use $$\int_a^bf(x)dx=\int_a^bf(a+b-x)dx$$
Then divide by $\sec^2x$ and set $\tan x=u$
A: Hint:
We can find the anti-derivative,
$$\begin{align}
\int\frac{\mathrm{d}x}{a^2\cos^2{x}+b^2\sin^2{x}}
&=\int\frac{\sec^2{x}\,\mathrm{d}x}{a^2+b^2\tan^2{x}}\\
&=\int\frac{\mathrm{d}u}{a^2+b^2u^2}\\
&=\frac{\arctan{\frac{bu}{a}}}{ab}+\color{grey}{constant}\\
&=\frac{\arctan{\left(\frac{b\tan{x}}{a}\right)}}{ab}+\color{grey}{constant}.
\end{align}$$
Now integrate by parts.
