Finding the inverse of an integral I'm looking for a computational approach here, since I don't think there is a closed-form solution.
I have the following:
$$ s(x) = \rho + \int_{\rho}^{x} \sqrt{ 1 + (\alpha \cos t - k)^2 } \, dt $$
$ k = \frac{\rho \sin \alpha - \alpha \sin(\rho \cos \alpha)}{\frac{\pi}{2} - \rho \cos \alpha} $ for $x<\frac{\pi}{2}$, otherwise $k=0$.
The following are all constants: $0 < \rho < \frac{\pi}{2}$, $0 < \alpha < \frac{\pi}{2}$ (and thus $k$).
I'd like to find $x$ such that $s(x) = r$ for some constant $0 \le r \le \pi$.
The interesting thing is that $s(x)$ is an elliptic integral for $x \ge \frac{\pi}{2}$, because $k=0$.  However, my lower limit $\rho$ means that I need to handle $k \ne 0$.
My hunch is that I can use some kind of series expansion here. Any ideas?

The numerical approach I would use here is quite obvious: reducing the problem to an ODE. From the integral itself it's clear that:
$$\frac{ds}{dx} = \sqrt{ 1 + (\alpha \cos x - k)^2 }$$
$$s(\rho)=\rho$$
Now we simply invert the function:

$$\frac{dx}{ds} = \frac{1}{\sqrt{ 1 + (\alpha \cos x - k)^2 }}$$
$$x(\rho)=\rho$$

Now we use any suitable numerical scheme, for example, the simplest explicit Euler method.
$$x_0=\rho$$
$$x_{n+1}=x_n+\frac{\Delta s}{\sqrt{ 1 + (\alpha \cos x_n - k)^2 }}$$
To reach $r$ we take:
$$\Delta s=\frac{r-\rho}{N}$$
Then:
$$x_{N} \approx x(r)$$
