Transform differential equation $u'' +f(u) = 0$ into system of first order For $f \in C^1(\mathbb{R})$ let the following differential equation be given: $u'' +f(u) = 0$.
How can one transform this equation into a system of first order and give a non-constant first integral of this system?
I know that $f(u)= \omega^2 \sin(u)$ describes the mathematical pendulum and that we probably need this to transform the equation, but I'm not sure how!
I found a page which described the nonlinear pendulum, but it describes it by using a second order differential equation:

 A: Let $v=u'$, so that $u'' + f(u) = 0$ becomes equivalent to the system $$\begin{cases}u' = v \\  v' = -f(u) \end{cases}$$This is a Hamiltonian system. Namely, if one thinks of $u$ as position and $v$ as momentum, then we have that $$\begin{cases} u' = \dfrac{\partial H}{\partial v} \\[1em] v' = -\dfrac{\partial H}{\partial u},\end{cases}$$where $H(u,v) = F(u) + v^2/2$, and $$F(u)= \int_{u_0}^u f(s)\,{\rm d}s$$By conservation of energy, if $t \mapsto (u(t),v(t))$ is a solution to the system, then $t \mapsto H(u(t),v(t))$ is a constant. Thus, if $t \mapsto u(t)$ is a solution to $u''+f(u)=0$, we have that $$\int_{u_0}^{u(t)} f(s)\,{\rm d}s + \frac{u'(t)^2}{2} = c$$for some constant $c \in \Bbb R$, for all $t$ in the domain of the solution.
A: $$\frac{d^2u}{dx^2}+f(u)=0$$ Switch variables and the equation becomes
$$\frac{\frac{d^2x}{du^2}}{\left(\frac{dx}{du}\right)^3 }=f(u)$$ Reduction of order $p=\frac{dx}{du}$ gives
$$\frac {p'}{p^3}=f(u)\implies -\frac 1{2p^2}=\int f(u)\,du+c_1$$
$$p=\frac{dx}{du}=\pm\frac 1{\sqrt{c_1+2\int f(u)\,du }}$$
A: A common rule of thumb is that if you have $m$ $n$th order systems, then it is the same as $m\times n$ $1$st order systems. If we start with:
$$u''+f(u)=0$$ we can make the substitutions:
$$z_1=u$$
$$z_2=u'$$
and we then get that:
$$z_1'=u'=z_2$$
$$z_2'=u''=-f(u)=-f(z_1)$$
which leaves us with the system:
$$\begin{cases}z_1'=z_2\\z_2'=-f(z_1)\end{cases}$$
