Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/ii/paper-2/14e/c/solution

Under the gauge transformation,
because the curl of a gradient vanishes, and
The transformed Lagrangian is
A total time derivative changes the action only by endpoint terms, whose variation vanishes for fixed endpoints, so the Euler-Lagrange equations are unchanged.
The new momentum is
Use the type-two generating function for a canonical transformation
It gives , , and
This equals , so the gauge change is a time-dependent canonical transformation.

New to topics? Read the docs here!