Total time derivatives preserve fixed-endpoint Euler-Lagrange equations (source code)

= Total time derivatives preserve fixed-endpoint Euler-Lagrange equations
{title2=$L\mapsto L+dg(q)/dt$}

Adding a <total derivative> $dg(q(t))/dt$ to a <Lagrangian> changes its <action> only by $g(q(T))-g(q(0))$. Under fixed-endpoint <variations>, this <boundary term> is constant, so the <Euler-Lagrange equations> and their minimizing paths are unchanged. Componentwise, $d[\partial(dg/dt)/\partial\dot q_i]/dt=\sum_jg_{ij}\dot q_j=\partial(dg/dt)/\partial q_i$ by equality of mixed <partial derivatives>. Endpoint freedom would require reconsidering the resulting <natural boundary conditions for a free endpoint>.