Evaluate $\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{a^2 \cos^2 \theta+b^2 \sin^2 \theta}} d \theta$ 
$\int_0^{\frac{\pi}{2}} \frac{1}{\sqrt{a^2 \cos^2 \theta+b^2 \sin^2 \theta}} d \theta$

$ = \int_0^{\frac{\pi}{2}} \frac{1}{a}\sec \theta \frac{1}{ \sqrt{1+(b/a)^2 \tan^2 \theta}} d \theta$
But i know $d(\tan \theta) = \sec^2 \theta$. But this is not in that form. Can you tell me how to proceed further?

$$I(a, b) =\int_0^\frac{\pi}{2} \frac{1}{\sqrt{a^2 \sin^2 t + b^2 \cos^2 t}}dt$$
$$ = \int_0^\frac{\pi}{2} \frac{1}{\sqrt{b^2-(b^2-a^2)\sin^2 t}}dt=\frac1b \int_0^\frac{\pi}{2} \frac{1}{\sqrt{1-\left(1-\frac{a^2}{b^2}\right)\sin^2 t}}dt=\frac1b K\left(1-\frac{a^2}{b^2}\right)$$ Or this can be written as: $I(a, b)=\frac{\pi}{2M(a,b)},$ where $M(a,b)$ is the arithmetic-geometric mean of $a,b$ defined by $M(a,b):=\lim_{n\to\infty}a_n=\lim_{n\to\infty}b_n$ where 
$$a_0=a, \ b_0=b, \ a_{n+1}=\frac{a_n+b_n}{2}, \ b_{n+1}=\sqrt{a_nb_n}$$
