Definition.
The function $K:(-\infty,1) \to \mathbb R$ defined for every $m \in (-\infty,1)$ by
\[
K(m) = \int_0^{\pi/2} \frac{1}{\sqrt{1-m \, (\sin \theta)^2\ }} d\theta
\]
is called the complete elliptic integral of the first kind. In Mathematica this function is EllipticK[].
Before stating this definition we should have emphasised the following fact: For every $m \in (-\infty,1)$ the function
\[
\theta \mapsto \frac{1}{\sqrt{1-m \, (\sin \theta)^2\ }}
\]
is defined and continuous on the closed interval $[0,\pi/2].$ Therefore this function is Riemann integrable on $[0,\pi/2].$. Hence the complete elliptic integral of the first kind is well defined.
Below is a visualization of the definition of the complete elliptic integral of the first kind.