3
$\begingroup$

I would like to find out how to obtain the equation of motion from the total energy of the $B$ and $E$ fields

$$E_\text{tot} = \frac{1}{2\mu_0}\int\mathbf{B}(\mathbf{r},t)^2\ d^3r + \frac{\epsilon_0}{2}\int\mathbf{E}(\mathbf{r},t)^2\ d^3r.$$

A couple of methods I have seen while researching how to do this:

  1. An explicit variation of the action and applying the principle of least action shown in this video https://youtu.be/sUk9y23FPHk?t=668 by Physics with Elliot. That requires the Lagrangian to be known.

  2. This post on PSE Energy method to solving equations of motion? Why does this method work and what is it called?. However, it seems to be for 1-dimensional problems only as noted in the answer to that question

My question is, which method do I use and is it possible to use any of the 2 I listed? Are there any other options that I could do?

$\endgroup$
2
  • 2
    $\begingroup$ If you haven’t learned the Hamiltonian formalism, I recommend that you start with the Hamiltonian for a particle in a potential rather than the Hamiltonian for a field. Hamiltonian field theory is somewhat more complicated than Hamiltonian mechanics. $\endgroup$
    – Ghoster
    Commented Oct 9, 2023 at 19:46
  • 1
    $\begingroup$ This is the reverse order of doing things. You start with equation of motion. The you find a lagrangian that reproduces it. From this you derive the Noether conservation laws. $\endgroup$
    – my2cts
    Commented Mar 27 at 7:07

2 Answers 2

4
$\begingroup$

In the following I will show you two ways of how to derive the equations of motion (EOMs) for the electric and magnetic fields. The first method utilizes the Lagrangian formalism. I will give a quick introduction into the Lagrangian formalism with fields (as this is a little more complicated than the Lagrangian formalism in classical mechanics) so even if you aren't familiar with the Lagrangian formalism for fields, you should get some idea of how it works. After that I will derive Maxwell's equations (the EOMs of the fields) from the Lagrangian of electrodynamics. In the second part I will show you, how you can use the energy of the electromagnetic field to derive the EOMs. In order to do this, we need to use the Hamiltonian formalism for fields. Again, I will first give you a short introduction into the general topic, so that hopefully you can understand my explanation even if you aren't familiar with the Hamiltonian formalism for fields. Finally, I apply this formalism to electrodynamics and derive the EOMs from the Hamiltonian, which turns out to be equal to the energy of the fields. As you can see, the whole procedure does take some time to set up, so you won't get a short and conclusive answer on this question. However, I think it is very much worth it, as this mechanism is very powerful and besides offering new insights into the theory of electrodynamics, it is applied in a wide variety of areas in physics.

A short introduction to the Lagrangian formalism

Let's first do a quick review of the Lagrangian formalism for fields. In general, we have a Lagrangian \begin{equation} \mathcal{L}(\phi_j, \nabla \phi_j, \partial_t \phi_j) = \int d^3x \, \mathscr{L}(\phi_j, \nabla \phi_j, \partial_t \phi_j) \end{equation} where $\mathscr{L}$ is called the Lagrangian density. The Lagrangian density is some function of our fields $\phi_j$ with $j=1,...,N$ (where $N$ is the number of independent fields that we consider), their spatial derivatives, and their time derivatives. We define the action as usual \begin{equation} S = \int dt\, \mathcal{L} = \int dt\, \int d^3r \, \mathscr{L}. \end{equation} As in the case of Lagrangian mechanics, the principle of least action gives us the Euler-Lagrange-equations. As we are considering fields, these equations give us the EOMs for the fields \begin{equation} \partial_k \frac{\partial \mathscr{L}}{\partial (\partial_k \phi_j)} + \partial_t \frac{\partial \mathscr{L}}{\partial (\partial_t \phi_j)} - \frac{\partial \mathscr{L}}{\partial \phi_j} = 0 \quad \quad j = 1,...,N \end{equation} where I used the Einstein summation convention (which I will continue to use throughout the post). Notice that we get $N$ EOMs, one for each field. If we apply this formalism to the case of electrodynamics, the EOMs that we get are Maxwell's equations, as we will see next.

Electrodynamics in the Lagrangian formalism

The Lagrangian density of electrodynamics is \begin{equation} \mathscr{L} = \frac{\varepsilon_0}{2} \left( \mathbf{E}^2 - c^2 \mathbf{B}^2 \right) \end{equation} where for simplicity, I only consider free fields, i.e., no sources. However there is still one problem. Notice how we expressed the Lagrangian density as a function of the electric and the magnetic fields, but there appear no spatial or time derivatives of the fields in the Lagrangian density. This is a problem, because this means that our EOMs will return that $\mathbf{E}$ and $\mathbf{B}$ are zero, which is obviously wrong. The reason for this is that the electric and magnetic fields are not truly independent. It turns out that we can solve this problem if we use the vector potential instead. As is well known, the electric and magnetic fields can be expressed by the electric potential $V$ and the vector potential $\mathbf{A}$: \begin{equation} \mathbf{E} = -\partial_t \mathbf{A} - \nabla V \, , \quad \mathbf{B} = \nabla \times \mathbf{A} \end{equation} In addition, we will use the Coulomb gauge $\nabla \cdot \mathbf{A} = 0$ as this will make our life much easier. Furthermore, because we assumed no sources, we can set $V=0$. From these definitions we already get three of Maxwell's equations: \begin{equation} \nabla \cdot \mathbf{E} = \nabla \cdot (-\partial_t \mathbf{A}) = -\partial_t (\nabla \cdot \mathbf{A}) = 0 \end{equation} and \begin{equation} \nabla \times \mathbf{E} = \nabla \times (-\partial_t \mathbf{A}) = -\partial_t (\nabla \times \mathbf{A}) = -\partial_t \mathbf{B}. \end{equation} and \begin{equation} \nabla \cdot \mathbf{B} = \nabla \cdot (\nabla \times \mathbf{A}) = 0 \end{equation} The last of Maxwell's equations will be the EOMs of our Lagrangian density. Let's now express the Lagrangian density as a function of the vector potential: \begin{equation} \mathscr{L} = \frac{\varepsilon_0}{2} \left[ (\partial_t \mathbf{A})^2 + c^2 (\nabla \times \mathbf{A})^2 \right] \end{equation} From this we can finally derive the EOMs. We get \begin{equation} \frac{\partial \mathscr{L}}{\partial A_j} = 0 \end{equation} for the $j$th component of $A$, \begin{equation} \frac{\partial \mathscr{L}}{\partial (\partial_t A_j)} = \varepsilon_0 \partial_t A_j \end{equation} and \begin{align} \frac{\partial \mathscr{L}}{\partial (\partial_k A_j)} &= -\frac{\varepsilon_0}{2}c^2 \frac{\partial}{\partial (\partial_k A_j)} \left[ \nabla \times \mathbf{A} \right]^2 \\ &= -\frac{\varepsilon_0}{2}c^2 \frac{\partial}{\partial (\partial_k A_j)} \left[ \varepsilon_{lmn} (\partial_m A_n) \varepsilon_{lab} (\partial_a A_b) \right] \\ &= -\frac{\varepsilon_0}{2} c^2 (\delta_{ma}\delta_{nb} - \delta_{mb}\delta_{na}) \frac{\partial}{\partial (\partial_k A_j)} \left[ (\partial_m A_n) (\partial_a A_b) \right] \\ &= -\frac{\varepsilon_0}{2} c^2 (\delta_{ma}\delta_{nb} - \delta_{mb}\delta_{na}) \left[ \delta_{km}\delta_{jn}(\partial_a A_b) + (\partial_m A_n) \delta_{ka}\delta_{jb} \right] \\ &= -\frac{\varepsilon_0}{2} c^2 \left[ 2\partial_k A_j - 2\partial_j A_k \right] \\ &= \varepsilon_0 c^2 (\partial_j A_k - \partial_k A_j) \end{align} where I made use of the fact that $(\nabla \times A)_l = \epsilon_{lmn}\partial_m A_n$ with $\epsilon_{lmn}$ the totally antisymmetric epsilon tensor. Finally we get for the EOMs: \begin{align} 0 &= \partial_k \frac{\partial \mathscr{L}}{\partial (\partial_k A_j)} + \partial_t \frac{\partial \mathscr{L}}{\partial (\partial_t A_j)} - \frac{\partial \mathscr{L}}{\partial A_j} \\ &= \varepsilon_0 \left[ c^2 (\partial_j \partial_k A_k - \partial_k \partial_k A_j) + \partial_t \partial_t A_j \right] \end{align} As you can easily show, we have $\left[ \nabla \times (\nabla \times \mathbf{A}) \right]_j = \left[ \partial_j \partial_k A_k - \partial_k \partial_k A_j \right]$. Using $\nabla \times \mathbf{A} = \mathbf{B}$ and $-\partial_t \mathbf{A} = \mathbf{E}$ we finally get \begin{equation} \nabla \times \mathbf{B} = \frac{1}{c^2} \partial_t \mathbf{E} \end{equation} which is the last of Maxwell's equations. Therefore we are finished and I have demonstrated how to get Maxwell's equations from the Lagrangian formalism. Next we will look at how to derive Maxwell's equations in the Hamiltonian formalism (meaning, from the energy).

A short introduction to the Hamiltonian formalism

First I will give a quick review of the general idea of the Hamiltonian formalism for fields. Let's assume that we are given a Lagrangian density $\mathscr{L}(\phi_j, \nabla \phi_j, \partial_t \phi_j)$ for the fields $\phi_j$ with $j=1,...,N$. We define the canonical momenta as \begin{equation} \Pi_j = \frac{\partial \mathscr{L}}{\partial (\partial_t \phi_j)}. \end{equation} Now the Hamiltonian density is defined as \begin{equation} \mathscr{H}(\phi_j, \nabla \phi_j, \Pi_j) = (\partial_t \phi_j) \Pi_j - \mathscr{L} \end{equation} and the Hamiltonian of the system is defined as \begin{equation} \mathcal{H} = \int d^3r \, \mathscr{H}. \end{equation} It can be shown that we can derive the EOMs from the Hamiltonian density, similarly to how we can derive the EOMs from the Lagrangian density via the Euler-Lagrange-equations. The EOMs that we calculate from the Hamiltonian density are \begin{align} \partial_t \phi_j &= \frac{\partial \mathscr{H}}{\partial \Pi_j} \\ \partial_t \Pi_j &= -\frac{\partial \mathscr{H}}{\partial \phi_j} + \partial_k \frac{\partial \mathscr{H}}{\partial (\partial_k \phi_j)}. \end{align}

Electrodynamics in the Hamiltonian formalism

In the following we will apply the procedure from the last section to derive the Hamiltonian of electrodynamics and after that we will derive the EOMs from the Hamiltonian. We already calculated the canonical momenta when we derived the Euler-Lagrange-equations: \begin{equation} \Pi_j = \varepsilon_0 \partial_t A_j \end{equation} Therefore we get for the Hamiltonian density: \begin{align} \mathscr{H} &= (\partial_t A_j) \Pi_j - \frac{\varepsilon_0}{2} \left[ (\partial_t \mathbf{A})^2 - c^2 (\nabla \times \mathbf{A})^2 \right] \\ &= \frac{1}{\varepsilon_0} \mathbf{\Pi}^2 - \frac{1}{2\varepsilon_0} \mathbf{\Pi}^2 + \frac{\varepsilon_0}{2} c^2 (\nabla \times \mathbf{A})^2 \\ &= \frac{1}{2\varepsilon_0} \mathbf{\Pi}^2 + \frac{\varepsilon_0}{2} c^2 (\nabla \times \mathbf{A})^2 \end{align} where in the second line I expressed $\partial_t \mathbf{A}$ in terms of $\mathbf{\Pi}$. Although we generally want to express the Hamiltonian density in terms of $\mathbf{A}$, its spatial derivatives and $\mathbf{\Pi}$, let's try to express it as a function of the electric and magnetic fields for a moment. Remembering that $\mathbf{\Pi} = \varepsilon_0 \partial_t \mathbf{A} = -\varepsilon_0 \mathbf{E}$ and $\nabla \times \mathbf{A} = \mathbf{B}$, we get \begin{equation} \mathscr{H} = \frac{\varepsilon_0}{2} \left[ \mathbf{E}^2 + c^2 \mathbf{B}^2 \right] \end{equation} and therefore \begin{equation} \mathcal{H} = \frac{\varepsilon_0}{2} \int d^3r \, \left[ \mathbf{E}^2 + c^2 \mathbf{B}^2 \right] \end{equation} which is exactly the expression for the energy which you used! So we see here that the Hamiltonian indeed corresponds to the energy of the electromagnetic field, as expected.

Let's now use the expression of $\mathscr{H}$ in terms of the vector potential again and derive the EOMs. For the first EOM, we get \begin{align} \partial_t A_j &= \frac{\partial \mathscr{H}}{\partial A_j} \\ &= \frac{1}{\varepsilon_0} \Pi_j \end{align} which is just our expression for the canonical momentum. Now let's look at the second EOM. We have \begin{align} -\frac{\partial \mathscr{H}}{\partial A_j} = 0 \end{align} and \begin{align} \frac{\partial \mathscr{H}}{\partial (\partial_k A_j)} &= \frac{\varepsilon_0}{2}c^2 \frac{\partial}{\partial (\partial_k A_j)} \left[ \nabla \times \mathbf{A} \right]^2 \\ &= \varepsilon_0 c^2 (\partial_j A_k - \partial_k A_j) \end{align} where I used the fact that except for the sign, we already calculated the exact same expression in the chapter about electrodynamics in the Lagrangian formalism. Using the same tricks we did back then, we get for the EOMs: \begin{align} \partial_t \Pi_j &= -\frac{\partial \mathscr{H}}{\partial A_j} + \partial_k \frac{\partial \mathscr{H}}{\partial (\partial_k A_j)} \\ &= -\varepsilon_0 c^2 \nabla \times \mathbf{B}. \end{align} Finally, using $\partial_t \mathbf{\Pi} = \varepsilon_0 \partial_t \partial_t \mathbf{A} = -\varepsilon_0 \partial_t \mathbf{E}$, we get \begin{equation} \nabla \times \mathbf{B} = \frac{1}{c^2} \partial_t \mathbf{E} \end{equation} which, again, is the last of Maxwell's equations.

Conclusion and outlook

I derived Maxwell's equations without sources in both the Lagrangian and the Hamiltonian formalism for fields. So it is possible to derive the EOMs from the energy of the field, however, one has to express the energy in terms of the vector potential and its conjugate momentum. As I already stated at the beginning, the formalisms I presented are very powerful as they can be employed for general field theories, not just electrodynamics. The Lagrangian formalism is especially useful in order to formulate relativistic theories. Also when working in the Lagrangian formalism, Noether's theorem establishes a very powerful link between symmetries and conserved quantities. The Hamiltonian formalism is very important if you want to quantize a theory (see canonical quantization). This might make intuitive sense as in nonrelativistic quantum mechanics, one usually works with the Hamiltonian operator. I hope that I could shed some light onto these formalisms and of course answer you question.

$\endgroup$
6
  • $\begingroup$ Outstanding answer! Thank you for shedding some light on this topic. I really appreciate the long and detailed answer that you have given me. $\endgroup$
    – Tachyon
    Commented Oct 11, 2023 at 22:55
  • $\begingroup$ Thank you for the feedback! I'm very glad that my answer was helpful to you :) $\endgroup$
    – WillHallas
    Commented Oct 12, 2023 at 9:29
  • $\begingroup$ Follow up: the last Maxwell equation you wrote $$\begin{equation} \nabla \times \mathbf{B} = \frac{1}{c^2} \mathbf{E} \end{equation}$$ is the equation of motion as you mentioned. If it is the EOM for E and B fields (without a source), then why doesn't it equal 0 like other EOMs? $\endgroup$
    – Tachyon
    Commented Oct 17, 2023 at 22:07
  • $\begingroup$ @Tachyon I just made a small edit, the last Maxwell equation I wrote should of course be $\nabla \times \mathbf{B} = \frac{1}{c^2} \partial_t \mathbf{E}$. If you use the Lagrangian formalism for the EOM then yes, one side is zero, i.e. $\nabla \times \mathbf{B} - \frac{1}{c^2} \partial_t \mathbf{E} = 0$. I just brought the expression into the usual form. The way I laid out the EOMs in the Hamiltonian formalism, there is no need for one side to be zero though. But again, it doesn't really matter, as you can always bring a term on the other side. $\endgroup$
    – WillHallas
    Commented Mar 22 at 10:35
  • 1
    $\begingroup$ @Tachyon Yes, exactly. You could add another term in the Lagrangian to include sources. Specifically, you would add $\mathbf{j} \cdot \mathbf{A} - \rho V$ in the Lagrangian. This will give you the Maxwell equations including matter. Note that you don't get EOMs for $\rho$ and $\mathbf{j}$ from this Lagrangian though (the EOMs that we expect would be given by the Lorentz force law). In order to get these, you would need to include even more stuff in the Lagrangian. Note that calculating the Hamiltonian with sources from the Lagrangian is completely analogous to the more simple case I presented. $\endgroup$
    – WillHallas
    Commented Mar 22 at 17:52
1
$\begingroup$

In this answer I will address the second method that you mention in your question.

So that approach was proposed in a 2016 question submitted by Russell Yang. My opinion: while that method eventually produced the correct equation of motion, that method is encumbered with unnecessary complexity.

To explain why that is, and to explain the validity of energy approach in general I derive the work-energy theorem.

The starting point is Newton's second law:

$$ F = ma \tag{1} $$

The next step is to integrate both sides with respect to the spatial coordinate, integrating from starting point $s_0$ to final point $s$

$$ \int_{s_0}^s F \ ds = \int_{s_0}^s ma \ ds \tag{2} $$

The work-energy theorem hinges on the fact that the two factors in the right hand side of (2), acceleration $a$ and position coordinate $s$, are not independent of each other; acceleration is the second derivative of position.

We proceed to work out the right hand side.

In the steps starting with (5) the integrand $a$ is converted to velocity and the differential $ds$ is converted to $dv$, using the relations (3) and (4)

$$ v = \frac{ds}{dt} \ \Leftrightarrow \ ds = v \ dt \tag{3} $$

$$ a = \frac{dv}{dt} \ \Leftrightarrow \ dv = a \ dt \tag{4} $$


(5) is the right hand side of (2) (The factor $m$ for mass is temporarily omitted; it is a multiplicative factor that is just carried over each step.)

$$ \int_{s_0}^s a \ ds \tag{5} $$ $$ \int_{t_0}^t a \ v \ dt \tag{6} $$ $$ \int_{t_0}^t v \ a \ dt \tag{7} $$ $$ \int_{v_0}^v v \ dv \tag{8} $$

First (3) was used to change the differential from $ds$ to $dt$, with corresponding change of limits. Next (4) was used - with change of limits - to arrive at (8).

So we have the following mathematical relation:

$$ \int_{s_0}^s a \ ds = \tfrac{1}{2}v^2 - \tfrac{1}{2}v_0^2 \tag{9} $$

(9) is very general; it is valid for any acceleration that is integrable. The definitions (3) and (4) are sufficient to imply (9).

Notice especially that (9) is not specific to mechanics. The form of (9) is applicable in any situation where the description of physics taking place is in terms of position coordinate, first derivative of position, and second derivative of position.


We use (9) to go from (2) to the work-energy theorem:

$$ \int_{s_0}^s F \ ds = \tfrac{1}{2}mv^2 - \tfrac{1}{2}mv_0^2 \tag{10} $$

The left hand side of (9) is the expression for work done; as we know: potential energy is defined as the negative of work done.

The work-energy theorem expresses the relation between Force-Acceleration on one hand, and Potential-Kinetic on the other hand.


Implementation

The work-energy theorem is an expression in terms of integrals: that means that it is an expression in terms of increments.

The following expression is equivalent to (9): $$ -\Delta E_p = \Delta E_k \tag{10} $$

The $\Delta$ of (10) is change over time. (10) is valid down to infinitisimal increments of time, therefore the time derivative of the sum of potential energy and kinetic energy will be zero:

$$ \frac{d(E_p + E_k)}{dt} = 0 \tag{11} $$



(11) explains why the approach proposed by Russell Yang eventually produced the equation of motion.

However, there is a much, much better way to capitalize on the work-energy theorem.

The setup is as follows:
take any point along the true trajectory and examine the effect of an infinitisimally small virtual change of the position coordinate, relative to the true trajectory.

So that is a $\delta$ of position; not a $\delta$ of time.

In case of $\delta$ of time:
the kinetic energy and potential energy are counterchanging; one is converted to the other.

As you examine virtual $\delta$ of position:
the two energies are co-changing.

The Euler-Lagrange equation expresses the idea of examining the effect of a virtual change of position coordinate.


In classical mechanics: the operation that the Euler-Lagrange performs is the inverse of the operation that we performed to obtain the work-energy theorem.

The potential energy:
The operation that the EL-equation performs on that is to take the derivative with respect to position.

The kinetic energy:
We have that the operation that the EL-equation performs on the kinetic energy is not transparent. We do know this: that operation must be dimensionally the same as the operation that is performed on the potential energy.
So:
-We know the EL-equation is valid
-the inputs of the EL-equation match each other dimensionally
-the outputs of the EL-equation match each dimensionally
It follows: the operation that the EL-equation performs on the kinetic energy is in fact differentiation with respect to the position coordinate.

That is: for classical mechanics the EL-equation is effectively the following equation:

$$ \frac{E_k}{ds} - \frac{E_p}{ds} = 0 \tag{12} $$

(As explained earlier: this is derivative with respect to the position coordinate $s$, not derivative with respect to time. (12) expresses examination of virtual displacement of position, hence in (12) the derivative of the potential energy is subtracted from the derivative of the kinetic energy.)



Example:
Let's say we have a cilindrically symmetric object, and an applied torque is causing angular acceleration. We will use polar coordinates to express the dynamics.

We integrate the torque to obtain an expression for potential energy, and we express the state of rotation in terms of rotational kinetic energy.

We insert the expressions for potential energy and rotational kinetic energy into the EL-equation:

The resulting equation of motion is then in terms of torque and angular acceleration.


Multiple degrees of freedom

Of course: energy approch generalizes to multiple degrees of freedom.
The standard is to use index notation for the respective degrees of freedom. The EL-equation is then populated with indexed expressions for the potential energy.

The expression for kinetic energy is always a single term, whatever number of degrees of freedom. The resultant kinetic energy of the velocity components along the respective degrees of freedom is the sum of the component kinetic energies. (Pythagoras' theorem is in terms of squares, and kinetic energy is proportional to the square of velocity, so it slots right in.)

With multiple degrees of freedom: the gradient of the potential energy tells you in which direction the acceleration will be, that is sufficient.



As pointed out by PSE contributor Kevin Zhou: "in physics you can often run derivations in both directions"

The Euler-Lagrange equation is an operator that takes the derivative with respect tot the position coordinate.

In classical mechanics we have that that when the EL-equation is populated with the Lagrangian $(E_k - E_p)$ the result is the equation of motion.


So:
the problem of finding an expression for Lagrangian density of the electromagnetic field is a reverse engineering problem: find an expression such that when you take partial derivatives with respect to position you recover Maxwell's equations.

A particularly extensive treatment of that is the one by PSE contributor Frobenius, in an answer to a question titled: Deriving Lagrangian density for electromagnetic field

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.