Deriving the Hamiltonian | A generalization of Beltrami's Identity