Defining the momentum to be p i = m i ⁠ d q i / dt ⁠, Hamilton's equations of motion for the n -body problem become d q i d t = ∂ ∂ H ∂ ∂ p i d p i d t = − − ∂ ∂ H ∂ ∂ q i , where the Hamiltonian function is H = T + U and T is the kinetic energy T = ∑ ∑ i = 1 n ‖ p i ‖ 2 2 m i .