Evaluate $\int_{0}^{\pi/2}\frac{x}{(a^2\cos^2x+b^2\sin^2x)}dx$ The question is to evaluate this definite integral: 
$$\int_{0}^{\pi/2}\frac{x}{(a^2\cos^2x+b^2\sin^2x)}dx$$
I know the definite integration with limits from $0$ to $\pi$, where we use the identity $\int_{a}^{b}f(x)dx = \int_{a}^{b}f(a+b-x)dx$, but it obviously cannot be used here. I also tried breaking the $0$ to $\pi$ one into two parts to no avail. Since the other one had such a simple solution, I can't wrap my head around this one, and would love some help!

Write $\alpha = a/b$ and substitute $\tan x = \alpha t$ to obtain
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{a^2\cos^2 x + b^2\sin^2 x} \, dx
=  \frac{1}{ab} \int_{0}^{\infty} \frac{\arctan(\alpha t)}{1 + t^2} \, dt
=: \frac{1}{ab}I(\alpha). $$
Then
\begin{align*}
I'(\alpha)
&= \int_{0}^{\infty} \frac{t}{(1+t^2)(1+\alpha^2 t^2)} \, dt \\
&\hspace{1.5em} = \left[ -\frac{1}{2(1-\alpha^2)} \log\left( \frac{1+\alpha^2 t^2}{1+t^2} \right) \right]_{0}^{\infty}
 = -\frac{\log \alpha}{1 - \alpha^2}.
\end{align*}
Now it is easy to check that, if we write $\chi_2(z) = \int_{0}^{z} \frac{\operatorname{artanh} \xi}{\xi} \, d\xi$ for the Legendre chi function, then
$$ \frac{d}{d\alpha} \chi_2\left(\frac{1-\alpha}{1+\alpha}\right) = \frac{\log \alpha}{1-\alpha^2}. $$
So it follows that
$$ I(\alpha) = \chi_2(1) - \chi_2\left(\frac{1-\alpha}{1+\alpha}\right) = \frac{\pi^2}{8} + \chi_2\left(\frac{\alpha-1}{\alpha+1}\right). $$
Plugging this back and manipulating a bit, we obtain
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{a^2\cos^2 x + b^2\sin^2 x} \, dx
= \frac{1}{ab} \left( \frac{\pi^2}{8} + \chi_2\left(\frac{a-b}{a+b}\right) \right). $$
