I am trying to solve the following differential equation: $$ \frac{\mathrm{d} f}{\mathrm{d} x} = \frac{x^2-2 a}{\sqrt{4k^2-(x^2-2 a)^2}}, $$ where $a$ and $k$ are constants ($k$ is known and $a$ is unknown). Integration of both sides with respect to $x$ gives

\begin{align*} f = \sqrt{\frac{2}{k-a}} \Bigg\{(a&-k)E\left[\arcsin \left(\frac{x}{\sqrt{2(a+k)}}\right), \frac{a+k}{a-k} \right] \\ &+k~F \left[\arcsin \left(\frac{x}{\sqrt{2(a+k)}}\right), \frac{a+k}{a-k} \right] \Bigg\}+b, \end{align*}

where $F$ is the incomplete elliptic integral of the first kind, $E$ is the incomplete elliptic integral of the second kind and $b$ is another constant.

The boundary conditions are

\begin{align*} f(0) &= \infty,\\ f_x(x_0) &= c,\\ f(x_0) &= y_0.\\ \end{align*}

Here $c$ and $y_0$ are given while $x_0$ is unknown. The constants $a$, $b$ and $x_0$ need to be determined as a part of the solution.

The problem arises when I attempt implement the first boundary condition i.e. $f(0) = \infty$. An elliptic integral $E(\psi,z)$ becomes large if the first argument $\psi$ is large. I think the only way to implement the above boundary condition is to make the first arguments of the elliptic integrals (in the equation for $f$) large. However, I don't know how to do it because the argument is given by an $\arcsin$ function. $\arcsin$ is a periodic function while the elliptic integrals are not. If $$\arcsin \left(\frac{x}{\sqrt{2(a+k)}}\right)= \theta +2~n~\pi,$$ which $n$ should I chose?

Can you recommend an alternative way of solving this equation?

Thanks a lot in advance.