# How do we formulate the electromagnetic Lagrangian?

I'm trying to understand how we set up the lagrangian for a charged particle in an electromagnetic field.

I know that the lagrangian is given by $$L = \frac{m}{2}\mathbf{\dot{r}}\cdot \mathbf{\dot{r}} -q\phi +q\mathbf{\dot{r}}\cdot \mathbf{A}$$
I can use this to derive the Lorentz force law using the Euler-Lagrange equations, but I was wondering how we formulate the lagrangian.

My understanding that the lagrangian takes the form ## L = T - U ## in nearly all situations

My issue is with the potential energy terms.

Typically, I understand that potential energy is the found by placing charge/mass in a scalar potential field, so the term ##-q\phi## is the contribution of the electric field.

The fact that the magnetic field is derived from a vector potential field is what's throwing me off right now. $$\mathbf{B}=\mathbf{\nabla\times \mathbf{A}}$$
Plus won't the electric field have some dependence on the vector potential as well due to presence of the magnetic field? $$\mathbf{E}=-\mathbf{\nabla}\phi -\frac{\partial \mathbf{A}}{\partial t}$$
Any help will be much appreciated!

This Lagrangian has the form T-U and it leads to the Lorentz force, so all is well.
From the form of L you can only conclude that statement "potential energy is the found by placing charge/mass in a scalar potential field" does not hold in the presence of a vector field.
Hope this helps :-) .

As always with questions on electromagnetics the explanation is much more clear from relativity. Of course, one cannot prove the form of the fundamental laws mathematically but they are founded in observations in nature, but here relativity can help to understand, why the form of the Lagrangian is pretty obvious, given the fact that the electromagnetic interaction is described by a vector field.

In relativistic physics, it's always most simple to work with covariant quantities. The electromagnetic field is described by the four-potential ##A^{\mu}##, which is a vector field, i.e., it transforms under Lorentz transformations like the space-time coordinates, ##x^{\mu}=(ct,x,y,z)##.

Now the usual fundamental laws are derived from the Hamilton action principle with a Lagrangian ##L(\vec{x},\dot{\vec{x}})##. Now to get a Lorentz covariant equation of motion it is for sure sufficient to have a Lorentz invariant action,
$$A[\vec{x}]=\int \mathrm{d} t L.$$
For a free particle it must be a function of ##\dot{\vec{x}}## alone due to translation invariance, i.e., it must not depend on ##\vec{x}##. Further it should be a scalar under rotations due to rotation invariance. Finally, the action must be invariant also under Lorentz boosts, and indeed there's only one possibility left
$$\mathrm{d} t L_0=-m c \mathrm{d} t \sqrt{\eta_{\mu \nu} \dot{x}^{\mu} \dot{x}^{\nu}}=-m c^2 \mathrm{d} \tau,$$
where ##(\eta_{\mu \nu})=\mathrm{diag}(1,-1,-1,-1)## is the Minkowski pseudo-metric and ##\tau## the proper time of the particle.

Now for the interaction with a vector field the most simple possibility to add a term that is invariant is
$$\mathrm{d} t L_{\text{int}}=-\mathrm{d} t \frac{1}{c} \dot{x}^{\mu} A_{\mu}=-\mathrm{d} \tau \frac{1}{c} \frac{\mathrm{d} x^{\mu}}{\mathrm{d} \tau} A_{\mu}.$$
$$L=-m c \sqrt{\dot{x}_{\mu} \dot{x}^{\mu}}-\frac{1}{c} \dot{x}^{\mu} A_{\mu}.$$
Since
$$\dot{x}^{\mu}=(c,\dot{\vec{x}}), \quad A^{\mu}=(\phi,\vec{A})$$
we get
$$L_{\text{int}}=-\phi+\frac{1}{c}\dot{\vec{x}} \cdot \vec{A},$$
which is the same interaction part as written in the OP, only written in more convenient Heaviside-Lorentz (or Gaussian) units.

For the "kinetic part" it's clear that we get back the non-relativistic kinetic energy, if ##|\dot{\vec{v}} \ll c##, because then we can expand
$$L_0=-m c^2 \sqrt{1-\dot{\vec{x}}^2/c^2} \simeq -m c^2 \left (1-\frac{1}{2 c^2} \dot{\vec{x}}^2 \right ) = - m c^2 +\frac{m}{2} \dot{\vec{x}}^2.$$
So despite the constant contribution from the mass, which doesn't change the equations of motion, we get indeed the usual kinetic energy of non-relativistic physics.

That suggests quite convincingly why the Lagrangian for a particle in an electromagnetic field takes the form it does. The Euler-Lagrange equations of course lead to the Lorentz force for the charged particle in the electromagnetic field, and this is what is observed.