<s>[INST] Calculating an integral using Leibniz parametric integration formula Let there be $a, b > 0$, find:
$\int_0^{\pi/2}$$\frac{dx}{(a\cos^2(x)+b\sin^2(x))^2}$
Hints given:
1. Remember: $\cos^2(x) + \sin^2(x) = 1$, use it to make the integral a sum of two parts.
2. Define $f(x,y)=\frac{-1}{(y\cos^2(x)+b\sin^2(x))^2}$, and calculate:
$F(y) = \int_0^{\pi/2}f'y(x,y)\,dx$, and use Leibniz rule for parametric integrals while $y=a$.
what I did so far(at the image. im stuck):

any help/hints/anything would be much appreciated. thanks in advance!
i
 [/INST] $$f(a,b)=\int_0^{\pi/2}\frac{dx}{a\cos^2(x)+b\sin^2(x)}=\int_0^{\pi/2}\frac{sec^2(x)}{a+b \tan^2(x)}dx=\frac{1}{\sqrt{ab}}arctan\left(\sqrt{\frac{b}{a}}tan(x)\right)_0^{\pi/2}$$
$$\color{red}{f(a,b)=\int_0^{\pi/2}\frac{dx}{a\cos^2(x)+b\sin^2(x)}=\frac{\pi}{2\sqrt{ab}}}$$
$$\frac{\partial f(a,b)}{\partial a}+\frac{\partial f(a,b)}{\partial b}=-\int_0^{\pi/2}\frac{cos^2(x)}{(a\cos^2(x)+b\sin^2(x))^2}dx-\int_0^{\pi/2}\frac{sin^2(x)}{(a\cos^2(x)+b\sin^2(x))^2}dx$$
$$\frac{\partial f(a,b)}{\partial a}+\frac{\partial f(a,b)}{\partial b}=\frac{\pi}{2}\left(-\frac{1}{2\sqrt{a^3b}}-\frac{1}{2\sqrt{ab^3}}\right)$$
Hence:
$$\int_0^{\pi/2}\frac{dx}{(a\cos^2(x)+b\sin^2(x))^2}=\frac{\pi}{4\sqrt{ab}}\left(\frac{1}{a}+\frac{1}{b}\right)$$
</s>