the energy functional
If you want to find the shortest road between two towns you could minimize total distance — but distance has an awkward feature: it does not care how fast you drive, so it gives no information about parametrization, and the square root inside it makes calculus messy. The energy functional is a smoother surrogate. For a curve gamma on a Riemannian manifold it is E(gamma) = (1/2) integral over [0,1] of |gamma'(t)|^2 dt — the integral of speed squared, the same quantity a physicist calls kinetic action. Minimizing energy and minimizing length turn out to single out the same curves, but energy is far friendlier to work with.
Here is the link, by Cauchy-Schwarz. For a curve on [0,1], L(gamma)^2 = (integral |gamma'| dt)^2 is at most integral 1 dt times integral |gamma'|^2 dt = 2 E(gamma), with equality exactly when |gamma'| is constant. So L^2 <= 2E always, and the two functionals have the same minimizers precisely among constant-speed curves. The advantage is that E is a genuinely smooth function on the space of curves, with no square root to spoil differentiation. Computing its critical points — setting the first variation to zero — gives the geodesic equation directly: critical curves of energy are exactly geodesics, parametrized proportionally to arc length, with no reparametrization ambiguity to mod out.
Energy is the gateway to the variational and Morse-theoretic study of geodesics. Its second variation defines the index form, whose negative directions are counted by the Morse index theorem and detected by conjugate points; its sublevel sets organize the loop space into a Morse complex (this is how Bott computed the homotopy of the classical groups). Caveat: energy depends on the parametrization interval — rescaling time changes E but not L — so energy lives most naturally on curves with a fixed domain, and its minimizers are automatically the constant-speed minimizing geodesics.
Compare two parametrizations of the same straight segment in R^n from p to q on [0,1]: the constant-speed one gamma(t) = (1-t)p + tq has |gamma'| = |q-p| constant, so E = (1/2)|q-p|^2 and L = |q-p|, giving L^2 = 2E. A speed-up-then-slow-down reparametrization traces the identical path with the same length L but a strictly larger E, because Cauchy-Schwarz is strict whenever the speed varies. Energy thus 'penalizes' uneven pacing.
Same path, same length, different energy: E is minimized only by the constant-speed parametrization.
Length is reparametrization-invariant; energy is not. That is a feature, not a bug — energy's critical points come pre-parametrized at constant speed, which is exactly why one differentiates E rather than L.