Solution to Kepler ODE I'm working on Problem 8.20 from Teschl's ODEs book which asks to solve the ODE
$$\frac{1}{r^2} \frac{dr}{d\varphi} = \sqrt{\frac{2 (H - \frac{1}{r})}{J_0^2} - \frac{1}{r^2}}$$
(where $H, J_0$ are constant with respect to $\varphi$). The hint is to substitute $\rho = r^{-1}$ and I did that and got
$$\frac{d\rho}{d\varphi} = - \sqrt{\frac{2 (H - \rho)}{J_0^2} - \rho^2}$$
This is separable, but I'm stuck trying to integrate the reciprocal of the righthand side (I tried a trigonometric substitution and it didn't seem to help). The claimed answer is
$$r (\varphi) = \frac{J_0^2}{1 - \sqrt{1 + H J_0^2} \cos (\varphi - \varphi_0)}$$
 A: In your second equation, you complete the square inside the square root and you get something of the form
$$
\frac{d\rho}{dt}=-\sqrt{A-(B+\rho)^2}
$$
for some $A$ and $B$, which I am going to let you find. Substitute $\rho=\sqrt{A}\cos(\theta)-B$ and get
$$
-\sqrt{A}\dot{\theta}\sin(\theta)=-\sqrt{A}\sin(\theta),
$$
thus
$$
\dot{\theta}=1,\text{implying }{\theta}=\phi-\phi_0,\text{ thus }\rho=\sqrt{A}\cos(\phi-\phi_0)-B,
$$
where $\phi_0$ is a constant of integration. There seem to be two small errors in the given answer (a 2 and a sign) unless of course there is something wrong with my reasoning.
A: $$\frac{d\rho}{d\varphi} = - \sqrt{\frac{2 (H - \rho)}{J^2} - \rho^2}\quad \implies\quad \frac{d\varphi}{d\rho} =-\frac 1 {\sqrt{\frac{2 (H - \rho)}{J^2} - \rho^2} }$$
Let
$$a=\frac{2 H}{J^2}+\frac{1}{J^4}\quad \text{and} \quad x=\rho+\frac{1}{J^2}$$
$$\frac{d\varphi}{dx} =-\frac 1 {\sqrt{a- x^2}}\quad \implies\quad \varphi+c=-\tan ^{-1}\left(\frac{x}{\sqrt{a-x^2}}\right)$$ Inversing
$$x=\pm\sqrt{a} \sin (c+\varphi )$$
