Vectors and Maxwell’s Equations
Electric and Magnetic Fields: Foundations and Maxwell’s Equations
Maxwell’s equations describe how electric and magnetic fields relate to charge, current, and changes in time. In vacuum, the relevant constants are the permittivity of free space, ε0, and the permeability of free space, μ0.
To understand the equations, it helps to build up their mathematical language: vectors, vector fields, divergence, curl, and flux. These ideas explain both the integral and local forms of the laws.
1. Vectors and Vector Fields
Vectors
A vector describes a quantity with both a magnitude and a direction. For example, stating how strong a push is does not specify which way it acts; the push must be described by its strength and direction together.
A vector can be represented by an arrow:
The arrow’s length represents the vector’s magnitude.
The arrow’s orientation represents its direction.
Changing either the length or the direction produces a different vector.
In a coordinate system, a vector is described by components along perpendicular axes. In three dimensions, a vector F has components Fx, Fy, and Fz:
Each component describes how much of the vector points along its corresponding axis.
Vector fields
A vector field assigns a vector to every location in space. The electric field E and magnetic field B are examples.
A single vector describes a quantity at one location.
A vector field describes how the vector quantity varies from place to place.
At any chosen location, the field’s vector gives the local field value.
Field diagrams often show arrows at fixed sample positions. These sample positions do not move with the arrows; they represent locations where the field is being measured or displayed.
A field can vary across space and can also change over time. Illustrations of changing fields may show values changing at fixed locations, but this does not by itself depict electromagnetic radiation propagating with a delay. The arrows represent the field at each instant.
2. Divergence: Local Net Outflow
Divergence measures the net outward flux of a vector field from a small volume, divided by that volume. It indicates whether a field behaves locally like a source, a sink, or neither.
For a vector field F in Cartesian coordinates,
Each derivative measures how one component changes as position changes along the same direction:
∂x∂Fx measures how Fx changes along x.
∂y∂Fy measures how Fy changes along y.
∂z∂Fz measures how Fz changes along z.
Flux through a small volume
Imagine a small box placed in a field. Each face has an outward-pointing normal. Only the field component perpendicular to a face contributes to the flux through that face.
Field leaving a face contributes positive flux.
Field entering a face contributes negative flux.
Field tangent to a face contributes no flux through that face.
Divergence compares the total amount leaving the box with the total amount entering it. In a flow analogy, it asks whether there is more flow out than in. The analogy helps visualize the mathematics; it does not mean an electric field is literally a fluid.
The three directional contributions add. For example, if the x contribution is 1, the y contribution is 1, and the z contribution is 0, then the divergence is 2.
Divergence is net outward flux per unit volume in the limit of a shrinking volume.
Interpreting divergence
Positive divergence: More field leaves a small volume than enters. The field has a local outward-source character.
Negative divergence: More field enters than leaves. The field has a local inward-sink character.
Zero divergence: Inward and outward flux balance locally.
Zero divergence does not mean the field is zero. A strong, uniform field can enter one side of a small box and leave the opposite side in equal amounts. Nor does zero divergence mean no field crosses the boundary; it means the signed total balances.
3. Curl: Local Circulation
Curl describes a field’s local tendency to circulate, including the direction of the axis around which the circulation occurs. In three dimensions, curl is itself a vector.
For a field F, its Cartesian form is
The z-component in a plane
For a field in the xy-plane, the component of curl perpendicular to the plane is
The first derivative follows the change in the vertical component Fy as position changes horizontally along x. The second follows the change in the horizontal component Fx as position changes vertically along y.
This distinction matters: a derivative’s numerator identifies which field component is being tracked; its denominator identifies the direction in which position changes. Moving along x does not require the field arrows themselves to point along x.
Paddlewheel interpretation and sign
A small paddlewheel placed in a flow analogy helps illustrate curl. If the local flow exerts unequal turning tendencies on opposite arms, the wheel rotates.
With x pointing right, y pointing up, and positive z pointing toward the observer:
Counterclockwise circulation corresponds to positive z-component of curl.
Clockwise circulation corresponds to negative z-component of curl.
No net local turning corresponds to zero z-component.
For instance, a field may have upward flow that gets stronger toward the right. This gives a positive contribution to ∂x∂Fy. If the horizontal flow also changes so that its contribution reinforces the same turning direction, the two terms add. If the cross-derivatives are equal, their effects cancel and the curl is zero.
Reversing a circulating field reverses the direction of its curl. A field can also spread outward and stretch a small group of tracers without producing local rotation: that is a divergence effect, not necessarily a curl effect.
Curl measures local circulation per unit area in the limit of a shrinking loop; it is not simply a measure of whether field lines look curved.
Divergence and curl describe different properties of the same field. In a three-dimensional field, curl has three components; a planar diagram showing rotation in the xy-plane displays specifically its z-component.
4. Electric Field and Electric Flux
Defining the electric field
A positive source charge produces an outward electric force on a nearby positive test charge. The force’s direction and strength can change with position.
The electric field is defined as electric force per unit positive test charge:
If the test charge is doubled at a fixed location, the force on it doubles, so the ratio remains the same. The test charge is imagined to be small enough that it does not appreciably disturb the source charges.
The electric field is a description of the force that a positive test charge would experience at a location. Its value is defined even when no test charge is present there. Its SI units are newtons per coulomb, equivalent to volts per metre:
Electric flux through a surface
Electric flux measures how much of the electric field passes through a surface, with the sign determined by the surface’s chosen normal direction.
For a small flat patch with area vector dA, the flux contribution is
The area vector points normal to the patch and has magnitude equal to the patch’s area.
When the field points along the normal, the perpendicular field component—and therefore the flux—is greatest.
Tilting the patch reduces the perpendicular component.
When the field lies in the plane of the patch, its flux through the patch is zero.
Reversing the normal reverses the sign of the flux without changing the field.
For a larger surface, the flux is the sum of the contributions from all its small patches:
Electric flux is a measurement of the field through a surface, not a count of material particles moving across it.
Flux through a closed surface
A closed surface encloses a volume. Its area vectors point outward everywhere. Field entering the surface counts negatively, while field leaving counts positively. Thus, the net flux is the total outward contribution minus the total inward contribution.
A uniform field can cross a closed surface while producing zero net flux: what enters through one part balances what leaves through another. A positive charge enclosed by the surface produces net outward flux; a negative enclosed charge produces net inward flux.
5. Gauss’s Law for Electricity
Integral form
Gauss’s law states that the net electric flux through any closed surface is proportional to the signed charge enclosed:
Here, Qenc is the total signed charge inside the surface. Charges outside the surface may contribute to the electric field at its boundary, but their total inward and outward flux contributions cancel. Therefore, the net flux depends on the enclosed charge, not on the outside charge.
Electric fields add as vectors, so flux contributions from multiple charges add as well:
Two equal positive enclosed charges produce twice the net outward flux of either one alone.
Equal positive and negative enclosed charges give zero net flux, even though the electric field may be nonzero throughout the region.
A charge outside the surface can produce field through the surface, but its total signed flux is zero.
The enclosing surface is imaginary; it need not be a physical shell. Spherical symmetry can make calculations especially simple, but Gauss’s law holds for closed surfaces of any shape.
Point-charge illustration
For a positive point charge q, choose a spherical surface of radius r centered on the charge. The field is radial and has equal magnitude everywhere on the sphere. Coulomb’s law gives
The sphere’s area is 4πr2, so its total flux is
If the radius doubles, the field strength decreases by a factor of four while the area increases by a factor of four. The product—and therefore the total flux—remains unchanged. This illustrates why the net flux is determined by the enclosed charge rather than by the radius of the chosen sphere.
Charge density and the local form
For a continuous charge distribution, the charge density ρ is charge per unit volume. It can be defined locally by taking the charge inside a small volume, dividing by that volume, and shrinking the volume around a location:
Charge density has units of coulombs per cubic metre. It may be positive, negative, or zero, and it describes the distribution of charge in space—not the strength of the electric field.
Apply Gauss’s law to a small volume. Its net outward flux equals its enclosed charge divided by ε0. Dividing by the volume and shrinking the volume gives the local relationship:
This is the differential form of Gauss’s law. It says that charge density is the local source of electric-field divergence:
Positive ρ corresponds to positive divergence.
Negative ρ corresponds to negative divergence.
Zero ρ means zero local divergence, but the electric field itself may still be nonzero.
For an ideal point charge, the field is singular at the charge, so an ordinary smooth derivative cannot be applied there. Away from the charge, the field’s divergence is zero; the enclosed flux around the singular source accounts for its charge.
Gauss’s law also holds when charges and fields vary with time. The stationary-charge examples simplify the visualization but are not a restriction on the law.
6. Magnetic Field and Magnetic Force
The magnetic field B assigns a direction and strength to every location. Its strength is measured in tesla. A compass can indicate its direction, and forces on moving charges provide another way to measure it.
For a charge q moving with velocity v in a magnetic field, the magnetic force is
The cross product makes the magnetic force perpendicular to both the velocity and the magnetic field. The sign of q determines which of the two opposite perpendicular directions the force takes.
Important consequences include:
A charge at rest experiences no magnetic force, even when a magnetic field is present.
Reversing the sign of the charge reverses the magnetic force for the same velocity and field.
A magnetic force alone changes a particle’s direction of motion but does no work on it, so its speed stays constant in the idealized case.
By contrast, the electric force Felectric=qE can act on a stationary charge.
A magnetic field is therefore not simply another name for an electric field.
7. Gauss’s Law for Magnetism
Integral and differential forms
The net magnetic flux through every closed surface is zero:
The local form is
Together, these statements say that magnetic fields have no isolated sources or sinks of the kind electric charges provide for electric fields. Zero net magnetic flux does not mean the magnetic field is zero; a strong magnetic field can enter and leave a closed surface in equal amounts.
Bar magnets and magnetic field lines
Outside a bar magnet, the magnetic field points from its north end toward its south end. Inside the magnet, it continues from south toward north, forming continuous loops.
A closed surface around just one end still has both outward and inward magnetic flux; the field does not begin or end at that pole. Cutting a bar magnet does not isolate a magnetic pole. Each resulting piece becomes a smaller magnet with both a north end and a south end.
Magnetic field lines have no isolated starting or ending poles; magnetic flux entering a closed surface balances the flux leaving it.
8. Faraday’s Law: Changing Magnetic Fields Produce Electric Circulation
Induction in a stationary loop
Faraday’s law describes how a changing magnetic field produces a circulating electric field. Consider a stationary conducting loop with its normal pointing in the positive z direction. Viewed from the positive z side, the positive direction around the loop is counterclockwise.
A stationary magnet can produce magnetic field through the loop, but if the linked magnetic flux is steady, it produces no induced circulation. When the magnet moves, the flux through the loop changes and an induced electric field appears. In a conductor, this electric field can drive a conventional current even though the loop itself is stationary.
The induced current produces a magnetic response that opposes the change in flux. This is Lenz’s law, represented by the minus sign in Faraday’s law.
For the illustrated motion of a bar magnet through the loop:
Approach: Upward magnetic flux increases. The induced circulation is clockwise when viewed from the positive z side; its magnetic response points downward and opposes the increase.
At the centered position: In the symmetric example, the linked flux reaches a maximum. Its rate of change is momentarily zero, so the circulation around the loop passes through zero at that instant. The magnet is still moving, and the field may be nonuniform; the zero is due to the flux reaching an extremum in this particular setup.
Departure: The upward flux decreases. The induced circulation reverses to counterclockwise, producing an upward response that opposes the decrease.
After motion stops: The field can remain present, but the flux stops changing and the induced circulation becomes zero.
Lenz’s law opposes the change in flux; it does not mean that the induced field always opposes the original magnetic field.
Integral and differential forms
The circulation of the electric field around a fixed loop equals the negative rate of change of magnetic flux through the loop:
The local form is
Here, curl describes the local circulating part of the electric field, while ∂t∂B describes how the magnetic field changes with time at a fixed location. A loop’s total flux and the local time rate of change of the field are different measurements, connected by the law.
For an increasing magnetic field in the positive z direction, the curl of the electric field points in the negative z direction. This corresponds to clockwise electric circulation when viewed from the positive z side. Reversing the change in magnetic field reverses the induced circulation.
The circulating electric field is a field in space, not something that exists only inside a wire. A conductor makes the field’s effect visible by allowing current to flow. If the magnetic field becomes steady, this induction term vanishes; electric fields due to charge can still be present, and their electrostatic part has zero curl.
9. Ampère’s Law and the Current Source of Magnetic Circulation
Steady currents
A conventional current through a wire produces a magnetic field that circulates around it. The right-hand rule relates their directions:
Point the right thumb along the conventional current.
The curled fingers indicate the direction of magnetic circulation.
Reversing the current reverses the magnetic circulation.
For a steady current in vacuum, the circulation around a closed path is
The local form is
where J is current density: current per unit area, with a direction. Its SI units are amperes per square metre.
Magnetic field can circulate around a wire while having zero local curl at points outside the wire. Circulation around a whole path and curl at one point are related, but they are not the same measurement.
The steady-current rule alone is incomplete when electric fields change with time.
10. The Displacement-Current Term
The charging-capacitor problem
A charging capacitor reveals why Ampère’s law needs an additional term. In a circuit, conventional current flows through the wires to the capacitor plates. Opposite charges accumulate on the plates, causing the electric field in the vacuum gap to grow. No conduction charge crosses that gap.
Once charging ends, the plate charges and gap field become steady, and the charging current falls to zero. During charging, however, two surfaces spanning the same boundary appear to give different accounts if only conduction current is considered:
A surface cutting through a wire is crossed by conduction current.
A surface bending through the vacuum gap is crossed by no conduction charge.
Both surfaces have the same boundary, so the magnetic circulation around that boundary must be the same. The changing electric field in the gap supplies the missing contribution.
Displacement current and the complete law
For an ideal parallel-plate capacitor, ε0 times the rate of change of electric flux through the gap equals the wire current during charging. This field-change contribution is called displacement current. It has the units and role of a current in the equation, but it is not charge carriers traveling across the vacuum gap.
The complete Ampère–Maxwell law in vacuum is
Its integral form is
The two contributions to magnetic circulation are:
μ0J: the contribution from actual current density.
μ0ε0∂t∂E: the contribution from a changing electric field.
Displacement current is tied to change in electric flux, not merely to the presence of an electric field. If the electric field is constant in time, the displacement term is zero and the equation reduces to the steady-current form.
The capacitor does not create or destroy charge at the gap. Charge accumulates on its plates, while the changing electric field ensures that the two surface descriptions of magnetic circulation agree.
11. Maxwell’s Four Equations in Vacuum
The four laws connect field sources, flux, and circulation:
Gauss’s law for electricity
Electric charge is the local source of electric-field divergence.
Gauss’s law for magnetism
Magnetic flux entering a closed surface balances magnetic flux leaving it.
Faraday’s law
A changing magnetic field produces electric-field circulation, with its direction specified by Lenz’s law.
Ampère–Maxwell law
Electric current and a changing electric field both produce magnetic-field circulation.
These equations use vacuum constants and total charge and current as sources. Descriptions of fields in materials can reorganize the source terms using the auxiliary fields D and H; those material conventions are distinct from the vacuum form presented here.

Ask anything
We've read this whole study set, so questions about it get the best answers.