# Show the energy function $E(t):= \frac{1}{2} (u'(t))^2 - \int^{u(t)}_{u_0}f(s)ds$ is constant for every solution to Differential equation

The Differential equation is given as $$\begin{cases} u''(t)=f(u(t)) & \text{for}\ t\in I \\ (u(0),u'(0)=(u_0,v_0) \end{cases}$$

where $(u_0,v_0)\in \mathbb{R}^2$ and $f \in \mathcal{C}({\mathbb{R}})$ and $I$ is the maximum interval of existence for some solution to the Differential equation.

Now if we assume $u$ is a solution, I want to show that the energy function

$$E(t):= \frac{1}{2} (u'(t))^2 - \int^{u(t)}_{u_0}f(s)ds$$ is constant and I want to know which Differential equation u' suffices.

As there is not too much information to go from, I tried showing the first derivative is zero, implying via the MVT that the function must be constant.

What should I look at or which method can I use to show the function is constant? A good hint would be very much appreciated!

The first derivative of $E$ is $$E'(t) = u'(t) u''(t) - f(u(t)) u'(t) = 0, \qquad \forall t\in I.$$
Hint. Multiply both sides of $u''(t)-f(u(t))=0$ by $u'(t)$ and integrate with respect to $t$. Then we obtain $$\int(u''(t)u'(t)-f(u(t))u'(t))dt=C$$ that is $$\frac{(u'(t))^2}{2}-\int f(u) du=C.$$