# Electricity and magnetism/Maxwell's equations
## The divergence of a vector field

To understand the fundamental equations of electromagnetism given by Maxwell, we must understand the divergence and curl of a vector field.
To understand its divergence, one must understand the flux of a vector field across a surface.
If we think of a vector field as the velocity field of a fluid, its flux through a surface is the flow rate of the fluid through that surface. The flux obviously depends on the orientation of the surface:
Let $dS$ be a sufficiently small surface element so that we can assume that the vector field $\mathbf {v}$ is almost constant. Let $\mathbf {\hat {n}}$ be a vector of unit length perpendicular to $dS$. The flux $d\phi$ from $\mathbf {v}$ through $dS$ in the direction of $\mathbf {\hat {n}}$ is then $d\phi =\mathbf {\hat {n}} .\mathbf {v}$ $dS$
To find the flux through a surface, we divide the surface into small surface elements and sum all the fluxes. When the magnitude of the surface elements tends to zero, the limit of this sum is an integral. It is the flux $\phi$ through the surface.
$\phi =\int _{S}d\phi =\int _{S}\mathbf {\hat {n}} \cdot \mathbf {v}$ $dS$
To calculate the flux $\phi$ we must have chosen a direction of crossing the surface. The flux is positive if the vector field goes in the same direction, negative otherwise.
The divergence $\operatorname {div} \mathbf {v}$ of a vector field $\mathbf {v}$ is obtained at each point by considering closed surfaces smaller and smaller that surround this point, small spheres centered on the point for example, or small cubes. It is the limit of the flux of the vector field through these small closed surfaces, divided by the volume which they delimit, when this volume tends towards zero. The crossing direction is always chosen from the inside to the outside.
If its divergence at a point is positive, the vector field is divergent at this point, it is like a source of fluid. If its divergence is negative, it is convergent at this point, it is like a sink for a fluid.
As the volume of an incompressible fluid is constant, the divergence of its velocity field is always zero, because there is neither source nor sink.
To calculate the divergence, we use the following formula:
$\operatorname {div} \mathbf {v} ={\frac {\partial v_{x}}{\partial x}}+{\frac {\partial v_{y}}{\partial y}}+{\frac {\partial v_{z}}{\partial z}}$
for a field $\mathbf {v}$ whose three components are $v_{x}$, $v_{y}$ and $v_{z}$.
Proof: we reason about a small cube of side $a$ and whose faces are parallel to the xy, xz and yz planes. On faces parallel to yz, therefore perpendicular to the x axis, the flux is $a^{2}v_{x}$ and $a^{2}(v_{x}+a{\frac {\partial v_{x}}{\partial x}})$. The difference of the two is $a^{3}{\frac {\partial v_{x}}{\partial x}}$. The same goes for faces parallel to xz and xy. So the total flux leaving the cube is $a^{3}({\frac {\partial v_{x}}{\partial x}}+{\frac {\partial v_{y}}{\partial y}}+{\frac {\partial v_{z}}{\partial z}})$. This flux is also equal to $a^{3}\operatorname {div} \mathbf {v}$.
The divergence of a vector field is a real number, positive or negative, defined at each point in space. It is therefore a scalar field derived from a vector field.

## Gauss's theorem

The flux of a vector field through a closed surface, from the inside to the outside, is always the integral of its divergence over the entire volume inside the surface.
Proof: if two cubes have a face in common, the flow through the rectangular tile they form together is the sum of the two fluxes through the two cubes, because the two fluxes through the interior face of the tile exactly compensate each other. Everything that comes out of a cube through this face goes into the other.
A volume delimited by a closed surface can always be divided into small adjacent volumes, so
$\phi =\int _{V}\operatorname {div} \mathbf {v}$ $dV$
where $V$ is the volume delimited by $S$.
With Gauss' theorem and Coulomb's law, we find the first of Maxwell's equations:
$\operatorname {div} \mathbf {E} =\rho /\epsilon _{0}$
where $\rho$ is the electric charge density. For a uniformly charged volume $V$ of charge $q$, $\rho =q/V$ is the charge density inside $V$.
Proof of Maxwell's first equation: we reason about the flux of the electric field produced by a spherical charge through a sphere centered on this charge:
The flux of the electric field created by a charge $q$ which passes through a sphere of radius $r$ centered on this charge, is $\phi =4\pi r^{2}E$ where $E={\frac {q}{4\pi \epsilon _{0}r^{2}}}$. So $\phi =q/\epsilon _{0}$. Or $q=\int _{V}\rho$ $dV$ where $\rho$ is the charge density and $V$ is the volume of the sphere centered on $q$. So $\phi =\int _{V}\operatorname {div} \mathbf {E}$ $dV=\int _{V}{\frac {\rho }{\epsilon _{0}}}dV$. Since this equation is true for any volume that surrounds a charge density $\rho$: $\operatorname {div} \mathbf {E} =\rho /\epsilon _{0}$
Maxwell's second equation is:
$\operatorname {div} \mathbf {B} =0$
It says that the magnetic charge density is always zero, so magnetic monopoles do not exist.
The flux of the magnetic field through a surface bounded by a loop depends only on the loop.
Proof: let $S_{1}$ and $S_{2}$ be two surfaces delimited by the same loop. These two surfaces delimit a volume. The flux of the magnetic field leaving this volume is the difference of the fluxes through $S_{1}$ and $S_{2}$. But since the divergence of the magnetic field is always zero, this difference is zero, according to Gauss's theorem. So the two fluxes are equal.
The magnetic field can always be identified with the velocity field of an incompressible fluid. The flux entering a volume is always equal to the flux leaving it. The same is true for the flux of an electric field in a volume that contains no charges.
Gauss' theorem allows us to calculate the electric field created by an infinite electrically charged plane or by an infinite electrically charged line.
The infinite charged plane
Let $\sigma$ be the surface charge density of a plane. If the plane has a finite surface, the electric field of which it is the source depends on the distance from its edges. But for a very large surface, this edge effect is negligible, provided that we are far from the edges. The electric field created on an axis perpendicular to the middle of a large electrically charged disk is therefore equal to the field created by an infinite plane which has the same charge per unit area. The charged disk is rotationally symmetrical. Curie's law, which says that effects have the same symmetry as their causes, therefore requires that the electric field it produces is also symmetrical by rotation. On the axis of the disk, it is therefore necessarily in the direction of this axis. The electric field produced by an infinite charged plane is therefore everywhere perpendicular to this plane.
Consider a cylinder whose surface faces $S$ are parallel to the charged plane, such that this plane passes through the midpoint between the two faces. The flux of the electric field through the side wall of the cylinder is zero, since it is always parallel to the wall. The flux is therefore the sum of the fluxes on the two sides:
$\phi =2SE$
where $E$ is the magnitude of the electric field on each face.
The electric charge $q$ contained in the cylinder is
$q=\sigma S$
Gauss' theorem allows us to conclude:
$E={\frac {\sigma }{2\epsilon _{0}}}$
$E$ does not depend on the distance to the charged plane.
The magnitude $E$ of the electric field produced by an infinite electrically charged plane is the same everywhere in space. The electric field is perpendicular to the plane and directed towards it, if its charge is negative, and in the opposite direction, if its charge is positive.
The surface charge of a conductive surface
On one side of the surface the electric field is zero. On the other side it is perpendicular to the surface. Gauss' theorem applied to a small cylinder which crosses the surface and whose faces parallel to it have a surface $dS$ gives $EdS={\frac {\sigma dS}{\epsilon _{0}}}$ so
$E={\frac {\sigma }{\epsilon _{0}}}$
The infinite charged line
If a charged wire is of finite length, the electric field it is the source of depends on the distance from its ends. But for a very long wire, this edge effect is negligible, provided that we are far from the ends. The electric field created in a plane perpendicular to the middle of a long electrically charged finite wire is therefore equal to the field created by a wire of infinite length which has the same charge per unit length. The electric field created in a plane perpendicular to the middle of a long electrically charged finite wire is therefore equal to the field created by a wire of infinite length which has the same charge per unit length.
The electric field created in a plane perpendicular to a uniformly electrically charged wire of finite length, which passes through its middle, is necessarily perpendicular to the wire, by symmetry. If this electric field deviated from this median plane, Curie's law would be violated. This law also shows that the electric field created by a uniformly charged wire is necessarily in a plane parallel to its axis. So it is necessarily directed towards the wire, or in the opposite direction. As the wire is symmetrical by rotation around its axis, Curie's law also shows that the magnitude of the field can only depend on the distance from the wire.
Consider a cylinder of radius $r$ and length $L$, centered on a uniformly charged infinite wire. The internal charge on the cylinder is equal to $q=\lambda L$ where $\lambda$ is the linear charge density of the wire. Across both ends of the cylinder, the electric field flux is zero, since the electric field is parallel to them. The flux $\phi$ of the electric field $\mathbf {E}$ is therefore equal to the surface of the cylinder, apart from its ends, multiplied by the field $E$, which is always perpendicular to this surface:
$\phi =2\pi rLE$
where $r$ is the radius of the cylinder, $L$ its length and $E$ the magnitude of the electric field $\mathbf {E}$ created by the uniformly charged wire at distance $r$ from the wire.
So $q/\epsilon _{0}=2\pi rLE$
$E={\frac {q}{2\pi rL\epsilon _{0}}}={\frac {\lambda }{2\pi r\epsilon _{0}}}$

## The curl of a vector field

To understand its curl, we must understand the circulation of a vector field along a loop.
For a uniform vector field $\mathbf {v}$, the circulation of the field along a straight line $\mathbf {dx}$ is equal to $dc=\mathbf {v} \cdot \mathbf {dx}$.
If the vector field is not uniform or if the path $C$ is not straight, we consider a broken line which follows the same path and whose segments can be as small as we want . We calculate the circulation of the field by assuming that it is uniform on each segment, and we take the limit of the sum of the circulations of the field on each segment when the length of the segments tends to zero. This limit is an integral and it is the circulation $c$ of the field $\mathbf {v}$ on the path $C$ considered:
$c=\int _{C}dc=\int _{C}\mathbf {v} \cdot \mathbf {dx}$.
The work of the electric force on a unit charge along a path is the flow of the electric field along that path.
If a force field derives from a potential, its circulation on a loop is always zero, because the potential at the starting point is equal to the potential at the ending point, which is the same as the starting point.
To measure circulation on a loop, one must choose a direction of circulation on the loop. Circulation in one direction is the opposite of circulation in the opposite direction.
The curl of a vector field is obtained from its circulation in the same way that its divergence is obtained from its flux, but the curl of a vector field in three-dimensional space is a vector field, whereas its divergence is a scalar field.
To understand the curl of a vector field, it is better to start by understanding it in a two-dimensional space, a surface, because then it is a scalar field, and a scalar field is simpler than a vector field.
The curl of a two-dimensional vector field $\mathbf {v}$ at the point $\mathbf {r}$ is the limit of ${\frac {c}{dS}}$ when $dS$ tends to zero, where $c$ is the circulation of $\mathbf {v}$ on a loop whose surface is $dS$ and which surrounds the point $\mathbf {r}$.
To calculate the curl we use the formula:
$\operatorname {curl} \mathbf {v} ={\frac {\partial v_{y}}{\partial x}}-{\frac {\partial v_{x}}{\partial y}}$
for a field $\mathbf {v}$ whose two components are $v_{x}$ and $v_{y}$.
Proof: We reason about a small square with side $a$ and whose sides are parallel to the x and y axes. On the sides parallel to the y axis, therefore perpendicular to the x axis, the circulation is $-av_{y}$ and $a(v_{y}+a{\frac {\partial v_{y}}{\partial x}})$. The sum of the two is $a^{2}{\frac {\partial v_{y}}{\partial x}}$. On the sides perpendicular to the y-axis, the circulation is $av_{x}$ and $-a(v_{x}+a{\frac {\partial v_{x}}{\partial y}})$ . The sum of the two is $-a^{2}{\frac {\partial v_{x}}{\partial y}}$. So the circulation over the entire square is $a^{2}({\frac {\partial v_{y}}{\partial x}}-{\frac {\partial v_{x}}{\partial y}})$. This circulation is also equal to $a^{2}\operatorname {curl} \mathbf {v}$.
When the vector field is three-dimensional, we consider its projections on three perpendicular planes. These are three two-dimensional vector fields, each of which has a curl. We can therefore associate three numbers with each point. These are the components of a vector field:
$\operatorname {curl} \mathbf {v} =({\frac {\partial v_{z}}{\partial y}}-{\frac {\partial v_{y}}{\partial z}},{\frac {\partial v_{x}}{\partial z}}-{\frac {\partial v_{z}}{\partial x}},{\frac {\partial v_{y}}{\partial x}}-{\frac {\partial v_{x}}{\partial y}})$
The curl of a three-dimensional vector field is also a three-dimensional vector field.
The divergence of the curl of a three-dimensional vector field is always zero.
Proof: $\operatorname {div} \operatorname {curl} \mathbf {v} ={\frac {\partial ^{2}v_{z}}{\partial x\partial y}}-{\frac {\partial ^{2}v_{y}}{\partial x\partial z}}+{\frac {\partial ^{2}v_{x}}{\partial y\partial z}}-{\frac {\partial ^{2}v_{z}}{\partial x\partial y}}+{\frac {\partial ^{2}v_{y}}{\partial x\partial z}}-{\frac {\partial ^{2}v_{x}}{\partial y\partial z}}=0$
The curl of a vector field can therefore always be identified with the velocity field of an incompressible fluid.
The flux of the curl of a vector field through a surface bounded by a loop depends only on the loop.
Proof: let $S_{1}$ and $S_{2}$ be two surfaces delimited by the same loop. These two surfaces delimit a volume. The flux out of this volume is the difference of the fluxes through $S_{1}$ and $S_{2}$. But since the divergence of a curl is always zero, this difference is zero, according to Gauss's theorem. So the two fluxes are equal.
The curl of the gradient of a potential is always zero.
Proof: let A and B be two points on a loop. The flux of the gradient of a potential $V$ on any path from A to B is equal to $V_{B}-V_{A}$. The circulation of the gradient on the loop is the circulation on a path from A to B plus the circulation on a path from B to A. It is therefore always equal to zero. As the rotational is defined from the circulation on a small loop, it is also always zero for the gradient of a potential.

## Stokes' theorem

The circulation of a vector field on a closed loop is the flux of its curl through a surface delimited by this loop.
Proof :
* Let C be a closed loop, D, E, F and G four points on C, in that order. We can divide the loop C into two loops by adding a link between E and G: DEG and EFG. The circulation of a vector field along the loop C is equal to the sum of the circulations on DE, EF, FG and GD. The circulation on the DEG loop is the sum of the circulations on DE, EG and GD. The circulation on EFG is the sum of the circulations on EF, FG and GE. Now the circulation on EG is the opposite of the circulation on GE, so the circulation on C is the sum of the circulations on the DEG and EFG loops.
* We can always divide a loop into many small adjacent loops. The circulation on the complete loop is the sum of the circulations on all the small loops that divide it, provided that the same direction of circulation is always chosen.
* Let $dS$ be a surface delimited by a small loop C parallel to the xy plane. The flux of the curl of a vector field $\mathbf {v}$ through $dS$ is equal to $dS({\frac {\partial v_{y}}{\partial x}}-{\frac {\partial v_{x}}{\partial y}})$. This flux is therefore equal to the circulation of $\mathbf {v}$ on the loop. The same would happen if $dS$ were parallel to the yz plane or the xz plane.
* A triangular loop can always be divided into three loops parallel to the xy, yz and xz planes. So the flux of the curl of $\mathbf {v}$ through a triangular loop is always the circulation of $\mathbf {v}$ on the loop.
* A loop can always be divided into small, almost triangular loops. If they are small enough, their difference from triangular loops is negligible. So the flux of the curl of $\mathbf {v}$ through any loop is equal to the circulation of $\mathbf {v}$ on the loop.
Stokes' theorem is to curl what Gauss' theorem is to divergence. They are both special cases of a very general theorem, also called Stokes' theorem, which can be proved for any finite-dimensional space with the means of differential geometry.

## Faraday's law

The work of the electric force on a unit charge along a closed loop is equal to the opposite of the rate of change of the flux of the magnetic field through an area bounded by the loop.
The work of electric force on a unit charge along a closed loop is an electromotive force.
A closed loop can always be thought of as a circuit that connects a generator to a resistor. The resistance is that of the loop. The generator is assumed to have zero resistance and to provide an electromotive force equal to the rate of change of the magnetic field flux. This is why we can always define a potential in an electric circuit, even though it contains loops which can be traversed by variable magnetic fields. Each time an electromotive force appears, we reason as if a generator instantly imposed a potential difference equal to this electromotive force. We can thus define a fictitious potential on the entire electrical circuit.
Faraday's law leads to Maxwell's third equation:
$\operatorname {curl} \mathbf {E} =-{\frac {\partial \mathbf {B} }{\partial t}}$
Proof: let a loop be placed in the electromagnetic field $(\mathbf {E} ,\mathbf {B} )$. By Stokes' theorem, the circulation of $\mathbf {E}$ over this loop is the flux of $\operatorname {curl} \mathbf {E}$ through it . According to Faraday's law, it is also the opposite of the rate of change of the flux of $\mathbf {B}$. The rate of change of the flux of $\mathbf {B}$ is the flux of ${\frac {\partial \mathbf {B} }{\partial t}}$. The equality of the fluxes of $\operatorname {curl} \mathbf {E}$ and of $-{\frac {\partial \mathbf {B} }{\partial t}}$ for any small loop proves that $\operatorname {curl} \mathbf {E}$ and $-{\frac {\partial \mathbf {B} }{\partial t}}$ are necessarily equal.

## Maxwell's fourth equation

Maxwell's fourth equation determines $\operatorname {curl} \mathbf {B}$ as the sum of two terms. One can be obtained with the Biot-Savart law.
The magnetic field lines around a wire of infinite length carrying a current $I$ are circular and centered on the wire in a plane perpendicular to the wire. With the Biot-Savart law, we can calculate the magnitude $B$ of the field $\mathbf {B}$
$B={\frac {I}{2\pi r\epsilon _{0}c^{2}}}$
where $r$ is the distance to the wire.
The circulation of $\mathbf {B}$ along a field line is therefore
$2\pi r\ B={\frac {I}{\epsilon _{0}c^{2}}}=\mu _{0}I$
By Stokes' theorem, the flux of $\operatorname {curl} \mathbf {B}$ through a loop is always the circulation of $\mathbf {B}$ over this loop. If $\mathbf {J}$ is the current density, $I$ is the flux of $\mathbf {J}$ through a surface crossed by the current. By setting $\operatorname {curl} \mathbf {B} =\mu _{0}\mathbf {J}$, we therefore find the Biot-Savart law for a wire of infinite length.
$\operatorname {curl} \mathbf {B} =\mu _{0}\mathbf {J}$ cannot be true everywhere.
Proof: let a circuit be made up of a capacitor which discharges into a resistor. Consider a loop that surrounds the circuit wire. The flux of $\mathbf {J}$ through a surface passing through the wire is equal to the current $I$. But the flux of $\mathbf {J}$ through a surface that passes between the two plates of the capacitor is zero, since there is no current between the two plates. Now the flux of $\operatorname {curl} \mathbf {B}$ through a surface delimited by the loop only depends on the loop. So $\operatorname {curl} \mathbf {B} =\mu _{0}\mathbf {J}$ cannot always be true.
On the other hand, if we put
$\operatorname {curl} \mathbf {B} =\mu _{0}(\epsilon _{0}{\frac {\partial \mathbf {E} }{\partial t}}+\mathbf {J} )$
we correct this error.
Proof: between the capacitor plates, $E=\sigma /\epsilon _{0}$ and is directed perpendicular to the plates. The flow of $\mathbf {E}$ through a surface between the plates is therefore $SE=S\sigma /\epsilon _{0}=Q/\epsilon _{0}$. So the flux of $\epsilon _{0}{\frac {\partial \mathbf {E} }{\partial t}}$ between the capacitor plates is equal to $dQ/dt=I$, the intensity of the current.

## Maxwell's equations

$\operatorname {div} \mathbf {E} =\rho /\epsilon _{0}$
$\operatorname {div} \mathbf {B} =0$
$\operatorname {curl} \mathbf {E} =-{\frac {\partial \mathbf {B} }{\partial t}}$
$\operatorname {curl} \mathbf {B} =\mu _{0}(\epsilon _{0}{\frac {\partial \mathbf {E} }{\partial t}}+\mathbf {J} )$
With the Lorentz equation,
$\mathbf {F} =q(\mathbf {E} +\mathbf {v} \times \mathbf {B}$)
Maxwell's equations are the fundamental laws of the classical theory of electromagnetism. Classical means here that it is not a quantum theory.
Maxwell's equations explain how moving charges are the sources of the electromagnetic field and how it changes over time. The Lorentz equation explains how this electromagnetic field exerts forces on moving charges.
Light is an electromagnetic wave. We can prove the existence of light from Maxwell's equations.
Aside from gravitation and nuclear forces, electromagnetic forces explain all natural phenomena. Light, atoms, molecules, ions, solids, liquids, gases, plasmas, liquid crystals, electric motors, radio waves, x-rays... are all explained from electromagnetic forces . For physicists, the Maxwell and Lorentz equations are therefore like the tables of the law.
Maxwell's and Lorentz's equations can be deduced from generalized Coulomb's law and the relativistic geometry of space-time. Generalized Coulomb's law is therefore the most fundamental law of classical electromagnetism.
Spacetime geometry assumes the existence of the speed $c$ of light, but it does not impose the existence of light. It is enough to assume the existence of particles that travel at the speed of light. So Coulomb's generalized law and the geometry of space-time prove the existence of light, without presupposing it.

## Maxwell's equations in matter

We generally think about point charges. The charge density $\rho$ is infinite at the point where the charge is. We assume that the charge density $\rho$ is a Dirac delta such that $\int _{V}\rho$ $dV=q$ for a point charge $q$, where $V$ is a volume that contains only the charge.
If the charges are ponctual, space is empty almost everywhere, and the Maxwell equations in matter are the same as the equations above, where the charge and current densities are calculated with Dirac deltas.