The given integral is $K(1/2)/2$ (convention!), but i will try to follow also a geometric path, the canonical one, detailed in the given particular case $x_-=1$, and $x_+=2$, so that things are easier to type. There will be also numerical check (also for intermediate steps), so that i can calmly sleep tonight.
Let us recall the Complete elliptic integral of the first kind:
$$
K(k)
=
\int_0^{\pi/2}\frac{d\theta}{\sqrt{1-k^2\sin^2\theta}}
=
\int_0^1
\frac {dt}{\sqrt{(1-t^2)(1-k^2t^2)}}\ .
$$
See also DLMF on Elliptic integrals, where $K(k)=F(\pi/2,k)$, and in the definition of $F$ the above convention is used.
Note that the above convention differs from the convention used by Mathematica, as also remarked in loc. cit. .
Taking in the last integral $k=\frac 12$ we obtain an integral "similar" to the given one, at least under the integral, but the limits of integration differ. What can we do?
The lower integration limit $0$ is the point of symmetry for $(1-t^2)(1-k^2t^2)$, and $1$ is one of its roots. In our case, for $(x^2-1)(x^2-4)$ the value $2$ is also a root, so the substitution $t=2/x$ is natural. We get for the given integral $I$ (well, let us have this handy notation):
$$
\begin{aligned}
I&=
\int_{2}^\infty
\frac1{\sqrt{(x^2-1)(x^2-4)}}\; dx
\\
&=
\int_1^0
\frac1{\sqrt{\left(\frac 4{t^2}-1\right)\left(\frac 4{t^2}-4\right)}}\; \left(-\frac 2{t^2}\right)\; dt
\\
&=
\int_0^1
\frac1{\sqrt{(4-t^2)(4- 4t^2)}}\; 2\; dt
\\
&=
\frac12
\int_0^1
\frac1{\sqrt{(1-\frac 14t^2)(1- 1t^2)}}\; dt
\\
&=\frac 12K\left(\frac 12\right)\ .
\end{aligned}
$$
Numerical check using sage, which also suffers from the same convention as Mathematica.
sage: var('x,t');
sage: I = integral( 1/sqrt( (x^2-1)*(x^2-4) ), x, 2, oo, hold=1 )
sage: I.n()
0.8428751774069201
sage: def K(k): return elliptic_kc(k^2) # convention
sage: K(1/2).n() / 2
0.842875177406298
pari/gp has the wiki convention, a numerical check using pari, taking advantage of the implementation of ellK
, recently made public, October 2020,
is as follows:
? intnum(x=2, oo, 1/sqrt( (x^2-1)*(x^2-4) ))
%1 = 0.84287517740629802143560182889542910036
? \p 60
realprecision = 77 significant digits (60 digits displayed)
? intnum(x=2, oo, 1/sqrt( (x^2-1)*(x^2-4) ))
%2 = 0.842875177406298021435601828899538494750400447070248008383945
? ellK(1/2)/2
%3 = 0.842875177406298021435601828899538494750400447070544522059974
It seems that Mathematica goes an other way when evaluating the given integral, thus delivering a value which reflects 19.7.3 in DLMF, Legendre's relations, explicitly:
$$K(1/k) = k(K(k)\mp iK(k')\ ,\qquad k^2 + {k'}^2=1\ .$$
In our case, with $k=1/2$, we get $K(2)=\frac 12(K(1/2)\mp iK(\sqrt{3/2}))$.
This is compatible with the result of Mathematica, written in its convention.
This is already an answer to the question.
$\square$
A possible digression: Please ignore, if it feels not related to the question.
This is inserted for my own purpose, so that i can find it next time as an explicit example. For me there is a natural relation, the most natural way to deal with elliptic integrals is to see them explicitly in relation with elliptic curves. We will obtain (after an expensive tour) an other realization of the given integral in terms of the complete elliptic integral, $K(\sqrt{8/9})/3$.
The given integral can be written as
$$
\color{blue}{
I = \int_{(2,0)}^{\infty}\frac{dx}y
} \ ,
$$
and it can be considered on the compact manifold $Q(\Bbb R)$ or $\Bbb C$, where $Q$ is the "quartic curve" (an algebraic variety, thus analytic, thus smooth manifold) with affine equation
$$
Q\ :\ y^2 =(x-1)(x+1)(x-2)(x+2)\ .
$$
(The infinity point is the point $(0:1:0)$ which verifies the projective form, the homogenized form
of this equation, $y^2z^2=(x-z)(x+z)(x-2z)(x+2z)$.)
The idea is to obtain a birational morphism to an elliptic curve.
We use the (birational) transformations:
$$
\left\{
\begin{aligned}
x &=-\frac 4Y(X-5)\ ,\\
y &=2-\frac 4{Y^2}X(X-5)^2\ ,
\end{aligned}
\right.
\qquad
\left\{
\begin{aligned}
X &=-\frac 4{x^2}(y-2)\ ,\\
Y &=\frac 1{x^3}(16(y-2)+20x^2)\ ,
\end{aligned}
\right.
$$
and then
$$
y^2- (x^2-1)(x^2-4)
=
\frac{16(X - 5)^3}{Y^4}\cdot(-Y^2+ X^3 - 5X^2- 16X + 80)\ ,
$$
so we have a passage to the elliptic curve with the equation from the last parentesis,
$$
Y^2 =(X-5)(X-4)(X+4)\ .
$$
We may (or may not) want to keep it simple (and unstructural), thus involve only the substitution
$$
x =
-\frac{4(X-5)}{\sqrt{(X-4)(X+4)(X-5)}}
\ .
$$
We have already made the "natural choice" for the square root.
Note that for $X=2$ we obtain $x=2$. And
$X\searrow -4$ implies $x\nearrow \infty$.
The structure or brute force computations shows now that we have:
$$
\color{blue}{
I=
\int_2^\infty\frac {dx}{\sqrt{(x^2-1)(x^2-4)}}
=
\int_{-4}^2
\frac {dX}{\sqrt{(X-4)(X+4)(X-5)}}\ .
}
$$
This is the passage from the integral on the quartic to an integral on the elliptic curve written in Weierstraß form.
Instead of a proof, here is a
numerical check using pari/gp:
? \p 60
realprecision = 77 significant digits (60 digits displayed)
? intnum( x=2, oo, 1/sqrt( (x^2-1)*(x^2-4) ) )
%2 = 0.842875177406298021435601828899538494750400447070248008383945
? intnum( X=-4, 2, 1/sqrt( (X-4)*(X+4)*(X-5) ) )
%3 = 0.842875177406298021435601828899538494750400447070446045891423
We are thus in the position to calculate the integral of the canonical differential on the elliptic curve $E$ with equation
$$
(E)\qquad
Y^2=(X-e_1)(X-e_2)(X-e_3)\ ,\qquad e_1,e_2,e_3=5,4,-4,\ e_1>e_2>e_3\ .
$$
The limit of integration $e_1=-4$ corresponds to one torsion point of order two, $(e_1,0)$. The other $2$-torsion points are $(e_2,0)$, and $(e_3,0)$. Can we give a structural sense to the limit of integration $2$ from the blue realtion?!
Yes, the points $(2,\pm 6)$ are ($\Bbb Q$-rational) points on $E$, and they are $4$-torsion points. For this reason we have the chain of relations:
$$
\begin{aligned}
I
&=
\int_2^\infty\frac {dx}{\sqrt{(x^2-1)(x^2-4)}}
\\
&=
\int_{-4}^2
\frac {dX}{\sqrt{(X+4)(X-4)(X-5)}}
=
\int_2^4
\frac {dX}{\sqrt{(X+4)(X-4)(X-5)}}
\\
&=\frac12\int_{e_3=-4}^{e_2=4}
\frac {dX}{\sqrt{(X-e_1)(X-e_2)(X-e_3)}}
\\
&=\frac 12\omega_1(E)\qquad\text{(real half-period of the elliptic curve $E$)}
\\
&=\frac 1{\sqrt{e_1-e_3}}K\left(\sqrt{\frac{e_2-e_3}{e_1-e_3}}\right)
\\
&=\frac 1{\sqrt{5-(-4)}}K\left(\sqrt{\frac{4-(-4)}{5-(-4)}}\right)
\\
&=\frac 13 K\left(\frac{2\sqrt 2}3\right)\ .
\end{aligned}
$$
Let us numerically check again, pari/gp.
? intnum(x=2, oo, 1/sqrt( (x^2-1)*(x^2-4) ))
%10 = 0.842875177406298021435601828899538494750400447070248008383945
? ellK(sqrt(8/9))/3
%11 = 0.842875177406298021435601828899538494750400447070544522059974
Addendum. Computer algebra support for the elliptic curve computations.
Using sage:
sage: var('x,y,X,Y');
sage: def f(x,y): return y^2 - (x^2-1)*(x^2-4)
sage: factor( f(-4*(X-5)/Y, 2-4*X*(X-5)^2/Y^2) )
16*(X^3 - 5*X^2 - Y^2 - 16*X + 80)*(X - 5)^3/Y^4
sage: E = EllipticCurve(QQ, [0, -5, 0, -16, 80])
sage: E
Elliptic Curve defined by y^2 = x^3 - 5*x^2 - 16*x + 80 over Rational Field
sage: for T in E.torsion_points():
....: if T != E(0):
....: print(f"Order {T.order()} for the torsion point {T.xy()}")
....:
Order 2 for the torsion point (-4, 0)
Order 4 for the torsion point (2, -6)
Order 4 for the torsion point (2, 6)
Order 2 for the torsion point (4, 0)
Order 2 for the torsion point (5, 0)
Order 4 for the torsion point (8, -12)
Order 4 for the torsion point (8, 12)
This structural aspect explains why, when we compute the integrals of the canonical differential form $\frac{dX}Y$ of $E$ on the intervals delimited (in $\Bbb R$) by the points
$$
-\infty\ ,\
-4\ ,\
2\ ,\
4\ ,\
5\ ,\
8\ ,\
+\infty
$$
we obtain numerically the values for the integral of $(\ (X-4)(X+4)(X-5)\ )^{-1/2}$ on the delimited intervals... (I am taking the absolute value to not confuse sage.)
sage: f = 1/sqrt( abs((X-4)*(X+4)*(X-5)) )
sage: integral(f, X, -oo, -4, hold=True).n()
1.07825782381822
sage: integral(f, X, -4, 2, hold=True).n()
0.8428751689072135
sage: integral(f, X, 2, 4, hold=True).n()
0.8428751680336899
sage: integral(f, X, 4, 5, hold=True).n()
1.0782578072972744
sage: integral(f, X, 5, 8, hold=True).n()
0.8428751637656617
sage: integral(f, X, 8, oo, hold=True).n()
0.8428751775376374
And the above values are related to the periods of $(E)$:
sage: L = E.period_lattice()
sage: L
Period lattice associated to
Elliptic Curve defined by y^2 = x^3 - 5*x^2 - 16*x + 80 over Rational Field
sage: L.gens()
(1.68575035481260, 1.07825782374982*I)
sage: L.gens()[0]/2
0.842875177406298
Best Answer
Your integral $$f(x)=\int_0^{\pi/2}\frac{dt}{\sqrt{x^2+\sin^2t}}\tag{1}$$ equals $$\int_0^{\pi/2}\frac{dt}{\sqrt{1+x^{2}-\cos^2t}}=\frac {1}{\sqrt{1+x^2}} \int_0^{\pi/2}\frac{dt}{\sqrt{1-(1+x^2)^{-1}\cos^2t}} $$ And this is nothing but $$f(x) =(1+x^2)^{-1/2}K(k')\tag{2} $$ where $$k'=\sqrt{1-k^2}=(1+x^2)^{-1/2},k=x(1+x^2)^{-1/2}\tag{3}$$ When $x\to 0$ we have $k\to 0$ and we have the well known formula $$K(k') = \frac{2K(k)}{\pi}\log\left(\frac{4}{k}\right) - 2\left[\left(\frac{1}{2}\right)^{2}\left(\frac{1}{1\cdot 2}\right)k^{2} + \left(\frac{1\cdot 3}{2\cdot 4}\right)^{2}\left(\frac{1}{1\cdot 2} + \frac{1}{3\cdot 4}\right)k^{4} + \cdots\right]\tag{4}$$ Using $$\frac{2K(k)}{\pi}=1+\left(\frac{1}{2}\right)^2k^2+\left(\frac{1\cdot 3}{2\cdot 4}\right)^2k^4+\dots\tag{5}$$ together with $(3)$ in equation $(4)$ we can get the desired approximation given in question. We also need to use a bit of binomial theorem for general index to deal with $(1+x^2)^{-1/2}$ appearing in $(2),(3)$.