Mathematical descriptions of the electromagnetic field
There are various mathematical descriptions of the electromagnetic field that are used in the study of electromagnetism, one of the four fundamental forces of nature. In this article three approaches are discussed, generally the equations are in terms of electric and magnetic fields, potentials, and charges with currents.
Contents
Vector field approach
The most common description of the electromagnetic field uses two threedimensional vector fields called the electric field and the magnetic field. These vector fields each have a value defined at every point of space and time and are thus often regarded as functions of the space and time coordinates. As such, they are often written as E(x, y, z, t) (electric field) and B(x, y, z, t) (magnetic field).
If only the electric field (E) is nonzero, and is constant in time, the field is said to be an electrostatic field. Similarly, if only the magnetic field (B) is nonzero and is constant in time, the field is said to be a magnetostatic field. However, if either the electric or magnetic field has a timedependence, then both fields must be considered together as a coupled electromagnetic field using Maxwell's equations.
Maxwell's equations in the vector field approach
The behaviour of electric and magnetic fields, whether in cases of electrostatics, magnetostatics, or electrodynamics (electromagnetic fields), is governed in a vacuum by Maxwell's equations:
where ρ is the charge density, which can (and often does) depend on time and position, ε_{0} is the electric constant, μ_{0} is the magnetic constant, and J is the current per unit area, also a function of time and position. The units used above are the standard SI units.
Inside a linear material, Maxwell's equations change by switching the permeability and permittivity of free space with the permeability and permittivity of the linear material in question. Inside other materials which possess more complex responses to electromagnetic fields, these properties can be represented by tensors, with timedependence related to the material's ability to respond to fast field changes (dispersion (optics), Green–Kubo relations), and possibly also field dependencies representing nonlinear and/or nonlocal material responses to large amplitude fields (nonlinear optics).
Potential field approach
Many times in the use and calculation of electric and magnetic fields, the approach used first computes an associated potential: the electric potential, \varphi, for the electric field, and the magnetic potential, A, for the magnetic field. The electric potential is a scalar field, while the magnetic potential is a vector field. This is why sometimes the electric potential is called the scalar potential and the magnetic potential is called the vector potential. These potentials can be used to find their associated fields as follows:
 \mathbf E =  \mathbf \nabla \varphi  \frac{\partial \mathbf A}{\partial t}
 \mathbf B = \mathbf \nabla \times \mathbf A
Maxwell's equations in potential formulation
These relations can be substituted into Maxwell's equations to express the latter in terms of the potentials. Faraday's law and Gauss's law for magnetism reduce to identities (e.g. in the case of Gauss's Law for magnetism, 0 = 0). The other two of Maxwell's equations turn out less simply.

Maxwell's equations (Potential formulation) \nabla^2 \varphi + \frac{\partial}{\partial t} \left ( \mathbf \nabla \cdot \mathbf A \right ) =  \frac{\rho}{\varepsilon_0}
\left ( \nabla^2 \mathbf A  \frac{1}{c^2} \frac{\partial^2 \mathbf A}{\partial t^2} \right )  \mathbf \nabla \left ( \mathbf \nabla \cdot \mathbf A + \frac{1}{c^2} \frac{\partial \varphi}{\partial t} \right ) =  \mu_0 \mathbf J
These equations taken together are as powerful and complete as Maxwell's equations. Moreover, the problem has been reduced somewhat, as between the electric and magnetic fields, each had three components which needed to be solved for, meaning it was necessary to solve for six quantities.^{[1]} In the potential formulation, there are only four quantities, the electric potential and the three components of the vector potential. However, this improvement is contrasted with the equations being much messier than Maxwell's equations using just the electric and magnetic fields.
Gauge freedom
Fortunately, these equations can be simplified by taking advantage of the fact that only the electric and magnetic fields are physically meaningful quantities that can be measured; the potentials are not. Thus there is a freedom to impose conditions on the potentials so long as whatever condition is chosen to impose does not affect the resultant electric and magnetic fields. This freedom is called gauge freedom. Specifically for these equations, for any choice of a scalar function of position and time λ, the potentials can be changed as follows:
 \mathbf A' = \mathbf A + \mathbf \nabla \lambda
 \varphi' = \varphi  \frac{\partial \lambda}{\partial t}
This freedom can be used to greatly simplify the potential formulation. Generally, two such scalar functions are chosen.
Coulomb gauge
The Coulomb gauge is chosen in such a way that \mathbf \nabla \cdot \mathbf A' = 0, which corresponds to the case of magnetostatics. In terms of λ, this means that it must satisfy the equation
 \nabla^2 \lambda =  \mathbf \nabla \cdot \mathbf A.
This choice of function results in the following formulation of Maxwell's equations:
 \nabla^2 \varphi' = \frac{\rho}{\varepsilon_0}
 \nabla^2 \mathbf A'  \mu_0 \varepsilon_0 \frac{\partial^2 \mathbf A'}{\partial t^2} =  \mu_0 \mathbf J + \mu_0 \varepsilon_0 \nabla \left ( \frac{\partial \varphi'}{\partial t} \right )
Several features about Maxwell's equations in the Coulomb gauge are as follows. Firstly, solving for the electric potential is very easy, as the equation is a version of Poisson's equation. Secondly, solving for the magnetic vector potential is particularly difficult. This is the big disadvantage of this gauge. The third thing to note, and something which is not immediately obvious, is that the electric potential changes instantly everywhere in response to a change in conditions in one locality.
For instance, if a charge is moved in New York at 1 pm local time, then a hypothetical observer in Australia who could measure the electric potential directly would measure a change in the potential at 1 pm New York time. This seemingly goes against the prohibition in special relativity of sending information, signals, or anything faster than the speed of light. The solution to this apparent problem lies in the fact that, as previously stated, no observers measure the potentials, they measure the electric and magnetic fields. So, the combination of ∇φ and ∂A/∂t used in determining the electric field restores the speed limit imposed by special relativity for the electric field, making all observable quantities consistent with relativity.
Lorenz gauge
Another gauge (used very often) is the Lorenz gauge. This scalar function λ is chosen such that
 \mathbf \nabla \cdot \mathbf A' =  \mu_0 \varepsilon_0 \frac{\partial \varphi'}{\partial t}.
meaning λ must satisfy the equation
 \nabla^2 \lambda  \mu_0 \varepsilon_0 \frac{\partial^2 \lambda }{\partial t^2}=  \mathbf \nabla \cdot \mathbf A  \mu_0 \varepsilon_0 \frac{\partial \varphi}{\partial t}.
The Lorenz gauge results in the following form of Maxwell's equations:
 \nabla^2 \mathbf A'  \mu_0 \varepsilon_0 \frac{\partial^2 \mathbf A'}{\partial t^2} = \Box^2 \mathbf A' =  \mu_0 \mathbf J
 \nabla^2 \varphi'  \mu_0 \varepsilon_0 \frac{\partial^2 \varphi'}{\partial t^2} = \Box^2 \varphi' =  \frac{\rho}{\varepsilon_0}
The operator \Box^2 is called the d'Alembertian (some authors denote by just one square \Box). These equations are inhomogeneous versions of the wave equation, with the terms on the right side of the equation serving as the source functions for the wave. These equations lead to two solutions: advanced potentials (which depend on the configuration of the sources at future points in time), and retarded potentials (which depend on the past configurations of the sources); the former are usually (and sensibly) dismissed as 'nonphysical' in favor of the latter, which preserve causality.
As pointed out above, the Lorenz gauge is no more valid than any other gauge since the potentials cannot be measured. Despite this, there are certain quantum mechanical phenomena in which potentials seem to affect particles in regions where the observable field vanishes, for example as in the Aharonov–Bohm effect. However, these phenomena do not provide means to measure the potentials nor to detect a difference between different but mutually gauge equivalent potentials.
Extension to quantum electrodynamics
Canonical quantization of the electromagnetic fields proceeds by elevating the scalar and vector potentials; φ(x), A(x), from fields to field operators. Substituting 1/c^{2} = ε_{0}μ_{0} into the previous Lorenz gauge equations gives:
 \nabla^2 \mathbf A  \frac 1 {c^2} \frac{\partial^2 \mathbf A}{\partial t^2} =  \mu_0 \mathbf J
 \nabla^2 \varphi  \frac 1 {c^2} \frac{\partial^2 \varphi}{\partial t^2} =  \frac{\rho}{\varepsilon_0}
Here, J and ρ are the current and charge density of the matter field. If the matter field is taken so as to describe the interaction of electromagnetic fields with the Dirac electron given by the fourcomponent Dirac spinor field ψ, the current and charge densities have form:^{[2]}
 \mathbf{J}=e\psi^{\dagger}\boldsymbol{\alpha}\psi\,\quad \rho=e\psi^{\dagger}\psi \,,
where α are the first three Dirac matrices. Using this, we can rewrite Maxwell's equations as:

Maxwell's equations (QED) \nabla^2 \mathbf A  \frac 1 {c^2} \frac{\partial^2 \mathbf A}{\partial t^2} = \mu_0 e \psi^{\dagger} \boldsymbol{\alpha} \psi
\nabla^2 \varphi  \frac 1 {c^2} \frac{\partial^2 \varphi}{\partial t^2} = \frac{1}{\varepsilon_0} e \psi^{\dagger} \psi
which is the form used in quantum electrodynamics.
Geometric algebra formulations
Analogous to the tensor formulation, two objects, one for the field and one for the current, are introduced. In geometric algebra (GA) these are multivectors. The field multivector, known as the Riemann–Silberstein vector, is
 \bold{F} = \bold{E} + Ic\bold{B} = E^k\sigma_k + IcB^k\sigma_k
and the current multivector is
 c \rho  \bold{J} = c \rho  J^k\sigma_k
where, in the algebra of physical space (APS) C\ell_{3,0}(\mathbb{R}) with the vector basis \{\sigma_k\}. The unit pseudoscalar is I=\sigma_1\sigma_2\sigma_3 (assuming an orthonormal basis). Orthonormal basis vectors share the algebra of the Pauli matrices, but are usually not equated with them. After defining the derivative
 \boldsymbol{\nabla} = \sigma^k \partial_k
Maxwell's equations are reduced to a single equation,^{[3]}

Maxwell's equations (APS formulation) \left(\frac{1}{c}\dfrac{\partial }{\partial t} + \boldsymbol{\nabla}\right)\bold{F} = \mu_0 c (c \rho  \bold{J})
In three dimensions, the derivative has a special structure allowing the introduction of a cross product:
 \boldsymbol{\nabla}\bold{F} = \boldsymbol{\nabla} \cdot \bold{F} + \boldsymbol{\nabla} \wedge \bold{F} = \boldsymbol{\nabla} \cdot \bold{F} + I \boldsymbol{\nabla} \times \bold{F}
from which it is easily seen that Gauss's law is the scalar part, the Ampère–Maxwell law is the vector part, Faraday's law is the pseudovector part, and Gauss's law for magnetism is the pseudoscalar part of the equation. After expanding and rearranging, this can be written as
 \left( \boldsymbol{\nabla} \cdot \mathbf{E}  \frac{\rho}{\epsilon_0} \right) c \left( \boldsymbol{\nabla} \times \mathbf{B}  \mu_0 \epsilon_0 \frac{\partial {\mathbf{E}}}{\partial {t}}  \mu_0 \mathbf{J} \right)+ I \left( \boldsymbol{\nabla} \times \mathbf{E} + \frac{\partial {\mathbf{B}}}{\partial {t}} \right)+ I c \left( \boldsymbol{\nabla} \cdot \mathbf{B} \right)= 0
We can upgrade from APS to spacetime algebra (STA) C\ell_{1,3}(\mathbb{R}) by reassigning \sigma_k=\gamma_k\gamma_0 with unit pseudoscalar I=\gamma_0\gamma_1\gamma_2\gamma_3. The new basis vectors share the algebra of the gamma matrices but like above are usually not equated with them. The derivative is now
 \nabla = \gamma^\mu \partial_\mu.
It is customary to leave the Riemann–Silberstein vector as a bivector
F = \bold{E} + Ic\bold{B} = E^k\gamma_k\gamma_0 c(B^1\gamma_2\gamma_3 + B^2\gamma_3\gamma_1 + B^3\gamma_1\gamma_2),
but to reduce the current to a vector
 J = J^\mu \gamma_\mu = c \rho \gamma_0 + J^k \gamma_k = \gamma_0(c \rho  J^k \sigma_k).
Owing to the very simple identity
 \gamma_0 \nabla = \gamma_0\gamma^0 \partial_0 + \gamma_0\gamma^k\partial_k = \partial_0 + \sigma^k\partial_k = \frac{1}{c}\dfrac{\partial }{\partial t} + \boldsymbol{\nabla},
all of Maxwell's equations reduce to an even terser single equation:

Maxwell's equations (STA formulation) \nabla F = \mu_0 c J
Differential forms approach
Field 2form
In free space, where ε = ε_{0} and μ = μ_{0} are constant everywhere, Maxwell's equations simplify considerably once the language of differential geometry and differential forms is used. In what follows, cgsGaussian units, not SI units are used. (To convert to SI, see here.) The electric and magnetic fields are now jointly described by a 2form F in a 4dimensional spacetime manifold, The Maxwell tensor F_{\mu\nu} can be written as a 2form in Minkowski space as
 \begin{align} \bold{F} \equiv & \frac{1}{2}F_{\mu\nu} dx^{\mu} \wedge dx^{\nu} \\ = & B_x dy \wedge dz + B_y dz \wedge dx + B_z dx \wedge dy + E_x dx \wedge dt + E_y dy \wedge dt + E_z dz \wedge dt \end{align}
which, as the curvature form, is the exterior derivative of the electromagnetic fourpotential,
 \bold{F} = \mathrm{d} \bold{A} = ( \partial_{\mu} A_{\nu} ) dx^{\mu} \wedge dx^{\nu}
The source free equations can be written by the action of the exterior derivative on this 2form. But for the equations with source terms (Gauss's law and the AmpèreMaxwell equation), the Hodge dual of this 2form is needed. The Hodge 'star' dual takes a pform to a d − p form, where d is the number of dimensions. Here, it takes the 2form (F) and gives another 2form (in four dimensions, d − p = 4 − 2 = 2). For the basis cotangent vectors, the Hodge dual is given as (see here)
 {\star dx} \wedge dy =  dz \wedge dt ,\quad {\star dx} \wedge dt = dy \wedge dz,
and so on. Using these relations, the dual of Maxwell 2form is
 {\star \bold{F}} =  B_x dx \wedge dt  B_y dy \wedge dt  B_z dz \wedge dt + E_x dy \wedge dz + E_y dz \wedge dx + E_z dx \wedge dy
Current 3form, dual current 1form
Here, the 3form J is called the electric current form or current 3form:
 \bold{J} = \rho dx \wedge dy \wedge dz  j_x dt \wedge dy \wedge dz  j_y dt \wedge dz \wedge dx  j_z dt \wedge dx \wedge dy
with the corresponding dual 1form:
 {\star \bold{J}} = \rho dt + j_x dx + j_y dy + j_z dz
Maxwell's equations then reduce to the Bianchi identity and the source equation, respectively:

Maxwell's equations (current 3form) \mathrm{d}\bold{F}=0
\mathrm{d}\,{\star\bold{F}}=\bold{J}
where d denotes the exterior derivative — a natural coordinate and metric independent differential operator acting on forms, and the (dual) Hodge star operator \star is a linear transformation from the space of 2forms to the space of (4−2)forms defined by the metric in Minkowski space (in four dimensions even by any metric conformal to this metric). The fields are in natural units where 1/4πε_{0} = 1.
Since d^{2} = 0, the 3form J satisfies the continuity equation:
 \mathrm{d}{\bold{J}}=0.
The current 3form can be integrated over a 3dimensional spacetime region. The physical interpretation of this integral is the charge in that region if it is spacelike, or the amount of charge that flows through a surface in a certain amount of time if that region is a spacelike surface cross a timelike interval. As the exterior derivative is defined on any manifold, the differential form version of the Bianchi identity makes sense for any 4dimensional manifold, whereas the source equation is defined if the manifold is oriented and has a Lorentz metric. In particular the differential form version of the Maxwell equations are a convenient and intuitive formulation of the Maxwell equations in general relativity.
Linear macroscopic influence of matter
In a linear, macroscopic theory, the influence of matter on the electromagnetic field is described through more general linear transformation in the space of 2forms. We call
 C:\Lambda^2\ni\bold{F}\mapsto \bold{G}\in\Lambda^{(42)}
the constitutive transformation. The role of this transformation is comparable to the Hodge duality transformation. The Maxwell equations in the presence of matter then become:
 \mathrm{d}\bold{F} = 0
 \mathrm{d}\bold{G} = \bold{J}
where the current 3form J still satisfies the continuity equation dJ = 0.
When the fields are expressed as linear combinations (of exterior products) of basis forms θ^{p},
 \bold{F} = \frac{1}{2}F_{pq}\bold{\theta}^p\wedge\bold{\theta}^q.
the constitutive relation takes the form
 G_{pq} = C_{pq}^{mn}F_{mn}
where the field coefficient functions are antisymmetric in the indices and the constitutive coefficients are antisymmetric in the corresponding pairs. In particular, the Hodge duality transformation leading to the vacuum equations discussed above are obtained by taking
 C_{pq}^{mn} = \frac{1}{2}g^{ma}g^{nb} \epsilon_{abpq} \sqrt{g}
which up to scaling is the only invariant tensor of this type that can be defined with the metric.
In this formulation, electromagnetism generalises immediately to any 4dimensional oriented manifold or with small adaptations any manifold, requiring not even a metric.
Current 1form, dual current 3form
In the literature, the current is usually defined as a 1form (i.e. the hodge dual of the 3form J above):
 \bold{J} = \rho dt + j_x dx + j_y dy + j_z dz
with the corresponding dual 3form:
 {\star \bold{J}} = \rho dx \wedge dy \wedge dz  j_x dt \wedge dy \wedge dz  j_y dt \wedge dz \wedge dx  j_z dt \wedge dx \wedge dy
In terms of these forms, the Maxwell equations are:^{[4]}

Maxwell's equations (current 1form) \mathrm{d}\bold{F}=0
\mathrm{d}\,{\star \bold{F}} = {\star \bold{J}}
The conservation of current (continuity equation) simply follows from the property of exterior derivative that d^{2} = 0 (exterior derivative).
 \mathrm{d}\,{\star \bold{J}} = \mathrm{d}^2\,{\star \bold{F}} = 0
which is the conservation of current.
Curved spacetime
Traditional formulation
Matter and energy generate curvature of spacetime. This is the subject of general relativity. Curvature of spacetime affects electrodynamics. An electromagnetic field having energy and momentum also generates curvature in spacetime. Maxwell's equations in curved spacetime can be obtained by replacing the derivatives in the equations in flat spacetime with covariant derivatives. (Whether this is the appropriate generalization requires separate investigation.) The sourced and sourcefree equations become (cgsGaussian units):
 { 4 \pi \over c }j^{\beta} = \partial_{\alpha} F^{\alpha\beta} + {\Gamma^{\alpha}}_{\mu\alpha} F^{\mu\beta} + {\Gamma^{\beta}}_{\mu\alpha} F^{\alpha \mu} \ \stackrel{\mathrm{def}}{=}\ \nabla_{\alpha} F^{\alpha\beta} \ \stackrel{\mathrm{def}}{=}\ {F^{\alpha\beta}}_{;\alpha} \, \!
and
 0 = \partial_{\gamma} F_{\alpha\beta} + \partial_{\beta} F_{\gamma\alpha} + \partial_{\alpha} F_{\beta\gamma} = \nabla_{\gamma} F_{\alpha\beta} + \nabla_{\beta} F_{\gamma\alpha} + \nabla_{\alpha} F_{\beta\gamma}.\,
Here,
 {\Gamma^{\alpha}}_{\mu\beta} \!
is a Christoffel symbol that characterizes the curvature of spacetime and ∇_{α} is the covariant derivative.
Formulation in terms of differential forms
The formulation of the Maxwell equations in terms of differential forms can be used without change in general relativity. The equivalence of the more traditional general relativistic formulation using the covariant derivative with the differential form formulation can be seen as follows. Choose local coordinates x^{α} which gives a basis of 1forms dx^{α} in every point of the open set where the coordinates are defined. Using this basis and cgsGaussian units we define
 The antisymmetric infinitesimal field tensor F_{αβ}, corresponding to the field 2form F
 \bold{F} = \frac{1}{2}F_{\alpha\beta} \,\mathrm{d}\,x^{\alpha} \wedge \mathrm{d}\,x^{\beta}.
 The currentvector infinitesimal 3form J
 \bold{J} = {4 \pi \over c } \left ( \frac{1}{6} j^{\alpha} \sqrt{g} \, \epsilon_{\alpha\beta\gamma\delta} \mathrm{d}\,x^{\beta} \wedge \mathrm{d}\,x^{\gamma} \wedge \mathrm{d}\,x^{\delta}. \right)
The epsilon tensor contracted with the differential 3form produces 6 times the number of terms required.
Here g is as usual the determinant of the metric tensor g_{αβ}. A small computation that uses the symmetry of the Christoffel symbols (i.e., the torsionfreeness of the LeviCivita connection) and the covariant constantness of the Hodge star operator then shows that in this coordinate neighborhood we have:
 the Bianchi identity
 \mathrm{d}\bold{F} = 2(\partial_{\gamma} F_{\alpha\beta} + \partial_{\beta} F_{\gamma\alpha} + \partial_{\alpha} F_{\beta\gamma})\mathrm{d}\,x^{\alpha}\wedge \mathrm{d}\,x^{\beta} \wedge \mathrm{d}\,x^{\gamma} = 0,
 the source equation
 \mathrm{d}\,{\star \bold{F}} = \frac{1}{6}{F^{\alpha\beta}}_{;\alpha}\sqrt{g} \, \epsilon_{\beta\gamma\delta\eta}\mathrm{d}\,x^{\gamma} \wedge \mathrm{d}\,x^{\delta} \wedge \mathrm{d}\,x^{\eta} = \bold{J},
 the continuity equation
 \mathrm{d}\bold{J} = { 4 \pi \over c } {j^{\alpha}}_{;\alpha} \sqrt{g} \, \epsilon_{\alpha\beta\gamma\delta}\mathrm{d}\,x^{\alpha}\wedge \mathrm{d}\,x^{\beta} \wedge \mathrm{d}\,x^{\gamma} \wedge \mathrm{d}\,x^{\delta} = 0.
Classical electrodynamics as the curvature of a line bundle
An elegant and intuitive way to formulate Maxwell's equations is to use complex line bundles or principal bundles with fibre U(1). The connection ∇ on the line bundle has a curvature F = ∇^{2} which is a twoform that automatically satisfies dF = 0 and can be interpreted as a fieldstrength. If the line bundle is trivial with flat reference connection d we can write ∇ = d + A and F = dA with A the 1form composed of the electric potential and the magnetic vector potential.
In quantum mechanics, the connection itself is used to define the dynamics of the system. This formulation allows a natural description of the Aharonov–Bohm effect. In this experiment, a static magnetic field runs through a long magnetic wire (e.g., an iron wire magnetized longitudinally). Outside of this wire the magnetic induction is zero, in contrast to the vector potential, which essentially depends on the magnetic flux through the crosssection of the wire and does not vanish outside. Since there is no electric field either, the Maxwell tensor F = 0 throughout the spacetime region outside the tube, during the experiment. This means by definition that the connection ∇ is flat there.
However, as mentioned, the connection depends on the magnetic field through the tube since the holonomy along a noncontractible curve encircling the tube is the magnetic flux through the tube in the proper units. This can be detected quantummechanically with a doubleslit electron diffraction experiment on an electron wave traveling around the tube. The holonomy corresponds to an extra phase shift, which leads to a shift in the diffraction pattern.^{[5]}^{[6]}
Discussion
Following are the reasons for using each of such formulations.
Potential formulation
In advanced classical mechanics it is often useful, and in quantum mechanics frequently essential, to express Maxwell's equations in a potential formulation involving the electric potential (also called scalar potential) φ, and the magnetic potential (also called vector potential) A. For example, the analysis of radio antennas makes full use of Maxwell's vector and scalar potentials to separate the variables, a common technique used in formulating the solutions of differential equations. The potentials can be introduced by using the Poincaré lemma on the homogeneous equations to solve them in a universal way (this assumes that we consider a topologically simple, e.g. contractible space). The potentials are defined as in the table above. Alternatively, these equations define E and B in terms of the electric and magnetic potentials which then satisfy the homogeneous equations for E and B as identities. Substitution gives the nonhomogeneous Maxwell equations in potential form.
Many different choices of A and φ are consistent with given observable electric and magnetic fields E and B, so the potentials seem to contain more, (classically) unobservable information. The non uniqueness of the potentials is well understood, however. For every scalar function of position and time λ(x, t), the potentials can be changed by a gauge transformation as
 \varphi' = \varphi  \frac{\partial \lambda}{\partial t}, \quad \mathbf A' = \mathbf A + \mathbf \nabla \lambda
without changing the electric and magnetic field. Two pairs of gauge transformed potentials (φ, A) and (φ′, A′) are called gauge equivalent, and the freedom to select any pair of potentials in its gauge equivalence class is called gauge freedom. Again by the Poincaré lemma (and under its assumptions), gauge freedom is the only source of indeterminacy, so the field formulation is equivalent to the potential formulation if we consider the potential equations as equations for gauge equivalence classes.
The potential equations can be simplified using a procedure called gauge fixing. Since the potentials are only defined up to gauge equivalence, we are free to impose additional equations on the potentials, as long as for every pair of potentials there is a gauge equivalent pair that satisfies the additional equations (i.e. if the gauge fixing equations define a slice to the gauge action). The gaugefixed potentials still have a gauge freedom under all gauge transformations that leave the gauge fixing equations invariant. Inspection of the potential equations suggests two natural choices. In the Coulomb gauge, we impose \mathbf \nabla \cdot \mathbf A = 0 which is mostly used in the case of magneto statics when we can neglect the c^{−2}∂^{2}A/∂t^{2} term. In the Lorenz gauge (named after the Dane Ludvig Lorenz), we impose
 \mathbf \nabla \cdot \mathbf A + \frac{1}{c^2} \frac{\partial \varphi}{\partial t} = 0\,.
The Lorenz gauge condition has the advantage of being Lorentz invariant and leading to Lorentzinvariant equations for the potentials.
Manifestly covariant (tensor) approach
Maxwell's equations are exactly consistent with special relativity—i.e., if they are valid in one inertial reference frame, then they are automatically valid in every other inertial reference frame. In fact, Maxwell's equations were crucial in the historical development of special relativity. However, in the usual formulation of Maxwell's equations, their consistency with special relativity is not obvious; it can only be proven by a laborious calculation.
For example, consider a conductor moving in the field of a magnet.^{[7]} In the inertial frame of the magnet, that conductor experiences a magnetic force. But in the frame of a conductor moving relative to the magnet, the conductor experiences a force due to an electric field. The motion is exactly consistent in these two different reference frames, but it mathematically arises in quite different ways.
For this reason and others, it is often useful to rewrite Maxwell's equations in a way that is "manifestly covariant"—i.e. obviously consistent with special relativity, even with just a glance at the equations—using covariant and contravariant fourvectors and tensors. This can be done using the EM tensor F, or the 4potential A, with the 4current J – see covariant formulation of classical electromagnetism.
Differential forms approach
Gauss's law for magnetism and the Faraday–Maxwell law can be grouped together since the equations are homogeneous, and be seen as geometric identities expressing the field F (a 2form), which can be derived from the 4potential A. Gauss's law for electricity and the Ampere–Maxwell law could be seen as the dynamical equations of motion of the fields, obtained via the Lagrangian principle of least action, from the "interaction term" A J (introduced through gauge covariant derivatives), coupling the field to matter. For the field formulation of Maxwell's equations in terms of a principle of extremal action, see electromagnetic tensor.
Often, the time derivative in the Faraday–Maxwell equation motivates calling this equation "dynamical", which is somewhat misleading in the sense of the preceding analysis. This is rather an artifact of breaking relativistic covariance by choosing a preferred time direction. To have physical degrees of freedom propagated by these field equations, one must include a kinetic term F *F for A, and take into account the nonphysical degrees of freedom which can be removed by gauge transformation A → A' = A − dα. See also gauge fixing and Faddeev–Popov ghosts.
Geometric calculus approach
This formulation is structured on the algebra that spacetime generates through the introduction of a distributive, associative (but not commutative) product called the geometric product. Every element and every operation within the algebra has geometric meaning. The members of the algebra carry a grade (as in the formalism of differential forms) and the (geometric) product of a vector with a kvector can always be decomposed into a (k1)vector and a (k+1)vector. The gradelowering product can be identified with the inner product and the graderaising product as the outer product. Of great importance is the fact that the geometric product is invertible while the inner and outer products are not. The derivatives that appear in Maxwell's equations are vectors and Electromagnetic fields are represented by the Faraday bivector F. This formulation is more general than that of differential forms as one can construct a unique rvector which yields a quantity which has al the properties of a differential form. The description is more general in many senses and all results of differential forms can be reproduced. In the light of this formulation one can identify that the dynamics of electromagnetic fields is given by one equation, Maxwell's equation. This equation can be separated into parts as is done above for comparative reasons.
References and notes
 Module:Hatnote     This module produces hatnote links and links to related articles. It   implements the and metatemplates and includes   helper functions for other Lua hatnote modules. 
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments  lazily initialise Module:Arguments local yesno  lazily initialise Module:Yesno
local p = {}
 Helper functions
local function getArgs(frame)  Fetches the arguments from the parent frame. Whitespace is trimmed and  blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s)  Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon)  Finds the namespace id (namespace number) of a link or a pagename. This  function will not work if the link is enclosed in double brackets. Colons  are trimmed from the start of the link by default. To skip colon  trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...)  Formats a list of pages using formatLink and returns it as an array. Nil  values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...)  Takes a list of page/display tables and returns it as a list of  formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory)  Formats an error message to be returned to wikitext. If  addTrackingCategory is not false after being returned from  Module:Yesno, and if we are not on a talk page, a tracking category  is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle()  Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end  Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end
 Format link   Makes a wikilink from the given link and display values. Links are escaped  with colons if necessary, and links to sections are detected and displayed  with " § " as a separator rather than the standard MediaWiki "#". Used in  the template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display)  Find whether we need to use the colon trick or not. We need to use the  colon trick for categories and files, as otherwise category links  categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end  Find whether a faux display value has been added with the  magic  word. if not display then local prePipe, postPipe = link:match('^(.)(.*)$') link = prePipe or link display = postPipe end  Find the display value. if not display then local page, section = link:match('^(.)#(.*)$') if page then display = page .. ' § ' .. section end end  Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end
 Hatnote   Produces standard hatnote text. Implements the template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( 'end
return p  Module:Hatnote     This module produces hatnote links and links to related articles. It   implements the and metatemplates and includes   helper functions for other Lua hatnote modules. 
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments  lazily initialise Module:Arguments local yesno  lazily initialise Module:Yesno
local p = {}
 Helper functions
local function getArgs(frame)  Fetches the arguments from the parent frame. Whitespace is trimmed and  blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s)  Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon)  Finds the namespace id (namespace number) of a link or a pagename. This  function will not work if the link is enclosed in double brackets. Colons  are trimmed from the start of the link by default. To skip colon  trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...)  Formats a list of pages using formatLink and returns it as an array. Nil  values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...)  Takes a list of page/display tables and returns it as a list of  formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory)  Formats an error message to be returned to wikitext. If  addTrackingCategory is not false after being returned from  Module:Yesno, and if we are not on a talk page, a tracking category  is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle()  Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end  Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end
 Format link   Makes a wikilink from the given link and display values. Links are escaped  with colons if necessary, and links to sections are detected and displayed  with " § " as a separator rather than the standard MediaWiki "#". Used in  the template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display)  Find whether we need to use the colon trick or not. We need to use the  colon trick for categories and files, as otherwise category links  categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end  Find whether a faux display value has been added with the  magic  word. if not display then local prePipe, postPipe = link:match('^(.)(.*)$') link = prePipe or link display = postPipe end  Find the display value. if not display then local page, section = link:match('^(.)#(.*)$') if page then display = page .. ' § ' .. section end end  Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end
 Hatnote   Produces standard hatnote text. Implements the template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( 'end
return p ^ Introduction to Electrodynamics by Griffiths
 ^ Quantum Electrodynamics, Mathworld
 ^ Oersted Medal Lecture David Hestenes "Reforming the Mathematical Language of Physics" (Am. J. Phys. 71 (2), February 2003, pp. 104–121) Online:http://geocalc.clas.asu.edu/html/OerstedReformingTheLanguage.html p26
 ^
 ^
 ^
 ^ Albert Einstein (1905) On the electrodynamics of moving bodies
 Module:Hatnote     This module produces hatnote links and links to related articles. It   implements the and metatemplates and includes   helper functions for other Lua hatnote modules. 
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments  lazily initialise Module:Arguments local yesno  lazily initialise Module:Yesno
local p = {}
 Helper functions
local function getArgs(frame)  Fetches the arguments from the parent frame. Whitespace is trimmed and  blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s)  Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon)  Finds the namespace id (namespace number) of a link or a pagename. This  function will not work if the link is enclosed in double brackets. Colons  are trimmed from the start of the link by default. To skip colon  trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...)  Formats a list of pages using formatLink and returns it as an array. Nil  values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...)  Takes a list of page/display tables and returns it as a list of  formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory)  Formats an error message to be returned to wikitext. If  addTrackingCategory is not false after being returned from  Module:Yesno, and if we are not on a talk page, a tracking category  is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle()  Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end  Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end
 Format link   Makes a wikilink from the given link and display values. Links are escaped  with colons if necessary, and links to sections are detected and displayed  with " § " as a separator rather than the standard MediaWiki "#". Used in  the template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display)  Find whether we need to use the colon trick or not. We need to use the  colon trick for categories and files, as otherwise category links  categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end  Find whether a faux display value has been added with the  magic  word. if not display then local prePipe, postPipe = link:match('^(.)(.*)$') link = prePipe or link display = postPipe end  Find the display value. if not display then local page, section = link:match('^(.)#(.*)$') if page then display = page .. ' § ' .. section end end  Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end
 Hatnote   Produces standard hatnote text. Implements the template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( 'end
return p  Module:Hatnote     This module produces hatnote links and links to related articles. It   implements the and metatemplates and includes   helper functions for other Lua hatnote modules. 
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments  lazily initialise Module:Arguments local yesno  lazily initialise Module:Yesno
local p = {}
 Helper functions
local function getArgs(frame)  Fetches the arguments from the parent frame. Whitespace is trimmed and  blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s)  Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon)  Finds the namespace id (namespace number) of a link or a pagename. This  function will not work if the link is enclosed in double brackets. Colons  are trimmed from the start of the link by default. To skip colon  trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...)  Formats a list of pages using formatLink and returns it as an array. Nil  values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...)  Takes a list of page/display tables and returns it as a list of  formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory)  Formats an error message to be returned to wikitext. If  addTrackingCategory is not false after being returned from  Module:Yesno, and if we are not on a talk page, a tracking category  is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle()  Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end  Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end
 Format link   Makes a wikilink from the given link and display values. Links are escaped  with colons if necessary, and links to sections are detected and displayed  with " § " as a separator rather than the standard MediaWiki "#". Used in  the template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display)  Find whether we need to use the colon trick or not. We need to use the  colon trick for categories and files, as otherwise category links  categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end  Find whether a faux display value has been added with the  magic  word. if not display then local prePipe, postPipe = link:match('^(.)(.*)$') link = prePipe or link display = postPipe end  Find the display value. if not display then local page, section = link:match('^(.)#(.*)$') if page then display = page .. ' § ' .. section end end  Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end
 Hatnote   Produces standard hatnote text. Implements the template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( 'end
return p (with worked problems in Warnick, Russer 2006 ISBN 1596930969)