Integral of equation of motion for pendulum

I am reading a book on pendulums and at some point during the derivation of the period of the pendulum, the authors jump from one equation (I) to another (II). I would be really grateful if someone could clarify the steps between these two equations. Here is the part, copied from p.43 of the book (Baker, Gregory L., and James A. Blackburn. The pendulum: a case study in physics. Oxford University Press, 2005.):

By substituting $$d\theta=\displaystyle\frac{d\theta}{dt}dt$$ the equation of motion becomes:

$$\displaystyle\frac{d\theta}{dt}\frac{d^2\theta}{dt^2}dt=-\displaystyle\frac{g}{l}sin\theta d\theta$$ (Equation I)

The integral of this equation [...] is:

$$(\displaystyle\frac{d\theta}{dt})^2=\displaystyle\frac{2g}{l}cos\theta + C$$ (Equation II).

Specifically I am interested on the LHS of Equations I and II. Thank you.

As $$\frac{d^2\theta}{dt^2} = \frac{d\left(\frac{d\theta}{dt}\right)}{dt}$$
letting $$\frac{d\theta}{dt} = \theta'$$
we get on the LHS - $$\frac{d\theta}{dt}\frac{d^2\theta}{dt^2}dt=\theta'\frac{d\theta'}{dt}dt = \theta'd\theta'$$
integrating which we get $$\frac{\left(\frac{d\theta}{dt}\right)^2}{2}$$ on the LHS.