For a parametrized curve on the surface, the energy of a curve is
where the first fundamental form coefficients are evaluated at . A fixed-endpoint variation of a curve has coordinate variation fields vanishing at . Differentiating under the integral and integrating their derivative terms by parts gives
The fields can be chosen independently with compact support in . Stationarity and the fundamental lemma of the calculus of variations therefore force both coefficients to vanish. These Euler-Lagrange equations are the geodesic equations: