I am trying to find $v_0$ such that $$(x'(t))^2=v_0^2+\cos(x)-\dfrac 1{\sqrt 2}$$ $v_0>0$, $x(0)= \dfrac \pi 4$ and we want the solution to be bounded. In addition $x'(t)\neq 0$ $\forall t \in R$
and I am really stuck with trying to solve $$\int \dfrac { dx}{\sqrt{v_0^2+\cos(x)-1/\sqrt2}}=\pm t+c$$ How do I proceed?
You are simulating the pendulum $x''=-\frac12\sin(x)$. The periodic solutions have points where the direction changes, that is, zero-crossings of the velocity. The rotational solutions are not bounded, the angle steadily increases. Thus the only solution that has the demanded characteristics connects the saddle points at $x=\pm\pi$. The integration constant of that solution is the same as at the saddle point, even if the solution never reaches it. This gives $$(x')^2=\cos(x)+1=2\cos^2(x/2)$$ along the solution and then $$v_0^2=1+\frac1{\sqrt2}$$ for the velocity at the angle $x=\frac\pi4$.