The equation of a pendulum is given by $\ddot{\theta}=-\sin(\theta)$ so we write this as a system $$\begin{cases} \theta'=\dot\theta\\ (\dot\theta)'=\ddot\theta=-\sin(\theta)\end{cases}$$ The vector field associated to this system is $\vec{F}(\theta,\dot\theta)=(\dot\theta,-\sin\theta)$ and the integral curves are given by $$\dot\theta^2=2\cos(\theta)+c\;\;\;\; (*)$$ I want to understand how to obtain the last equation $(*)$.
My undestanding is that if we have a curve $\gamma(t)=(\theta(t),\dot\theta(t))$ then we need the vector $\gamma'(t)$ to be colinear to the vector field $\vec{F}(\theta,\dot\theta)=(\dot\theta,-\sin\theta)$ but I can't see how write this into equations that lead to $(*)$.
Multiply the first equation by $\dot \theta$ to obtain \begin{align} \dot \theta \ddot \theta & = -\dot \theta \sin \theta \\ \frac{1}{2} \frac{d}{dt} \dot \theta^2 & = \frac{d}{dt} \cos \theta \\ \frac{d}{dt} \left(\frac{1}{2} \dot \theta^2 - \cos \theta \right) & = 0 \\ \frac{1}{2}\dot \theta^2 - \cos \theta & = E, \end{align} where $E$ is a constant of integration.