Second Variation Formula (Theorem # 2729)
Theorem
Let $\gamma: [0, T] \to M$ be a unit-speed geodesic ($|\dot{\gamma}| = 1$, $\frac{\nabla}{dt}\dot{\gamma} = 0$) and $H(t,s)$ a smooth variation of $\gamma$. Let $Y(t, s) = \frac{\partial H}{\partial s}(t, s)$ and $Y'(t) = \frac{\nabla}{dt}Y(t, 0)$.
1. **Second variation of energy:**
\begin{align*}
\left.\frac{d^2}{ds^2} E(\gamma_s)\right|_{s=0} = g\!\left(\frac{\nabla Y}{ds}(t, 0),\, \dot{\gamma}(t)\right)\bigg|_0^T + \int_0^T \left(|Y'|^2 - R(Y, \dot{\gamma}, Y, \dot{\gamma})\right) dt,
\end{align*}
where $R$ denotes the $(0,4)$ Riemann curvature tensor.
2. **Second variation of length:** Let $Y_n = Y - g(Y, \dot{\gamma})\dot{\gamma}$ be the normal component of $Y$ along $\gamma$. Then
\begin{align*}
\left.\frac{d^2}{ds^2} \ell(\gamma_s)\right|_{s=0} = g\!\left(\frac{\nabla Y_n}{ds}(t, 0),\, \dot{\gamma}(t)\right)\bigg|_0^T + \int_0^T \left(|Y'_n|^2 - R(Y_n, \dot{\gamma}, Y_n, \dot{\gamma})\right) dt.
\end{align*}
Discussion
No discussion available for this theorem.
Proof
[proofplan]
We work under the standard hypothesis for the second variation formula on path space $\Omega(p, q)$: the variation $H : [0, T] \times (-\varepsilon, \varepsilon) \to M$ is **endpoint-fixing**, meaning $H(0, s) = \gamma(0)$ and $H(T, s) = \gamma(T)$ for all $s$. Equivalently, the variation field $Y = \partial_s H|_{s = 0}$ satisfies $Y(0) = Y(T) = 0$. Part 1 differentiates the energy twice in $s$ and uses metric compatibility and the symmetry $\nabla_s \partial_t H = \nabla_t \partial_s H$ for pullback covariant derivatives (no bracket, since $[\partial_t, \partial_s] = 0$). The second mixed covariant derivative is rewritten via the Riemann curvature. Integrating by parts on each smooth segment, on a smooth geodesic the boundary jumps and the geodesic-equation term vanish. Part 2 decomposes $Y = Y_n + g(Y, \dot\gamma)\dot\gamma$ and uses the endpoint-fixing hypothesis to discard the tangential boundary contribution.
[/proofplan]
[step:Set up the variation, the pullback covariant derivative, and the energy functional]
Let $H : [0, T] \times (-\varepsilon, \varepsilon) \to M$ be the smooth **endpoint-fixing** variation of $\gamma$, with $\gamma_s := H(\cdot, s)$, $\gamma_0 = \gamma$, and $H(0, s) = \gamma(0)$, $H(T, s) = \gamma(T)$ for all $s$. Differentiating in $s$ gives $\partial_s H(0, s) \equiv 0$ and $\partial_s H(T, s) \equiv 0$, so the variation field $Y(t) := \partial_s H(t, 0)$ satisfies $Y(0) = Y(T) = 0$. Write $\partial_t H, \partial_s H \in \Gamma(H^* TM)$ for the velocity fields of the $t$- and $s$-coordinate curves of $H$. On the pullback bundle $H^* TM \to [0, T] \times (-\varepsilon, \varepsilon)$ the Levi-Civita connection induces a unique connection extending $\nabla$ via the [Covariant Derivative Along a Curve](/theorems/2708); we write $\nabla_t := \nabla_{\partial_t H}$ and $\nabla_s := \nabla_{\partial_s H}$.
Define
\begin{align*}
E : (-\varepsilon, \varepsilon) &\to \mathbb{R} \\
s &\mapsto \frac{1}{2}\int_0^T g\!\left(\partial_t H(t, s),\, \partial_t H(t, s)\right) d\mathcal{L}^1(t).
\end{align*}
The integrand $(t, s) \mapsto g(\partial_t H, \partial_t H)$ is smooth on the compact rectangle $[0, T] \times [-\varepsilon/2, \varepsilon/2]$, so $E \in C^\infty(-\varepsilon, \varepsilon)$ and the differentiation-under-the-integral-sign theorem applies in both $s$-derivatives below.
We will use two structural identities of the Levi-Civita connection on the pullback bundle, both holding for any smooth two-parameter map $H$:
(M) Metric compatibility: $\partial_X g(V, W) = g(\nabla_X V, W) + g(V, \nabla_X W)$ for $X \in \{\partial_t, \partial_s\}$ and $V, W \in \Gamma(H^* TM)$.
(S) Symmetry of the pullback covariant derivative: $\nabla_s \partial_t H = \nabla_t \partial_s H$. There is **no** bracket term: the coordinate vector fields $\partial_t, \partial_s$ on the parameter rectangle satisfy $[\partial_t, \partial_s] = 0$, and the Levi-Civita connection is torsion-free, so the torsion identity $\nabla_s \partial_t H - \nabla_t \partial_s H = T(\partial_t H, \partial_s H) + \mathrm{d}H([\partial_t, \partial_s]) = 0$ holds.
[/step]
[step:Compute the first $s$-derivative and rewrite via $\nabla_s \partial_t H = \nabla_t \partial_s H$]
Differentiate $E$ once. Using identity (M) with $V = W = \partial_t H$ and $X = \partial_s$:
\begin{align*}
\frac{d}{ds} E(\gamma_s) = \frac{1}{2} \int_0^T \partial_s g(\partial_t H, \partial_t H) \, d\mathcal{L}^1(t) = \int_0^T g\!\left(\nabla_s \partial_t H,\, \partial_t H\right) d\mathcal{L}^1(t).
\end{align*}
Apply identity (S) to swap the iterated covariant derivatives:
\begin{align*}
\frac{d}{ds} E(\gamma_s) = \int_0^T g\!\left(\nabla_t \partial_s H,\, \partial_t H\right) d\mathcal{L}^1(t).
\end{align*}
[/step]
[step:Differentiate again in $s$ and convert into a curvature-plus-derivative expression]
Differentiate once more in $s$. Using (M) on the integrand $g(\nabla_t \partial_s H, \partial_t H)$ with $X = \partial_s$:
\begin{align*}
\partial_s g(\nabla_t \partial_s H, \partial_t H) = g(\nabla_s \nabla_t \partial_s H, \partial_t H) + g(\nabla_t \partial_s H, \nabla_s \partial_t H).
\end{align*}
For the second term use (S): $\nabla_s \partial_t H = \nabla_t \partial_s H$, so
\begin{align*}
g(\nabla_t \partial_s H, \nabla_s \partial_t H) = g(\nabla_t \partial_s H, \nabla_t \partial_s H) = |\nabla_t \partial_s H|_g^2.
\end{align*}
For the first term we rewrite $\nabla_s \nabla_t$ using the Riemann curvature. With the chapter sign convention $R = -\nabla \circ \nabla$, the curvature acts on a section $V$ of $H^*TM$ as
\begin{align*}
\nabla_s \nabla_t V - \nabla_t \nabla_s V = -R(\partial_s H, \partial_t H) V,
\end{align*}
so applied to $V = \partial_s H$:
\begin{align*}
\nabla_s \nabla_t \partial_s H = \nabla_t \nabla_s \partial_s H - R(\partial_s H, \partial_t H) \partial_s H.
\end{align*}
Therefore
\begin{align*}
\frac{d^2}{ds^2} E(\gamma_s) = \int_0^T \Big[ g(\nabla_t \nabla_s \partial_s H, \partial_t H) - g(R(\partial_s H, \partial_t H)\partial_s H, \partial_t H) + |\nabla_t \partial_s H|_g^2 \Big] d\mathcal{L}^1(t).
\end{align*}
[guided]
The strategy: starting from
\begin{align*}
\frac{d}{ds} E(\gamma_s) = \int_0^T g\!\left(\nabla_t \partial_s H,\, \partial_t H\right) d\mathcal{L}^1(t),
\end{align*}
we differentiate once more in $s$. The plan is to expand the $s$-derivative of the integrand via metric compatibility, isolate the term that already has a clean form ($|\nabla_t \partial_s H|^2$), and rewrite the remaining mixed-derivative term using the Riemann curvature so that it becomes a total $t$-derivative plus a curvature contribution.
We pull $\partial_s$ inside the integral (justified by smoothness on the compact rectangle, as in Step 1) and apply identity (M) on the pullback bundle to the inner product $g(\nabla_t \partial_s H, \partial_t H)$ in the $\partial_s$-direction:
\begin{align*}
\partial_s g(\nabla_t \partial_s H, \partial_t H) = g(\nabla_s \nabla_t \partial_s H, \partial_t H) + g(\nabla_t \partial_s H, \nabla_s \partial_t H).
\end{align*}
This is just the product rule for the Levi-Civita connection in the $\partial_s$-direction; both summands are inner products of pullback-bundle sections.
Look at the second summand. We have $\nabla_t \partial_s H$ paired with $\nabla_s \partial_t H$. By identity (S) — symmetry of the pullback covariant derivative, which holds because $[\partial_t, \partial_s] = 0$ on the parameter rectangle and the Levi-Civita connection is torsion-free — we may swap $\nabla_s \partial_t H = \nabla_t \partial_s H$. The two factors are then identical, so
\begin{align*}
g(\nabla_t \partial_s H, \nabla_s \partial_t H) = g(\nabla_t \partial_s H, \nabla_t \partial_s H) = |\nabla_t \partial_s H|_g^2.
\end{align*}
This is the term that will eventually become $|Y'|_g^2$ in the second variation formula.
Now the first summand $g(\nabla_s \nabla_t \partial_s H, \partial_t H)$ is the heart of the calculation. We have $\nabla_s \nabla_t \partial_s H$, but we want to relate it to $\nabla_t (\text{something})$ — a $t$-derivative we can integrate by parts on $[0, T]$. The Riemann curvature is exactly the failure of $\nabla_s$ and $\nabla_t$ to commute on sections of the pullback bundle. With our sign convention $R = -\nabla \circ \nabla$, applied to the two coordinate fields $\partial_s, \partial_t$ on the rectangle whose Lie bracket is zero, the curvature acts on a section $V$ of $H^* TM$ as
\begin{align*}
\nabla_s \nabla_t V - \nabla_t \nabla_s V = -R(\partial_s H, \partial_t H) V.
\end{align*}
The hypothesis used here is that $\nabla$ is the Levi-Civita connection on $M$ so that the curvature operator is well-defined and satisfies this bracket identity on the pullback bundle. The minus sign is the chapter sign convention.
Substituting $V = \partial_s H$ rearranges to
\begin{align*}
\nabla_s \nabla_t \partial_s H = \nabla_t \nabla_s \partial_s H - R(\partial_s H, \partial_t H) \partial_s H.
\end{align*}
This is the desired conversion: we have traded $\nabla_s \nabla_t \partial_s H$ (a mixed derivative we cannot integrate) for $\nabla_t \nabla_s \partial_s H$ (a $t$-derivative ready for integration by parts) plus a curvature term (which becomes the curvature term in the second variation).
Putting all three contributions back together inside the integral:
\begin{align*}
\frac{d^2}{ds^2} E(\gamma_s) = \int_0^T \Big[ g(\nabla_t \nabla_s \partial_s H, \partial_t H) - g(R(\partial_s H, \partial_t H)\partial_s H, \partial_t H) + |\nabla_t \partial_s H|_g^2 \Big] d\mathcal{L}^1(t).
\end{align*}
The first term will be integrated by parts in the next step; the second is the curvature term; the third is already in final form.
[/guided]
[/step]
[step:Evaluate at $s = 0$ and integrate by parts on each smooth segment]
Set $s = 0$. By hypothesis, $\partial_t H(t, 0) = \dot\gamma(t)$ is unit and $\nabla_t \partial_t H|_{s = 0} = \nabla_t \dot\gamma = 0$. Write $Y(t, s) := \partial_s H(t, s)$ and $Y(t) := Y(t, 0)$, $Y'(t) := \nabla_t Y(t, 0)$. Then
\begin{align*}
\frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} = \int_0^T \Big[ g(\nabla_t \nabla_s Y, \dot\gamma) - g(R(Y, \dot\gamma) Y, \dot\gamma) + |Y'|_g^2 \Big] d\mathcal{L}^1(t).
\end{align*}
We now integrate the first term by parts. Apply (M) on $[0, T]$ to the smooth section $\nabla_s Y(\cdot, 0)$ of $\gamma^* TM$ paired with $\dot\gamma$:
\begin{align*}
\frac{d}{dt} g(\nabla_s Y(\cdot, 0), \dot\gamma) = g(\nabla_t \nabla_s Y, \dot\gamma) + g(\nabla_s Y, \nabla_t \dot\gamma).
\end{align*}
On the geodesic segments $\nabla_t \dot\gamma = 0$, so the second term vanishes pointwise on each smooth segment.
The variation $H$ is smooth, so $\nabla_s Y(\cdot, 0)$ and $\dot\gamma$ are continuous on each segment of $\gamma$; we apply the fundamental theorem of calculus separately on each segment. Let $0 = t_0 < t_1 < \cdots < t_N = T$ be the breakpoints (in our setup $\gamma$ is a smooth unit-speed geodesic, so there is only one segment, $N = 1$, but we keep the bookkeeping explicit because it is the standard piecewise-smooth statement of the second variation). Summing FTC on each segment:
\begin{align*}
\int_0^T g(\nabla_t \nabla_s Y, \dot\gamma) \, d\mathcal{L}^1(t) = g(\nabla_s Y(\cdot, 0), \dot\gamma)\Big|_0^T - \sum_{i = 1}^{N - 1} g\!\left(\nabla_s Y(t_i, 0),\, \dot\gamma(t_i^+) - \dot\gamma(t_i^-)\right).
\end{align*}
Under the standing hypothesis that $\gamma$ is a smooth unit-speed geodesic, the velocity $\dot\gamma$ is continuous across all interior $t_i$, so $\dot\gamma(t_i^+) - \dot\gamma(t_i^-) = 0$ and the sum vanishes; only the boundary term at $\{0, T\}$ survives:
\begin{align*}
\int_0^T g(\nabla_t \nabla_s Y, \dot\gamma) \, d\mathcal{L}^1(t) = g\!\left(\frac{\nabla Y}{ds}(t, 0),\, \dot\gamma(t)\right)\Big|_0^T,
\end{align*}
using the standard notation $\frac{\nabla Y}{ds}(t, 0) := \nabla_s Y(t, 0)$.
[guided]
We now specialise to $s = 0$ and integrate by parts to release the $t$-derivative inside the integral to a boundary term. Let us first record what the variation becomes at $s = 0$. By the standing hypothesis, $\partial_t H(t, 0) = \dot\gamma(t)$ has unit speed and $\nabla_t \partial_t H|_{s = 0} = \nabla_t \dot\gamma = 0$ (the geodesic equation). Adopt the standard names $Y(t, s) := \partial_s H(t, s)$, $Y(t) := Y(t, 0)$, and $Y'(t) := \nabla_t Y(t, 0)$. Plugging $s = 0$ into the formula from Step 3:
\begin{align*}
\frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} = \int_0^T \Big[ g(\nabla_t \nabla_s Y, \dot\gamma) - g(R(Y, \dot\gamma) Y, \dot\gamma) + |Y'|_g^2 \Big] d\mathcal{L}^1(t).
\end{align*}
The first integrand is a $t$-derivative in disguise; the second is already the curvature term in final form; the third is already in final form.
To unpack the first integrand, apply identity (M) on $[0, T]$ to the inner product of the pullback-bundle section $\nabla_s Y(\cdot, 0)$ with $\dot\gamma$ in the $\partial_t$-direction:
\begin{align*}
\frac{d}{dt} g(\nabla_s Y(\cdot, 0), \dot\gamma) = g(\nabla_t \nabla_s Y, \dot\gamma) + g(\nabla_s Y, \nabla_t \dot\gamma).
\end{align*}
This is the standard product rule for the Levi-Civita connection. The integrand we want, $g(\nabla_t \nabla_s Y, \dot\gamma)$, is the first summand. The second summand involves $\nabla_t \dot\gamma$, which is zero on each smooth segment of $\gamma$ because $\gamma$ is a geodesic — so on each smooth segment the second summand vanishes pointwise.
Why bother with piecewise bookkeeping? Although the standing hypothesis is that $\gamma$ is a smooth unit-speed geodesic, the first variation formula is typically stated for piecewise $C^1$ curves, and the second variation extends to that setting at the cost of explicit jump terms in the integration-by-parts. We record those jumps now so the formula is unambiguously the standard one. Let $0 = t_0 < t_1 < \cdots < t_N = T$ be the breakpoints of $\gamma$ (in our setting $N = 1$, but the argument is the same).
We apply the fundamental theorem of calculus to $\frac{d}{dt} g(\nabla_s Y(\cdot, 0), \dot\gamma)$ on each segment $[t_{i-1}, t_i]$. The variation $H$ is smooth, so $\nabla_s Y(\cdot, 0)$ is continuous everywhere on $[0, T]$, but $\dot\gamma$ may jump at interior breakpoints; therefore each segment contributes a clean two-point evaluation, and summing produces interior jump terms. Concretely:
\begin{align*}
\int_0^T g(\nabla_t \nabla_s Y, \dot\gamma) \, d\mathcal{L}^1(t) = g(\nabla_s Y(\cdot, 0), \dot\gamma)\Big|_0^T - \sum_{i = 1}^{N - 1} g\!\left(\nabla_s Y(t_i, 0),\, \dot\gamma(t_i^+) - \dot\gamma(t_i^-)\right).
\end{align*}
The $Y$ side is continuous across breakpoints — it is smooth in $(t, s)$, so $\nabla_s Y(t_i, 0)$ has a single value — so the only contribution at each interior breakpoint is the velocity jump $\dot\gamma(t_i^+) - \dot\gamma(t_i^-)$.
Under the standing hypothesis that $\gamma$ is smooth, $\dot\gamma$ is continuous across all interior $t_i$, so $\dot\gamma(t_i^+) - \dot\gamma(t_i^-) = 0$ and the sum vanishes. The formula collapses to the clean two-point boundary expression:
\begin{align*}
\int_0^T g(\nabla_t \nabla_s Y, \dot\gamma) \, d\mathcal{L}^1(t) = g\!\left(\frac{\nabla Y}{ds}(t, 0),\, \dot\gamma(t)\right)\Big|_0^T,
\end{align*}
where we use the standard notation $\frac{\nabla Y}{ds}(t, 0) := \nabla_s Y(t, 0)$. The hypotheses consumed in this step: smoothness of $\gamma$ on each segment, smoothness of $H$ in $(t, s)$, and $\nabla_t \dot\gamma = 0$ — all explicit in the theorem statement.
[/guided]
[/step]
[step:Assemble Part 1]
Combining Steps 3 and 4:
\begin{align*}
\frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} = g\!\left(\frac{\nabla Y}{ds}(t, 0),\, \dot\gamma(t)\right)\Big|_0^T + \int_0^T \Big[ |Y'(t)|_g^2 - g(R(Y, \dot\gamma) Y, \dot\gamma) \Big] d\mathcal{L}^1(t).
\end{align*}
By the convention $R(X, Y, Z, W) = g(R(X, Y) Z, W)$ for the $(0,4)$-curvature tensor, $g(R(Y, \dot\gamma) Y, \dot\gamma) = R(Y, \dot\gamma, Y, \dot\gamma)$. This is the formula stated in Part 1.
[/step]
[step:Reduce the second variation of length to the second variation of energy on the normal component]
For Part 2 we may pass through the calculation directly on $\ell$ in the same style, but the cleanest route is via Part 1 plus the relation
\begin{align*}
\ell(\gamma_s) = \int_0^T |\partial_t H(t, s)|_g \, d\mathcal{L}^1(t),
\end{align*}
combined with the identity $|v|_g^2 = (|v|_g)^2$ to relate the second derivatives of $\ell$ and of $\tfrac12 |v|_g^2$ at unit speed.
Let $f(t, s) := |\partial_t H(t, s)|_g$. At $s = 0$, $f(t, 0) = |\dot\gamma(t)|_g = 1$. Compute the first two $s$-derivatives of $f^2 = g(\partial_t H, \partial_t H)$:
\begin{align*}
\partial_s (f^2) = 2 f \cdot \partial_s f, \qquad \partial_s^2 (f^2) = 2 (\partial_s f)^2 + 2 f \cdot \partial_s^2 f.
\end{align*}
At $s = 0$ this gives
\begin{align*}
\partial_s f \big|_{s = 0} = \tfrac{1}{2} \partial_s(f^2)\big|_{s = 0}, \qquad \partial_s^2 f \big|_{s = 0} = \partial_s^2 (f^2)\big|_{s = 0} \cdot \tfrac{1}{2} - (\partial_s f)^2\big|_{s = 0}.
\end{align*}
Integrating in $t$:
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} = \int_0^T \partial_s^2 f(t, 0)\, d\mathcal{L}^1(t) = \int_0^T \tfrac{1}{2} \partial_s^2(f^2)(t, 0)\, d\mathcal{L}^1(t) - \int_0^T (\partial_s f)^2(t, 0)\, d\mathcal{L}^1(t).
\end{align*}
The first integral is exactly $\frac{d^2}{ds^2} E(\gamma_s)\big|_{s = 0}$ by definition of $E$. For the second, $\partial_s f(t, 0) = \tfrac{1}{2 f}\partial_s(f^2) = g(\nabla_s \partial_t H, \partial_t H)\big|_{s = 0} = g(\nabla_t \partial_s H, \partial_t H)\big|_{s = 0} = g(Y'(t), \dot\gamma(t))$, where we used (M), (S), and $|\dot\gamma|_g = 1$.
Therefore
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} = \frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} - \int_0^T g(Y', \dot\gamma)^2 \, d\mathcal{L}^1(t).
\end{align*}
[guided]
The strategy: we already have the second variation of energy from Part 1, so rather than redo the entire pullback-bundle computation for length, we relate length to energy and convert. The relation $\ell^2 \le T \cdot 2E$ (Cauchy-Schwarz) is saturated when $|\dot\gamma_s|_g$ is constant in $t$, but we are not assuming that — only that the reference curve $\gamma_0$ has unit speed. So energy and length agree to first order at $s = 0$, but at second order they differ by a Cauchy-Schwarz defect; we need to extract that defect cleanly.
Set $f(t, s) := |\partial_t H(t, s)|_g$, the speed of the variation. At $s = 0$, the unit-speed hypothesis gives $f(t, 0) = |\dot\gamma(t)|_g = 1$. Working with $f^2 = g(\partial_t H, \partial_t H)$ rather than $f$ is more convenient because $f^2$ is smooth wherever $\partial_t H$ is non-vanishing, while $f$ is only $C^\infty$ there. Apply the product rule once and twice in $s$:
\begin{align*}
\partial_s (f^2) = 2 f \cdot \partial_s f, \qquad \partial_s^2 (f^2) = 2 (\partial_s f)^2 + 2 f \cdot \partial_s^2 f.
\end{align*}
Solving for the derivatives of $f$ at $s = 0$ — where $f = 1$ kills the awkward $1/f$ factors — we obtain
\begin{align*}
\partial_s f \big|_{s = 0} = \tfrac{1}{2} \partial_s(f^2)\big|_{s = 0}, \qquad \partial_s^2 f \big|_{s = 0} = \partial_s^2 (f^2)\big|_{s = 0} \cdot \tfrac{1}{2} - (\partial_s f)^2\big|_{s = 0}.
\end{align*}
The second identity is the key one: differentiating the square-root twice produces a $-(\partial_s f)^2$ correction (the "Cauchy-Schwarz defect") that is absent for the energy. This is the source of the difference between Part 1 and Part 2.
Now bring the differentiation under the integral. The integrand of $\ell$ is $f$, and $f$ is smooth in $(t, s)$ on a neighbourhood of $\{s = 0\}$ where $f \ge 1/2 > 0$, so the same dominated-convergence argument as in Step 1 lets us differentiate twice under the integral:
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} = \int_0^T \partial_s^2 f(t, 0)\, d\mathcal{L}^1(t) = \int_0^T \tfrac{1}{2} \partial_s^2(f^2)(t, 0)\, d\mathcal{L}^1(t) - \int_0^T (\partial_s f)^2(t, 0)\, d\mathcal{L}^1(t).
\end{align*}
The first integral is exactly $\frac{d^2}{ds^2} E(\gamma_s)\big|_{s = 0}$ — by the definition $E = \tfrac12 \int f^2\, d\mathcal{L}^1$, the second derivative of $E$ in $s$ pulls a factor of $\tfrac12$ out of $\partial_s^2(f^2)$. The second integral is the Cauchy-Schwarz defect we need to identify.
We compute $\partial_s f|_{s=0}$. By the formula above $\partial_s f|_{s=0} = \tfrac{1}{2 f}\partial_s(f^2)|_{s=0} = \tfrac{1}{2}\partial_s(f^2)|_{s=0}$ since $f(t, 0) = 1$. Now $f^2 = g(\partial_t H, \partial_t H)$, so by metric compatibility (M) in the $\partial_s$-direction on the pullback bundle, $\partial_s(f^2) = 2g(\nabla_s \partial_t H, \partial_t H)$. By identity (S), $\nabla_s \partial_t H = \nabla_t \partial_s H$. Evaluating at $s = 0$ converts $\partial_s H$ into $Y$ and $\partial_t H$ into $\dot\gamma$:
\begin{align*}
\partial_s f(t, 0) = g(\nabla_s \partial_t H, \partial_t H)\big|_{s = 0} = g(\nabla_t \partial_s H, \partial_t H)\big|_{s = 0} = g(Y'(t), \dot\gamma(t)).
\end{align*}
The hypotheses consumed: metric compatibility (M), pullback symmetry (S), and the unit-speed condition $|\dot\gamma|_g = 1$ that allowed us to drop the $1/f$ factor.
Substituting this into the second integral:
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} = \frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} - \int_0^T g(Y', \dot\gamma)^2 \, d\mathcal{L}^1(t).
\end{align*}
We have reduced the second variation of length to the second variation of energy minus an explicit $g(Y', \dot\gamma)^2$ correction. The next step will show that this correction cancels the tangential part of $|Y'|^2$ in the energy formula, leaving a clean expression in $Y_n$ alone.
[/guided]
[/step]
[step:Decompose $Y$ into normal and tangential parts and identify the corrections]
Write $Y = Y_n + g(Y, \dot\gamma) \dot\gamma$ where $Y_n$ is the pointwise orthogonal projection of $Y$ onto $\dot\gamma^\perp$. Set $\phi(t) := g(Y(t), \dot\gamma(t))$, so $Y(t) = Y_n(t) + \phi(t) \dot\gamma(t)$. Differentiate this decomposition along $\gamma$:
\begin{align*}
Y' = \nabla_t Y = \nabla_t Y_n + \phi'(t) \dot\gamma(t) + \phi(t) \nabla_t \dot\gamma = \nabla_t Y_n + \phi'(t) \dot\gamma(t),
\end{align*}
since $\nabla_t \dot\gamma = 0$. Pairing with $\dot\gamma$ and using $\nabla_t \dot\gamma = 0$ together with metric compatibility:
\begin{align*}
g(Y', \dot\gamma) = g(\nabla_t Y_n, \dot\gamma) + \phi'(t).
\end{align*}
Now $Y_n \perp \dot\gamma$ at every $t$, so $g(Y_n, \dot\gamma) \equiv 0$. Differentiating this identity in $t$ via (M):
\begin{align*}
0 = \frac{d}{dt} g(Y_n, \dot\gamma) = g(\nabla_t Y_n, \dot\gamma) + g(Y_n, \nabla_t \dot\gamma) = g(\nabla_t Y_n, \dot\gamma),
\end{align*}
so $g(Y', \dot\gamma) = \phi'(t)$. Squaring and integrating:
\begin{align*}
\int_0^T g(Y', \dot\gamma)^2 \, d\mathcal{L}^1(t) = \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t).
\end{align*}
The integrand $|Y'|_g^2$ in Part 1 splits using the same orthogonal decomposition. Since $\nabla_t Y_n \perp \dot\gamma$ from above and $Y' = \nabla_t Y_n + \phi'(t) \dot\gamma$:
\begin{align*}
|Y'|_g^2 = |\nabla_t Y_n|_g^2 + \phi'(t)^2 \cdot |\dot\gamma|_g^2 = |Y'_n|_g^2 + \phi'(t)^2,
\end{align*}
where $Y'_n := \nabla_t Y_n$ and $|\dot\gamma|_g = 1$.
For the curvature term, observe $R(Y, \dot\gamma)Y = R(Y_n + \phi \dot\gamma, \dot\gamma)(Y_n + \phi \dot\gamma)$. By the antisymmetry $R(\dot\gamma, \dot\gamma) = 0$ in the first slot and $R(\cdot, \cdot)\dot\gamma$ pairs with $\dot\gamma$ to vanish (using $g(R(X, Y)\dot\gamma, \dot\gamma) = -g(R(X,Y)\dot\gamma, \dot\gamma)$ from skew-symmetry in the last pair, see [Symmetries of the Riemann Curvature Tensor](/theorems/2704)), every term involving the tangential factor $\phi \dot\gamma$ contributes zero to $R(Y, \dot\gamma, Y, \dot\gamma) = g(R(Y, \dot\gamma)Y, \dot\gamma)$. Concretely:
\begin{align*}
R(Y, \dot\gamma, Y, \dot\gamma) = R(Y_n, \dot\gamma, Y_n, \dot\gamma).
\end{align*}
For the boundary term, $\frac{\nabla Y}{ds}(t, 0)$ refers to the variation; under the same decomposition the tangential and normal parts contribute separately. The normal piece corresponds to $\frac{\nabla Y_n}{ds}(t, 0)$ in the formula stated in Part 2.
Combining: the second variation of $\ell$ becomes
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} &= \frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} - \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t) \\
&= g\!\left(\frac{\nabla Y}{ds}(t, 0), \dot\gamma\right)\Big|_0^T + \int_0^T \Big[|Y'_n|_g^2 + \phi'(t)^2 - R(Y_n, \dot\gamma, Y_n, \dot\gamma)\Big] d\mathcal{L}^1(t) - \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t).
\end{align*}
The two $\phi'(t)^2$ integrals cancel exactly. We now show the boundary term reduces to $g(\nabla Y_n / ds, \dot\gamma)\big|_0^T$ rigorously.
Define $\Phi(t, s) := g(Y(t, s), \partial_t H(t, s) / |\partial_t H(t, s)|_g)$ on a neighbourhood of $s = 0$ where $\partial_t H$ is non-vanishing. At $s = 0$, $\Phi(t, 0) = \phi(t)$. The endpoint-fixing hypothesis gives $\partial_s H(0, s) = Y(0, s) \equiv 0$ and $\partial_s H(T, s) = Y(T, s) \equiv 0$ for all $s$, hence $\Phi(0, s) \equiv 0$ and $\Phi(T, s) \equiv 0$ as functions of $s$. Differentiating in $s$:
\begin{align*}
\partial_s \Phi(0, 0) = 0, \qquad \partial_s \Phi(T, 0) = 0,
\end{align*}
and also $\Phi(0, 0) = \phi(0) = 0$, $\Phi(T, 0) = \phi(T) = 0$ (since $Y(0) = Y(T) = 0$).
The $\nabla_s$-derivative of the tangential summand $\Phi(\cdot, s)\, \partial_t H / |\partial_t H|_g$ at $s = 0$, $t \in \{0, T\}$, expands as
\begin{align*}
\partial_s \Phi(t, 0) \cdot \dot\gamma(t) + \Phi(t, 0) \cdot \nabla_s\!\left[\frac{\partial_t H}{|\partial_t H|_g}\right]\bigg|_{s = 0}.
\end{align*}
Both $\partial_s \Phi(t, 0) = 0$ and $\Phi(t, 0) = 0$ at $t \in \{0, T\}$, so the entire tangential contribution to the boundary term vanishes. Hence at the endpoints, $\nabla_s Y$ and $\nabla_s Y_n$ have the same inner product with $\dot\gamma$:
\begin{align*}
g(\nabla_s Y, \dot\gamma)\big|_{t \in \{0, T\}} = g(\nabla_s Y_n, \dot\gamma)\big|_{t \in \{0, T\}}.
\end{align*}
We obtain
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} = g\!\left(\frac{\nabla Y_n}{ds}(t, 0),\, \dot\gamma(t)\right)\Big|_0^T + \int_0^T \Big[|Y'_n|_g^2 - R(Y_n, \dot\gamma, Y_n, \dot\gamma)\Big] d\mathcal{L}^1(t),
\end{align*}
which is the statement of Part 2.
[guided]
The strategy: decompose the variation field $Y$ at each $t$ into its component along $\dot\gamma$ and its component perpendicular to $\dot\gamma$. The tangential component represents a reparametrisation of $\gamma$, which costs no length, while the normal component represents an actual perpendicular deformation. We expect every length-relevant quantity to depend only on $Y_n$. The cancellation we want to exhibit is concrete: the $g(Y', \dot\gamma)^2$ correction from Step 6 should exactly kill the tangential contribution to $|Y'|_g^2$ in the energy formula, leaving a clean expression in $Y_n$.
Define $\phi(t) := g(Y(t), \dot\gamma(t))$ and split
\begin{align*}
Y(t) = Y_n(t) + \phi(t) \dot\gamma(t),
\end{align*}
where $Y_n(t) := Y(t) - \phi(t) \dot\gamma(t)$ is the pointwise orthogonal projection of $Y$ onto $\dot\gamma^\perp$. Why is this an orthogonal decomposition? Because $g(Y_n, \dot\gamma) = g(Y, \dot\gamma) - \phi \cdot g(\dot\gamma, \dot\gamma) = \phi - \phi \cdot 1 = 0$ at every $t$, using $|\dot\gamma|_g = 1$.
We need to know how $Y'$ decomposes. Differentiate $Y = Y_n + \phi \dot\gamma$ along $\gamma$ using metric compatibility (the connection is linear and obeys the product rule for the scalar function $\phi$ times the section $\dot\gamma$):
\begin{align*}
Y' = \nabla_t Y = \nabla_t Y_n + \phi'(t) \dot\gamma(t) + \phi(t) \nabla_t \dot\gamma = \nabla_t Y_n + \phi'(t) \dot\gamma(t),
\end{align*}
where the last term dropped because $\nabla_t \dot\gamma = 0$ on the geodesic. So $Y'$ splits as a covariant $t$-derivative of the normal part plus a $\phi'(t) \dot\gamma$ tangential piece.
To check this is an orthogonal decomposition we need $\nabla_t Y_n \perp \dot\gamma$. Differentiate the identity $g(Y_n, \dot\gamma) \equiv 0$ along $\gamma$ via (M):
\begin{align*}
0 = \frac{d}{dt} g(Y_n, \dot\gamma) = g(\nabla_t Y_n, \dot\gamma) + g(Y_n, \nabla_t \dot\gamma) = g(\nabla_t Y_n, \dot\gamma),
\end{align*}
where the second term again dropped via $\nabla_t \dot\gamma = 0$. So $\nabla_t Y_n \perp \dot\gamma$ pointwise. Setting $Y_n' := \nabla_t Y_n$, this gives the orthogonal decomposition we want.
Now compute the squared norm. Since $\nabla_t Y_n \perp \phi'(t) \dot\gamma$ pointwise, the cross term in $|Y'|_g^2 = g(\nabla_t Y_n + \phi'(t) \dot\gamma, \nabla_t Y_n + \phi'(t) \dot\gamma)$ vanishes, leaving
\begin{align*}
|Y'|_g^2 = |\nabla_t Y_n|_g^2 + \phi'(t)^2 \cdot |\dot\gamma|_g^2 = |Y_n'|_g^2 + \phi'(t)^2,
\end{align*}
using the unit-speed condition $|\dot\gamma|_g = 1$.
Pair $Y'$ with $\dot\gamma$ to identify the Cauchy-Schwarz defect from Step 6. We have $g(Y', \dot\gamma) = g(\nabla_t Y_n, \dot\gamma) + \phi'(t) \cdot g(\dot\gamma, \dot\gamma)$, and the first term is zero by orthogonality just established, while the second is $\phi'(t)$ since $|\dot\gamma|_g = 1$. So
\begin{align*}
g(Y', \dot\gamma) = \phi'(t).
\end{align*}
Squaring and integrating gives
\begin{align*}
\int_0^T g(Y', \dot\gamma)^2 \, d\mathcal{L}^1(t) = \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t).
\end{align*}
This is exactly the correction we need to subtract.
Why does this cancel? In the energy formula from Part 1 we have $|Y'|_g^2 = |Y_n'|_g^2 + \phi'(t)^2$, while in the length-from-energy formula from Step 6 we subtract $\int \phi'(t)^2 \, d\mathcal{L}^1(t)$. The $\phi'(t)^2$ pieces cancel exactly, leaving only $|Y_n'|_g^2$ inside the integral.
Curvature term. The Riemann tensor $R(\cdot, \cdot, \cdot, \cdot)$ is skew in each of its two pairs by [Symmetries of the Riemann Curvature Tensor](/theorems/2704). In particular $R(X, Y, Z, \dot\gamma) = -R(X, Y, \dot\gamma, Z)$ and $R(\dot\gamma, Y, Z, W) = -R(Y, \dot\gamma, Z, W)$. We compute
\begin{align*}
R(Y, \dot\gamma)Y = R(Y_n + \phi \dot\gamma, \dot\gamma)(Y_n + \phi \dot\gamma).
\end{align*}
Expanding bilinearly: the first slot gives $R(Y_n, \dot\gamma) + \phi R(\dot\gamma, \dot\gamma)$, and skew-symmetry forces $R(\dot\gamma, \dot\gamma) = 0$, so the first-slot expansion contributes only $R(Y_n, \dot\gamma)$. Then $R(Y_n, \dot\gamma)(Y_n + \phi \dot\gamma) = R(Y_n, \dot\gamma) Y_n + \phi R(Y_n, \dot\gamma) \dot\gamma$. When we now pair with $\dot\gamma$, the second piece becomes $\phi g(R(Y_n, \dot\gamma) \dot\gamma, \dot\gamma)$, which is zero by skew-symmetry in the second pair. So
\begin{align*}
R(Y, \dot\gamma, Y, \dot\gamma) = g(R(Y, \dot\gamma)Y, \dot\gamma) = g(R(Y_n, \dot\gamma) Y_n, \dot\gamma) = R(Y_n, \dot\gamma, Y_n, \dot\gamma).
\end{align*}
Every term involving the tangential factor $\phi \dot\gamma$ has been killed by the curvature symmetries.
Boundary term. We must show that the boundary term $g(\nabla_s Y(t, 0), \dot\gamma(t))\big|_0^T$ from Part 1 reduces to the normal-component version $g(\nabla_s Y_n(t, 0), \dot\gamma(t))\big|_0^T$ — i.e., the tangential part of $\nabla_s Y$ contributes nothing at the endpoints. This is where the endpoint-fixing hypothesis is decisive, and the argument needs care because we are differentiating at the boundary.
Define $\Phi(t, s) := g(Y(t, s), \partial_t H(t, s) / |\partial_t H(t, s)|_g)$ on a neighbourhood of $\{s = 0\}$ where $\partial_t H$ is non-vanishing (this neighbourhood exists by continuity of $\partial_t H$ and unit-speed at $s = 0$). At $s = 0$, $\Phi(t, 0) = g(Y(t), \dot\gamma(t)) = \phi(t)$. The endpoint-fixing hypothesis from Step 1 gives $\partial_s H(0, s) = Y(0, s) \equiv 0$ and $\partial_s H(T, s) = Y(T, s) \equiv 0$ for all $s$, hence $\Phi$ vanishes identically at the boundary in $t$:
\begin{align*}
\Phi(0, s) \equiv 0, \qquad \Phi(T, s) \equiv 0 \qquad \text{for all } s.
\end{align*}
Differentiating these identities in $s$ at $s = 0$:
\begin{align*}
\partial_s \Phi(0, 0) = 0, \qquad \partial_s \Phi(T, 0) = 0,
\end{align*}
and we also have $\Phi(0, 0) = \phi(0) = 0$, $\Phi(T, 0) = \phi(T) = 0$ since $Y(0) = Y(T) = 0$ from the endpoint-fixing hypothesis.
Now decompose $\nabla_s Y$ at the endpoints. The tangential summand of $Y(\cdot, s)$ is $\Phi(\cdot, s)\, \partial_t H/|\partial_t H|_g$. By the product rule for $\nabla_s$ (it is a connection; it satisfies the Leibniz rule on the scalar-times-section product), at $s = 0$ and $t \in \{0, T\}$:
\begin{align*}
\nabla_s\!\left[\Phi \cdot \tfrac{\partial_t H}{|\partial_t H|_g}\right]\bigg|_{s = 0, t \in \{0, T\}} = \partial_s \Phi(t, 0) \cdot \dot\gamma(t) + \Phi(t, 0) \cdot \nabla_s\!\left[\tfrac{\partial_t H}{|\partial_t H|_g}\right]\bigg|_{s = 0}.
\end{align*}
Both factors $\partial_s \Phi(t, 0)$ and $\Phi(t, 0)$ are zero at $t \in \{0, T\}$ by the calculation above. So the tangential summand contributes zero to $\nabla_s Y$ at the endpoints, which means $\nabla_s Y$ and $\nabla_s Y_n$ have the same inner product with $\dot\gamma$ at $\{0, T\}$:
\begin{align*}
g(\nabla_s Y, \dot\gamma)\big|_{t \in \{0, T\}} = g(\nabla_s Y_n, \dot\gamma)\big|_{t \in \{0, T\}}.
\end{align*}
Assembling. Combining the cancellation of $\phi'(t)^2$, the curvature simplification, and the boundary reduction:
\begin{align*}
\frac{d^2}{ds^2} \ell(\gamma_s)\Big|_{s = 0} &= \frac{d^2}{ds^2} E(\gamma_s)\Big|_{s = 0} - \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t) \\
&= g\!\left(\frac{\nabla Y}{ds}(t, 0), \dot\gamma\right)\Big|_0^T + \int_0^T \Big[|Y_n'|_g^2 + \phi'(t)^2 - R(Y_n, \dot\gamma, Y_n, \dot\gamma)\Big] d\mathcal{L}^1(t) - \int_0^T \phi'(t)^2 \, d\mathcal{L}^1(t) \\
&= g\!\left(\frac{\nabla Y_n}{ds}(t, 0),\, \dot\gamma(t)\right)\Big|_0^T + \int_0^T \Big[|Y_n'|_g^2 - R(Y_n, \dot\gamma, Y_n, \dot\gamma)\Big] d\mathcal{L}^1(t).
\end{align*}
The two $\phi'(t)^2$ pieces cancelled, the curvature term collapsed to its normal part, and the boundary term reduced to the normal component. This is the statement of Part 2.
[/guided]
[/step]
Explore Further
Divergence Leibniz Rule
Riemannian Geometry
Myers' Theorem
Differential Geometry
Moser's Theorem
Differential Geometry
Codifferential and Divergence
Riemannian Geometry
Whitney Embedding Theorem
Differential Geometry
Involutivity Criterion
Differential Geometry
Bochner Vanishing Theorem
Riemannian Geometry
Structure of Jacobi Fields
Riemannian Geometry