I have been working on a problem on satellite orbits but i've been stuck solving one part for a while. I have the following set of ODEs. $(x(t),y(t))$ describe the trajectory of the satellite. \begin{equation} x^{\prime\prime}=-\frac{x}{r^{3}}, \;\; y^{\prime\prime}=-\frac{y}{r^{3}}, \end{equation} where $r$ is the distance of the satellite to the centre of the earth. \begin{equation} r=\sqrt{x^{2}+y^{2}}. \end{equation} Now using polar coordinates, $x=r\cos\theta$ and $y=r\sin\theta$, I need to rewrite the ODEs as \begin{equation} r^{\prime\prime}-r(\theta^{\prime})^{2}+\frac{1}{r^{2}}=0,\;\; (r^{2}\theta^{\prime})^{\prime}=0. \end{equation} To start off I computed $x^{\prime\prime}$ and $y^{\prime\prime}$: \begin{equation} x^{\prime\prime}=r^{\prime\prime}\cos\theta-2r^{\prime}\theta^{\prime}\sin\theta-r\theta^{\prime\prime}\sin\theta-r(\theta^{\prime})^{2}\cos\theta \end{equation} \begin{equation} y^{\prime\prime}=r^{\prime\prime}\sin\theta+2r^{\prime}\theta^{\prime}\cos\theta+r\theta^{\prime\prime}\cos\theta-r(\theta^{\prime})^{2}\sin\theta \end{equation} Now if I plug these back into our original ODEs and simplify I get \begin{equation} r^{\prime\prime}-r(\theta^{\prime})^{2}-\frac{\sin\theta}{\cos\theta}(2r^{\prime}\theta^{\prime}+r\theta^{\prime\prime})+\frac{1}{r^{2}}=0 \end{equation} \begin{equation} r^{\prime\prime}-r(\theta^{\prime})^{2}+\frac{\cos\theta}{\sin\theta}(2r^{\prime}\theta^{\prime}+r\theta^{\prime\prime})+\frac{1}{r^{2}}=0 \end{equation} This is the point where I get stuck, I can't seem to figure out how to remove the terms with $\sin$ and $\cos$ to determine the first desired ODE. I have also considered that maybe I need to find the second ODE first but I also can't figure out how to determine that one from this point.
Edit: Thanks to Ninad Munshi's answer I understand how to get the first of the two equations. However I have not been able to determine the second equation. I have tried using the first equation and also from the original ODEs but unfortunately I don't even manage to find anything close.