5.3: The Divergence and Curl of B #
5.3.1: Straight-Line Currents #
The magnetic field of an infinite straight wire is shown in Fig 5.27 (the current is coming out of the page). At a glance, it is clear that this field has a nonzero curl (something you’ll never see in an electrostatic field); let’s calculate it.
According to Eq. 5.38, the integral of B around a circular path of radius s, centered at the wire, is
\[\oint \vec{B} \cdot \dd l = \oint \frac{\mu_0 I}{2 \pi s} = \frac{\mu_0 I}{2 \pi s } \oint \dd l = \mu_0 I\]Notice that the answer is independent of s; that’s because B decreases at the same rate as the circumference increases. In fact, it doesn’t have to be a circle; any old loop that encloses the wire would give the same answer. For if we use cylindrical coordinates \( (s, \phi, z) \), with the current flowing along the z axis, \( \vec{B} = (\mu_0 I / 2 \pi s) \vu{\phi} \) and \( \dd \vec{l} = \dd s , \vu{s} + s \dd \phi , \vu{\phi} + \dd z , \vu{z} \), so
\[\oint \vec{B} \cdot \dd l = \frac{\mu_0 I}{2 \pi} \oint \frac{1}{s} s \dd \phi = \frac{\mu_0 I}{2 \pi } \int _0 ^{2 \pi} \dd \phi = \mu_0 I\]This assumes that the loop encircles the wire exactly once; if it went around twice, then \( \phi \) would go from \( 0 \) to \( 4 \pi \), and if it didn’t enclose the wire at all, then \( \phi \) would go from \( \phi_1 \) to \( \phi_2 \) and back again, with \( \int \dd \phi = 0 \) (Fig 5.28).
Now suppose we have a bundle of straight wires. Each wire that passes through our loop contributes \( \mu_0 I \), and those outside contribute nothing (Fig 5.29). The line integral will then be
\[\oint \vec{B} \cdot \dd l = \mu_0 I_{enc} \tagl{5.44}\]where \( I_{enc} \) stands for the total current enclosed by the integration path. If the flow of charge is represented by a volume current density J, the enclosed current is
\[I_{enc} = \int \vec{J} \cdot \dd \vec{a} \tagl{5.45}\]with the integral taken over any surface bounded by the loop. Applying Stokes’ theorem to Eq 5.44, then
\[\int (\curl \vec{B}) \cdot \dd \vec{a} = \mu_0 \int \vec{J} \cdot \dd \vec{a}\]and hence
\[\curl \vec{B} = \mu_0 \vec{J}\]With minimal labor, we have actually obtained the general formula for the curl of B. But our derivation is seriously flawed by the restriction to infinite straight line currents (and combinations thereof). Most current configurations cannot be constructed out of infinite straight wires, and we have no right to assume that Eq. 5.46 applies to them. So the next section is devoted to the formal derivation of the divergence and curl of B, starting from the Biot-Savart law itself.
5.3.2: The Divergence and Curl of B #
The Biot-Savart law for the general case of a volume current reads
\[\vec{B}(\vec{r}) = \frac{\mu_0}{4 \pi} \int \frac{\vec{J}(r') \times \vu{\gr}}{\gr ^2} \dd \tau' \tagl{5.47} \]This formula gives the magnetic field at a point r = (x, y, z) in terms of an integral over the current distribution \( \vec{J} (x’, y’, z’) \) (Fig 5.30). It is best to be absolutely explicit at this stage:
- B is a function of (x, y, z)
- J is a function of (x’, y’, z')
- \( \vu{\gr} = (x - x’) \vu{x} + (y - y’) \vu{y} + (z - z’) \vu{z} \)
- \( \dd \tau’ = dx’ dy’ dz’ \)
The integration is over the primed coordinates; the divergence and the curl of B are with respect to the unprimed coordinates.
Applying the divergence to \( \eqref{5.47} \) we obtain
\[\div \vec{B} = \frac{\mu_0 }{4 \pi } \int \div \left( \vec{J} \times \frac{\vu{\gr}}{\gr^2} \right)\dd \tau' \tagl{5.48}\]With one of our product rules for divergences
\[\div \left( \vec{J} \times \frac{\vu{\gr}}{\gr^2} \right) = \frac{\vu{\gr}}{\gr^2} \cdot (\curl \vec{J}) - \vec{J} \cdot \left( \curl \frac{ \vu{\gr}}{\gr ^2} \right) \tagl{5.49}\]But \( \curl \vec{J} = 0 \) because J doesn’t depend on the unprimed variables, while \( \curl ( \vu{\gr} / \gr ^2) = 0 \) (we’ve already explicitly worked that in Chapter 1), so
\[\div \vec{B} = 0 \tagl{5.50}\]Evidently, the divergence of the magnetic field is zero.
Applying the curl to Eq 5.47, we obtain
\[\curl \vec{B} = \frac{\mu_0}{4 \pi} \int \curl \left( \vec{J} \times \frac{\vu{\gr}}{\gr ^2} \right) \dd \tau' \tagl{5.51}\]Again, our strategy is to expand the integrand, using the appropriate product rule - in this case one of those for curls
\[\curl \left( \vec{J} \times \frac{\vu{\gr}}{\gr^2} \right) = \vec{J} \left( \div \frac{\vu{\gr}}{\gr ^2} \right) - ( \vec{J} \cdot \grad) \frac{\vu{\gr}}{\gr^2} \tagl{5.52} \](I have dropped terms involving derivatives of J, because J does not depend on x, y, z.) The second term integrates to zero, as we’ll see in the next paragraph. The first term involves the divergence we were at pains to calculate in Chapter 1 (Eq. 1.100):
\[\div \left( \frac{\vu{\gr}}{\gr^2} \right) = 4 \pi \delta ^2(\gr) \tagl{5.53}\]Thus
\[\curl \vec{B} = \frac{\mu_0}{4 \pi} \int \vec{J}(r') 4 \pi \delta ^3 (\vec{r} - \vec{r'} \dd \tau' = \mu_0 \vec{J} (\vec{r})\]which confirms that Eq. 5.46 is not restricted to straight-line currents, but holds quite generally in magnetostatics.
To complete the argument, however, we must check that the second term in Eq 5.52 integrates to zero. Because the derivative acts only on \( \vu{\gr} / \gr ^2 \), we can switch from \( \grad \) to \( \grad’ \) at the cost of a minus sign
\[-(\vec{J} \cdot \grad) \frac{\vu{\gr}}{\gr^2} = (\vec{J} \cdot \grad' ) \frac{\vu{\gr}}{\gr^2} \tagl{5.54}\]The x component, in particular, is
\[(\vec{J} \cdot \grad') \left( \frac{x - x' }{\gr ^3} \right) = \grad' \cdot \left( \frac{(x - x')}{\gr ^3} \vec{J} \right) - \left( x - x' \gr ^3 \right)(\grad' \cdot \vec{J})\]Now, for steady currents the divergence of J is zero, so
\[\left( - (\vec{J} \cdot \grad) \frac{\vu{\gr}}{\gr^2} \right)_{x} = \grad' \cdot \left( \frac{(x - x')}{\gr ^3} \vec{J} \right)\]and therefore this contribution to the integral can be written
\[\int_{V} \grad' \cdot \left( \frac{(x - x')}{\gr ^3} \vec{J} \right) \dd \tau' = \oint_S \frac{(x - x')}{\gr^3} \vec{J} \cdot \dd \vec{a'} \tagl{5.55}\](The reason for switching from \( \grad \) to \( \grad’ \) was to allow this integration by parts).
But what region are we integrating over? Well, it’s the volume that appears in the Biot-Savart law (Eq. 5.47) - large enough, that is, to include all the current. You can make it bigger than that, if you like; \( \vec{J} = 0 \) out there anyway, so it will add nothing to the integral. The essential point is that on the boundary the current is zero (all current is safely inside) and hence the surface integral (Eq. 5.55) vanishes.
5.3.3: Ampere’s Law #
The equation for the curl of B,
\[\curl \vec{B} = \mu_0 \vec{J} \tagl{5.56}\]is called Ampere’s Law (in differential form). It can be converted to integral form by the usual device of applying one of the fundamental theorems - in this case Stokes’ theorem:
\[\int (\curl \vec{B}) \cdot \dd \vec{a} = \oint \vec{B} \cdot \dd \vec{l} = \mu_0 \int \vec{J} \cdot \dd \vec{a}\]Now, \( \int \vec{J} \cdot \dd \vec{a} \) is the total current passing through the surface (Fig. 5.31), which we call \( I_{enc} \) (the current enclosed by the Amperian loop). Thus
\[\oint \vec{B} \cdot \dd \vec{l} = \mu_0 I_{enc} \tagl{5.57}\]This is the integral version of Ampere’s law; it generalizes Eq 5.44 to arbitrary steady currents. Notice that Eq 5.57 inherits the sign ambiguity of Stokes’ theorem: which way around the loop am I supposed to go? And which direction through the surface corresponds to a “positive” current? The resolution, as always, is the right-hand rule: If the fingers of your right hand indicate the direction of integration around the boundary, then your thumb defines the direction of a positive current.
Just as the Biot-Savart law plays a role in magnetostatics that Coulomb’s law assumed in electrostatics, so Ampere’s plays the part of Gauss’s. In particular, for currents with appropriate symmetry, Ampere’s law in integral form offers a lovely and extraordinarily efficient way of calculating the magnetic field.
Example 5.7 #
We know the direction of B is “circumferential,” circling around the wire as indicated by the right-hand rule. By symmetry, the magnitude of B is constant around an Amperian loop of radius s, centered on the wire. So Ampere’s law gives
\[\oint \vec{B} \cdot \dd \vec{l} = B \oint dl = 2 \pi s B = \mu_0 I_{enc} = \mu_0 I\]or
\[B = \frac{\mu_0 I}{2 \pi s} \]This is the same answer we got before (Eq. 5.38), but it was waay easier to obtain this time.
Example 5.8 #
First of all, what is the direction of B? Could it have any x component? No: A glance at the Biot-Savart law (Eq. 5.42) reveals that B is perpendicular to K. Could it have a z component? No again. You could confirm this by noting that any vertical contribution from a filament at +y is canceled by the corresponding filament at - y. But there is a nicer argument: Suppose the field pointed away from the plane. By reversing the direction of the current, I could make it point toward the plane (in the Biot-Savart law, changing the sign of the current switches the sign of the field). But the z component of B cannot possibly depend on the direction of the current in the xy plane. (Think about it!) So B can only have a y component, and a quick check with your right hand should convince you that it points to the left above the plane and to the right below it.
With this in mind, we draw a rectangular Amperian loop as shown in Fig. 5.33, parallel to the yz plane and extending an equal distance above and below the surface. Applying Ampere’s law,
\[\oint \vec{B} \cdot \dd \vec{l} = 2 B l = \mu_0 I_{enc} = \mu_0 K l\](One Bl comes from the top segment and the other from the bottom), so \( B = (\mu_0 / 2) K \), or, more precisely
\[\vec{B} = \begin{cases} +(\mu_0 / 2) K \vu{y} \quad & \text{ for } z < 0 \\ - (\mu_0 / 2) K \vu{y} \quad & \text{ for } z > 0 \end{cases} \tagl{5.58}\]Notice that the field is independent of the distance from the plane, just like the electric field of a uniform surface charge.
Example 5.9 #
First of all, what is the direction of B? Could it have a radial component? No. For suppose \( B_s \) were positive; if we reversed the direction of the current, \( B_s \) would then be negative. But switching I is physically equivalent to turning the solenoid upside down, and that certainly should not alter the radial field. How about a “circumferential” component? No. For \( B_{\phi} \) would be constant around an Amperian loop concentric with the solenoid (Fig. 5.36), and hence
\[\oint \vec{B} \cdot \dd \vec{l} = B_{\phi} (2 \pi s) = \mu_0 I_{enc} = 0\]since the loop encloses no current.
So, the magnetic field of an infinite, closely wound solenoid runs parallel to the axis. From the right-hand rule, we expect that it points inside the solenoid and downward outside. Moreover, it certainly approaches zero as you go very far away. With this in mind, let’s apply Ampere’s law to the two rectangular loops in Fig 5.37. Loop 1 lies entirely outside the solenoid, with its sides at distances a and b from the axis:
\[\oint \vec{B} \cdot \dd \vec{l} = [ B(a) - B(b)] L = \mu_0 I_{enc} = 0\]so
\[B(a) = B(b)\]Evidently the field outside does not depend on the distance from the axis. But we agreed that it goes to zero for large s. It must therefore be zero everywhere! (This astonishing result can also be derived from the Biot-Savart law, of course, but it’s much more difficult. See Prob. 5.46.)
As for loop 2, which is half inside and half outside, Ampere’s law gives
\[\oint \vec{B} \cdot \dd \vec{l} = B L = \mu_0 I_{enc} = \mu_0 n I L\]where B is the field inside the solenoid. (The right side of the loop contributes nothing, since B = 0 out there.) Conclusion:
\[\vec{B} = \begin{cases} \mu_0 n I \vu{z} & \quad \text{ inside the solenoid } \\ 0 & \quad \text{ outside the solenoid } \end{cases} \tagl{5.59}\]Notice that the field inside is uniform - it doesn’t depend on the distance from the axis. In this sense the solenoid is to magnetostatics what the parallel-plate capacitor is to electrostatics: a simple device for producing strong uniform fields.
Like Gauss’s law, Ampere’s law is always true (for steady currents), but it is not always useful. Only when the symmetry of the problem enables you to pull B outside the integral \( \oint \vec{B} \cdot \dd \vec{l} \) can you calculate the magnetic field from Ampere’s law. When it does work, it’s by far the fastest method; when it doesn’t, you have to fall back on the Biot-Savart law. The current configurations that can be handled by Ampere’s law are
- Infinite straight lines (Ex 5.7)
- Infinite planes (Ex 5.8)
- Infinite solenoids (Ex 5.9)
- Toroids (Ex 5.10)
The last of these is a surprising and elegant application of Ampere’s law. As in Exs. 5.8 and 5.9, the hard part is figuring out the direction of the field (which we will now have done, once and for all, for each of the four geometries); the actual application of Ampere’s law takes only one line.
Example 5.10 #
According to the Biot-Savart law, the field at r due to the current element at r’ is
\[\dd \vec{B} = \frac{\mu_0 }{4 \pi} \frac{\vec{I} \cross \vu{\gr}}{\gr ^3} \dd l'\]We may as well put r in the xz plane (Fig 5.39), so its Cartesian components are (x, 0, z), while the source coordinates are
\[\vec{r'} = (s' \cos \phi', s' \sin \phi', z')\] Then \[\gr = (x - s' \cos \phi', -s' \sin \phi', z - z')\]Since the current has no \( \phi \) component, \( \vec{I} = I_s \vu{x} + I_z \vu{z} \), or (in Cartesian coordinates)
\[\vec{I} = (I_s \cos \phi', I_s \sin ' , I_z)\]Accordingly,
\[\vec{I} \cross \vec{\gr} = \begin{bmatrix} \vu{x} & \vu{y} & \vu{z} \\ I_s \cos \phi' & I_s \sin \phi' & I_z \\ (x - s' \cos \phi') & (- s' \sin \phi') & (z - z') \end{bmatrix} \\ = [ \sin \phi' (I_s (z - z') + s' I_z)] \vu{x} + [I_z (x - s' \cos \phi') - I_s \cos \phi' (z - z')] \vu{y} + [-I_s x \sin \phi']\vu{z}\]But there is a symmetrically situated current element at r’’, with the same \( s’ \) , the same \( \gr \), the same \( dl’ \), the same \( I_s \), and the same \( I_z \), but negative \( \phi’ \) (Fig 5.39). Because \( \sin \phi’ \) changes sign, the \( \vu{x} \) and \( \vu{z} \) contributions from \( \vu{r’} \) and \( \vu{r’’} \) cancel each other, leaving only a \( \vu{y} \) term. Thus the field at \( \vu{r} \) is in the \( \vu{y} \) direction, and in general the field points in the \( \vu{\phi} \) direction.
Now that we know the field is circumferential, determining its magnitude is simple: just apply Ampere’s law to a circle of radius s about the axis of the toroid
\[B 2 \pi s = \mu_0 I_{enc}\]and hence
\[\vec{B}(\vec{r}) = \begin{cases} \frac{\mu_0 N I}{2 \pi s} \vu{\phi} \quad & \text{ for points inside the coil} \\ 0 \quad & \text{ for points outside the coil} \end{cases} \tagl{5.60}\]where N is the total number of turns.
5.3.4: Comparison of Magnetostatics and Electrostatics #
The divergence and curl of the electrostatic field are
\[\begin{cases} \div \vec{E} = \frac{1}{\epsilon_0} \rho \quad & \text{(Gauss's law)}\\ \curl \vec{E} = 0 \quad & \text{(no name)} \end{cases}\]These are Maxwell’s equations for electrostatics. Together with the boundary condition \( \vec{E} \rightarrow 0 \) far from all charges, Maxwell’s equations determine the field, if the source charge density \( \rho \) is given; they contain essentially the same information as Coulomb’s law plus the principle of superposition. The divergence and curl of the magnetostatic field are
\[\begin{cases} \div \vec{B} = 0 \quad & \text{(no name)} \\ \curl \vec{B} = \mu_0 \vec{J} \quad & \text{(Ampere's Law)} \end{cases}\]These are Maxwell’s equations for magnetostatics. Again, together with the boundary condition \( \vec{B} \rightarrow 0 \) far from all currents, Maxwell’s equations determine the magnetic field; they are equivalent to the Biot-Savart law (plus superposition). Maxwell’s equations and the force law
\[\vec{F} = Q(\vec{E} + \vec{v} \cross \vec{B})\]constitute the most elegant formulation of electrostatics and magnetostatics.
The electric field diverges away from a (positive) charge; the magnetic field line curls around a current (Fig. 5.44). Electric field lines originate on positive charges and terminate on negative ones; magnetic field lines do not begin or end anywhere - to do so would require a nonzero divergence. They typically form closed loops or extend out to infinity. To put it another way, there are no point sources for B, as there are for E; there exists no magnetic analog to electric charge. This is the physical content of the statement \( \div \vec{B} = 0 \). Coulomb and others believed that magnetism was produced by magnetic charges (magnetic monopoles, as we would now call them), and in some older books you will still find references to a magnetic version of Coulomb’s law, giving the force of attraction or repulsion between them. It was Ampere who first speculated that all magnetic effects are attributable to electric charges in motion (currents). As far as we know, Ampere was right; nevertheless, it remains an open experimental question whether magnetic monopoles exist in nature (they are obviously pretty rare, or somebody would have found one), and in fact some recent elementary particle theories require them. For our purposes, though, B is divergenceless, and there are no magnetic monopoles. It takes a moving electric charge to produce a magnetic field, and it takes another moving electric charge to “feel” a magnetic field.
Typically, electric forces are enormously larger than magnetic ones. That’s not something intrinsic to the theory; it has to do with the sizes of the fundamental constants \( \epsilon_0 \) and \( \mu_0 \). In general, it is only when both the source charges and the test charge are moving at velocities comparable to the speed of light that the magnetic force approaches the electric force in strength. (Problems 5.13 and 5.17 illustrate this rule.) How is it, then, that we notice magnetic effects at all? The answer is that both in the production of a magnetic field (Biot-Savart) and in its detection (Lorentz), it is the current that matters, and we can compensate for a smallish velocity by pouring huge amounts of charge down the wire. Ordinarily, this charge would simultaneously generate so large an electric force as to swamp the magnetic one. But if we arrange to keep the wire neutral, by embedding in it an equal quantity of opposite charge at rest, the electric field cancels out, leaving the magnetic field to stand alone. It sounds very elaborate, but of course this is precisely what happens in an ordinary current carrying wire.