Generalized Forces and Generalized Momenta

Watch a robot arm hold a coffee cup perfectly still. Somewhere in its controller, sixty times a second, a computer answers a strange question: not "what force acts on the arm?" but "what torque about each joint does gravity exert, and what must each motor supply to cancel it?" Nobody programmed Newton's F=ma\mathbf{F}=m\mathbf{a} component by component into that controller. The arm's software thinks in the arm's own natural coordinates — two joint angles — and in the quantities conjugate to them. Those quantities are the subject of this article. Once a system is described by generalized coordinates q1,…,qnq_1,\dots,q_n, the Newtonian notions of force and momentum must be repackaged to match. The repackaging is energetic and beautifully uniform: the generalized force QjQ_j is whatever multiplies δqj\delta q_j in the virtual work, and the generalized momentum pj=∂L/∂q˙jp_j = \partial L/\partial\dot q_j is whatever the Lagrangian's velocity-derivative says it is. If qjq_j is a length, QjQ_j is a force and pjp_j looks like mq˙jm\dot q_j; if qjq_j is an angle, they become a torque and an angular momentum — automatically, with no special handling. And when velocity-dependent couplings enter, as for a charge in a magnetic field, pjp_j quietly stops being mq˙jm\dot q_j at all. The payoff is the cleanest statement in mechanics: the Euler–Lagrange equation reads p˙j=∂L/∂qj\dot p_j = \partial L/\partial q_j — rate of change of generalized momentum equals generalized force. Newton's second law, re-tailored to fit any coordinates you choose, and the direct gateway to conservation laws and to the Hamiltonian picture.

Key takeaways
  • The generalized force conjugate to qjq_j is defined through virtual work, δW=∑jQj δqj\delta W = \sum_j Q_j\,\delta q_j, which unpacks to Qj=∑iFi⋅∂ri/∂qjQ_j = \sum_i \mathbf{F}_i\cdot\partial\mathbf{r}_i/\partial q_j — the projection of the real applied forces onto the motion that changing qjq_j actually produces.
  • QjQ_j carries whatever units make Qj δqjQ_j\,\delta q_j an energy: a force for a length coordinate, a torque for an angle, a pressure when the coordinate is a volume. Constraint forces never contribute — they are perpendicular to every allowed displacement.
  • The generalized (canonical, conjugate) momentum is pj=∂L/∂q˙jp_j = \partial L/\partial\dot q_j. For TT quadratic in velocities it is pj=∑kMjk(q) q˙kp_j = \sum_k M_{jk}(q)\,\dot q_k — a configuration-dependent mixture of velocities, not necessarily mq˙jm\dot q_j.
  • With a velocity-dependent potential the split from mvm\mathbf{v} becomes dramatic: a charge in a magnetic field carries canonical momentum p=mr˙+qA\mathbf{p} = m\dot{\mathbf{r}} + q\mathbf{A}.
  • The Euler–Lagrange equation is exactly p˙j=∂L/∂qj\dot p_j = \partial L/\partial q_j, with non-conservative pieces appearing on the right as p˙j−∂L/∂qj=Qjnc\dot p_j - \partial L/\partial q_j = Q_j^{\mathrm{nc}}.
  • Key idea: generalized force is the coordinate-conjugate of work, δW=∑jQj δqj\delta W=\sum_j Q_j\,\delta q_j; generalized momentum is the velocity-conjugate of the Lagrangian, pj=∂L/∂q˙jp_j=\partial L/\partial\dot q_j. The Euler–Lagrange equation p˙j=∂L/∂qj\dot p_j=\partial L/\partial q_j welds them together as the Lagrangian analogue of p˙=F\dot{\mathbf p}=\mathbf F.

Where this lives today

The manipulator equation of modern robotics is equation (7) wearing industrial clothing: M(q)q¨+C(q,q˙)q˙+g(q)=τM(q)\ddot q + C(q,\dot q)\dot q + g(q) = \tau, where M(q)M(q) is exactly the mass matrix of Derivation B, g(q)g(q) collects the gravitational generalized forces of the worked example, and the motor torques τ\tau are the non-conservative QjncQ_j^{\mathrm{nc}}. Every physics engine that trains today's humanoid robots and quadrupeds — MuJoCo, Drake, Isaac — assembles and inverts this equation millions of times per training run, in joint coordinates, because that is the space where constraints vanish and motors live. When a 2026-era humanoid catches a thrown package, a computer has just solved for generalized forces along sixty-odd coordinates in under a millisecond. The concept's reach goes far beyond machines. Thermodynamics organizes itself around the same conjugacy: pressure is the generalized force conjugate to volume, surface tension to area, chemical potential to particle number — "whatever multiplies δq\delta q in the work" is one of physics' most reused sentences. And the canonical momentum p=mv+qA\mathbf{p} = m\mathbf{v} + q\mathbf{A} is the reason your MRI scanner's physics and your quantum mechanics course agree: the operator −iℏ∇-i\hbar\nabla represents the canonical momentum, so magnetic couplings enter quantum mechanics exactly as Lagrange's derivative said they must.

The physical picture

Configuration space is a surface of allowed shapes: each point is one arrangement of the whole system, and moving along the qjq_j-direction deforms the system in one specific, constraint-respecting way. The real forces Fi\mathbf{F}_i live out in ordinary 3D space and point wherever they point. The generalized force QjQ_j is the answer to a sharper question: of all that force, how much actually pushes along the qjq_j-direction of allowed motion? Formally it is a dot product with ∂ri/∂qj\partial\mathbf{r}_i/\partial q_j; informally it is the shadow the physical forces cast on the system's freedom.

Figure
Generalized force is a projection — only the component of gravity along the allowed motion survives
frictionless wire y = f(x) bead N (constraint) mg ∂r/∂x (allowed motion) Q_x = F·∂r/∂x = −mg f′(x) one coordinate x, one direction of freedom gravity is projected onto the wire's tangent; the normal force is ⊥ to every allowed δr and does zero virtual work — it never appears in Q

The projection picture explains at a stroke the two most useful facts about QjQ_j. First, constraint forces vanish from the bookkeeping: a frictionless wire pushes only perpendicular to itself, and a perpendicular force dotted with an allowed displacement gives zero. You never compute the normal force, the string tension, or the hinge reaction — they are filtered out at the definition. Second, units follow the coordinate: if qjq_j is an angle, ∂ri/∂qj\partial\mathbf{r}_i/\partial q_j has the length of a lever arm, and QjQ_j comes out as a torque. Work is the universal currency; QjQ_j is denominated in whatever makes Qj δqjQ_j\,\delta q_j come out in joules.

Figure
One pattern, three costumes — the conjugate pair is set by the coordinate, not by Newton
q = x (length) Q = force [N] p = m ẋ [kg·m/s] δW = Q δx q = φ (angle) Q = torque [N·m] p = m r² φ̇ [kg·m²/s] δW = Q δφ q = V (volume) Q = −p [Pa] δW = −p δV the recipe never changes: Q = coefficient of δq in the work, p = ∂L/∂q̇ force/momentum, torque/angular momentum, pressure/… — one definition, every unit system

Generalized momentum answers the mirror-image question: how does the dynamics grip the velocity q˙j\dot q_j? For a free particle in Cartesian coordinates the answer is boring, px=mx˙p_x = m\dot x. But the definition pj=∂L/∂q˙jp_j = \partial L/\partial\dot q_j takes orders from the Lagrangian, not from Newton. Curve the coordinates and pjp_j becomes a mixture of several velocities weighted by a configuration-dependent mass matrix. Add a magnetic field and it silently absorbs a piece of the field itself, qAq\mathbf{A}. The single most instructive mistake in this chapter — one you should make once, carefully, and never again — is to write pj=mq˙jp_j = m\dot q_j on autopilot. The pairing is symmetric and worth savoring: QjQ_j comes from differentiating work with respect to a coordinate; pjp_j from differentiating LL with respect to a velocity. The Euler–Lagrange equation is the bridge that balances their rates, and because every object in sight is built from derivatives of scalars, the whole structure survives any smooth change of coordinates untouched.

From forces to generalized forces

Start with the definition, which is nothing more than a change of basis applied to work. Displace the system virtually — freeze time, wiggle the configuration by δqj\delta q_j in a way the constraints allow — and tally the work done by the applied forces. Written once in particle language and once in coordinate language, that tally defines the QjQ_j:

δW  =  ∑iFi⋅δri  =  ∑j=1nQj δqj(1)\delta W \;=\; \sum_{i}\mathbf{F}_i\cdot\delta\mathbf{r}_i \;=\; \sum_{j=1}^{n} Q_j\,\delta q_j \qquad (1)

where: Fi\mathbf{F}_i — the net applied (non-constraint) force on particle ii; δri\delta\mathbf{r}_i — its virtual displacement; δqj\delta q_j — the independent virtual changes of the coordinates. Because the δqj\delta q_j can be varied one at a time, the coefficients QjQ_j are uniquely determined — the definition is not circular, it is a component extraction. The machinery of virtual displacements itself belongs to the principle of virtual work and d'Alembert's principle; here we harvest it. Unpacking δri=∑j(∂ri/∂qj) δqj\delta\mathbf{r}_i = \sum_j (\partial\mathbf{r}_i/\partial q_j)\,\delta q_j by the chain rule and swapping the two sums turns the definition into the formula you actually compute with:

Qj  =  ∑iFi⋅∂ri∂qj(2)Q_j \;=\; \sum_{i}\mathbf{F}_i\cdot\frac{\partial\mathbf{r}_i}{\partial q_j} \qquad (2)

where: ∂ri/∂qj\partial\mathbf{r}_i/\partial q_j — the vector telling how particle ii moves per unit change of qjq_j, with every other coordinate and time held fixed. Read it as a projection: each particle's force is dotted onto the direction that coordinate actually drags that particle. For the bead of the hero diagram, F=(0,−mg)\mathbf{F} = (0,-mg) and ∂r/∂x=(1,f′(x))\partial\mathbf{r}/\partial x = (1, f'(x)) give Qx=−mg f′(x)Q_x = -mg\,f'(x) — gravity matters only through the wire's slope, and the normal force never even enters. When the applied forces come from a potential V(q1,…,qn)V(q_1,\dots,q_n), the projection in (2) is exactly a gradient component, and the generalized force collapses to

Qj  =  −∂V∂qj(3)Q_j \;=\; -\frac{\partial V}{\partial q_j} \qquad (3)

where: VV — the potential energy expressed directly in the generalized coordinates. This is the form that gets absorbed into L=T−VL = T - V: conservative generalized forces stop being a separate object and become part of the Lagrangian's landscape. Anything not derivable from VV — friction, drag, a motor drive — stays outside and re-enters below as an explicit right-hand side.

Generalized momentum

Now the mirror object. Instead of asking how work responds to a coordinate, ask how the Lagrangian responds to a velocity:

pj  ≡  ∂L∂q˙j(4)p_j \;\equiv\; \frac{\partial L}{\partial \dot q_j} \qquad (4)

where: L(q,q˙,t)=T−VL(q,\dot q,t) = T - V — the Lagrangian; pjp_j — the momentum canonically conjugate to qjq_j. The three names in circulation — generalized, conjugate, canonical — all denote this one derivative. Its units, like those of QjQ_j, follow the coordinate: pj q˙jp_j\,\dot q_j always carries the units of energy, so an angular coordinate breeds an angular momentum. For the vast standard class of mechanical systems, TT is quadratic in the velocities, T=12∑klMkl(q) q˙kq˙lT = \tfrac12\sum_{kl} M_{kl}(q)\,\dot q_k\dot q_l, and VV is velocity-independent. Differentiating and using the symmetry Mkl=MlkM_{kl} = M_{lk} gives the momentum in its most physical form:

pj  =  ∑kMjk(q) q˙k,Mjk=∂2T∂q˙j ∂q˙k(5)p_j \;=\; \sum_k M_{jk}(q)\,\dot q_k, \qquad M_{jk} = \frac{\partial^2 T}{\partial\dot q_j\,\partial\dot q_k} \qquad (5)

where: MjkM_{jk} — the configuration-dependent mass (inertia) matrix. Two lessons sit in this formula. The momentum conjugate to one coordinate is in general a blend of all the velocities — in a two-link robot arm, pθ1p_{\theta_1} contains θ˙2\dot\theta_2, because swinging the forearm moves mass that the shoulder angle also carries. And even in one dimension the effective inertia can depend on position: the bead on the parabolic wire below has px=m (1+f′2) x˙p_x = m\,(1 + f'^2)\,\dot x, larger where the wire is steep because a unit of x˙\dot x then implies extra vertical speed. With both conjugate objects defined, the Euler–Lagrange equation — derived from stationary action in its own article — can be read as a physical sentence rather than a formula:

p˙j  =  ∂L∂qj(6)\dot p_j \;=\; \frac{\partial L}{\partial q_j} \qquad (6)

where: ∂L/∂qj\partial L/\partial q_j — the Lagrangian's own generalized force, containing both −∂V/∂qj-\partial V/\partial q_j and any coordinate-dependence of the kinetic energy (the origin of centrifugal-type terms). This is Newton's second law in coordinate-free dress: rate of change of conjugate momentum equals conjugate force. Its most celebrated corollary costs nothing: if qjq_j is absent from LL, the right side vanishes and pjp_j is conserved — the cyclic-coordinate mechanism that the next article develops into a systematic tool. Real machines have friction and drives. Forces with no potential simply stay in the projected form (2) and sit on the right-hand side:

p˙j−∂L∂qj  =  Qjnc,Qjnc=∑iFinc⋅∂ri∂qj(7)\dot p_j - \frac{\partial L}{\partial q_j} \;=\; Q_j^{\mathrm{nc}}, \qquad Q_j^{\mathrm{nc}} = \sum_i \mathbf{F}_i^{\mathrm{nc}}\cdot\frac{\partial\mathbf{r}_i}{\partial q_j} \qquad (7)

where: Finc\mathbf{F}_i^{\mathrm{nc}} — the non-conservative forces (friction, air drag, motor torques). The conservative part of the physics lives inside LL; everything else is projected and appended. This split is exactly how robot dynamics engines organize the manipulator equation, with motor torques appearing as the QjncQ_j^{\mathrm{nc}}.

Which formula answers which question

you wantusenotes
the force conjugate to qjq_j, any forcesQj=∑iFi⋅∂ri/∂qjQ_j = \sum_i \mathbf{F}_i\cdot\partial\mathbf{r}_i/\partial q_j, eq. (2)constraint forces drop out automatically
conservative caseQj=−∂V/∂qjQ_j = -\partial V/\partial q_j, eq. (3)gets absorbed into L=T−VL = T-V
the momentum conjugate to qjq_jpj=∂L/∂q˙jp_j = \partial L/\partial\dot q_j, eq. (4)the definition — always safe
explicit momentum, standard TTpj=∑kMjk(q) q˙kp_j = \sum_k M_{jk}(q)\,\dot q_k, eq. (5)a blend of velocities; ≠mq˙j\neq m\dot q_j in general
equation of motionp˙j=∂L/∂qj\dot p_j = \partial L/\partial q_j, eq. (6)Newton II in conjugate variables
with friction or drivep˙j−∂L/∂qj=Qjnc\dot p_j - \partial L/\partial q_j = Q_j^{\mathrm{nc}}, eq. (7)non-conservative forces projected on the right
charge in a fieldp=mr˙+qA\mathbf{p} = m\dot{\mathbf{r}} + q\mathbf{A}, eq. (9)canonical ≠\neq kinetic momentum
Derivation AFrom dAlemberts Principle to Generalized Forces and Momenta

We are deriving Lagrange's equations in their force form, ddt(∂T/∂q˙j)−∂T/∂qj=Qj\tfrac{\mathrm{d}}{\mathrm{d}t}(\partial T/\partial\dot q_j) - \partial T/\partial q_j = Q_j — the equation that shows why the two objects of this article are conjugate partners, because both appear in it and nowhere is a constraint force in sight. The strategy: take d'Alembert's principle (established in its own article, used here as input), project it onto each generalized coordinate, and convert the awkward inertial term into derivatives of the kinetic energy using two small kinematic identities. The step to watch is that conversion — the "dot-cancellation" identities are where the generalized momentum ∂T/∂q˙j\partial T/\partial\dot q_j is born, and misremembering them is the classic way to lose a term. No assumption about conservative forces is made until the very last step, so the result holds for friction and drives too.

Step 1. d'Alembert's principle states ∑i(Fi−mir¨i)⋅δri=0\sum_i (\mathbf{F}_i - m_i\ddot{\mathbf{r}}_i)\cdot\delta\mathbf{r}_i = 0 for every virtual displacement compatible with the constraints. Substitute δri=∑j(∂ri/∂qj) δqj\delta\mathbf{r}_i = \sum_j(\partial\mathbf{r}_i/\partial q_j)\,\delta q_j and use the independence of the δqj\delta q_j to peel off one equation per coordinate:

∑imir¨i⋅∂ri∂qj  =  ∑iFi⋅∂ri∂qj  =  Qj\sum_i m_i\ddot{\mathbf{r}}_i\cdot\frac{\partial\mathbf{r}_i}{\partial q_j} \;=\; \sum_i \mathbf{F}_i\cdot\frac{\partial\mathbf{r}_i}{\partial q_j} \;=\; Q_j

Why the constraint forces are already gone: they do no virtual work, so only applied forces survive on the right — which is exactly the generalized force of equation (2).

Step 2. Attack the left side with the product rule, trading a second derivative for two first-derivative terms:

∑imir¨i⋅∂ri∂qj=ddt(∑imir˙i⋅∂ri∂qj)−∑imir˙i⋅ddt∂ri∂qj\sum_i m_i\ddot{\mathbf{r}}_i\cdot\frac{\partial\mathbf{r}_i}{\partial q_j} = \frac{\mathrm{d}}{\mathrm{d}t}\Big(\sum_i m_i\dot{\mathbf{r}}_i\cdot\frac{\partial\mathbf{r}_i}{\partial q_j}\Big) - \sum_i m_i\dot{\mathbf{r}}_i\cdot\frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial\mathbf{r}_i}{\partial q_j}

Why this move: acceleration dotted into a geometric vector is not yet recognizable as anything; velocity dotted into geometric vectors can be matched against derivatives of T=12∑imir˙i2T = \tfrac12\sum_i m_i\dot{\mathbf{r}}_i^2.

Step 3. Deploy the two kinematic identities that follow from ri=ri(q,t)\mathbf{r}_i = \mathbf{r}_i(q,t) and the chain rule:

∂r˙i∂q˙j=∂ri∂qj,ddt∂ri∂qj=∂r˙i∂qj\frac{\partial\dot{\mathbf{r}}_i}{\partial\dot q_j} = \frac{\partial\mathbf{r}_i}{\partial q_j}, \qquad \frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial\mathbf{r}_i}{\partial q_j} = \frac{\partial\dot{\mathbf{r}}_i}{\partial q_j}

Why they hold: r˙i=∑k(∂ri/∂qk)q˙k+∂ri/∂t\dot{\mathbf{r}}_i = \sum_k(\partial\mathbf{r}_i/\partial q_k)\dot q_k + \partial\mathbf{r}_i/\partial t is linear in the q˙k\dot q_k, so differentiating by q˙j\dot q_j picks out its coefficient ("cancel the dots"); and mixed partials of ri\mathbf{r}_i commute, so the total time derivative and ∂/∂qj\partial/\partial q_j can be swapped.

Step 4. Substitute both identities into Step 2. The first parenthesis becomes ∑imir˙i⋅∂r˙i/∂q˙j=∂T/∂q˙j\sum_i m_i\dot{\mathbf{r}}_i\cdot\partial\dot{\mathbf{r}}_i/\partial\dot q_j = \partial T/\partial\dot q_j; the second sum becomes ∑imir˙i⋅∂r˙i/∂qj=∂T/∂qj\sum_i m_i\dot{\mathbf{r}}_i\cdot\partial\dot{\mathbf{r}}_i/\partial q_j = \partial T/\partial q_j. The projected law assembles into

ddt ⁣(∂T∂q˙j)−∂T∂qj  =  Qj(8)\frac{\mathrm{d}}{\mathrm{d}t}\!\left(\frac{\partial T}{\partial\dot q_j}\right) - \frac{\partial T}{\partial q_j} \;=\; Q_j \qquad (8)

where: the object being time-differentiated is precisely the generalized momentum — it appeared uninvited, as the natural coefficient the algebra produces. Equation (8) is fully general: any forces, any holonomic constraints.

Step 5. Specialize to conservative forces: with Qj=−∂V/∂qjQ_j = -\partial V/\partial q_j and VV velocity-independent, both VV-terms fold into L=T−VL = T - V, giving ddt(∂L/∂q˙j)=∂L/∂qj\tfrac{\mathrm{d}}{\mathrm{d}t}(\partial L/\partial\dot q_j) = \partial L/\partial q_j — equation (6). Keeping any leftover forces outside reproduces equation (7). Verified: for a single Cartesian coordinate, T=12mx˙2T = \tfrac12 m\dot x^2 makes (8) read mx¨=Qx=Fxm\ddot x = Q_x = F_x — Newton recovered; the derivation matches Goldstein §1.4 term for term.

Go deeper · Derivation B · 1 minThe Mass Matrix and Why Momenta Mix Velocities
Derivation BThe Mass Matrix and Why Momenta Mix Velocities

The goal is the explicit momentum formula (5), pj=∑kMjk(q) q˙kp_j = \sum_k M_{jk}(q)\,\dot q_k, together with the physical claim that hangs on it: conjugate momenta are configuration-dependent blends of all the velocities, reducing to mq˙jm\dot q_j only when the kinetic energy is diagonal with constant coefficients. The strategy is a two-line computation — differentiate the quadratic form carefully — followed by the sanity checks that give the formula meaning. The point to watch is the double sum: both slots of the quadratic form contain q˙j\dot q_j, and forgetting one of them silently halves the momentum.

Step 1. For particles at positions ri(q)\mathbf{r}_i(q) (no explicit time dependence), the chain rule gives r˙i=∑k(∂ri/∂qk) q˙k\dot{\mathbf{r}}_i = \sum_k (\partial\mathbf{r}_i/\partial q_k)\,\dot q_k, so the kinetic energy is a pure quadratic form,

T=12∑k,lMkl(q) q˙kq˙l,Mkl(q)=∑imi ∂ri∂qk⋅∂ri∂qlT = \tfrac12\sum_{k,l} M_{kl}(q)\,\dot q_k\dot q_l, \qquad M_{kl}(q) = \sum_i m_i\,\frac{\partial\mathbf{r}_i}{\partial q_k}\cdot\frac{\partial\mathbf{r}_i}{\partial q_l}

Why MM is symmetric and positive-definite: it is built from dot products of the same set of vectors, weighted by positive masses — no negative kinetic energies, ever.

Step 2. Differentiate with respect to q˙j\dot q_j, remembering that q˙j\dot q_j can occupy either slot:

pj=∂T∂q˙j=12∑k,lMkl(δjkq˙l+q˙kδjl)=∑kMjk(q) q˙kp_j = \frac{\partial T}{\partial\dot q_j} = \tfrac12\sum_{k,l} M_{kl}\big(\delta_{jk}\dot q_l + \dot q_k\delta_{jl}\big) = \sum_k M_{jk}(q)\,\dot q_k

Why the two halves merge: the symmetry Mkl=MlkM_{kl} = M_{lk} makes the two Kronecker-delta terms equal, and the 12\tfrac12 is spent combining them.

Step 3. Read the result. Off-diagonal MjkM_{jk} means momenta mix: for the double pendulum or robot arm, pθ1=M11θ˙1+M12θ˙2p_{\theta_1} = M_{11}\dot\theta_1 + M_{12}\dot\theta_2, and M12M_{12} depends on the relative angle. Diagonal but position-dependent Mjj(q)M_{jj}(q) means the effective inertia varies along the motion: the parabolic-wire bead's px=m(1+f′2) x˙p_x = m(1+f'^2)\,\dot x. Verified: in Cartesian coordinates Mjk=m δjkM_{jk} = m\,\delta_{jk} and pj=mq˙jp_j = m\dot q_j; in planar polar coordinates M=diag(m,mr2)M = \mathrm{diag}(m, mr^2) gives pr=mr˙p_r = m\dot r and pϕ=mr2ϕ˙p_\phi = mr^2\dot\phi — the angular momentum, as it must.

When momentum stops being mass times velocity

Everything so far assumed VV carries no velocities. Electromagnetism breaks that assumption in the most consequential way in physics. The Lagrangian that reproduces the Lorentz force on a charge qq in potentials ϕ, A\phi,\ \mathbf{A} is

L  =  12mr˙2  −  qϕ(r,t)  +  q r˙⋅A(r,t)(9)L \;=\; \tfrac12 m\dot{\mathbf{r}}^2 \;-\; q\phi(\mathbf{r},t) \;+\; q\,\dot{\mathbf{r}}\cdot\mathbf{A}(\mathbf{r},t) \qquad (9)

where: ϕ\phi — scalar potential; A\mathbf{A} — vector potential, B=∇×A\mathbf{B} = \nabla\times\mathbf{A}. The velocity-linear coupling q r˙⋅Aq\,\dot{\mathbf{r}}\cdot\mathbf{A} is a velocity-dependent potential — a genuinely new structural feature, and the reason the momentum conjugate to position acquires a field contribution.

Figure
Canonical versus kinetic momentum — a charge in a magnetic field carries a piece of the field
charge q m v (kinetic) q A p = m v + q A Newton tracks m v. The Lagrangian tracks p = ∂L/∂v = m v + q A. conservation laws, the Hamiltonian, and quantum mechanics (p → −iħ∇) all use the canonical p — when a coordinate is cyclic, it is m v + q A that stays constant while m v alone circles uniform B out of the page
Go deeper · Derivation C · 2 minCanonical Momentum of a Charge and the Lorentz Force
Derivation CCanonical Momentum of a Charge and the Lorentz Force

We are deriving the canonical momentum p=mr˙+qA\mathbf{p} = m\dot{\mathbf{r}} + q\mathbf{A} from the Lagrangian (9), and then closing the loop by checking that the Euler–Lagrange machinery hands back the Lorentz force — so that the strange-looking momentum is certified by the right equation of motion. The strategy is direct computation: one velocity-derivative for the momentum, one coordinate-derivative for the generalized force, then a careful assembly in which the total time derivative of A(r(t),t)\mathbf{A}(\mathbf{r}(t),t) is the step to watch — it contains a convective piece (r˙⋅∇)A(\dot{\mathbf{r}}\cdot\nabla)\mathbf{A} that beginners drop, and dropping it destroys the magnetic force.

Step 1. Differentiate LL by the velocity components. The 12mr˙2\tfrac12 m\dot{\mathbf{r}}^2 term gives mr˙m\dot{\mathbf{r}}; the coupling q r˙⋅Aq\,\dot{\mathbf{r}}\cdot\mathbf{A} is linear in velocity and gives qAq\mathbf{A}; the scalar potential gives nothing:

p=∂L∂r˙=mr˙+qA(r,t)(10)\mathbf{p} = \frac{\partial L}{\partial\dot{\mathbf{r}}} = m\dot{\mathbf{r}} + q\mathbf{A}(\mathbf{r},t) \qquad (10)

where: the canonical momentum splits into the kinetic momentum mr˙m\dot{\mathbf{r}} (what a speed gun measures) plus the field contribution qAq\mathbf{A} (what the bookkeeping requires). Note p\mathbf{p} inherits the gauge-dependence of A\mathbf{A} — only in a fixed gauge is its value meaningful, though its conservation statements are physical.

Step 2. Differentiate LL by position to get the generalized force: ∂L/∂r=−q∇ϕ+q ∇(r˙⋅A)\partial L/\partial\mathbf{r} = -q\nabla\phi + q\,\nabla(\dot{\mathbf{r}}\cdot\mathbf{A}), with r˙\dot{\mathbf{r}} held fixed during the gradient. Why this is velocity-dependent: the "force" side of the EL equation now contains r˙\dot{\mathbf{r}} — the hallmark of magnetism, and the reason no scalar V(r)V(\mathbf{r}) could ever produce it.

Step 3. Write the EL equation p˙=∂L/∂r\dot{\mathbf{p}} = \partial L/\partial\mathbf{r} and expand the total derivative of A\mathbf{A} along the trajectory:

ddt(mr˙+qA)=−q∇ϕ+q∇(r˙⋅A),dAdt=∂A∂t+(r˙⋅∇)A\frac{\mathrm{d}}{\mathrm{d}t}\big(m\dot{\mathbf{r}} + q\mathbf{A}\big) = -q\nabla\phi + q\nabla(\dot{\mathbf{r}}\cdot\mathbf{A}), \qquad \frac{\mathrm{d}\mathbf{A}}{\mathrm{d}t} = \frac{\partial\mathbf{A}}{\partial t} + (\dot{\mathbf{r}}\cdot\nabla)\mathbf{A}

Why the convective term exists: the particle samples the field at a moving point, so A\mathbf{A} changes both because the field evolves and because the particle relocates.

Step 4. Move the A\mathbf{A}-terms to the right and use the vector identity ∇(r˙⋅A)−(r˙⋅∇)A=r˙×(∇×A)\nabla(\dot{\mathbf{r}}\cdot\mathbf{A}) - (\dot{\mathbf{r}}\cdot\nabla)\mathbf{A} = \dot{\mathbf{r}}\times(\nabla\times\mathbf{A}) together with E=−∇ϕ−∂tA\mathbf{E} = -\nabla\phi - \partial_t\mathbf{A} and B=∇×A\mathbf{B} = \nabla\times\mathbf{A}:

mr¨=q(E+r˙×B)m\ddot{\mathbf{r}} = q\big(\mathbf{E} + \dot{\mathbf{r}}\times\mathbf{B}\big)

Why this closes the case: the kinetic momentum obeys the Lorentz force law, exactly as experiment demands — while the object the formalism conserves and transports into Hamiltonian and quantum mechanics is the canonical p\mathbf{p} of (10). *Verified: matches Goldstein §1.5 and Landau–Lifshitz, Classical Theory of Fields §16–17; setting A=0\mathbf{A} = 0 collapses canonical to kinetic momentum and the force to −q∇ϕ-q\nabla\phi.*

Limiting cases

CaseResultMeaning
Cartesian length coordinateQx=FxQ_x = F_x,  px=mx˙\ p_x = m\dot xNewton's force and momentum are the special case qj=q_j = length, constant diagonal MM
angular coordinateQϕ=τzQ_\phi = \tau_z,  pϕ=mr2ϕ˙\ p_\phi = mr^2\dot\phitorque and angular momentum emerge automatically; Qϕ δϕQ_\phi\,\delta\phi still in joules
conservative forcesQj=−∂V/∂qjQ_j = -\partial V/\partial q_jthe generalized force disappears into L=T−VL = T - V
velocity-dependent potential (EM)px=mx˙+qAx≠mx˙p_x = m\dot x + qA_x \neq m\dot xcanonical splits from kinetic momentum — the gauge field rides inside pp
coordinate absent from LLp˙j=0\dot p_j = 0conservation for free — the cyclic-coordinate mechanism
frozen configuration, TT diagonal constanteq. (8) →mjq¨j=Qj\to m_j\ddot q_j = Q_jper-coordinate Newton — the formalism's training wheels

Worked examples

1 · Bead on a parabolic wire (confidence builder)

A bead of mass m=0.2 kgm = 0.2\ \mathrm{kg} slides on a frictionless parabolic wire y=x2/2Ry = x^2/2R with R=0.5 mR = 0.5\ \mathrm{m}, in gravity. Using xx as the generalized coordinate, find the generalized force QxQ_x and the conjugate momentum pxp_x at the moment the bead passes x=0.3 mx = 0.3\ \mathrm{m} with x˙=1.5 m/s\dot x = 1.5\ \mathrm{m/s}.

Step 1. Geometry first. The position is r=(x, x2/2R)\mathbf{r} = (x,\ x^2/2R), so ∂r/∂x=(1, x/R)\partial\mathbf{r}/\partial x = (1,\ x/R) with slope f′(x)=x/R=0.3/0.5=0.6f'(x) = x/R = 0.3/0.5 = 0.6 at the given point.

Step 2. Generalized force by projection, eq. (2): with F=(0, −mg)\mathbf{F} = (0,\ -mg),

Qx=F⋅∂r∂x=−mg f′(x)=−0.2×9.81×0.6=−1.18 NQ_x = \mathbf{F}\cdot\frac{\partial\mathbf{r}}{\partial x} = -mg\,f'(x) = -0.2 \times 9.81 \times 0.6 = \boxed{-1.18\ \mathrm{N}}

The sign says the force pushes toward decreasing xx — downhill. The normal force never entered: it is perpendicular to ∂r/∂x\partial\mathbf{r}/\partial x by construction.

Step 3. Momentum from the Lagrangian. The speed obeys v2=x˙2+y˙2=(1+f′2) x˙2v^2 = \dot x^2 + \dot y^2 = (1 + f'^2)\,\dot x^2, so L=12m(1+f′2) x˙2−mg x2/2RL = \tfrac12 m (1 + f'^2)\,\dot x^2 - mg\,x^2/2R and

px=∂L∂x˙=m(1+f′2)x˙=0.2×1.36×1.5=0.408 kg m/sp_x = \frac{\partial L}{\partial\dot x} = m\big(1 + f'^2\big)\dot x = 0.2 \times 1.36 \times 1.5 = \boxed{0.408\ \mathrm{kg\,m/s}}

Step 4. Compare with the naive answer: mx˙=0.300 kg m/sm\dot x = 0.300\ \mathrm{kg\,m/s} — a 36% error. The effective inertia m(1+f′2)m(1+f'^2) is the one-coordinate mass matrix Mxx(x)M_{xx}(x): where the wire is steep, a unit of x˙\dot x drags extra vertical speed, and the momentum knows it. No field, no exotic units — geometry alone already separates pxp_x from mx˙m\dot x.

2 · Holding torque for a two-link robot arm (exam level)

A planar two-link arm has link 1: m1=3.0 kgm_1 = 3.0\ \mathrm{kg}, length l1=0.40 ml_1 = 0.40\ \mathrm{m}, centre of mass at lc1=0.20 ml_{c1} = 0.20\ \mathrm{m}; link 2: m2=1.5 kgm_2 = 1.5\ \mathrm{kg}, centre of mass at lc2=0.15 ml_{c2} = 0.15\ \mathrm{m} from the elbow. Joint angles are measured from the horizontal: θ1=30°\theta_1 = 30° at the shoulder, and the elbow adds θ2=45°\theta_2 = 45°, so link 2 sits at θ1+θ2=75°\theta_1 + \theta_2 = 75°. Find the gravitational generalized forces Qθ1,Qθ2Q_{\theta_1}, Q_{\theta_2} and the motor torques needed to hold the pose — first bare, then carrying a 2.0 kg2.0\ \mathrm{kg} payload at the wrist, l2=0.30 ml_2 = 0.30\ \mathrm{m} from the elbow.

Step 1. Set up the potential in the joint coordinates. Heights above the shoulder: yc1=lc1sin⁡θ1y_{c1} = l_{c1}\sin\theta_1 for link 1's centre of mass, yc2=l1sin⁡θ1+lc2sin⁡(θ1+θ2)y_{c2} = l_1\sin\theta_1 + l_{c2}\sin(\theta_1+\theta_2) for link 2's. So V=g[(m1lc1+m2l1)sin⁡θ1+m2lc2sin⁡(θ1+θ2)]V = g\big[(m_1 l_{c1} + m_2 l_1)\sin\theta_1 + m_2 l_{c2}\sin(\theta_1+\theta_2)\big].

Step 2. Generalized forces by eq. (3), Qj=−∂V/∂θjQ_j = -\partial V/\partial\theta_j — note both angles move link 2, so θ1\theta_1 collects both terms:

Qθ1=−g[(m1lc1+m2l1)cos⁡θ1+m2lc2cos⁡(θ1+θ2)],Qθ2=−g m2lc2cos⁡(θ1+θ2)(11)Q_{\theta_1} = -g\big[(m_1 l_{c1} + m_2 l_1)\cos\theta_1 + m_2 l_{c2}\cos(\theta_1+\theta_2)\big], \qquad Q_{\theta_2} = -g\, m_2 l_{c2}\cos(\theta_1+\theta_2) \qquad (11)

Step 3. Numbers. m1lc1+m2l1=3.0×0.20+1.5×0.40=1.20 kg mm_1 l_{c1} + m_2 l_1 = 3.0\times0.20 + 1.5\times0.40 = 1.20\ \mathrm{kg\,m}; m2lc2=0.225 kg mm_2 l_{c2} = 0.225\ \mathrm{kg\,m}; cos⁡30°=0.866\cos 30° = 0.866, cos⁡75°=0.259\cos 75° = 0.259. Then Qθ1=−9.81 (1.20×0.866+0.225×0.259)=−(10.19+0.57)=−10.8 N mQ_{\theta_1} = -9.81\,(1.20\times0.866 + 0.225\times0.259) = -(10.19 + 0.57) = \boxed{-10.8\ \mathrm{N\,m}} and Qθ2=−9.81×0.225×0.259=−0.571 N mQ_{\theta_2} = -9.81\times0.225\times0.259 = \boxed{-0.571\ \mathrm{N\,m}}. These are torques, not forces — the coordinate is an angle.

Step 4. Static balance via eq. (7): holding still means p˙j=0\dot p_j = 0 and ∂L/∂θj\partial L/\partial\theta_j reduces to QθjgravQ_{\theta_j}^{\mathrm{grav}}, so the motors must supply τj=−Qθj\tau_j = -Q_{\theta_j}: τ1=+10.8 N m\tau_1 = +10.8\ \mathrm{N\,m}, τ2=+0.571 N m\tau_2 = +0.571\ \mathrm{N\,m} — the shoulder works nineteen times harder than the elbow, because it carries every gram at full lever arm.

Step 5. Add the payload: it hangs at height l1sin⁡θ1+l2sin⁡(θ1+θ2)l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2), so append mpl1cos⁡θ1m_p l_1\cos\theta_1 to the θ1\theta_1 bracket and mpl2cos⁡(θ1+θ2)m_p l_2\cos(\theta_1+\theta_2) to both. Recomputing: Qθ1=−10.8−9.81 (2.0×0.40×0.866+2.0×0.30×0.259)=−19.1 N mQ_{\theta_1} = -10.8 - 9.81\,(2.0\times0.40\times0.866 + 2.0\times0.30\times0.259) = \boxed{-19.1\ \mathrm{N\,m}} and Qθ2=−0.571−9.81×2.0×0.30×0.259=−2.09 N mQ_{\theta_2} = -0.571 - 9.81\times2.0\times0.30\times0.259 = \boxed{-2.09\ \mathrm{N\,m}}. A 2 kg cup of coffee nearly doubles the shoulder torque. This calculation — equation (11) evaluated at every control tick — is called gravity compensation, and it runs inside every collaborative robot on every factory floor.

Origins · 1 minJean le Rond d'Alembert and how this was discovered
JL
Jean le Rond d'Alembert
1717–1783 · Paris, Académie des Sciences and the Encyclopédie

Abandoned as a newborn on the steps of the Saint-Jean-le-Rond chapel and raised by a glazier's wife, d'Alembert rose to co-edit the Encyclopédie with Diderot while producing the mechanics that bears his name. His Traité de dynamique (1743) advanced the principle that converts dynamics into statics — treat −mr¨-m\ddot{\mathbf{r}} as one more force and demand zero virtual work — which is precisely the move that banishes constraint forces and opens Step 1 of this article's central derivation. He gave the first general treatment of the wave equation for a vibrating string, fought famously with Clairaut over precession and with Bernoulli over probability, and refused to guess where he could derive. Lagrange, who called the Traité his starting point, built the Mécanique analytique on d'Alembert's projection idea — turning the generalized force from a trick into the foundation of analytical mechanics.

History
1743
— d'Alembert's Traité de dynamique recasts dynamics as statics with inertial forces, making virtual-work projection the master tool.
1760
— Lagrange, in the Turin Miscellanea, combines d'Alembert's principle with the calculus of variations, introducing generalized coordinates and their conjugate quantities.
1788
— The Mécanique analytique delivers the mature ddt(∂T/∂q˙)−∂T/∂q=Q\tfrac{\mathrm{d}}{\mathrm{d}t}(\partial T/\partial\dot q) - \partial T/\partial q = Q — a mechanics book, Lagrange boasts, with not a single diagram.
1834
— Hamilton reads p=∂L/∂q˙p = \partial L/\partial\dot q as one member of a conjugate pair and builds phase space on it, promoting the canonical momentum to a coordinate in its own right.
1873
— Maxwell's Treatise applies generalized forces and momenta to circuits and fields, treating flux linkage as a momentum — analytical mechanics escapes mechanics.

Going further

References. Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., §1.4, §2.6 · Landau & Lifshitz, Mechanics, 3rd ed., §§7–8 · Morin, Introduction to Classical Mechanics, Ch. 6 · Taylor, Classical Mechanics, §7.8

Provenance. Definitions and the d'Alembert-to-Euler-Lagrange derivation follow Goldstein, Poole & Safko §1.4 and Landau–Lifshitz Mechanics §§7–8. A verifier should confirm: (1) the chain-rule derivation of Qj=∑iFi⋅∂ri/∂qjQ_j=\sum_i\mathbf F_i\cdot\partial\mathbf r_i/\partial q_j; (2) the 'dot-cancellation' identities used to convert the inertial term into TT-derivatives; (3) the EM Lagrangian yields the Lorentz force and p=mr˙+qA\mathbf p=m\dot{\mathbf r}+q\mathbf A (Goldstein §1.5); (4) the central-force result pϕ=mr2ϕ˙p_\phi=mr^2\dot\phi conserved. All numerical/structural relations are standard textbook results, no fabricated constants. Worked-example numbers on this page (Qx=−1.18 NQ_x = -1.18\ \mathrm{N} and px=0.408 kg m/sp_x = 0.408\ \mathrm{kg\,m/s} for the bead; τ1=10.8→19.1 N m\tau_1 = 10.8\to19.1\ \mathrm{N\,m}, τ2=0.571→2.09 N m\tau_2 = 0.571\to2.09\ \mathrm{N\,m} for the arm) are illustrative arithmetic recomputed from equations (2), (3), (5), (11).

Builds on: Generalized Coordinates and Configuration Space · Virtual Displacements and the Principle of Virtual Work · d'Alembert's Principle · The Lagrangian Function

Leads to: The Euler-Lagrange Equations · Cyclic Coordinates and Conservation of Conjugate Momenta · The Energy Function and Jacobi Integral · Symmetries and Continuous Transformations

Is the generalized force an actual force I could measure with a spring scale?

Only when qjq_j is a Cartesian length — then QjQ_j is the corresponding force component and a scale would read it. In general QjQ_j is the work coefficient of the coordinate: newton-metres for an angle, pascals (with a sign) for a volume, and stranger units for stranger coordinates. What is always measurable is the product Qj δqjQ_j\,\delta q_j — an energy. The robot-arm example makes it concrete: no single spring scale anywhere on the arm reads −10.8 N m-10.8\ \mathrm{N\,m}; that number is the assembled gravitational torque about the shoulder axis, which is what the motor must fight. Think of QjQ_j as force re-expressed in the currency of your chosen coordinate, at the exchange rate ∂ri/∂qj\partial\mathbf{r}_i/\partial q_j.

Why does the definition use virtual displacements instead of real ones?

Because the projection must probe configuration directions, one coordinate at a time, without smuggling in time evolution. A real displacement dri\mathrm{d}\mathbf{r}_i during dt\mathrm{d}t includes whatever motion the constraints themselves generate (a rotating platform drags you along even if you hold still), and for moving constraints the constraint forces do do real work. The virtual displacement δri\delta\mathbf{r}_i freezes time and wiggles only the coordinates, which is exactly the condition under which ideal constraint forces do zero work and drop out of QjQ_j. That single technicality is what buys the formalism's superpower — never solving for normal forces and tensions. The fine print lives in the article on virtual work and virtual displacements.

How do I actually compute Q_j in practice — the projection sum looks unwieldy?

You almost never evaluate ∑iFi⋅∂ri/∂qj\sum_i\mathbf{F}_i\cdot\partial\mathbf{r}_i/\partial q_j particle by particle. Three shortcuts cover practice. If the forces are conservative, write the potential directly in the generalized coordinates and use Qj=−∂V/∂qjQ_j = -\partial V/\partial q_j — that is how the robot-arm torques took two lines. If the force is a single applied force at a known point, give that point's position as r(q)\mathbf{r}(q) and take one dot product — the bead's Qx=−mgf′(x)Q_x = -mg f'(x). If you only need the units and meaning, displace qjq_j alone by δqj\delta q_j, compute the work done, and read off the coefficient. The full sum is the definition's insurance policy, not its user interface.

If canonical momentum is gauge-dependent, how can it be physical?

The value of p=mr˙+qA\mathbf{p} = m\dot{\mathbf{r}} + q\mathbf{A} indeed changes under A→A+∇χ\mathbf{A}\to\mathbf{A}+\nabla\chi — so nobody's detector reads canonical momentum directly; detectors read mvm\mathbf{v}. What is physical is the role it plays within a fixed gauge: the conservation statement "if xx is cyclic, pxp_x is constant" holds in every gauge in which xx is cyclic, and differences of p\mathbf{p} around closed loops are gauge-invariant (they become the Aharonov–Bohm phase in quantum mechanics). The situation is like potential energy: its absolute value is convention, its differences and conservation laws are physics. Treat p\mathbf{p} as impeccable bookkeeping — and translate back to mvm\mathbf{v} whenever you want a number to compare with a speed gun.

When exactly does p_j = m q̇_j actually hold?

Three conditions, all needed: the coordinate qjq_j is a Cartesian length; the kinetic energy is diagonal in your coordinates with a constant coefficient (no curvilinear mixing, no configuration-dependent inertia); and the potential contains no velocities (no magnetic-type couplings). Break the first and you get angular momenta; the second, mass-matrix blends like the parabolic bead's m(1+f′2)x˙m(1+f'^2)\dot x; the third, field contributions like qAq\mathbf{A}. The safe procedure is always the definition: write LL, differentiate by q˙j\dot q_j, and accept whatever comes out. The naive formula is the special case, not the rule — this is the single most common source of wrong answers in Lagrangian coursework.

Where does friction go — it has no potential, so is the Lagrangian method stuck?

Not stuck; friction just refuses to hide inside LL. Project it like any force, Qjnc=∑iFinc⋅∂ri/∂qjQ_j^{\mathrm{nc}} = \sum_i\mathbf{F}_i^{\mathrm{nc}}\cdot\partial\mathbf{r}_i/\partial q_j, and carry it on the right-hand side of eq. (7): p˙j−∂L/∂qj=Qjnc\dot p_j - \partial L/\partial q_j = Q_j^{\mathrm{nc}}. For the common case of drag proportional to velocity there is an elegant repackaging, the Rayleigh dissipation function, which generates these QjncQ_j^{\mathrm{nc}} from a single scalar much as VV generates conservative forces — it has its own article in this track. What you may not do is stuff a velocity-dependent friction "potential" into L=T−VL = T - V; the Lorentz-force coupling works only because of its precise linear-in-velocity structure, which friction does not share.

Why is ∂L/∂q_j called a generalized force too — is it the same as Q_j?

They coincide exactly when all applied forces are conservative and absorbed into LL: then ∂L/∂qj=−∂V/∂qj=Qj\partial L/\partial q_j = -\partial V/\partial q_j = Q_j. But ∂L/∂qj\partial L/\partial q_j is a broader object, because the kinetic energy can also depend on coordinates. In polar coordinates, ∂L/∂r\partial L/\partial r contains mrϕ˙2mr\dot\phi^2 — the "centrifugal force" — which is no applied force at all but the geometry of the coordinates showing up in the bookkeeping. The clean sentence: p˙j=∂L/∂qj\dot p_j = \partial L/\partial q_j balances the momentum's rate against everything the Lagrangian knows about — real conservative forces plus coordinate-geometry effects — while genuinely external non-conservative pushes are appended as QjncQ_j^{\mathrm{nc}}.

Is there a deep reason force pairs with coordinates and momentum with velocities, or is it notation?

It is structure, and it runs all the way down. The pair (qj,pj)(q_j, p_j) is conjugate in the precise sense that later becomes Hamiltonian mechanics: LL trades velocities for momenta by a Legendre transform, and (q,p)(q, p) become independent coordinates on phase space with a symplectic geometry that Poisson brackets encode. The pairing also carries the conservation structure — a symmetry that shifts qjq_j conserves precisely its partner pjp_j, the pattern Noether's theorem makes universal. Quantum mechanics then promotes the same pairing to [q^,p^]=iℏ[\hat q, \hat p] = i\hbar: the reason position and canonical momentum cannot be simultaneously sharp is the same conjugacy you are learning here. The derivative ∂L/∂q˙j\partial L/\partial\dot q_j is the classical seed of all of it.

Before this

Where this leads