Why Does Adding a Total Derivative Preserve Hamilton’s Equations?
At a glance
- 1. Shift the momentum
Adding dF/dt changes the canonical momentum by the gradient of F with respect to the coordinates.
- 2. Transform the Hamiltonian
Write the new Hamiltonian using the shifted momentum; it also includes a term from the time dependence of F.
- 3. Apply Hamilton’s equations
The transformed variables obey Hamilton’s equations, and the coordinate trajectories remain unchanged.
- 4. Check an example
For a free particle, a coordinate-dependent boundary term shifts momentum but leaves the particle’s motion unchanged.
Adding a total time derivative to a Lagrangian does not change the equations of motion for the coordinates. It does, however, change the canonical momentum and the Hamiltonian written in canonical variables. The key distinction is that the equations retain their Hamiltonian form in the new variables; the canonical momentum and Hamiltonian are not generally unchanged.
Let the modified Lagrangian be
where is a twice continuously differentiable function of the coordinates and time. The result assumes the Legendre transform is regular, so velocities can be expressed in terms of canonical momenta.
Why the motion is unchanged
Since depends on and ,
The new canonical momentum is therefore
The Euler–Lagrange equations are unchanged: the added term contributes to the time derivative of the momentum and contributes exactly the same quantity to . These contributions cancel.
Equivalently, the action changes only by an endpoint term:
With fixed endpoint coordinates and times, this does not alter the paths that make the action stationary.
How the Hamiltonian changes
Use the new momentum to define the modified Hamiltonian. Since , the Legendre transform gives
Thus the Hamiltonian is not generally identical before and after the change. Rather, the momentum has been redefined, and the Hamiltonian must be expressed in terms of that redefined momentum.
Why Hamilton’s equations keep their form
The change from to is a time-dependent canonical transformation. It leaves the coordinates unchanged and shifts the momenta by a coordinate gradient. In the new variables, Hamilton’s equations are
They reproduce the same coordinate paths as the original equations. The momenta themselves differ by , so they should not be compared as though they were the same variables.
One way to see the canonical transformation is to use the generating function
It gives , while the new coordinate is . The transformed Hamiltonian is , with the old momentum replaced by its expression in terms of .
Worked example: a free particle
Take a one-dimensional free particle with mass :
Choose , where is constant. Then , so
The original momentum is , while the new one is . Since has no explicit time dependence, the new Hamiltonian is
Hamilton’s equations give
Differentiating the first equation in time yields . The free-particle motion is unchanged, even though the canonical momentum has shifted.
Common mistakes
- Claiming the Hamiltonian is unchanged. It is generally changed both by the momentum shift and, if depends explicitly on time, by the term .
- Comparing old and new momenta directly. They are different canonical variables: .
- Ignoring the explicit time dependence. If , the transformed Hamiltonian includes ; omitting it gives incorrect Hamilton equations.
- Assuming the energy value is always unchanged. The motion is unchanged, but the Hamiltonian function and its numerical value need not be. In a time-dependent transformation, even its explicit time dependence can change.
References
- Classical Mechanics, Herbert Goldstein, Charles Poole, and John Safko
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.