Hamilton's principle states that the Lagrangian for a system is $L=T-V$ where $T$ is kinetic energy and $U$ is potential energy. Lagrangian can also be defined as $L=\int \mathcal{L}\ d^3{x}$ where $\mathcal{L}$ is the Lagrangian density. In many text books I have seen that the Lagrangian density for the classical Electromagnetic fields is stated as \begin{equation} \mathcal{L}=-\rho(x,t)\phi(x,t)+J(x,t)\cdot A(x,t)+\dfrac{\varepsilon_{0}}{2}E^2(x,t)-\dfrac{1}{2\mu_{0}}B^2(x,t).\tag{1} \end{equation} I understand the first two terms, but why does the third term has positive sign? It should be negative according to the Hamilton principle, Shouldn't it? Because fields energy density is $$u=\dfrac{\varepsilon_{0}}{2}E^2(x,t)+\dfrac{1}{2\mu_{0}}B^2(x,t).\tag{2}$$
1 Answer
The positive sign of the $\frac{\varepsilon_{0}}{2}\vec{E}^2$ term in the Lagrangian density (1) is correct because it (among other things) contains the kinetic energy term $\frac{\varepsilon_{0}}{2}\dot{\vec{A}}^2$, which should be positive, cf. e.g. this Phys.SE post.
In contrast, the $\frac{1}{2\mu_{0}}\vec{B}^2$ term is a potential term, so it should come with a minus sign in the Lagrangian density (1).
In the Hamiltonian formulation the electric field $\vec{E}$ becomes the corresponding momentum, so the $\frac{\varepsilon_{0}}{2}\vec{E}^2$ term should also be positive in the Hamiltonian density (2).
-
1$\begingroup$ So you mean that the kinetic term has contributed $\varepsilon_{0}E^2(x,t)$ to the $\mathcal{L}$? $\endgroup$ Commented Feb 9, 2022 at 11:12
-