Gauss’s Law for Magnetism
Electric field lines start and end on charges; magnetic field lines do neither, because no one has ever found an isolated magnetic pole. That single experimental fact is Gauss's law for magnetism: the flux of through any closed surface is zero, , or in differential form .
╌╌╌╌
Closed-surface magnetic flux
Magnetic flux through an oriented surface is
The area element is normal to the surface. An open surface requires its orientation to be chosen and stated; reversing the normal reverses the flux sign. The standard orientation of a closed surface points outward. Gauss's law for magnetism states
Every closed surface has zero net magnetic flux. The law does not require magnetic field to vanish on the surface. A field can enter one region of a closed boundary and leave another with equal signed flux. The cancellation concerns the surface integral, not the field magnitude at a single point.
A uniform field of magnitude through a rectangular box can be taken parallel to the direction. The right face has outward normal , contributing , and the left face has outward normal , contributing . The remaining four faces have normals perpendicular to , so each contribution is zero. Summing all six contributions gives zero. This simple calculation checks the area-vector sign convention before more complicated surface geometry is used.
An open surface can have nonzero flux. A circular loop in a uniform field has when the field makes angle with the loop's chosen normal. Closing the loop with an imaginary surface elsewhere adds surface pieces whose flux balances the first one. Confusing an open loop flux with a closed-surface flux is a common source of an incorrect nonzero result for Gauss's law.
Field-line continuity and the absence of magnetic charge
Electric field lines can begin on positive charge and end on negative charge. A magnetic field map has a different topology. Magnetic field lines have no isolated beginning or end within the classical field description. A line that emerges from the north-seeking end of a bar magnet continues through the surrounding region, returns to the south-seeking end, and closes through the magnet's interior. The labels north and south describe the exterior pattern; they do not identify separate magnetic charges.
Gauss's law expresses this continuity in integral form. A closed surface around one end of a magnet is still crossed by magnetic field lines that continue through the surface elsewhere. A sufficiently large surface around the entire magnet contains both outgoing and incoming crossings. Changing the surface shape can change local flux density and the locations where lines cross, but the signed total remains zero.
The divergence theorem converts the surface law into the differential form
The divergence condition is local. It says that the net outward magnetic flux from an arbitrarily small closed volume is zero. A magnetic field may curve, vary in magnitude, and have nonzero curl while remaining divergence-free. Divergence and curl measure different local properties and should not be interchanged.
No isolated magnetic monopole has been established in the classical experiments covered here. A hypothetical monopole of magnetic charge would change the closed-surface law to a nonzero flux proportional to enclosed , analogous to electric Gauss's law. The observed zero law constrains the usual magnetic sources: currents, moving charges, and magnetized material produce fields with continuous lines rather than radial source or sink patterns.
Surface choice and flux bookkeeping
The closed surface used in Gauss's law is an accounting boundary, not a physical shell. It can be spherical, cubical, irregular, or assembled from several patches. Choose a surface that makes the flux contributions easy to identify. An ideal solenoid can be enclosed by a long narrow cylinder that contains strong nearly axial field and a region of weak exterior field; the end caps account for the corresponding entering and leaving flux. A pillbox around a circular current loop intersects field lines in different directions across its faces, but the sum remains zero.
The sign of an individual flux contribution follows from the dot product. A field pointing outward through an outward-oriented patch contributes positive flux. The same field pointing inward contributes negative flux. A field tangent to the patch contributes zero flux. Sketching the outward normal on every surface patch is more reliable than assigning signs from the left or right side of a page drawing.
Flux cancellation can occur between large contributions. A numerical surface integral should therefore store signed contributions and sum them before taking any magnitude. Reporting the absolute flux through each face and then adding the values destroys the cancellation required by Gauss's law. A relative residual
is a practical check for a discretized closed surface. A small value indicates cancellation within the mesh and measurement precision; it does not establish that the underlying field source has been identified correctly.
Normal component at a material boundary
Apply a thin closed pillbox across any ordinary magnetic boundary. As the pillbox height tends to zero, flux through its curved side vanishes relative to flux through the two faces. Gauss's law then gives
The normal component of is continuous across the boundary. The statement holds whether the regions are vacuum, air, or magnetic media. The tangential component can change when surface current or material magnetization is present; its boundary condition is a separate result from Ampère's law.
The normal-component condition is a local check for a field map. Draw a small boundary-normal arrow at corresponding points on either side, then compare the normal components after accounting for the coordinate convention. A discontinuity in the plotted normal component signals a measurement calibration error, an unresolved source current crossing the pillbox, or a calculation that violates the divergence-free condition.
Measuring a closed-surface flux balance
Magnetic probes usually measure one component at a time. A closed-surface flux test can be built from measurements on a tessellated surface. Divide the surface into small patches with known outward area vectors , measure or estimate the field vector at each patch centre, and form
Refine the patch spacing until the signed sum and its uncertainty stabilize. A probe with a fixed sensing axis must be rotated or the apparatus transformed to obtain the normal component on each patch. Background fields require the same treatment: include them consistently on all patches or subtract a separately measured background map before forming the sum.
The test has practical limits. A sparse mesh can miss rapid spatial variation near a wire, magnet edge, or small coil. Probe orientation error changes the measured normal component systematically. A surface that passes through a current-carrying conductor requires a field model with the conductor's finite cross-section, since point samples near the path may vary sharply. State the mesh geometry, coordinate calibration, probe axis, patch areas, background procedure, and convergence criterion with any reported flux residual.
Flux tubes and surface deformation
A flux tube is bounded by a family of magnetic field lines. Its side wall is tangent to , so the side-wall contribution to is zero. Take two cross-sections of the same tube and close the region between them with that tangent wall. Gauss's law gives
when both cross-section normals are chosen outward from the enclosed segment. In a common coordinate orientation, this says that the signed magnetic flux through one cross-section equals the signed flux through the other after their normals have been made parallel. Field magnitude and cross-sectional area compensate:
when each cross-section has nearly uniform normal field. A narrowing tube has larger field magnitude; a widening tube has smaller field magnitude. The relation describes the same continuous field lines passing through different areas. It is not a statement that a finite number of lines has been conserved.
The construction is local and geometric. It applies to a map of a solenoid, current loop, or magnetized object wherever a set of nearby field lines can be identified. It does not say that is constant along a field line. Curvature, surrounding currents, and material response can change both direction and magnitude. The tube relation identifies only the normal flux through selected cross-sections.
In a numerical map, draw a narrow tube through neighboring vector arrows and estimate cross-sectional area with a short normal segment. Compare at several locations. A systematic drift may reflect interpolation error, poor sensor orientation, or a tube boundary that no longer follows the local field. It can also indicate that the sampled surface crosses an unresolved current or magnetic material boundary, where a finer physical model is required.
Deforming a closed surface without changing its flux balance
Closed-surface flux is unchanged when an accounting surface is smoothly deformed through a region where . The local field crossings rearrange as the surface moves, yet the signed sum remains zero for every closed version of the surface. A sphere around a current loop, a rounded box around the same loop, and a wrinkled laboratory scan surface all give zero net magnetic flux if each is complete and the field is evaluated accurately.
The surface cannot be deformed across a singular model source without changing what the mathematical field model represents locally. A filamentary current path has an idealized singularity at its centreline. In practical work, give the conductor a finite radius and avoid claiming pointwise field values on the current itself. Gauss's law still applies to a closed surface around that finite conductor; the warning concerns numerical evaluation of the field near a singular line model.
Open-surface flux behaves differently. Tilting or bending an open surface changes the area vectors exposed to the field and generally changes . Faraday's law uses this open-surface flux together with a boundary loop and a chosen orientation. Gauss's law uses a complete boundary-free surface. Keeping those two uses separate prevents a field-map sketch from assigning the same flux value to surfaces with different boundaries.
Differential map checks on a finite grid
A sampled magnetic map can be checked cell by cell. A rectangular cell of volume gives a divergence approximation using face-centred components:
The superscripts label opposite faces, not positive and negative field values. A small value means that the signed fluxes through the six faces balance within grid and measurement error. It does not mean that all six components are small. A uniform field has nonzero components and zero discrete divergence because opposite face values are equal.
Finite differences require a stated resolution. If the cell is large compared with the scale on which changes, opposite-face averages cannot resolve strong internal variation. If the cell is extremely small, sensor noise divided by a short distance can dominate the estimated derivative. Use a coarse map to locate rapid variation, then refine locally and compare the divergence residual across more than one cell size.
Boundary cells need separate handling. A one-sided derivative near the edge has a different truncation error from a centred derivative. A cell that straddles a conductor, magnetic material, or region inaccessible to the probe should be labelled as a model boundary rather than silently filled with interpolated values. Such discipline makes a zero-divergence result traceable to measured data and stated interpolation choices.
Magnetic sources and field topology
Far from a compact current loop, the magnetic field has dipole form.
The calculated flux checks a far-field model of a current loop. The field magnitude should decrease strongly with radius, yet the flux balance remains zero at every radius. A calculation that produces the same-sign radial component over a complete sphere has adopted a radial-source pattern appropriate to electric charge, not to an ordinary magnetic dipole.
Finite solenoids and exterior return paths
An ideal infinitely long solenoid is often drawn with magnetic field confined to its interior. A finite solenoid has an exterior return field. Field lines leave one end, curve through the surrounding space, and enter the other end, completing continuous paths. A closed surface that intersects the interior axial field must also intersect the exterior return field or have other surface patches whose flux provides the balance.
The infinite-solenoid model is a local approximation to the central interior region of a long winding. It simplifies the field magnitude there but does not alter Gauss's law. An accounting surface surrounding a finite portion of the interior must still be closed. If its side wall is selected to follow field lines, the end caps have opposite signed flux. If the side wall cuts through curved exterior field, that side contribution must be retained.
A field probe scan along the solenoid axis can check this topology. The central interior component is large and nearly uniform for a long coil, falls near the ends, and changes character outside the winding. A one-dimensional axial scan alone does not measure the exterior return path. Add transverse scans outside the end regions before using the map to estimate a closed-surface flux balance.
Cutting a magnet and the scale of a field map
Dividing a bar magnet into shorter pieces does not expose an isolated north end or south end. Each piece has an exterior pattern with two ends and an interior return path. The microscopic current and material description of a magnet is treated separately; the field-map consequence is already fixed by the closed-surface law. A small Gaussian surface around one cut piece has equal incoming and outgoing magnetic flux.
The field scale changes as source size and observation distance change. A probe held at the same absolute distance from a shorter piece can move from a far-field regime into a near-field regime. Compare maps using dimensionless position such as distance divided by magnet length when the question concerns shape, and retain physical units when the question concerns sensor response or flux uncertainty.
Orientation errors in a surface-flux measurement
A component probe measures . If its sensing axis is tilted by a small angle away from the intended surface normal, the measured normal component includes a projection error. For a field parallel to the intended normal,
When the field also has a tangential component, a small tilt introduces a first-order contamination from that tangential field. The sign depends on the tilt direction. Calibrate probe orientation at every strongly curved surface region; using one fixed laboratory axis for all patches produces a false flux residual when the patch normals vary.
Record probe orientation together with position. A three-axis instrument can be projected onto each local normal after a coordinate calibration. A single-axis probe requires mechanical rotation or a surface fixture. Repeat a subset of patches after reversing source current; the genuine source field reverses, while a sensor offset does not. The reversal does not correct a systematic orientation error, but it separates that geometric error from a static additive background.
Nonuniform flux balance and topology checks
Gauss's law for magnetism applies to nonuniform fields as directly as to uniform ones. Consider the divergence-free field
over a rectangular closed surface with , , and . The field magnitude and direction change across the surface, so a single area times one representative field value is not a valid flux calculation. Decompose the closed-surface integral into its six planar faces and use the local outward normal on each face.
On the two faces normal to the x direction, the left face at contributes zero, while the right face at contributes
On the y-normal faces, the lower face at contributes zero. At , the field is and the outward normal is , giving
The z-normal faces contribute zero because the field has no z component. Thus . The cancellation is not accidental: the x component increases with x while the y component decreases with y by the same rate. The differential check gives , consistent with the complete face sum.
A sign audit lists the field component, face location, outward normal, area, and face contribution on separate lines. Assign each face its own normal, record the sign of every contribution, and then form the total. A result with two positive contributions from the displayed x and y faces usually signals that the upper-face normal or the y component sign was dropped. Units provide a second check: every face contribution must have units of tesla square metres.
Magnetic topology through a current loop is continuous. A loop current produces field that passes through the loop interior and returns through the surrounding region. Field lines can be drawn densely near the loop axis and more broadly outside, but they do not start at the wire and terminate elsewhere. The wire changes the curl of the field in its neighbourhood; it does not supply a magnetic line endpoint. A closed map that clips the exterior return region can make the interior field look one-sided, so the map boundary and any excluded volume must be stated.
Mesh convergence reports whether a numerical flux estimate is controlled by the grid. Partition a closed surface into patches, evaluate the normal component on each patch, multiply by patch area, and sum. Repeat after halving characteristic patch width. The difference between successive estimates is a numerical-resolution indicator, not a replacement for instrument uncertainty. Probe offset, orientation uncertainty, source current uncertainty, and patch-coordinate uncertainty must be propagated separately.
A field satisfying Gauss's law has a signed closed-surface sum that approaches zero as the mesh is refined until measurement noise dominates. Individual face sums need not approach zero; their cancellation is the test. Track the largest positive and negative face contributions as well as the total. A small total formed by two large poorly measured terms may have a larger uncertainty than a map with smaller individual terms. State both the total and its uncertainty interval.
A closed-surface result requires a geometry record and independent local checks. Record surface orientation, patch areas, probe axes, source-current setting, face-by-face contributions, mesh sequence, and uncertainty model. A current-loop topology map also states the mapped volume and the region excluded by the measurement boundary.
| test | quantity held fixed | diagnostic result |
|---|---|---|
| box-size scaling | field model and all but one box length | cancelling face terms scale with the corresponding face area |
| current reversal | probe coordinates and instrument settings | reversible source field changes sign; static background does not |
| mesh refinement | source current, probe height, and surface geometry | numerical change falls to the propagated uncertainty floor |
| local comparison | selected face points and loop-axis points | measured normal component agrees with the model within combined uncertainty |
A reversal pair separates the reversible source field from the static background with
The probe-coordinate system remains fixed during this comparison. The source vectors should reverse; an offset that remains unchanged belongs to the instrument or background field.
- Nonuniform-box scaling. Increase while holding the other dimensions fixed. The positive x-face and negative y-face terms grow in proportion to , so their cancellation persists. Increase : both nonzero face contributions acquire the same factor. A missing length in one area breaks these tests and exposes a unit or geometry error.
- Topology boundary. A finite box can have field entering one side and leaving another while no field line endpoint lies inside it. The closed-surface sum tests all faces. A two-dimensional line plot does not specify the three-dimensional surface used for that sum.
- Convergence record. For each mesh, retain total flux, positive-face subtotal, negative-face subtotal, and propagated uncertainty. A decreasing numerical difference followed by a plateau at the uncertainty floor supports convergence. Oscillation or continued drift after refinement can indicate coordinate registration error, probe interpolation bias, or a changing source field.
- Correlations and local checks. A common probe-gain factor shifts many patches together and does not average away. Repeated independent noise can decrease with sampling, whereas a shared orientation offset rotates every normal component. For a worked map, compare the measured and modeled normal component at one point on each nonzero face, near the loop axis, and in the exterior return region. Report each residual in units of its combined uncertainty.
A map that passes the local component checks and the closed-surface convergence check supports both the measured field components and their topology. A field-line drawing alone provides neither numerical test.
At a selected surface patch, reduce the component comparison to a signed normalized residual,
Use the same normal orientation in the data reduction and the model. A sequence of residuals with one common sign across a face indicates gain, coordinate, or normal orientation bias; alternating residuals at the scale of patch spacing can indicate interpolation or probe-position error. The face residuals and the total closed-surface sum test different claims, so retain both in the map record.
Repeat the residual calculation after rotating the probe through the stated normal orientation and after reversing the source current. A residual that changes sign with the source belongs to the source-field comparison; one that remains fixed can arise from probe offset, background field, or coordinate registration. This paired record prevents a small closed-surface sum from being accepted when one face carries a systematic normal-component bias.
Keep the face areas and normal vectors at full recorded precision until the final flux sum. Rounding each contribution before cancellation can create an apparent nonzero flux or conceal a coordinate error. A reproducible calculation stores the unrounded face terms, their covariance assumptions, and the final rounded result separately.
Divergence and diagnostic checks
The statement has the same physical meaning in every coordinate system, but component derivatives carry geometric scale factors. In cylindrical coordinates,
An ideal long straight current has an external magnetic field with azimuthal component , no radial or axial component, and no dependence on . Every term in the cylindrical divergence is then zero. The field can vary strongly with radius and still have zero divergence because the variation is in a component tangent to cylindrical surfaces, not in a radial source component.
A long axial solenoid has a central approximation with nearly constant, , and negligible derivative over a short central interval. The divergence is again zero. Near a finite solenoid end, radial and axial components both occur. A field map must retain both terms; applying the central uniform-field approximation to the end region discards the radial return that completes the closed-line topology.
In spherical coordinates, a radial field component contributes
The dipole field combines radial and polar components whose derivatives cancel. Checking only would give a false nonzero divergence. This is a recurring calculation error: a curved coordinate basis changes direction from point to point, so the derivative of a vector field includes geometric effects as well as changes in the displayed component magnitude.
Coordinate choices should be documented with measured maps. A three-axis probe returns components in its own laboratory axes. Transform those components into cylindrical or spherical directions at every map point before applying a symmetry formula. A probe kept parallel to one laboratory axis does not directly measure , , or everywhere on a curved surface.
Local zero divergence and excluded model singularities
The differential law applies where the magnetic field model is regular. A filament current is an idealization with an undefined field at its centreline. An experiment has a conductor with finite radius, current distribution, insulation, and a finite probe standoff. Model the field outside the conductor with the appropriate symmetry expression and treat the interior using the stated current-density model when a surface passes through it.
The difference between an excluded singular line and an isolated magnetic charge is important. A mathematical azimuthal field around a filament wire has a line at which the exterior coordinate formula is undefined. Its field lines circle the line and have no normal flux through a small cylinder around it. A radial point-source field would instead carry outward normal flux through a small sphere. Ordinary current sources have the first topology; magnetic monopoles would have the second. Excluding a wire centreline from a numerical mesh does not create a magnetic charge.
A numerical divergence calculation needs a declared domain. Do not form a centred finite difference across an inaccessible wire, a metal boundary, or a large gap in the measurement grid. Mark that region as excluded, use one-sided derivatives only with their larger truncation uncertainty, or compute an integral flux over a surface that stays in the resolved domain. A small residual near an excluded region has less diagnostic value than a small residual in a fully sampled volume.
Interpreting a nonzero closed-surface residual
Three classes of cause can produce an estimated nonzero flux.
- Orientation or sign error: one or more patch normals point inward in the calculation, a probe polarity is reversed, or a coordinate transformation has an inconsistent handedness.
- Resolution or interpolation error: patch size is too large near a gradient, a curved surface is represented by flat areas too coarsely, or missing components are filled with an unsupported interpolation.
- Model or apparatus error: the mapped current path differs from the drawing, a nearby ferromagnetic object distorts the field, the source current drifts, or a probe is measuring outside its calibrated range.
Diagnose these causes in order. Reverse source current and recompute the current-odd map. A sign or coordinate error often remains tied to one patch orientation, while a genuine source field reverses consistently. Refine the surface mesh without changing the physical apparatus. A numerical residual that shrinks with patch size is a resolution issue. Finally, move or shield a suspected external object and repeat the same map with the same coordinate survey. A persistent spatially localized residual points to source geometry or material response.
Report the residual relative to the sum of absolute patch fluxes as well as in webers. A small number of webers can be significant for a weak source and insignificant beside large cancelling face fluxes. Quote the measurement uncertainty of the signed sum, including common calibration terms that correlate many patches. The comparison belongs to zero within that uncertainty interval; rounding the individual patch values before summation can create a false residual.
The reporting record should identify whether the test used a measured vector field, a model field, or a mixture. A model may satisfy zero divergence algebraically while the apparatus does not match its source geometry. A measured map can have a zero-compatible surface sum while still lacking enough resolution to establish the near-source field shape. Both checks are required when Gauss's law is used as a validation condition for an experimental magnetic map.
Closed-cylinder test for an azimuthal magnetic map
The surface-flux test differs from the Ampère circulation integral around the same wire. An Amperian circle has tangent element parallel to , so is nonzero around the circle. The Gaussian cylinder has area normals perpendicular to , so is zero. One geometric path tests circulation; the other tests flux. Switching the dot-product element changes the physical question.
An experimental map can verify the azimuthal direction before calculating either integral. Place a three-axis probe at several polar angles on one cylindrical ring. Transform each recorded vector into radial, azimuthal, and axial components. A well-aligned long-wire region has dominant azimuthal component and small radial and axial components within uncertainty. Repeat at several radii. The magnitude can change substantially between rings while the normal flux through each cylindrical surface remains zero.
Finite wires, bends, return leads, and nearby magnetic material modify the ideal map. The measured radial and axial components then need not vanish. A closed surface around a finite apparatus still has zero net magnetic flux, but some patches carry positive and negative contributions that must be summed. The all-zero individual contribution test applies only to the ideal azimuthal geometry. Stating that domain prevents a convenient long-wire result from being extended to a complete circuit without its return path.
Use the cylindrical test as an orientation calibration. Reverse current and verify that the measured azimuthal component reverses at every polar angle. A probe axis misregistration often appears as an apparent radial component that changes with angle in the instrument frame. Correct the coordinate transformation before interpreting that component as a physical violation of cylindrical symmetry. Then evaluate the signed closed-surface flux from the transformed vector map and compare it with its propagated uncertainty.
A data table for each ring lists polar angle, radial component, azimuthal component, axial component, probe orientation, and the uncertainty of each component. Plotting components against polar angle exposes systematic patterns that are invisible in a single magnitude trace. A constant axial offset can indicate a background field. A radial component that follows a sinusoid with polar angle can indicate a small offset between the probe rotation axis and the wire centreline. An irregular pattern concentrated near one angle can identify a return lead or a local piece of magnetic material.
The surface calculation should use the same angular samples that establish the component map. Associate each sample with a cylindrical patch area and with its outward radial normal. Sum the measured normal components with signed area weights. A separate end-cap scan provides any axial flux relevant for a finite cylindrical surface. This procedure carries the geometric distinction between circulation and flux into the measured-data analysis instead of leaving it as a symbolic identity.
Keep the wire-centre survey separate from the probe-coordinate survey. A displacement of the assumed cylindrical axis changes every radial normal and can create a coherent artificial flux residual even when the measured magnetic vectors are accurate. Refit the axis from a multi-angle scan, repeat the transformation, and record the change in the residual as a coordinate-system uncertainty. The revised surface normals must be used consistently on every sampled patch. The result then remains comparable across mesh refinements and repeated scans. All orientations require explicit archival.
╌╌ END ╌╌