# Maxwell’s equations#

Maxwell’s equation are some of the most important equation in physics as form the understanding behind essentially all applications of electrical or magnetic systems in the modern world. Despite being devised in the $$19th$$ century, they obey the laws of relativity. This notebook will introduce the 4 Maxwell equations in both their intergral and differential form.

## Gauss’s law#

Gravity, Magnetism, and Orbital Dynamics

Gauss’s law is the first of Maxwell’s equations, and ultimately encapsulates the idea that charged particles are a source of electric field. In order to derive Gauss’s law, we first have to introduce the concept of electric flux, $$\Phi_\mathbf{E}$$. This is equivalent to the magnetic flux and is defined as

$\Phi_\mathbf{E} = \iint_{\mathbf{S}}^{} \mathbf{E} \cdot d\mathbf{S}$

where for a closed surface, $$d\mathbf{S}$$ points outwards by convention. To better understand the electric flux from a point charge, we will introduce the concept of Solid Angles. The solid angle is a generalisation of the ordinary angle between two lines. Consider a surface element, i.e., a small vector area $$d\mathbf{S}$$ which is distance $$r$$ from point $$P$$. The surface element is defined to subtend a solid angle $$d\Omega$$ as follows:

$d\Omega = \frac{d\mathbf{S} \cdot \mathbf{\hat{r}}} {r^2}$

where $$\mathbf{\hat{r}}$$ is the unit vector along the direction from $$P$$ to the surface element. It should be noted that just as there are $$2\pi$$ radians in a circle, there are $$4\pi$$ steradians covering the surface of a sphere.

Consider a point charge $$Q$$. The electric flux through a spherical surface $$S_1$$, radius $$r_1$$, is

$\Phi_{\mathbf{E},1} = 4\pi r_1^2 E_{r_1} = \frac{Q}{\epsilon_0}$

Now we consider the flux $$d\Phi_{\mathbf{E},1}$$ through the surface element $$dS_1$$. This is given by

$d\Phi_{\mathbf{E},1} = \mathbf{E}_{r_1} \cdot d\mathbf{S}_1 = \frac {\Phi_{\mathbf{E},1}} {4\pi r_1^2} dS_1$

where we have used the fact that $$\frac {d\Phi_{\mathbf{E},1}} {\Phi_{\mathbf{E},1}} = \frac {dS_1} {4\pi r_1^2}$$ and the fact that $$\mathbf{E}$$ is radial. Now, using the above definition of the solid angle, we can write

$\frac {\Phi_{\mathbf{E},1}} {4\pi r_1^2} dS_1 = \frac {\Phi_{\mathbf{E},1}} {4\pi} d\Omega = \frac{Q}{4\pi \epsilon_0} d\Omega$

Thus, we can finally write

$d\Phi_{\mathbf{E},1} = \frac{Q}{4\pi \epsilon_0} d\Omega$

Now consider $$S_2$$, an arbitrary surface enclosing $$S_1$$. The corresponding element of flux $$d\Phi_{\mathbf{E},2}$$ through $$dS_2$$ is given by

$d\Phi_{\mathbf{E},2} = \mathbf{E}_{r_2} \cdot d\mathbf{S}_2 = \frac{Q}{4\pi \epsilon_0 r_2^2} \mathbf{\hat{r}} \cdot d\mathbf{S}_2$

and using the definition of the solid angle we can write

$d\Phi_{\mathbf{E},2} = \frac{Q}{4\pi \epsilon_0}d\Omega = d\Phi_{\mathbf{E},1}$

Thus, the flux through the two surface elements is the same, even though the orientation of $$dS_2$$ is arbitrary and consequently, the flux through any closed surface is always $$\frac{Q}{\epsilon_0}$$

Now consider an arbitrary closed surface surrounding a collection of charges $$Q_1$$, $$Q_2$$, …, $$Q_N$$. Using the supeposition principle, the electric flux through the surface is given by

$\Phi_{\mathbf{E}} = \frac{Q_1}{\epsilon_0}, \frac{Q_2}{\epsilon_0}, ..., \frac{Q_N}{\epsilon_0}$

Since $$Q$$ = $$Q_1$$ + $$Q_2$$ + … + $$Q_N$$ we can write

$\oint_S \mathbf{E} \cdot d\mathbf{S} = \frac{Q}{\epsilon_0}$

This is the integral form of Gauss’s law! By considering a region of space with uniform charge density instead of point charges we can write Gauss’s law in a different form. Consider a volume, $$V$$, with total charge, $$Q$$, and charge density, $$\rho$$. The total charge can then be written in terms of the charge density:

$Q = \iiint_V \rho \,dV$

Substituting this to Gauss’s law:

$\oint_S \mathbf{E} \cdot d\mathbf{S} = \frac {1}{\epsilon_0} \iiint_V \rho \,dV$

where $$V$$ is the volume enclosed by the closed surface $$S$$.

Applying the Divergence theorem we get

$\iiint_V \nabla \cdot \mathbf{E} \,dV = \frac {1}{\epsilon_0} \iiint_V \rho \,dV$

By applying this to an infinitesimal volume, we can remove the integrals such that

$\nabla \cdot \mathbf{E} = \frac {\rho}{\epsilon_0}$

This is Gauss’s law in differential form!

## Gauss’s law for magnetism#

This is essentially the same law as Gauss’s law for electricity, but unlike electricity, there are no magnetic monopoles in nature, as magnetic pole always exist in pairs - dipoles. Thus, magnetic field lines are loops, with no beginning or end, unlike electric field lines. This is described mathematically by

$\nabla \cdot \mathbf{B} = 0 \, \ \mbox{(differential form)}$
$\oint_{Closed} \mathbf{B} \cdot d\mathbf{S} = 0 \, \ \mbox{(integral form)}$

This is Maxwell’s second equation.

We know by Faraday’s law of induction that when the magnetic flux changes through a wire loop an electromotive force ($$EMF$$) is acquired by the wire loop given by

$EMF = - \frac {d\mathbf{\Phi_B}}{dt}$

The $$EMF$$ and the electric field generated around the wire loop are essentially the same and thus

$EMF = \int_{circuit} \mathbf{E} \cdot d\boldsymbol{l}$

$\int_{circuit} \mathbf{E} \cdot d\boldsymbol{l} = - \frac {d}{dt} \iint_{S}^{} \mathbf{B} \cdot d\mathbf{S}$

This is the third Maxwell equation, in integral form. To get the differntial form we can use Stoke’s Theorem such that

$\iint_{S} \nabla \times \mathbf{E} \cdot d\mathbf{S} = - \frac {d}{dt} \iint_{S}^{} \mathbf{B} \cdot d\mathbf{S}$
$\nabla \times \mathbf{E} = - \frac {d\mathbf{B}}{dt}$

## Ampere - Maxwell equation#

The Biot-Savart law provides a general expression for the magnetic field from a current element:

$d\mathbf{B} = \frac{\mu_0 I} {4\pi} \frac{d\boldsymbol{l} \times \mathbf{\hat{r}}} {r^2}$

where $$d\boldsymbol{l}$$ is the line element, $$d\mathbf{B}$$ is the magnetic field by the current element $$Id\boldsymbol{l}$$ and $$\mathbf{\hat{r}}$$ is the unit vector from the line element to the location where we want the $$\mathbf{B}$$ field. Thus the total field at this point is given by

$\mathbf{B} = \frac{\mu_0} {4\pi} \int \frac{I\,d\boldsymbol{l} \times \mathbf{\hat{r}}} {r^2}$

Ampere’s law is just another formulation of the Biot-Savart law. Using Biot-Savart, we can write

$\int_L \mathbf{B} \cdot d\boldsymbol{l} = \frac{\mu_0 I} {2\pi r} \int_L d\boldsymbol{l} = \mu_0 I$

since $$\int_L d\boldsymbol{l}$$ is just the circumference. It should be noted that the line integral does not depend on the shape of path or the position of the wire within it. If the current in the wire is in the opposite direction, the integral has a negative sign.

Rather than using a single current, we can introduce a new quantity called the current density, $$\mathbf{J}$$, related to $$I$$ by

$I = \iint_S \mathbf{J} \cdot d\mathbf{S}$

Using this definition we can write

$\int_L \mathbf{B} \cdot d\boldsymbol{l} = \mu_0 \iint_S \mathbf{J} \cdot d\mathbf{S}$

and using Stoke’s Theorem we get

$\iint_S \nabla \times \mathbf{B} \cdot d\mathbf{S} = \mu_0 \iint_S \mathbf{J} \cdot d\mathbf{S}$
$\nabla \times \mathbf{B} = \mu_0\mathbf{J}$

This is Ampere’s law in differential form, but it is not quite yet a Maxwell equation, as it is not valid for a time-varying electric fields (not constant current). Another term needs to be added into the equation that takes into account the time-varying electric fields. Doing so yields the fourth Maxwell equation:

$\int_L \mathbf{B} \cdot d\boldsymbol{l} = \mu_0 \iint_S \mathbf{J} \cdot d\mathbf{S} + \mu_0 \epsilon_0 \iint_S \frac {d\mathbf{E}}{dt} \cdot d\mathbf{S} \, \ \mbox{(integral form)}$
$\nabla \times \mathbf{B} = \mu_0\mathbf{J} + \mu_0 \epsilon_0 \frac {d\mathbf{E}}{dt} \, \ \mbox{(differential form)}$