Solution (source code)

= Solution

A parametrized curve is a <geodesic> when its covariant acceleration vanishes, $\nabla_{\dot\gamma}\dot\gamma=0$, for the induced <Levi-Civita connection>. In coordinates this is
$$
\ddot\gamma^i+\Gamma^i_{jk}(\gamma)\dot\gamma^j\dot\gamma^k=0.
$$
Equivalently, for an embedded surface its ordinary acceleration is normal to the tangent plane. The parameter is affine; arbitrary reparametrizations need not remain <geodesics>.

The local existence and uniqueness theorem says that for every $p\in X$ and $v\in T_pX$ there is a unique <geodesic> with $\gamma(0)=p$, $\dot\gamma(0)=v$, on a maximal open interval containing zero, depending smoothly on $(p,v)$. This follows from the local existence and uniqueness theorem for the smooth first-order system in $(\gamma,\dot\gamma)$. The <exponential map> is $\exp_p(v)=\gamma_v(1)$ wherever the solution exists through time one. Its domain contains a neighborhood of zero, and $d(\exp_p)_0=I$, since $\exp_p(tv)=\gamma_v(t)$. Thus it is a local diffeomorphism near zero. Completeness is not assumed for a general surface; on a complete surface it is defined on all of $T_pX$.