Q:

First integral of an equation of motion: $\mu\ddot r=-\frac{k}{r^2}$

I've got an equation of motion (EOM), which is 
$$
\mu\ddot r=-\frac{k}{r^2}
$$
How do I find the first integral of this EOM? I'd appreciate it if someone could show me the steps involved. I should get 
$$
\frac{1}{2}\mu\dot r^2=-k \left( \frac{1}{R}-\frac{1}{r} \right)
$$ 
but I'm not sure how to proceed. 

A:

Multiply the left- and the right-hand sides of the equation by $\dot r$, and there will be full differentials at both sides. 

A:

Let $ \dot{r} $ be $  p$
$$  {d^2 r \over dt^2} = {dp \over dt } = {dp \over dr}\times {dr \over dt} = p {dp \over dr} \hspace{2 cm} (1)$$
Then we have
$$\mu p {dp \over dr} = {-\frac{k}{r^2}}$$
$$ \mu \int p \, dp = - k \int {dr \over r^2} $$
$$ \mu {p^2 \over 2} = {k \over r} + C \hspace{2 cm} (2)$$
Assuming $ \large \dot{r}(0) = 0$ when $ r = R$, you get
$$C = - {k \over R} \hspace{2 cm} (3)$$
Hence from $(2)$ and $(3)$, we have
$$ \mu {\dot{r}^2 \over 2} = -k \left [ {1 \over R}- {1 \over r}\right ] $$

