The orbital equation can be derived directly from the Hamilton–Jacobi equation. Adopting the radial distance r and the azimuthal angle φ as the coordinates, the Hamilton-Jacobi equation for a central-force problem can be written 1 2 m ( d S r d r ) 2 + 1 2 m r 2 ( d S φ φ d φ φ ) 2 + U ( r ) = E t o t where S = S φ (φ) + S r (r) − E tot t is Hamilton's principal function, and E tot and t represent the total energy and time, respectively. This equation may be solved by successive integrations of ordinary differential equations, beginning with the φ equation d S φ φ d φ φ = p φ φ = L where p φ is a constant of the motion equal to the magnitude of the angular momentum L. Thus, S φ (φ) = L φ and the Hamilton–Jacobi equation becomes 1 2 m ( d S r d r ) 2 + L 2 2 m r 2 + U ( r ) = E t o t