Solution (source code)

= Solution

The appropriate invariance is invariance of the <action> element $L\,dt$, including the change of the time measure. Under $\delta t=\lambda\phi$ and $\delta q_i=\lambda\psi_i$, <differentiation> of $q_i'(t')$ gives $\delta\dot q_i=\lambda(D_t\psi_i-\dot q_iD_t\phi)$. Therefore
$$
\frac{\delta(L\,dt)}{\lambda\,dt}=L_t\phi+\sum_iL_{q_i}\psi_i+\sum_i p_i(D_t\psi_i-\dot q_iD_t\phi)+L D_t\phi.
$$
Using the <Euler-Lagrange equations> and $D_tE=-L_t$, this becomes
$$
D_t\left[\sum_i p_i\psi_i-E\phi\right].
$$
An <action symmetry> therefore yields the <Noether charge>
$$
\boxed{Q=\sum_i p_i\psi_i+\left(L-\sum_i p_i\dot q_i\right)\phi,\qquad D_tQ=0.}
$$
For $\phi=0$ this reduces to the usual spatial form of <Noether's theorem>. The same on-shell calculation permits velocity-dependent generators when they define a legitimate variational <symmetry>. Merely preserving the numerical value of $L$ is insufficient for transformations of time: the <Jacobian matrix and determinant> $dt'/dt$ matters. If the <action> changes by a boundary term $\lambda D_tB$, the conserved quantity is $Q-B$.