Magnetic Energy Density in both static and time-dependent régime

I'd like to discuss the nature of magnetic energy: I will start by displaying the formula that both Griffiths's Electrodynamics and my course textbook give me: $$U_M = \frac{1}{2}\int_V \mathbf{A} \cdot \mathbf{J} d\tau \tag{1}$$

Griffiths then also derives an equivalent expression only in terms of the magnetic field: $$U_M = \frac{1}{2\mu_0}\int_{\text{all space}} B^2d\tau \tag{2}$$
The derivation of the $$(1)$$ is different in the two texts, but both of them start from previous results, obtained in the quasistatic régime, as @hyportnex made me realize. This means that both the magnetic field and the current density that happens to be in the region we are analyzing cannot change with time; otherwise, we couldn't even define the two vectors in $$(1)$$ I suppose.

Sidenote

Now, on a side note, my professor chose a different way of expressing this result, but he couldn't get a definite result, he instead only derived a formula for expressing an infinitesimal increment of magnetic energy (I couldn't find anything about this formula in any book I have): $$dU_M = \mathbf{H} \cdot d\mathbf{B} \tag{3}$$ Is there a way to integrate this and find a third expression [equivalent to $$(1),(2)$$] for $$U_M$$ directly from $$\mathbf{H}$$ and $$\mathbf{B}$$? End of sidenote

Now, my main problem is to understand whether it is possible to generalize the aforementioned formulas to the non-static régime, or whether it is just unfeasible to even define a magnetic energy, namely the energy stored in the magnetic field.
After some digging, I found out that my textbook adds a footnote which I'll try to translate:

We expect that $$(1)$$ can be extended to express the magnetic energy even in the non-static case, provided that we substitute the expressions that both $$\mathbf{A}$$ and $$\mathbf{J}$$ assume in the non-static case itself. This conclusion is supported by experimental evidence.

Therefore, from Maxwell's $$4^{th}$$ law in the non-static case, which tells us to consider even the displacement current term, I decided to take into account how the quantity $$\mathbf{J}$$ transforms in the nonstatic régime: $$\mathbf{J} \longrightarrow \mathbf{J} + \frac{\partial \mathbf{D}}{\partial t}$$ In fact, when I try to substitute this into $$(2)$$ I obtain: $$U_m = \frac{1}{2} \int \left(\mathbf{J} + \frac{\partial \mathbf{D}}{\partial t} \right )\cdot \mathbf{A} d\tau$$ By substituting Maxwell's fourth equation back, I obtain $$U_m = \frac{1}{2} \int_V (\nabla \times \mathbf{H}) \cdot \mathbf{A} d\tau$$ By taking into account a well-known vector identity involving the divergence of a cross-product (which I'll omit), I obtain: $$U_M = \frac{1}{2} \int_V \nabla \cdot (\mathbf{H} \times \mathbf{A}) d\tau + \frac{1}{2} \int_V \mathbf{H} \cdot (\nabla \times \mathbf{A}) d\tau$$ Applying the divergence theorem: $$U_M = \frac{1}{2} \int_S(\mathbf{H} \times \mathbf{A}) \cdot d\mathbf{a} + \frac{1}{2} \int_V \mathbf{H} \cdot (\nabla \times \mathbf{A}) d\tau \tag{4}$$ where $$S \equiv \partial V$$.

Now, I do remember obtaining the same formula for $$U_e$$ in the electrostatic case, and, in that particular circumstance, we were able to make the surface integral vanish by integrating over all space. This strategy was well justified: once we fix the charge distribution, the value of its electrostatic energy is well-defined, independently of the volume we choose to compute the integral. So here comes the question: Am I even allowed to safely apply the same reasonings made in the electrostatic case and make that surface integral vanish? Let us assume now that $$(4)$$ is indeed a valid generalization of $$(1)$$ to the non-static case. Under the latter assumption, I could go just back to the static case and, by integrating over all space, obtain the following expression for the magnetic energy: $$U_M = \frac{1}{2} \int_{\text{all space}} \mathbf{H} \cdot \mathbf{B}d\tau \tag{5}$$ Could this be the formula that one gets upon integrating $$(3)$$?I can't unsee the fact that there's a striking similarity between the two.
I hope I was able to convey my doubts in a clearer way this time. Any help is much appreciated

• I suggest that you add some more equation numbers and try to tighten up the text, I have difficulty following what your problem is, in fact I got completely lost in it. Here I only say that despite its appearance the equation $\mathcal E_g Idt = Id\Phi + I^2Rdt$ is really a static or quasi-static equation from your point of view since no radiation (displacement current) is involved. Sep 9, 2023 at 23:47
• I’ll rewrite it as soon as I got some spare time Sep 10, 2023 at 9:51
• I am still not completely sure what your problem is, but let us say that start with the conventional derivation of energy conservation a la Poynting, multiply Maxwell's I and II with E and H, sum, and introduce S=ExH, etc., and then interpret the terms including dD/dt and dB/dt, see, here and look at eq. (3). What is your question there? Or is your question if you could write (3) with $\phi$ and $\mathbf A$ instead of $\mathbf{E, B,H,D}$? Sep 10, 2023 at 15:42
• my problem is: my book says that $(1)$ can be extended to the non-static case. In order for me to do this I need to substitute the non-static expression for the current density as in Maxwell 4th law. Now, without introducing Poynting’s theorem and Poynting’s vector, I got to $(4)$. Is the latter formula correct? If that’s the case,Can I get rid of the surface integral as in the static case? Moreover, from the answer you gave in the linked post, I get that equation $(3)$ derived by my professor for the static case in indeed valid for both régimes. So my endeavor to derive ($4$) is pointless Sep 10, 2023 at 16:17
• I see now. First the last eq. number above should be (5), then the integral in your (4) does not need be confined to $\mathcal V$, extend it to all space and if a static field then the surface integral goes to zero, because $H \sim \frac{1}{r^2}$ and $A \sim \frac{1}{r}$. Then (4) and (5) are the same and giving (3) in a linear medium. When time varying you have Sommerfeld's radiation conditions to assure that the surface intgral is zero. In nonlinear medium they are not equal, and both (1) and (2) are for vacuum. Eq. (3) is true in the sense that only its full integral is measurable. Sep 10, 2023 at 16:51

Indeed, this is the magnetic analogue of expressing electric energy either in terms of electric field or potential and charge: $$\frac{\epsilon_0}{2}\int E^2 d^3x = \frac{1}{2}\int\rho Vd^3x$$ as always you need to be careful with boundary terms. In the electric case, the LHS is more fundamental as it comes from Poynting's theorem. The RHS gets an additional surface term: $$\frac{\epsilon_0}{2}\int E^2 d^3x = \frac{1}{2}\int\rho Vd^3x+\int V \sigma d^2x$$ with $$\sigma = E\cdot n$$ the surface charge charge at the boundary. For usual physical applications, you don't have surface charges at infinity which is why the boundary term is usually omitted.

You can use the same argument in magnetostatics. You just need to integrate by parts and use: $$B = \nabla \times A \\ \mu_0 J = \nabla\times B \\ \nabla\cdot (A\times B) = (\nabla\times A)\cdot B-(\nabla\times B)\cdot A$$ Once again, you rigorously should include a boundary term: $$\frac{1}{2\mu_0}\int B^2 d^3x = \frac{1}{2}\int J\cdot A d^3x+\int A\cdot J_s d^2x$$ with $$J_s = B\times n$$ the surface current density at the boundary. Once again, when considering the infinite space as your domain, you usually don't have surface currents at infinity.

You should use Ampere's law without the displacement current. Indeed, the equivalence between the two formulas is strictly valid only in the static regime. It works asymptotically when extending it to quasistatics if the characteristic velocity is negligible compared to the speed of light. Btw, the same applies for electrostatics where you disregard Faraday's law. In general, radiation would generate a magnetic field from changing charges and an electric field for a changing current and the correct energy is given by Poynting's theorem.

Your notation is a bit misleading. I suspect that you are only considering pure electromagnetism, but if you use $$D$$ and $$H$$, this usually means that you are dealing with EM in matter. This often alters the definition of energy. Indeed, the magnetic energy in EM and the one used in matter do not coincide in general: $$\frac{1}{2\mu_0}\int B^2 d^3x \neq \frac{1}{2}\int B\cdot H d^3x$$ They represent different quantities. The LHS represents the magnetic energy to create the magnetic field in its entirety. The RHS only applies for linear magnetic materials and looks only at the energy required by the free currents including the linear response of the magnetisation. Unless you are explicitly trying to model matter, it is best to stick to $$E,B$$ and refrain from using $$D,H$$.

If by $$(3)$$, you meant: $$dU = \frac{1}{\mu_0}B\cdot dB$$ then yes, it is pretty easy as you just rewrite it as: $$dU = d\left(\frac{1}{2\mu_0}B^2\right)$$ Note that this also applies for linear magnetic materials as well which is how you obtain the usual formula: $$dU = d\left(H\cdot B\right)$$

Hope this helps.

• Something is still not clear: "You should not use Ampere's law without the displacement current the equivalence between the two is valid only in the quasistatic regime, which is what you are interested in in the first place".You mean I should discard the displacement term in the first place since we're in the static case? In conclusion, when in vacuum or when dealing with linear media I can safely express the magnetic energy density as $\mathcal{u}_M = 1/2 \bf{B} \cdot H$. If there's hysteresis (non-linear relation between the two) I must stick to $\mathcal{u}_M = \mathbf{H} \cdot d\mathbf{B}$ Sep 10, 2023 at 19:19
• Yes, the quasistatic regime is just extrapolating the static formulas when your current/charges have explicit time dependence.
– LPZ
Sep 10, 2023 at 20:31
• Once again, if you are referring to the vacuum, avoid using $D,H$ and stick to $E,B$, it makes things clearer. But yes with the big caveat that your two expressions to not represent the same energy.
– LPZ
Sep 10, 2023 at 20:34
• Check out Section 4.4.3 in Griffiths for example in the case of electrostatics, the same ideas apply to magnetostatics.
– LPZ
Sep 10, 2023 at 20:36
• > Once again, when considering the infinite space as your domain, you usually don't have surface currents at infinity. However, notice this is very hard to verify for total current density $\mathbf J$ and vector potential $\mathbf A$ (and similarly, for $V$ and $\rho$). Currents in infinity could be present without any effect on EM field in the lab. More satisfactory argument is let's write down equations for $\mathbf A_{loc}$ and $\mathbf J_{loc}$, partial fields due to known nearby sources, and derive energy expression for these. $\mathbf J_{loc} = 0$ in infinity, $\mathbf J$ need not. Sep 11, 2023 at 5:40