Evaluate $I_n=\int_0^{\pi/2} \frac{1}{\left( a\cos^2x+b\sin^2x\right)^n} \, dx$ I would like to evaluate (using elementary methods if possible)   : (for $a>0,\ b>0$)

$$
I_n=\int_0^{\pi/2} \frac{1}{( a\cos^2x+b\sin^2x)^n} \, dx,\quad \ n=1,2,3,\ldots
$$
I thought about using $u=\tan(x)$ or $u=\frac{\pi}{2}-x$ but did not work. wolfram alpha evaluates the indefinite integral  but not definite integral???


Per geometric summation
\begin{align}
 \sum_{n\ge 1}I_n t^n=&
\int_0^{\frac{\pi}{2}} \sum_{n\ge 1}\frac{t^n}{(a \cos^2x+ b \sin^2x)^n}dx\\
=&\int_0^{\frac{\pi}{2}}\frac{t}{a\cos^2x+ b\sin^2x-t}dx
=\frac{\pi}{2}\frac{t}{\sqrt{(a-t )(b-t )}}\\
 =&\sum_{n\ge 1}\frac{\pi}{2^{2n-1}}\sum_{i+j+1=n} \frac{1}{a^{i+1/2} b^{j+1/2}} {2i\choose i}{2j\choose j} t^n
\end{align}
where the Taylor series $ \frac{1}{\sqrt{a-t}}=\sum_{i\ge 0}\frac{2i\choose i }{2^{2i} a^{i+1/2}}t^i$ is applied in the last step. Thus
$$I_n= \frac{\pi}{2^{2n-1}\sqrt{ab}}\sum_{i+j+1=n} \frac{{2i\choose i}{2j\choose j}}{a^{i} b^{j}}
$$
which, in particular, results in
\begin{align}
&I_1 =\frac\pi{2\sqrt{ab}}\\
& I_2 =\frac\pi{4\sqrt{ab}}\left(\frac1a+\frac1b\right)\\
& I_3 =\frac\pi{16\sqrt{ab}}\left(\frac3{a^2}+\frac2{ab}+\frac3{b^2}\right)\\
&I_4=\cdots
\end{align}
