Let $0<z<1$ and define two functions
\begin{align} &f(z) = \int_0^1 dt \frac{K(t)}{\sqrt{t\left(t+\frac{z}{1-z}\right)}}, \\ &g(z) = \frac{1}{2\sqrt{2}} \left(K\left(z_+\right)^2 +2iK(z_+) K(z_-) +K\left(z_-\right)^2 \right), \end{align} where $z_\pm = (1\pm z^{-1/2})/2$ and $K(t)$ is the complete elliptic integral \begin{equation} K(t) = \int_0^1 dx \frac{1}{\sqrt{(1-x^2)(1-t x^2)}}. \end{equation} I want to express $f(z)$ for all $0<z<1$ in terms of products of elliptic $K$ integrals, and by some trial and error I find numerically that $f(1/2)=g(1/2)$. Does anybody know a systematic way to calculate integrals like this? I sort of suspect there is a way to modify $g$ slightly such that its value at $z=1/2$ doesn't change and it agrees with $f$ throughout $0<z<1$, but I haven't managed to make it work.