<s>[INST] Definite integration of a trigonometric function 
How to integrate $$\int_0^{\pi/2}\!\dfrac{2a \sin^2 x}{a^2
\sin^2 x +b^2 \cos^2 x}\,dx $$

my first step is $$\frac{2}{a} \int_0^{\pi/2}\!\dfrac{a^2 \sin^2 x}{a^2 +(b^2 - a^2) \cos^2 x}\, dx $$
I would kind of want to do some sort of $u=\cos x$ substitution, to get at $\arctan u $ but no idea what to do with the sine in the numerator.
 [/INST] Essentially, we want to integrate
$$I = \int_0^{\pi/2} \dfrac{\sin^2(t)dt}{1+c \sin^2(t)}$$
where $c<1$.
We have
$$I = \sum_{k=0}^{\infty} (-c)^k\int_0^{\pi/2}\sin^{2k+2}(t)dt = \dfrac{\pi}8 \cdot\sum_{k=0}^{\infty}\left(\dfrac{-c}4 \right)^k \dbinom{2k+2}{k+1} = \color{red}{\dfrac{\pi}{2c} \left(\dfrac{\sqrt{1+c}-1}{\sqrt{1+c}}\right)}$$
$\dfrac1{1+r} = \displaystyle \sum_{k=0}^{\infty}(-r)^k$; $\displaystyle \int_0^{2\pi} \sin^{2k}(x) dx = \dbinom{2k}k \dfrac{2\pi}{2^{2k}}$; $ \dfrac1{\sqrt{1-4x}} = \displaystyle\sum_{k=0}^{\infty} \dbinom{2k}k x^k \,\, \forall x \in \left[-\dfrac14,\dfrac14 \right)$
The integral you have is
$$J = \dfrac{2a}{b^2} \int_0^{\pi/2} \dfrac{\sin^2(x)}{1+ \underbrace{\left(\dfrac{a^2-b^2}{b^2}\right)}_{c} \sin^2(x)}dx = \dfrac{2a}{b^2} \cdot \frac{\pi}{2c} \left(\dfrac{\vert a/b \vert-1}{\vert a/b \vert}\right) = \dfrac{a \pi}{a^2-b^2}\dfrac{\vert a \vert - \vert b \vert}{\vert a \vert}$$
This gives you
$$\boxed{\color{blue}{J = \dfrac{\text{sign}(a)}{\vert a \vert + \vert b \vert} \pi}}$$
</s>