The action integral for a particle of mass and charge is

where and is the given electromagnetic vector potential. The integral I is an extremum for those worldlines between and which satisfy the Euler-Lagrange equation

with

which are the Lorentz equations of motion for the charged particle.
A physically and mathematically more advantageous set of equations is based on the introduction of the momentum variables

In terms of these one has the two sets of Hamiltonian equations of motion

One can readily check that this system of first order equations implies the Euler-Lagrange equations.