Solution (source code)

= Solution

Let $Q$ be the configuration <smooth manifold>, and let $L(t,q,v)$ be a <smooth> <Lagrangian> on its <tangent bundle>. For a path with fixed endpoints, its <action> is
$$
S[q]=\int_a^b L(t,q(t),\dot q(t))\,dt.
$$
The <principle of stationary action> requires the <first variation> to vanish for every fixed-endpoint <variation>. In a coordinate chart take $q_s=q+s\eta$, with $\eta(a)=\eta(b)=0$. Differentiation under the integral and <integration by parts> give
$$
\left.\frac d{ds}S[q_s]\right|_{s=0}
=\int_a^b\left(\frac{\partial L}{\partial q^i}\eta^i+\frac{\partial L}{\partial v^i}\dot\eta^i\right)dt
=\int_a^b\left(\frac{\partial L}{\partial q^i}-\frac d{dt}\frac{\partial L}{\partial v^i}\right)\eta^i\,dt.
$$
Repeated coordinate indices are summed. The endpoint term vanishes. Since compactly supported <variations> can be chosen independently in each coordinate, the <fundamental lemma of the calculus of variations> yields the <Euler-Lagrange equations>
$$
\boxed{\frac d{dt}\frac{\partial L}{\partial\dot q^i}=\frac{\partial L}{\partial q^i}.}
$$
Conversely these equations make the displayed <first variation> zero for every fixed-endpoint <variation>. Variations localized in coordinate charts establish the same assertion for paths on $Q$. Thus \b[the <Euler-Lagrange equations> are exactly the stationary-path condition], not necessarily a condition for an <action> minimum.