Solution (source code)

= Solution

For generalized coordinates $q_i$ with <Lagrangian> $L(q,\dot q,t)$, the <conjugate momentum> is
$$
\boxed{p_i=\frac{\partial L}{\partial\dot q_i},\qquad\dot p_i=\frac{\partial L}{\partial q_i}.}
$$
A coordinate absent from $L$ is cyclic, and its <conjugate momentum> is conserved. More generally, <Noether's theorem> connects continuous symmetries of the action to conserved quantities: spatial translations give linear momentum and rotations give <angular momentum>. If $L$ has no explicit time dependence, the conserved energy function is
$$
E=\sum_i p_i\dot q_i-L,\qquad\frac{dE}{dt}=-\frac{\partial L}{\partial t}=0.
$$
The momentum conjugate to an angle is an <angular momentum>, not a linear velocity. <Canonical momentum> can also differ from <mechanical momentum>: for $L=\tfrac12m v^2+q\mathbf A\cdot\mathbf v-q\phi$, \b[$\mathbf p=m\mathbf v+q\mathbf A$]. Thus a conserved <conjugate momentum> must be identified from the actual <Lagrangian> and its symmetry, rather than assumed to equal $m\mathbf v$. Gauge-dependent canonical momenta require the corresponding gauge choice or gauge-covariant symmetry interpretation.<Classical Dynamics by David Tong>[Chapters 2 and 4: conservation laws, conjugate momentum and the Hamiltonian]{ref}