Lagrangian mechanics
Electromagnetism

A test particle is a particle whose mass and charge are assumed to be so small that its effect on external system is insignificant. It is often a hypothetical simplified point particle with no properties other than mass and charge. Real particles like electrons and up quarks are more complex and have additional terms in their Lagrangians. Not only can the fields form non conservative potentials, these potentials can also be velocity dependent.

The Lagrangian for a charged particle with electrical charge q, interacting with an electromagnetic field, is the prototypical example of a velocity-dependent potential. The electric scalar potential ϕ = ϕ (r, t) and magnetic vector potential A = A (r, t) are defined from the electric field E = E (r, t) and magnetic field B = B (r, t) as follows: E = − ∇ ϕ − ∂ A ∂ t, B = ∇ × A. {\displaystyle \mathbf {E} =-{\boldsymbol {\nabla }}\phi -{\frac {\partial \mathbf {A} }{\partial t}},\quad \mathbf {B} ={\boldsymbol {\nabla }}\times \mathbf {A}.}

The Lagrangian of a massive charged test particle in an electromagnetic field L = 1 2 m r ˙ 2 + q r ˙ ⋅ A − q ϕ, {\displaystyle L={\tfrac {1}{2}}m{\dot {\mathbf {r} }}^{2}+q\,{\dot {\mathbf {r} }}\cdot \mathbf {A} -q\phi,} is called minimal coupling. This is a good example of when the common rule of thumb that the Lagrangian is the kinetic energy minus the potential energy is incorrect. Combined with Euler–Lagrange equation, it produces the Lorentz force law m r ¨ = q E + q r ˙ × B {\displaystyle m{\ddot {\mathbf {r} }}=q\mathbf {E} +q{\dot {\mathbf {r} }}\times \mathbf {B} }

Under gauge transformation: A → A + ∇ f, ϕ → ϕ − f ˙, {\displaystyle \mathbf {A} \rightarrow \mathbf {A} +{\boldsymbol {\nabla }}f,\quad \phi \rightarrow \phi -{\dot {f}},} where f (r, t) is any scalar function of space and time, the aforementioned Lagrangian transforms like: L → L + q (r ˙ ⋅ ∇ + ∂ ∂ t) f = L + q d f d t, {\displaystyle L\rightarrow L+q\left({\dot {\mathbf {r} }}\cdot {\boldsymbol {\nabla }}+{\frac {\partial }{\partial t}}\right)f=L+q{\frac {df}{dt}},} which still produces the same Lorentz force law.

Note that the canonical momentum (conjugate to position r) is the kinetic momentum plus a contribution from the A field (known as the potential momentum): p = ∂ L ∂ r ˙ = m r ˙ + q A. {\displaystyle \mathbf {p} ={\frac {\partial L}{\partial {\dot {\mathbf {r} }}}}=m{\dot {\mathbf {r} }}+q\mathbf {A}.}

This relation is also used in the minimal coupling prescription in quantum mechanics and quantum field theory. From this expression, we can see that the canonical momentum p is not gauge invariant, and therefore not a measurable physical quantity; However, if r is cyclic (i.e. Lagrangian is independent of position r), which happens if the ϕ and A fields are uniform, then this canonical momentum p given here is the conserved momentum, while the measurable physical kinetic momentum m v is not.
startend:quotation, change_case:english_lowercase