The Hamiltonian is a quantity of great importance in both classical and quantum mechanics. Whereas the Lagrangian treats each generalised coordinate and its rate of change as independent, the Hamiltonian treats the generalised coordinate and its canonically conjugate momentum as independent. Lagrangian mechanics produces second order differential equations, one for each generalised coordinate. Hamiltonian mechanics leads to first order differential equations, which makes it often easier for solving problems computationally.
In classical dynamics, the Hamiltonian is defined to be
For many problems the Hamiltonian is the same as the total energy of the system.
Hamilton's equations are:
The canonically conjugate momentum is
which is the familiar expression for the energy of a simple harmonic oscillator.
The equations of motion are:
Inserting this into the first equation, we get . This is same as if we had used Newton's second law, .
The Hamiltonian for many quantum mechanical systems can be obtained by writing down a corresponding classical Hamiltonian and promoting all of the coordinates and momenta to operators. The non-relativistic Hamiltonian is
The quantum mechanical Hamiltonian is of central importance to the Schrodinger equation.