Periodicity of a specific non-linear ODE of second order

Consider the second-order ODE: $$\ddot{x} + x+x^2=0,$$ here $\ddot{x}$ is the second derivative w.r.t. $t$. Take initial values $x(0)=0.5$ and $\dot{x}(0)=0.$

Question: is the solution periodic or not?

Comment: Numerical experiments seems to show that the solution is periodic when $x(0)<0.5$ and if $x(0)>0.5$ then the solution fails to be periodic, in fact, $x(t)\rightarrow -\infty.$

(Asked by Prof. J.E. Björk, Stockholm Univ.)

• Since solution trajectories are level sets of the Hamiltonian $H(x,\dot{x}) = \frac{1}{2}\dot{x}^2 + \frac{1}{2}x^2 + \frac{1}{3}x^3$, are you asking about the level set of $H$ running through (.5,0)? – Aaron Hoffman Feb 8 '13 at 16:04
• Aaron Hoffman: Yes, that is correct. – Per Alexandersson Feb 9 '13 at 9:37

As Aaron Hoffman pointed out, all trajectories lie on the level lines of $p^2+x^2+(2/3)x^3=c$. The LHS has two critical points: the local minimum $(0,0)$ with critical value $c=0$, and the saddle $(-1,0)$ with critical value $c=1/3$. The behavior for large $(x,p)$ is also clear. So it is easy to sketch all these level lines, and the conclusion is that the trajectory starting from $(x_0,0)$ is bounded if and only if $x_0^2+(2/3)x_0^3\leq 1/3$, and closed when this inequality is strict. For $x_0=0.5$ we obtain that the trajectory is not really closed, but tends to $(-1,0)$ as time goes to infinity.
You cannot detect this on computer because the point $(-1,0)$ is unstable. It takes infinite time to approach it on the trajectory, but once you miss, no matter how little, you will be either on a closed trajectory or escape to infty. And it will take you long time to find out, if you miss very little.
• Finding the length of the period is simple. You write your equation as $(dx/dt)^2=P(x)$. This is separable, and the period $T=\int dx/\sqrt{P},$ where the integration is over the closed trajectory. This is an elliptic integral; it can be brought to a standard form, and this gives an explicit answer. – Alexandre Eremenko Feb 11 '13 at 14:30