The electromagnetic potential are

The Lagrange’s equation is

By setting

we can recover the Lorentz force,

Then, the hamiltonian is

First, we momentum is

Using the identity,

the terms with velocity are zero,

The term need special treatment, since the electric field depends on partial time derivative of the vector potential, but the time derivative in the Lagrange’s equation is total time derivative.

Thus,

The Lagrange’s equation,

Notice that , then,

we recovered the Lorentz force.

since