Hamiltonian is the Legendre Transform of the Lagrangian with respect to . Here is the trajectory.

Then is generalized momentum, and we have . This equation should give which we sub in to find formula for .

Hamilton’s equations

Suppose satisfies the Euler-Lagrange equations (which it ought to). Then satisfies: