What went wrong? [One-dimensional-inverse-square-law] Intrigued by this question,
one-dimensional inverse square laws,
I started to try to find an answer and came up with what follows. However, I calculated the derivatives to double check myself, and this does not work. However, it seems straightforward enough that I do not see my mistake.

Question: Is there a closed form solution to all

$$ \ddot x = \frac{k}{x^2}  \quad (x(0)=x_0), \  \dot{x}(0) = v_0, \ k \in \mathbb{R}.$$

Here is my very naive two cents. Multiplying both sides by $\dot{x}$ and obtain,

$$ \dot{x} \ddot{x} =  \frac{k \dot{x}}{x^2}.$$

Integrating both sides,  we obtain
\begin{equation} \tag{1} \frac{ (\dot{x})^2}{2} = -\frac{k}{x} + C. \end{equation}

Here it seems natural to re-write this as,
\begin{equation} \tag{2} \dot{x} = \sqrt{2} \sqrt{C - \frac{k}{x}}. \end{equation}
I do not know if that is fully acceptable. However, if it is we then have via integration one more time, or rather letting WolframAlpha integrate one side,

$$x(t) = \sqrt{2} x \sqrt{C - \frac{k}{x}} - \frac{ k \log \left( 2 \sqrt{C} x \sqrt{C - \frac{k}{x}} + 2Cx - k \right)}{\sqrt{2C}} + \tilde{C}. $$

Note, that both $C$ and $\tilde{C}$ are determined by initial conditions. Using the given initial conditions and (1), we can solve for $C$, to find that $C = \frac{v_0^2}{2} + \frac{k}{x_0}.$ Similarly we could solve for $\tilde{C}$, but before I did that I discovered my solution was wrong.

If you substitute my "solution" back into the differential equation, you find (much to my dismay)

$$ \ddot{x} = \frac{k}{x^2 \sqrt{2c - \frac{k}{x}}}. $$

Insight on my  mistake and/or a proper way to solve this is greatly appreciated.
Your manipulations are quite nice, and I enjoyed reading them, but I thought I'd point out they can be put in the language of conservation laws. You started with a differential equation

\begin{align*}
\ddot x(t) = F(x(t)) &amp;&amp; x(0) =x_0 &amp;&amp; \dot x(0) = v_0
\end{align*}

where $F(x)$ can be thought of as a "force field" on some 1D domain in $\mathbb{R}$. Now let $V = - \int F$ be a potential function (the choice of antiderivative turns out not to affect anything).  Basically, you took $\ddot x = F(x)$, wrote it as $ \dot x \ddot x = \dot x F(x) $ and used the chain rule to identify that with $\frac{d}{dt}\left( \frac{ \dot x^2}{2}  \right)= - \frac{d}{dt} V(x)$ or, in other words,
$$ \frac{d}{dt} \left( \frac{\dot x^2}{2} + V(x) \right) = 0$$
which says that the kinetic energy $K = \frac{\dot x^2}{2}$ and the potential energy $V(x)$ add to a constant $E$ which is fruitfully interpreted as the total energy of the system
$$ \frac{\dot x^2}{2} + V(x) = E.$$
We can calculate $E$ straight away from the initial conditions:  $E = \frac{1}{2} v_0^2 + V(x_0)$. Solving for the velocity, we get
$$ \dot x = \pm \sqrt{2(E-V(x(t))) }$$
which is a 1st order, automomous (in particular, separable) ODE. According as the intial velocity $v_0$ is positive or negative, we can safely assume that $\dot x(t)$ will retain its sign for a short time afterwards and remove the $\pm$ sign. For instance, if we suppose $v_0 &gt; 0$, then, for sufficiently small $t$, we apply the usual technique of separating variables:
$$ t = \int_0^t \ ds =  \int_0^t \frac{ \dot x(s) }{ \sqrt{ 2(E-V(x(s)))} } \ ds = \int_0^{x(t)} \frac{1}{ \sqrt{2(E-V(x))}} \ dx$$
which yields (assuming the integral can be solved) an equation relating $x(t)$ and $t$. In the case of the inverse square attractive force, we have $F(x) = \frac{-k}{x^2}$ whence $V = -\frac{k}{x}$ is a potential function so the integral becomes
$$ t = \int_0^{x(t)} \frac{1}{ \sqrt{2\left( E+ \frac{k}{x} \right)}} \ dx $$
which is a bit beyond me, but not beyond most integration packages.
With the non bound states (K>0, K&lt;0 and E>0) the solutions are not periodic. The complicated logarithmic relation between t and x, derived in previous posts, applies to these cases. If K&lt;0 (attractive inverse square case)and E&lt;0 then we can have bound states oscillating about the origin; i.e. we get periodic behavior. (don't worry about negative energy this just means it takes work to remove the particle from its bound state to infinity which is the reference zero of energy). The solution for this case follows the same method as reported by mikeF; when E= -|k|/x_a , where $x_a$ is the amplitude of the oscillation in the potential well. For a particle of mass m the integral for t can be done explicitly using the techniques shown earlier. The answer for the attractive inverse square law is 

$$\gamma t =   [arctan( \sqrt{\frac{x}{x_a-x}}) - \frac{\sqrt{x(x_a-x)}}{x_a}].$$

where $\gamma = \sqrt {\frac{2|k|}{m.x_a^3}}$ and $x_a=\frac{-2|k||x_o|}{mv_o^2|x_o|-2|k|}= \frac{|k|}{|E|}$

We can use this to find the period, T, of oscillation in such a 1-d potential: If t is the time to go from x=0 to $x = x_a$ then $T= 4t= 2\pi.\frac{1}{\gamma}= \sqrt{\frac{m.x_a^3}{2|k|}}.$

This is the one dimensional analogue of Kepler's third law which says that the period of oscillation squared is proportional to the amplitude cubed and is a consequence of the inverse square law.