Mechanics exercise using Newton’s second law. Could anyone help me with this question?-
Suppose a particle of mass m with position $x>0$ moves in 1D space under the influence of the gravitational force of another point particle with mass $M$ sitting at $x=0$.
The question gives
$$\mathbf F=-\frac{GmM}{x^2}i$$
And asks to prove $$\frac{d}{dt}(\frac{m \dot{x}^2}{2}- \frac{GmM}{x})=0 $$
Using Newton’s second law. I understand that $\mathbf F= ma = m\frac{dv}{dt}$ and that $ \frac{m \dot{x}^2}{2}$ is the formula for kinetic energy but I can’t figure out how to put all of this together to get the form the question is asking for.
Any help would be much appreciated!
 A: $$\mathbf{F}=-\frac{GmM}{x^2}\hat i=ma \hat i=m\ddot x \hat i$$or$$\left(m\ddot x+\frac{GmM}{x^2}\right)\hat i=0$$
Let's do a line integral of this quantity. Since the integrand is zero, the integral will be null. Use $\hat i\cdot dx\hat i=dx$.
$$0=\int\left(m\ddot x+\frac{GmM}{x^2}\right)dx$$
We integrate by parts the first term:
$$\int m\ddot xdx=m\dot x^2-\int m\dot xd\dot x=\frac12m\dot x^2+c_1$$
$c_1$ is a constant of integration.
For the second integral:
$$\int\frac{GmM}{x^2}dx=-\frac{GmM}x+c_2$$
Putting everything together, $$\frac12m\dot x^2-\frac{GmM}x=C$$
Here $C$ is a constant, in this case the total energy (kinetic+potential). Since the left hand side is a constant, the derivative is zero.
A: 
The question gives $$\mathbf F=-\frac{GmM}{x^2}\mathbf i$$

Hence, \begin{align}m\ddot{x}\mathbf i&=-\frac{GmM}{x^2}\mathbf i\\\ddot{x}&=-\frac{GM}{x^2}\end{align}

And asks to prove $$\frac{\mathrm d}{\mathrm dt}\left(\frac{m \dot{x}^2}{2}- \frac{GmM}{x}\right)=0.$$

\begin{align}\text{LHS}=&\frac{\mathrm d}{\mathrm dt}\left(\frac{m \dot{x}^2}{2}\right)-\frac{\mathrm d}{\mathrm dx}\left(\frac{GmM}x\right)\frac{\mathrm dx}{\mathrm dt}\\
=&m\dot{x}\ddot{x}+\left(\frac{GmM}{x^2}\right)\dot x\\
=&m\dot{x}\left(-\frac{GM}{x^2}\right)+\left(\frac{GmM}{x^2}\right)\dot x\\
=&\text{RHS}\end{align}
