Calculation $\int_0^1\frac{dx}{\sqrt{(1-x^2)(1-x^2k^2)}}$ My teacher said that calculate the following integral, and that the integral is convergent, I tried to calculate but failed, thanx in advanced for any help.
$$0<k<1$$
$$I=\displaystyle\int_0^1\dfrac{dx}{\sqrt{(1-x^2)(1-x^2k^2)}}=\text{?}$$
Attempt 1:
Integral's interval's boundaries are $1,0$ so I want to try $x=1-u$ substitution
$$I \int_0^1\dfrac{dx}{\sqrt{(1-x^2)(1-x^2k^2)}}=\int_1^0 \frac{-du}{\sqrt{(1-(1-u)^2) (1-(1-u)^2k^2)}}=\text{?}$$
I could not get from this, denominator will get too complicated so we could not get benefit by this trick.
Attempt 2:
We can use odd and even function for symmetric intervals of integrals so the function inside the integral is even function and interval is $[0,1]$ that is if we extend the integral's interval to $[-1,1]$ and if we think $$\frac 1 {\sqrt{(1-x^2)(1-x^2k^2)}} = \frac{g(x)+g(-x)}{2}\tag{*},$$ we can rewrite the integral as follows:
$$I= \int_{-1}^1 g(x)\,dx$$  But I couldnot arrange the function $g$ from $(*)$
Other attemts:
I've tried to substitute trigonometric functions, $x=\sin y$, $x=\tan y$ and $x=uk$ and $x=u/k$
 A: $I(k)$ is a complete elliptic integral of the first kind. It has some special values, and its numerical computation can be performed by exploiting the relation with the $\text{AGM}$ mean, defined in the following way.

Let $a,b>0$. The sequences $\{a_n\}_{n\geq 0},\{b_n\}_{n\geq 0}$ defined by $a_0=a, b_0=b$, $a_{n+1}=\frac{a_n+b_n}{2}$, $b_{n+1}=\sqrt{a_n b_n}$ converge (pretty fast) to a common limit, $\text{AGM}(a,b)$.

In our case we have
$$ I(k)=\int_{0}^{\pi/2}\frac{d\theta}{\sqrt{1-k^2\sin^2\theta}}=\int_{0}^{\pi/2}\frac{d\theta}{\sqrt{1-k^2\cos^2\theta}}=\int_{0}^{+\infty}\frac{dt}{\sqrt{(1+t^2)(1-k^2+t^2)}} $$
and
$$ I(k)=\color{red}{\frac{\pi}{2\cdot\text{AGM}(1,\sqrt{1-k^2})}}. $$
In terms of hypergeometric functions we have
$$ \forall k\in(0,1),\qquad I(k)=\frac{\pi}{2}\sum_{n\geq 0}\frac{\binom{2n}{n}^2}{16^n}\,k^{2n} $$
and the asymptotic behaviour as $k\to 1^-$ is $-\frac{1}{2}\log\left(\frac{1-k}{8}\right)+o(1-k)$.
See also the section Elliptic Integrals and the AGM in my notes.
