Undamped simple Pendulum written in Hamiltonian form Show that the equation of motion for an undamped simple pendulum 
$y'' + \frac{g}{l}sin(y)=0$ 
can be written in Hamiltonian form.
So this is the Euler-Lagrange form of the simple pendulum equation, which I know can be written in Hamiltonian form, and from there I can extract the canonical/Hamilton equations, nonetheless, if I attempt to write this as a system of first order differential equations and attempt to define the potential and kinetic energy I become stuck. So far I have the first order equations
$y_1'=y_2$
$y_2'=-\frac{g}{l}sin(y_1)$
nonetheless, if I define the potential as 
$y_2'=-\frac{g}{lm}sin(y_1) = -\frac{1}{m}\frac{dU(y)}{dy}$
taking the kinetic energy as T=$\frac{my_2^2}{2}$, 
then the total energy would read 
$E(y_1,y_2) = U(y_1) + \frac{my_2^2}{2}$,
$E(y_1,y_2) = \frac{g}{l}cos(y_1) + \frac{my_2^2}{2}$,
hence, the Hamiltonian form would read 
$y_1' = my_2$  and   $y_2' = -\frac{g}{ml}sin(y_1)$
Is the Total energy equation correct? As well as the Hamilton equations? Any help would be greatly appreciated. 
 A: Multiply the original equation with $y'$ and integrate to get
$$
C=\frac{y'^2}2+\frac{g}{l}(1-\cos y).
$$
If you want to introduce further physical context, notice that $y$ is the angle, thus $y'$ the angular velocity, so that the tangential velocity is $ly'$ and thus scaling to have a kinetic energy term gives
$$
E = m\frac{(ly')^2}2+mgl(1-\cos(y)),
$$
where $l(1-\cos y)$ is the height over the rest position of the pendulum of length $l$ with center in $(0,l)$, so that $mgl(1-\cos(y))$ is indeed the potential energy.
The impulse variable for $y$ is then $p=ml^2y'$, so that
\begin{align}
H(y,p)&=\frac{p^2}{2ml^2}+mgl(1-\cos(y))\\
y'&=H_p=\frac{p}{ml^2}\\
p'&=-H_y=-mgl\sin(y)\\
y''=\frac{p'}{ml^2}&=-\frac gl\sin y
\end{align}
and indeed the Hamiltonian system returns the original equation.
A: Define the potential a bit different
$$
-\frac{gm}{l}\sin y_1 = - \frac{\partial}{\partial y_1}U(y_1)
$$
and the kinetic energy as 
$$
T = \frac{1}{2}my_2^2
$$
The Hamiltonian is then
$$
H(y_1, y_2) = \frac{1}{2}my_2^2 + U(y_1)
$$
and the equations of motion are
\begin{eqnarray}
\frac{{\rm d}y_1}{{\rm d}t} &=& \frac{\partial H}{\partial y_2} = my_2 \\
\frac{{\rm d}y_2}{{\rm d}t} &=& -\frac{\partial H}{\partial y_1} = -\frac{\partial U}{\partial y_1} = -\frac{gm}{l}\sin y_1
\end{eqnarray}
That being said, I don't see why you need to introduce the factor $m$. If you truly need it in your equations, remember that $H$ and $H/m$ will lead to the same equations of motion
