Consider the elliptic integral of the second kind $E(\phi,m):=\int\limits _0^\theta \sqrt{1-m \sin^2 x}\,dx$. (Note that my convention will be to write in terms of $m=k^2$ rather than $k$ itself.) Naively, the range of allowed $m$ is $m\in [0,1]$. The question posted above is then a special case of the following: What is the meaning of $E(\theta,-m)$ for $0\leq m \leq 1$?
To answer this, We can manipulate $E(\theta,-m)$ into a more recognizable form. Substituting $u=\pi/2-x$, we have $$1+m \sin^2 x =1+m(1-\sin^2 u)=(1+m)\left(1-\frac{m}{1+m}\sin^2 u\right)$$ and therefore
\begin{align}
E(\theta,-m)
&=(1+m)^{1/2}\int\limits _{\pi/2-\theta}^{\pi/2} \sqrt{1-\frac{m}{1+m}\sin^2 u}\,du \\
&=(1+m)^{1/2} E\left(\frac{\pi}{2},\frac{m}{1+m}\right)-(1+m)^{1/2} E\left(\frac{\pi}{2}-\theta,\frac{m}{1+m}\right).
\end{align}
Note that the function in the first term is in fact the complete elliptic integral $E\left(\frac{m}{m+1}\right).$ For the special case of $m=1$, we conclude that
\begin{align}
E(\theta,-1)
&=\int_{0}^\theta \sqrt{1+\sin^2 x}\,dx \\
&= \sqrt{2}E\left(\frac{1}{2}\right)-\sqrt{2}E\left(\frac{\pi}{2}-\theta,\frac{1}{2}\right)=\sqrt{2}\int_{\pi/2-\theta}^{\pi/2} \sqrt{1-\frac{1}{2}\sin^2 x}\,dx.
\end{align}