By the first half of the 19th century, the understanding of electromagnetics had improved through many experiments and theoretical work. In the 1780s, Charles-Augustin de Coulomb established his law of electrostatics. In 1825, André-Marie Ampère published his force law. In 1831, Michael Faraday discovered electromagnetic induction through his experiments, and proposed lines of forces to describe it. In 1834, Emil Lenz solved the problem of the direction of the induction, and Franz Ernst Neumann wrote down the equation to calculate the induced force by change of magnetic flux. However, these experimental results and rules were not well organized and sometimes confusing to scientists. A comprehensive summary of the electrodynamic principles was needed.

This work was done by the Scottish physicist and mathematician James Clerk Maxwell through a series of papers published from the 1850s to the 1870s. In the 1850s, Maxwell was working at the University of Cambridge where he was impressed by Faraday's lines of forces concept. In 1856, he published his first paper in electromagnetism: On Faraday's Lines of Force. He tried to use the analogy of incompressible fluid flow to model the magnetic lines of forces. Later, Maxwell moved to King's College London where he actually came into regular contact with Faraday, and became life-long friends. From 1861 to 1862, Maxwell published a series of four papers under the title of On Physical Lines of Force. In these papers, he used mechanical models, such as rotating vortex tubes, to model the electromagnetic field. He also modeled the vacuum as a kind of insulating elastic medium to account for the stress of the magnetic lines of force given by Faraday. These works had already laid the basis of the formulation of the Maxwell's equations. Moreover, the 1862 paper already derived the speed of light from the expression of the velocity of the electromagnetic wave in relation to the vacuum constants. The final form of Maxwell's equations was published in 1865 A Dynamical Theory of the Electromagnetic Field, in which the theory is formulated in strictly mathematical form. In 1873, Maxwell published A Treatise on Electricity and Magnetism as a summary of his work on electromagnetism. In summary, Maxwell's equations successfully unified theories of light and electromagnetism, which is one of the great unifications in physics.

Maxwell built a simple flywheel model of electromagnetism, and Ludwig Boltzmann built an elaborate mechanical model ("Bicykel") based on Maxwell's flywheel model, which he used for lecture demonstrations. Figures are at the end of Boltzmann's 1891 book.

Later, Oliver Heaviside studied Maxwell's A Treatise on Electricity and Magnetism and employed vector calculus to synthesize Maxwell's over 20 equations into the four recognizable ones which modern physicists use. Maxwell's equations also inspired Albert Einstein in developing the theory of special relativity.

The experimental proof of Maxwell's equations was demonstrated by Heinrich Hertz in a series of experiments in the 1890s. After that, Maxwell's equations were fully accepted by scientists.

Relationships among electricity, magnetism, and the speed of light The relationships amongst electricity, magnetism, and the speed of light can be summarized by the modern equation:

The left-hand side is the speed of light and the right-hand side is a quantity related to the constants that appear in the equations governing electricity and magnetism. Although the right-hand side has units of velocity, it can be inferred from measurements of electric and magnetic forces, which involve no physical velocities. Therefore, establishing this relationship provided convincing evidence that light is an electromagnetic phenomenon.

The discovery of this relationship started in 1855, when Wilhelm Eduard Weber and Rudolf Kohlrausch determined that there was a quantity related to electricity and magnetism, "the ratio of the absolute electromagnetic unit of charge to the absolute electrostatic unit of charge" (in modern language, the value ), and determined that it should have units of velocity. They then measured this ratio by an experiment which involved charging and discharging a Leyden jar and measuring the magnetic force from the discharge current, and found a value , remarkably close to the speed of light, which had recently been measured at by Hippolyte Fizeau in 1848 and at by Léon Foucault in 1850. However, Weber and Kohlrausch did not make the connection to the speed of light. Towards the end of 1861 while working on Part III of his paper On Physical Lines of Force, Maxwell travelled from Scotland to London and looked up Weber and Kohlrausch's results. He converted them into a format which was compatible with his own writings, and in doing so he established the connection to the speed of light and concluded that light is a form of electromagnetic radiation.

The term Maxwell's equations The four modern Maxwell's equations can be found individually throughout his 1861 paper, derived theoretically using a molecular vortex model of Michael Faraday's "lines of force" and in conjunction with the experimental result of Weber and Kohlrausch. But it was not until 1884 that Oliver Heaviside, concurrently with similar work by Josiah Willard Gibbs and Heinrich Hertz, grouped the twenty equations together into a set of only four, via vector notation. This group of four equations was known variously as the Hertz–Heaviside equations and the Maxwell–Hertz equations, but are now universally known as Maxwell's equations. Heaviside's equations, which are taught in textbooks and universities as Maxwell's equations are not exactly the same as the ones due to Maxwell, and, in fact, the latter are more easily made to conform to quantum physics.

This very subtle and paradoxical sounding situation can perhaps be most easily understood in terms of the similar situation that exists with respect to Newton's second law of motion: In textbooks and in classrooms the law is attributed to Newton, but Newton in fact wrote his second law as . This is clearly visible in a glass case in the Wren Library of Trinity College, Cambridge, where Newton's manuscript is open to the relevant page, showing the equation , where is the time derivative of the momentum . This seems a trivial enough fact until you realize that remains true in special relativity, without modification.

Maxwell's contribution to science in producing these equations lies in the correction he made to Ampère's circuital law in his 1861 paper On Physical Lines of Force. He added the displacement current term to Ampère's circuital law and this enabled him to derive the electromagnetic wave equation in his later 1865 paper A Dynamical Theory of the Electromagnetic Field and to demonstrate the fact that light is an electromagnetic wave. This fact was later confirmed experimentally by Heinrich Hertz in 1887. The physicist Richard Feynman predicted that, "From a long view of the history of mankind, seen from, say, ten thousand years from now, there can be little doubt that the most significant event of the 19th century will be judged as Maxwell's discovery of the laws of electrodynamics. The American Civil War will pale into provincial insignificance in comparison with this important scientific event of the same decade."Crease, Robert (2008) The Great Equations: Breakthroughs in Science from Pythagoras to Heisenberg, page 133

The concept of fields was introduced by, among others, Faraday. Albert Einstein wrote:

Heaviside worked to eliminate the potentials (electric potential and magnetic potential) that Maxwell had used as the central concepts in his equations; this effort was somewhat controversial, though it was understood by 1884 that the potentials must propagate at the speed of light like the fields, unlike the concept of instantaneous action-at-a-distance like the then conception of gravitational potential.

On Physical Lines of Force

The four equations we use today appeared separately in Maxwell's 1861 paper, On Physical Lines of Force:

Equation (56) in Maxwell's 1861 paper is Gauss's law for magnetism, . Equation (112) is Ampère's circuital law, with Maxwell's addition of displacement current. This may be the most remarkable contribution of Maxwell's work, enabling him to derive the electromagnetic wave equation in his 1865 paper A Dynamical Theory of the Electromagnetic Field, showing that light is an electromagnetic wave. This lent the equations their full significance with respect to understanding the nature of the phenomena he elucidated. (Kirchhoff derived the telegrapher's equations in 1857 without using displacement current, but he did use Poisson's equation and the equation of continuity, which are the mathematical ingredients of the displacement current. Nevertheless, believing his equations to be applicable only inside an electric wire, he cannot be credited with the discovery that light is an electromagnetic wave). Equation (115) is Gauss's law. Equation (54) expresses what Oliver Heaviside referred to as 'Faraday's law', which addresses the time-variant aspect of electromagnetic induction, but not the one induced by motion; Faraday's original flux law accounted for both. Maxwell deals with the motion-related aspect of electromagnetic induction, , in equation (77), which is the same as equation (D) in Maxwell's original equations as listed below. It is expressed today as the force law equation, , which sits adjacent to Maxwell's equations and bears the name Lorentz force, even though Maxwell derived it when Lorentz was still a young boy.

The difference between the and the vectors can be traced back to Maxwell's 1855 paper entitled On Faraday's Lines of Force which was read to the Cambridge Philosophical Society. The paper presented a simplified model of Faraday's work, and how the two phenomena were related. He reduced all of the current knowledge into a linked set of differential equations.

It is later clarified in his concept of a sea of molecular vortices that appears in his 1861 paper On Physical Lines of Force. Within that context, represented pure vorticity (spin), whereas was a weighted vorticity that was weighted for the density of the vortex sea. Maxwell considered magnetic permeability to be a measure of the density of the vortex sea. Hence the relationship, Magnetic induction current causes a magnetic current density was essentially a rotational analogy to the linear electric current relationship, Electric convection current where ρ is electric charge density. was seen as a kind of magnetic current of vortices aligned in their axial planes, with being the circumferential velocity of the vortices. With representing vortex density, it follows that the product of with vorticity leads to the magnetic field denoted as .

The electric current equation can be viewed as a convective current of electric charge that involves linear motion. By analogy, the magnetic equation is an inductive current involving spin. There is no linear motion in the inductive current along the direction of the vector. The magnetic inductive current represents lines of force. In particular, it represents lines of inverse-square law force.

The extension of the above considerations confirms that where is to , and where is to , then it necessarily follows from Gauss's law and from the equation of continuity of charge that is to i.e. parallels with , whereas parallels with .

A Dynamical Theory of the Electromagnetic Field