For what value of $v_0$ is the solution periodic?

A solution of the second-order differential equation $$x''+x-x^3=0$$ satisfies the initial condition $x(0)=0$ and $x'(0)=v_0$. For what value of $v_0$ is the solution periodic?

I have tried using the phase-plane method, starting by writing $$x'=y \tag{1}$$ $$y'=x^3-x \tag{2}$$ So I have $$\frac{dy}{dx}=\frac{y'}{x'}=\frac{x^3-x}{y}$$ $$y^2=\frac{x^4}{2}-x+c=$$ For the initial equation $x(0)=0$ and $x'(0)=v_0$, it follows that $c=v_0^2$ and I have $$y^2= \frac{x^4}{2}-x^2+v_0^2 = \frac{(x^2-1)^2+2v_0^2-1}{2} \tag{3}$$ But I'm stuck on this. How can I determine the value $v_0$ that makes this solution a periodic solution? What condition ensures that this is a periodic solution? Or generally, what is the general idea to find $v_0$ that makes this solution a periodic solution?

Edit: Fix the typo $(x-1)^2 \rightarrow (x^2-1)^2$

Equation $(3)$ seems to say it all, provided you fix the typo to $(x^2-1)^2$ because if $v_0>\frac1{\sqrt2}$ then $y=x^{\prime}>0$, so $x$ just keeps on going. If $v_0=\frac1{\sqrt2}$, then when $y=x^{\prime}=0$, $x=1$, so $y^{\prime}=x^{\prime\prime}=0$ also, so (unstable) equilibrium is reached, so the system never turns around. Or, put another way, $$\frac1{\sqrt2}dt=\frac{dx}{1-x^2}$$ So it takes infinite time to reach $x=1$. If $v_0<\frac1{\sqrt2}$, then the turnaround point is reached in finite time and there is acceleration back to the starting point at that point and the system is conservative, so it's periodic. The same analysis works if $v_0>-\frac1{\sqrt2}$, so the range of periodicity seems to be $v_0\in(-\frac1{\sqrt2},\frac1{\sqrt2})$, but I seem to have been batting $0.000$ in dynamical systems lately so you might want to check over my statements carefully.
• I don't get this statement "If $v_0=\frac1{\sqrt2}$, then when $y=x^{\prime}=0$, $x=1$, so $y^{\prime}=x^{\prime\prime}=0$". Could you explain this more? Why $y=x^{\prime}=0$, $x=1$ when $v_0=\frac1{\sqrt2}$? May 29, 2016 at 9:51
• Just insert $v_0=\frac1{\sqrt2}$ into equation $(3)$ and see what happens to $y$ when $x\rightarrow1$. I posted an improved phase portrait where you can see more clearly what goes on near such X-points. It shows how they divide phase space. Passing orbits above and below, one-time turnaround orbits left and right, and bound orbits inside. It takes infinite time to reach them along a red trajectory, also infinite time to leave them. May 29, 2016 at 13:55
• Thank you, sorry for asking you too much. I already understand most part of your answer. Now I'm trying to understand the general idea of finding the condition that makes a solution periodic, and this would be my last question. I was just wondering how could you find the number $v_0=\frac{1}{\sqrt{2}}$ ? May 29, 2016 at 14:26
• A periodic solution must turn around at some point so that $x^{\prime}=y=0$ some time. In equation $(3)$ this is impossible if $v_0>\frac1{\sqrt2}$ because you are then adding a square to a positive number. If $v_0<\frac1{\sqrt2}$ we can solve for $(x^2-1)^2=2y^2+1-2v_0^2>0$ so we see that $|x|<1$ because it starts out that way and $|x|=1$ is impossible. So it's trapped in that finite well. When $x^{\prime}=0$, $x^{\prime\prime}\ne0$, so it doesn't get stuck anywhere. And it's a conservative system so the energy doesn't change after a cycle. May 29, 2016 at 14:59