Picture below is from do Carmo's Riemannian Geometry, seemly, the author think that the 2.2 Index Theorem implies the 2.9 Corollary. I don't see that at all. Did the author make a mistake?
In where, $E$ is the energy of curve in the variation. For example, assuming $f(s,t)$ is the variation of $\gamma (t)$, then $$ E(s) =\int_0^a |\partial_t f(s,t)|^2 dt $$


