Notation: For $\varphi \in [0,\frac{\pi}{2}]$ and $k \in [0,1)$ the definitions $$ \operatorname{F}(\varphi,k) = \int \limits_0^\varphi \frac{\mathrm{d} \theta}{\sqrt{1-k^2 \sin^2(\theta)}} = \int \limits_0^{\sin(\varphi)} \frac{\mathrm{d} x}{\sqrt{(1 - k^2 x^2)(1-x^2)}} $$ and $\operatorname{K}(k) = \operatorname{F}(\frac{\pi}{2},k)$ will be used for the elliptic integrals of the first kind.
When answering this question, I came across the function $$ \psi \colon [0,1) \to (0,\infty) \, , \, \psi(k) = \int \limits_0^1 \frac{\operatorname{K}(k x)}{\sqrt{(1-k^2 x^2)(1-x^2)}} \, \mathrm{d}x = \int \limits_0^{\pi/2} \frac{\operatorname{K}(k \sin(\theta))}{\sqrt{1-k^2 \sin^2 (\theta)}} \, \mathrm{d} \theta \, .$$
While $\psi(k) = \frac{\pi^2}{4} [1+ \frac{3}{8} k^2 + \mathcal{O}(k^4)]$ near $k=0$ is readily found using Maclaurin series, the expansion at $k=1$ is more elusive.
The naive attempt of replacing $\operatorname{K}(kx)$ by $\operatorname{K}(k)$ (since the largest contribution to the integral comes from the region near $x=1$) yields $\psi(k) \simeq \operatorname{K}^2 (k)$, which according to plots is not too far off but also not quite right. Integration by parts reproduces this term, but the remaining integral does not look very nice: \begin{align} \psi(k) &= \operatorname{K}^2 (k) - k \int \limits_0^1 \operatorname{K}'(k x) \operatorname{F}(\arcsin(x),k) \, \mathrm{d} x \\ &= \operatorname{K}^2 (k) - \int \limits_0^1 \left[\frac{\operatorname{E}(k x)}{1-k^2 x^2} - \operatorname{K}(kx)\right] \frac{\operatorname{F}(\arcsin(x),k)}{x} \, \mathrm{d} x \, . \end{align} The expansion $\operatorname{K}(k) = -\frac{1}{2} \log(\frac{1-k}{8}) + \mathcal{o}(1)$ is useful for the final steps, but I do not know how to extract all the leading terms, so:
How can we find the asymptotic expansion (ideally up to and including the constant terms) of $\psi(k)$ as $k \nearrow 1$ ?