Let $\alpha: (-\varepsilon,\varepsilon) \times [0,1] \to M$ be a smooth variation of geodesics on a Riemannian manifold $M$, not necessarily fixed at endpoints. Then in Spivak, Volume 4, Chapter 8, Theorem 1, it is proved that if $V = \partial_s \alpha$, and if $T = \partial_t \alpha$, then the energy function $L(s) = \int_0^1 (1/2) g(T,T)$ satisfies $L''(0) = - g( V, \nabla_V T )|_0^1$, where $\nabla$ is the Levi-Civita connection. But my calculations seems to reach a different conclusion. Namely, if we differentiate the energy function twice we get
$$ L''(0) = \int_0^1 g( \nabla_V \nabla_V T, T ) + g( \nabla_V T, \nabla_V T) $$
Now
$$\begin{align*}g(\nabla_V T, \nabla_V T) &= g(\nabla_T V, \nabla_T V)\\ &= T \{ g( V, \nabla_V T) \} - g(V, \nabla_T \nabla_T V).\end{align*}$$
On the other hand,
$$\begin{align*}g(\nabla_V \nabla_V T, T) &= g( \nabla_V \nabla_T V, T )\\ &= g( \nabla_T \nabla_V V, T ) + g( R(V,T) V, T )\\ &= T \{ g(\nabla_V V, T) \} - g( \nabla_V V, \nabla_T T ) - g( V, R(V,T) T) \\ &= T \{ g(\nabla_V V, T) \} - g( V, R(V,T) T). \end{align*}$$
Putting these two bounds together and noting that $g(V, \nabla_V T) + g(\nabla_V V, T) = V \{ g(V, T) \}$ gives that
$$ L''(0) = V \{ g(V,T) \} - \int_0^1 g( V, \nabla_T \nabla_T V - R(T,V)T) = V \{ g(V,T) \}. $$$$ L''(0) = V \{ g(V,T) \}|_0^1 - \int_0^1 g( V, \nabla_T \nabla_T V - R(T,V)T) = V \{ g(V,T) \}|_0^1. $$
Have I made a mistake, or is there a typo in Spivak's book, or are we both right?