Definition (geodesic)
Let $Σ$ be a smooth surface in $\R^3$.
A geodesic $γ:[a,b]\to Σ$ is a critical point for the energy functional in the space of smooth curves from $γ(a)$ to $γ(b)$.
Formulation: consider any one-parameter variation of $γ$ with fixed end-points, i.e. smooth map $Γ: (-ε, ε)\times [a,b]\to Σ$ such that writing $γ_s(t) = Γ(s,t)$, we have $γ_0 = γ$, and $γ_s(a)$ and $γ_s(b)$ are independent of $s$. Then $γ$ is a geodesic if $$ \begin{align*} \dd{s} E(γ_s)\Big|_{s=0} = 0. \end{align*} $$