significant change in their overall length s. This may be expressed mathematically using the calculus of variations where τ is the proper time, s = cτ is the arc-length in space-time and T is defined as in analogy with kinetic energy. If the derivative with respect to proper time is represented by a dot for brevity T may be written as Constant factors (such as c or the square root of two) don't affect the answer to the variational problem; therefore, taking the variation inside the integral yields Hamilton's principle The solution of the variational problem is given by Lagrange's equations When applied to t and φ, these equations reveal two constants of motion which may be expressed in terms of two constant length-scales, and As shown above, substitution of these equations into the definition of the Schwarzschild metric yields the equation for the orbit. Hamiltonian approach A Lagrangian solution can be recast into an equivalent Hamiltonian form. In this case, the Hamiltonian is given by Once again, the orbit may be restricted to by symmetry. Since and do not appear in the Hamiltonian, their conjugate momenta are constant; they may be expressed in terms of the speed of light and two constant length-scales and The derivatives with respect to proper time are given by Dividing the first equation by the second yields the orbital equation The radial momentum pr can be expressed in terms of r using the constancy of the Hamiltonian ; this yields the fundamental orbital equation Hamilton–Jacobi approach The orbital equation can be derived from the Hamilton–Jacobi equation. The advantage of this approach is that it equates the motion of the particle with the propagation of a wave, and leads neatly into the derivation of the deflection of light by gravity in general relativity, through Fermat's principle. The basic idea is that, due to gravitational slowing of time, parts of a wave-front closer to a gravitating mass move more slowly than those further away, thus bending the direction of the wave-front's propagation. Using general covariance, the Hamilton–Jacobi equation for a single particle of unit mass can be expressed in arbitrary coordinates as This is equivalent to the Hamiltonian formulation above, with the partial derivatives of the action taking the place of the generalized momenta. Using the Schwarzschild metric gμν, this equation becomes where we again orient the spherical coordinate system with the plane of the orbit.