Solution (source code)

= Solution

In vacuum the electric and <magnetic field> <energy> <densities> are
$$
\boxed{u_E=\frac{\epsilon_0E^2}{2},\qquad u_B=\frac{B^2}{2\mu_0}.}
$$
For example, charging a <capacitor> requires $U=\int_0^Q(q/C)\,dq=Q^2/(2C)=CV^2/2$. A <parallel-plate capacitor> with $C=\epsilon_0A/d$ and $E=V/d$ then gives $U=\epsilon_0E^2Ad/2$, identifying the <electric field> <energy> <density>. Similarly an <inductor> stores $LI^2/2$; applying this to a long <solenoid> yields $B^2/(2\mu_0)$ times its interior <volume>.

Electromagnetic <energy> is transported by the <Poynting vector> $\mathbf S=\mathbf E\times\mathbf B/\mu_0$. Poynting's theorem,
$$
\frac{\partial(u_E+u_B)}{\partial t}+\nabla\cdot\mathbf S=-\mathbf J\cdot\mathbf E,
$$
expresses local <energy> conservation and transfer to matter. In a vacuum <plane wave> $E=cB$, so the two <energy> <densities> are equal and the <energy> <flux> has magnitude $c(u_E+u_B)$. For nondispersive linear media the corresponding reversible expressions are $\mathbf E\cdot\mathbf D/2$ and $\mathbf B\cdot\mathbf H/2$; they must not be applied unchanged to arbitrary dispersive or hysteretic materials.