The total potential energy is then: V = q ϕ ϕ − − q A ⋅ ⋅ r ˙ ˙ and the kinetic energy is: T = m 2 r ˙ ˙ ⋅ ⋅ r ˙ ˙ hence the Lagrangian: L = T − − V = m 2 r ˙ ˙ ⋅ ⋅ r ˙ ˙ + q A ⋅ ⋅ r ˙ ˙ − − q ϕ ϕ L = m 2 ( x ˙ ˙ 2 + y ˙ ˙ 2 + z ˙ ˙ 2 ) + q ( x ˙ ˙ A x + y ˙ ˙ A y + z ˙ ˙ A z ) − − q ϕ ϕ