Hamilton’s crowning achievement was deriving both Lagrangian mechanics and Hamiltonian mechanics, directly in terms of a general form of his principle of least action S.
The Hamilton-Jacobi theory uses a canonical transformation of the Hamiltonian to a solvable form. Relate surfaces of constant action integral to corresponding particle momenta.