In Hamiltonian mechanics, the dynamics of a system are represented by a function called the Hamiltonian, which in many cases of interest is equal to the total energy of the system. The Hamiltonian is a function of the positions and the momenta of all the bodies making up the system, and it may also depend explicitly upon time. The time derivatives of the position and momentum variables are given by partial derivatives of the Hamiltonian, via Hamilton's equations. The simplest example is a point mass m constrained to move in a straight line, under the effect of a potential. Writing q for the position coordinate and p for the body's momentum, the Hamiltonian is H ( p , q ) = p 2 2 m + V ( q ) . In this example, Hamilton's equations are d q d t = ∂ ∂ H ∂ ∂ p and d p d t = − − ∂ ∂ H ∂ ∂ q . Evaluating these partial derivatives, the former equation becomes d q d t = p m , which reproduces the familiar statement that a body's momentum is the product of its mass and velocity. The time derivative of the momentum is d p d t = − − d V d q , which, upon identifying the negative derivative of the potential with the force, is just Newton's second law once again.