Evaluate the integral
$\int_0^{\pi}\frac{x}{a^2*\cos^2(x) + b^2*\sin^2(x)}\; dx$
In my textbook solution the integral has been split into intervals from $0$ to $\pi/4$ and then from $\pi/4$ to $\pi/2$. My question is what is the need to this? Why can't we compute the integral directly with $u=\tan x$ substitution? Any help would be appreciated.