- Home
- Learn
- Start Here
- Preparation by Topic
- Lagrangian and Hamiltonian Mechanics
Lagrangian and Hamiltonian Mechanics
A force that pulls to the right shifts a spring’s equilibrium to the right. That prediction checks the sign of a source both in the equation of motion and in the Hamiltonian. Begin with a real displacement , mass , frequency and prescribed force . A dot denotes a time derivative. Varying the motion will use the product rule and integration by parts.
is the Lagrangian and the action. The notation emphasizes that the input is a whole trajectory. The force enters with the positive action-source sign. Source conventions
Vary a trajectory with fixed endpoints
Compare with , where is a small real parameter and the smooth function vanishes at and . Compute the coefficient of in . Keep the endpoint term visible until using the endpoint condition. Which equation makes this coefficient vanish for every allowed ?
Solution
The velocity changes by . Expanding both squares and differentiating at gives
Integration by parts moves the derivative from to :
The bracket vanishes because is zero at both endpoints. The endpoint velocities can be arbitrary. The remaining coefficient must vanish everywhere: if it did not, a variation supported in a small interval could make the integral nonzero. Thus
The restoring force is , and is the external force. “Stationary action” refers to this vanishing first-order change. A minimum also requires control of higher orders.
To recover the sign, expand the product derivative before dropping any terms. The same calculation for any differentiable gives the Euler–Lagrange equation
and are treated as independent arguments while taking the partial derivatives. They become a trajectory and its velocity when evaluating the result. Holding fixed in is therefore meaningful.
Replace velocity by momentum
The momentum conjugate to is . Find the Hamiltonian as a function of , with no left. Check the two equations
Solution
Here , which can be inverted because . Substitution gives
The source changes sign in because it contains no velocity and is subtracted with the rest of . Hamilton's equations give and . Differentiating the first and inserting the second recovers the force equation.
For constant , complete the square:
The force shifts the equilibrium to positive when . The oscillation frequency remains . Both are physical checks on the source sign.
Change the Lagrangian. Add to , with a constant with units of momentum. Does this change the measured acceleration?
Solution using the shifted momentum
The momentum becomes . Solving for in gives the new kinetic term . Consequently and still give the same acceleration. In the action the extra term integrates to . Its variation vanishes for fixed endpoints. Both calculations show how the canonical momentum can change while the trajectory stays the same.
Which energy is conserved?
Define the energy stored in the unforced oscillator by
Use the equation of motion to find and . In particular, decide what is conserved for a constant nonzero force.
Solution
Differentiation gives
This is force times velocity, the power delivered by the source. Since ,
For constant , is conserved. generally is not: the source potential exchanges energy with it. For a time-dependent prescribed force, the oscillator and source potential form a system with explicit time dependence. The apparatus producing has not been included as a dynamical degree of freedom.
Use the equation. An impulse fixes a jump in velocity. A constant force sets a new equilibrium. Predict which features of the motion depend on the sign of , then solve for them in the oscillator Green function. To vary a field at each point of spacetime, follow the time integration by parts above through its spatial counterpart. Varying a field action
References
- David Tong, Classical Dynamics (PDF), §2.1, printed pp. 10–12 (fixed-endpoint variation), §§4.1.1–4.1.2, pp. 82–83 (Legendre transform and Hamilton’s equations), and §4.1.4 (energy conservation).
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.