Solution (source code)

= Solution

In SI units, the microscopic <Maxwell's equations> for total charge density $\rho$ and current density $\mathbf J$ are
$$
\boxed{\boldsymbol\nabla\cdot\mathbf E=\frac\rho{\epsilon_0},\qquad \boldsymbol\nabla\cdot\mathbf B=0,\qquad \boldsymbol\nabla\times\mathbf E=-\frac{\partial\mathbf B}{\partial t},\qquad \boldsymbol\nabla\times\mathbf B=\mu_0\mathbf J+\mu_0\epsilon_0\frac{\partial\mathbf E}{\partial t}.}
$$
The first is <Gauss's law>: <electric charge> sources <electric flux>. The second is <Gauss's law for magnetism>, expressing the absence of magnetic monopole sources in this theory. <Faraday's law> relates changing <magnetic flux> to circulating <electric field>. The <Ampere-Maxwell law> relates magnetic circulation to both material current and changing <electric flux>.

For fixed loops and surfaces, the integral versions are
$$
\oint_{\partial\Omega}\mathbf E\cdot d\mathbf A=\frac{Q_{\mathrm{enc}}}{\epsilon_0},\quad \oint_{\partial\Omega}\mathbf B\cdot d\mathbf A=0,
$$
$$
\oint_{\partial S}\mathbf E\cdot d\mathbf l=-\frac d{dt}\int_S\mathbf B\cdot d\mathbf A,\quad \oint_{\partial S}\mathbf B\cdot d\mathbf l=\mu_0I_S+\mu_0\epsilon_0\frac d{dt}\int_S\mathbf E\cdot d\mathbf A.
$$
Surface and loop orientations are related by the right-hand rule. These forms follow from the divergence theorem and Stokes' theorem. In material media, equivalent macroscopic equations can separate free and bound sources using $\mathbf D$ and $\mathbf H$ together with constitutive relations; the displayed forms use total sources.

The displacement-current term is essential for <charge conservation>. Taking the divergence of the last differential equation and using <Gauss's law> gives $\partial_t\rho+\boldsymbol\nabla\cdot\mathbf J=0$. It also makes magnetic circulation consistent for surfaces spanning the same loop through either a charging capacitor's wire or its dielectric gap.

In source-free vacuum the <curl> equations combine to give $\nabla^2\mathbf E=\mu_0\epsilon_0\partial_t^2\mathbf E$, with the same equation for $\mathbf B$. Thus
$$
\boxed{c=\frac1{\sqrt{\mu_0\epsilon_0}}.}
$$
A plane wave is transverse, with $\mathbf E$, $\mathbf B$ and propagation direction mutually perpendicular and $E=cB$. The fields transport <energy> with density $u=\epsilon_0E^2/2+B^2/(2\mu_0)$ and <Poynting vector> $\mathbf S=\mathbf E\times\mathbf B/\mu_0$. Together with the <Lorentz force law>, the equations connect charges, currents, forces, induction and electromagnetic radiation.