Solution to a Nonlinear System of ODEs In applying the method of characteristics to a problem, I came the across the following set of ODEs:
$$\frac{dz}{dt}=\frac{v_m}{2}z^2\cos(x),\quad\frac{dx}{dt}=v_mz\sin(x).$$
Here $v_m>0$ is a constant. With little hope of a solution, I dejectedly plugged this into Mathematica, and to my surprise, was greeted with a (not terribly complicated) solution:
$$z(t)=c_1\sqrt{\sin(x(t))},\quad x(t)=f^{-1}(c_1v_mt+c_2),$$
were $f$ involves $E$, the elliptic integral of the second kind:
$$f(x)=2E\left(\frac{1}{4}(\pi-2x)\big\vert2\right)-2\frac{\cos(x)}{\sqrt{\sin(x)}}.$$
This solution seems nice and self-contained, but I have no idea how it was obtained. For all of my efforts, I cannot get close to this solution (or any solution for that matter), though I can see how elliptic integrals and square roots would arise. I would greatly appreciate any insight on how to arrive at this solution.
 A: After eliminating $z(t)$, you get a second order Liouville equation in $x(t)$:
$$ x''(t) = \frac{3}{2} \cot(x(t)) x'(t)^2 $$
This has an implicit solution
$$ \int^{x(t)} \dfrac{ds}{\sin(s)^{3/2}} = c_1 t + c_2 $$
The elliptic integral comes from that integration.
A: Since these equations are autonomous (contain no external $t$ anywhere) we can try to write this either as $z(x)$ or $x(z)$ and then extract it from there. We write
$$\frac{dz}{dt}=\frac{dz}{dx}\frac{dx}{dt}\implies\frac{dz}{dx}v_mz\sin(x)=\frac{v_m}{2}z^2\cos(x)\implies\frac{1}{z}\frac{dz}{dx}=\frac{1}{2}\cot(x)$$
Integrating,
$$\ln(z)=\frac{1}{2}\ln(\sin(x))+C\implies z(x)=c_1\sqrt{\sin(x)}$$
Now that we have a solution for $z$ in terms of $x$, we can replace this in the second equation and get
$$\frac{dx}{dt}=c_1v_m\sqrt{\sin(x)}\sin(x)\implies\frac{1}{\sin^{3/2}(x)}\frac{dx}{dt}=c_1v_m\implies\int\frac{1}{\sin^{3/2}(x)}dx=c_1v_mt+c_2$$
From here the goal is to change the variable of this integral into that of an elliptic integral. Can you take it from here?
Edit We wish to evaluate
$$I=\int\frac{1}{\sin^{3/2}(x)}dx=\int\sqrt{\sin(x)}\csc^2(x)dx$$
We integrat by parts letting $dv=\csc^2(x)dx$ and get
$$I=-\sqrt{\sin(x)}\cot(x)+\frac{1}{2}\int\frac{\cos(x)\cot(x)}{\sqrt{\sin(x)}}dx=-\sqrt{\sin(x)}\cot(x)+\frac{1}{2}\int\frac{\cos^2(x)}{\sin^{3/2}(x)}dx$$
$$=-\sqrt{\sin(x)}\cot(x)+\frac{1}{2}\int\frac{1-\sin^2(x)}{\sin^{3/2}(x)}dx=-\sqrt{\sin(x)}\cot(x)+\frac{1}{2}I-\frac{1}{2}\int\sqrt{\sin(x)}dx$$
Reducing we have
$$I=-2\sqrt{\sin(x)}\cos(x)-\int\sqrt{\sin(x)}dx$$
We can use the chain of equalities
$$\sin(x)=\cos\left(\frac{\pi}{2}-x\right)=1-2\sin^2\left(\frac{\pi}{4}-\frac{x}{2}\right)$$
We can then write
$$\int\sqrt{\sin(x)}dx=\int\sqrt{1-2\sin^2\left(\frac{\pi}{4}-\frac{x}{2}\right)}dx$$
Let $u=\pi/4-x/2$ and get
$$\int\sqrt{\sin(x)}=-2\int\sqrt{1-2\sin^2(u)}du=-2E(u|2)=-2E\left(\frac{1}{4}(\pi-2x)\Big|2\right)$$
Putting this all together gives us our answer.
