It is frequently said that geodesics are "straight lines in curved space". By using the Hamilton–Jacobi approach to the geodesic equation, this statement can be given a very intuitive meaning: geodesics describe the motions of particles that are not experiencing any forces. In flat space, it is well known that a particle moving in a straight line will continue to move in a straight line if it experiences no external forces; this is Newton's first law. The Hamiltonian describing such motion is well known to be with p being the momentum. It is the conservation of momentum that leads to the straight motion of a particle. On a curved surface, exactly the same ideas are at play, except that, in order to measure distances correctly, one must use the metric. To measure momenta correctly, one must use the inverse of the metric. The motion of a free particle on a curved surface still has exactly the same form as above, i.e. consisting entirely of a kinetic term. The resulting motion is still, in a sense, a "straight line", which is why it is sometimes said that geodesics are "straight lines in curved space". This idea is developed in greater detail below.
Using the energy given above as the action, one may choose to solve either the Euler–Lagrange equations or the Hamilton–Jacobi equations. Both methods give the geodesic equation as the solution; however, the Hamilton–Jacobi equations provide greater insight into the structure of the manifold, as shown below. In terms of the local coordinates on M, the geodesic equation is where the xa are the coordinates of the curve γ, are the Christoffel symbols, and repeated indices imply the use of the summation convention.
Hamiltonian approach to the geodesic equations
Geodesics can be understood to be the Hamiltonian flows of a special Hamiltonian vector field defined on the cotangent space of the manifold. The Hamiltonian is constructed from the metric on the manifold, and is thus a quadratic form consisting entirely of the kinetic term. The geodesic equations are second-order differential equations; they can be re-expressed as first-order equations by introducing additional independent variables, as shown below. Note that a coordinate neighborhood U with coordinates xa induces a local trivialization of by the map which sends a point of the form to the point. Then introduce the Hamiltonian as Here, gab is the inverse of the metric tensor: gabgbc =. The behavior of the metric tensor under coordinate transformations implies that H is invariant under a change of variable. The geodesic equations can then be written as and The flow determined by these equations is called the cogeodesic flow; a simple substitution of one into the other obtains the Euler–Lagrange equations, which give the geodesic flow on the tangent bundleTM. The geodesic lines are the projections of integral curves of the geodesic flow onto the manifold M. This is a Hamiltonian flow, and the Hamiltonian is constant along the geodesics: Thus, the geodesic flow splits the cotangent bundle into level sets of constant energy for each energy E ≥ 0, so that