How to find the closed form of $\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(p \cos ^{2} x+q \sin ^{2} x+r\right)^{n}}$, where $n\in N$? In my post, I found the integral
$$\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(a^{2} \cos ^{2} x+b^{2} \sin ^{2} x\right)^{2}}=\frac{\pi\left(a^{2}+b^{2}\right)}{4 a^{3} b^{3}}$$
Then  I want to find the generalized integral using similar technique by using the integral
$$
I(p, q, r)=\int_{0}^{\frac{\pi}{2}} \frac{d x}{p \cos ^{2} x+q \sin ^{2} x+r} \quad \text{ where }p+r> 0 \textrm{ and }  q+r>0.
$$
Letting $t=\tan x$ yields
$$
\begin{aligned}
I(p, q, r)&=\int_{0}^{\infty} \frac{d t}{p+qt^{2}+r\left(1+t^{2}\right)}\\
&=\int_{0}^{\infty} \frac{d t}{(q+r) t^{2}+p+r}\\&=\frac{1}{\sqrt{(p+r)(q+r)}} \left.\tan ^{-1}\left(\frac{t\sqrt{q+r} }{\sqrt{p+r}}\right)\right]_{0}^{\infty}\\
&=\frac{\pi}{2 \sqrt{(p+r)(q+r)}}
\end{aligned}
$$
Differentiating it w.r.t. $r$ by $n$ times yields
$$
\begin{aligned}\int_{0}^{\frac{\pi}{2}} \frac{(-1)^{n}n! d x}{\left(p \cos ^{2} x+q \sin ^{2} x+r\right)^{n+1}}=\frac{\pi}{2 }\cdot \frac{\partial^{n}}{\partial r^{n}}\left(\frac{1}{\sqrt{(p+r)(q+r)}}\right) \\
\boxed{\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(p \cos ^{2} x+q\sin ^{2} x+r\right)^{n+1}}=\frac{(-1)^{n} \pi}{2n !} \frac{\partial^{n}}{\partial r^{n}}\left(\frac{1}{\sqrt{(p+r)(q+r)}}\right)}
\end{aligned}
$$
Using the formula, we can evaluate
$$
\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(p \cos ^{2} x+q \sin ^{2} x+r\right)^{2}}=\frac{-\pi}{2} \frac{\partial}{\partial r}\left(\frac{1}{\sqrt{(p+r)(q+r)}}\right)= \frac{\pi(p+q+2r)}{4\left[(p+r)( q+r)\right]^{\frac{3}{2}}}
$$
For higher derivative, applying Leibniz’s Rule gives
$$
\begin{aligned}\frac{d^{n}}{d r^{n}}\left[(p+r)^{-\frac{1}{2}}(q+r)^{-\frac{1}{2}}\right]&= (-1)^n \sum_{k=0}^{n}\left(\begin{array}{l}
n \\
k
\end{array}\right)\left(\frac{1}{2} \right)_k(p+r)^{-\frac{1}{2}-k}\left(\frac{1}{2} \right)_{n-k}(q+r)^{-\frac{1}{2}-n+k} \\&=\frac{(-1)^n}{(q+r)^{n} \sqrt{(p+r)(q+r)}} \sum_{k=0}^{n} \binom{n}{k} \left(\frac{1}{2}\right)_{k}\left(\frac{1}{2}\right)_{n-k}\left(\frac{q+r}{p+r}\right)^{k}\end{aligned}
$$
where $\displaystyle (\alpha)_n=\frac{\Gamma(\alpha+n)}{\Gamma(n)} $.
Now we can conclude that for any natural number $n\geq 2$,
$$
\int_{0}^{\frac{\pi}{2}} \frac{d x}{\left(p\cos ^{2} x+q\sin ^{2} x+r\right)^{n+1}}\\=\boxed{\frac{\pi}{2n!(q+r)^{n} \sqrt{(p+r)(q+r)}} \sum_{k=0}^{n} \binom{n}{k}\left(\frac{1}{2}\right)_{k}\left(\frac{1}{2}\right)_{n-k}\left(\frac{q+r}{p+r}\right)^{k}}
$$
Question:
Is there any other solution?

With $a=p+r$ and $b=q+r$
\begin{aligned}I_n=\int_{0}^{\frac{\pi}{2}} \frac{1}{\left(p \cos ^{2} x+q \sin ^{2} x+r\right)^{n}}dx
=\int_{0}^{\frac{\pi}{2}} \frac{1}{\left(a \cos ^{2} x+b \sin ^{2} x\right)^{n}}dx
\end{aligned}
Integrate, instead
\begin{align}
 \sum_{n=1}^\infty I_n t^n=&
\int_0^{\frac{\pi}{2}} \sum_{n=1}^\infty \left(\frac{t}{a \cos^2x+ b \sin^2x}\right)^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 )}}\\
\end{align}
and apply the Taylor series $ \frac{1}{\sqrt{1-x}}=\sum_{i=0}^\infty\frac1{2^{2i}}{2i\choose i}x^i$ to express the result in power of $t^n$
\begin{align}
 \sum_{n=1}^\infty I_n t^n
=\> 
 \sum_{i=0}^\infty\sum_{j=0}^\infty
\frac{\frac{\pi}{2}{2i\choose i} {2j\choose j} t^{i+j+1}}{2^{2i+2j}a^{i+1/2} b^{j+1/2}}
=
\sum_{n=1}^{\infty} \frac{\pi}{2^{2n-1}}\sum_{i+j+1=n} \frac{{2i\choose i}{2j\choose j}}{a^{i+1/2} b^{j+1/2}} t^n
\end{align}
Thus
$$I_n= \frac{\pi}{2^{2n-1}}\sum_{i+j+1=n} \frac{{2i\choose i}{2j\choose j}}{(p+r)^{i+1/2} (q+r)^{j+1/2}}
$$
