Hamiltonian function, mathematical definition introduced in 1835 by Sir William Rowan Hamilton to express the rate of change in time of the condition of a dynamic physical system—one regarded as a set of moving particles. The Hamiltonian of a system specifies its total energy—i.e., the sum of its kinetic energy (that of motion) and its potential energy (that of position)—in terms of the Lagrangian function derived in earlier studies of dynamics and of the position and momentum of each of the particles.
The Hamiltonian function originated as a generalized statement of the tendency of physical systems to undergo changes only by those processes that either minimize or maximize the abstract quantity called action. This principle is traceable to Euclid and the Aristotelian philosophers.
When, early in the 20th century, perplexing discoveries about atoms and subatomic particles forced physicists to search anew for the fundamental laws of nature, most of the old formulas became obsolete. The Hamiltonian function, although it had been derived from the obsolete formulas, nevertheless proved to be a more correct description of physical reality. With modifications, it survives to make the connection between energy and rates of change one of the centres of the new science.