Skip to article frontmatterSkip to article content

Chapter 21 - Sources of magnetic field

21.1Overview

print("Here is a Python cell")
print("Another code cell with a second optional metadata syntax")

In this chapter, we develop the tools to model the magnetic field that is produced by an electric current. We will introduce the Biot-Savart Law, which is analoguous to Coulomb’s Law in that it can be used to calculate the magnetic field produced by any current. We will also introduce Ampère’s Law, which can be thought of as the analogue to Gauss’ Law, allowing us to easily determine the magnetic field when there is a high degree of symmetry.

21.2The Biot-Savart Law

The Biot-Savart law allows us to determine the magnetic field at some position in space that is due to an electric current. More precisely, the Biot-Savart law allows us to calculate the infinitesimal magnetic field, dBd\vec B, that is produced by a small section of wire, dld\vec l, carrying a current, II, such that dld\vec l is co-linear with the wire and points in the direction of the electric current:

dB=μ0I4πdl×r^r2\boxed{d\vec B = \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \hat r}{r^2}}

where r\vec r is the vector from the element of wire, dld\vec l, to the point where we would like to determine the magnetic field, as illustrated in Figure 1. μ0\mu_0 is a constant of proportionality called the “permeability of free space”, and has the value μ0=4π×107Tm/A\mu_0=4\pi \times 10^{-7} {\rm T\cdot m/A}.

The infinitesimal magnetic field, $d\vec B$, that is created by an infinitesimal section of wire, $d\vec l$, carrying current $I$. Note that the vector, $\vec r$, goes from $d\vec l$ to the point where we wish to calculate the field.

Figure 1:The infinitesimal magnetic field, dBd\vec B, that is created by an infinitesimal section of wire, dld\vec l, carrying current II. Note that the vector, r\vec r, goes from dld\vec l to the point where we wish to calculate the field.

The Biot-Savart Law has some similarities with the Coulomb Law to calculate the electric field, as the magnitude of the magnetic field decreases as the inverse of the square distance between the source and the field. However, it can only be expressed in differential form (i.e. as an infinitesimal) and it requires working in three dimensions because of the cross product. It is usually more convenient to use the Biot-Savart Law in the form:

dB=μ0I4πdl×rr3d\vec B = \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \vec r}{r^3}

where the unit vector r^\hat r was replaced by r/r\vec r/r.

The procedure for applying the Biot-Savart Law is as follows:

  1. Make a really good diagram, as you will have to include some 3D aspects.
  2. Choose an infinitesimal section of wire, dld\vec l.
  3. Determine the vector r\vec r.
  4. Determine the cross-product, dl×rd\vec l \times \vec r, which will point in the direction of the magnetic field from that infinitesimal section of wire.
  5. Write out the infinitesimal vector dBd\vec B, and determine its components.
  6. Think about symmetry! As you sum the dBd\vec B, will some components cancel? If yes, you do not need to do those integrals.
  7. Determine the total magnetic field, component by component, by summing (integrating) the components of dBd\vec B over the wire.

21.2.1Magnetic field from a straight current-carrying wire

In this section, we use the Biot-Savart Law to determine the magnetic field a distance, hh, from the centre of a finite straight wire of length LL, carrying current II, as illustrated in Figure 2.

Setting up the model to use the Biot-Savart Law to calculate the magnetic field a distance $h$ from the centre of a current-carrying wire of length $L$.

Figure 2:Setting up the model to use the Biot-Savart Law to calculate the magnetic field a distance hh from the centre of a current-carrying wire of length LL.

We start by choosing an infinitesimal element of wire, dld\vec l, a distance yy above the centre of the wire, as shown (we choose the origin to be located at the centre of the wire). The vector dld\vec l is thus given by:

dl=dly^d\vec l = dl\hat y

The vector, r\vec r, from dld\vec l to the point at which we would like to know the magnetic field is given by:

r=rcosθx^rsinθy^r=h2+y2=hcosθ\begin{align*} \vec r &= r\cos\theta\hat x -r\sin\theta\hat y\\ r &=\sqrt{h^2+y^2} =\frac{h}{\cos\theta} \end{align*}

The cross-product between dld\vec l and r\vec r is easily found with the right-hand rule to point into the page (corresponding to the negative zz direction). The magnitude of the cross-product is given by:

dl×r=dlrsinϕ||d\vec l \times \vec r||=dl r \sin\phi

where ϕ=π/2+θ\phi=\pi/2+\theta is the angle between dld\vec l and r\vec r, so that sinϕ=cosθ\sin\phi=\cos\theta. The cross-product can thus be written in terms of θ as:

dl×r=dlrcosθz^d\vec l \times \vec r=-dl r \cos\theta \hat z

Note that we can also determine the cross-product algebraically instead of using the right-hand rule and the magnitude:

dl×r=(dly^)×(rcosθx^rsinθy^)=dlrcosθ(y^×x^)rdlsinθ(y^×y^)=dlrcosθz^\begin{align*} d\vec l \times \vec r &= (dl\hat y) \times (r\cos\theta\hat x -r\sin\theta\hat y)\\ &=dlr\cos\theta (\hat y \times\hat x) - rdl\sin\theta(\hat y \times \hat y)\\ &=-dlr\cos\theta \hat z \end{align*}

The infinitesimal magnetic field element, dBd\vec B, is given by:

dB=μ0I4πdl×rr3=μ0I4πdlcosθr2z^d\vec B = \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \vec r}{r^3}=-\frac{\mu_0 I}{4\pi}\frac{dl\cos\theta}{r^2}\hat z

Any segment along the wire will result in a magnetic field that is into the page (negative zz direction), thus there will be no cancellations due to any symmetries. We can now proceed to perform the integral.

We can use either θ or yy to label the wire elements and carry out the integration. We will choose to integrate over θ, requiring us to express dldl and rr in terms of θ (and constants), as those are the only quantities in dBd\vec B that depend on the position of dld\vec l. In order to express dldl in terms of dθd\theta, we first relate θ to yy, the position of the wire element:

y=htanθdl=dy=dydθdθ=hcos2θdθy = h\tan\theta\quad \to \quad dl = dy = \frac{dy}{d\theta}d\theta = \frac{h}{\cos^2\theta}d\theta

and rr is given by:

r=hcosθ1r2=cos2θh2\begin{align*} r=\frac{h}{\cos\theta}\quad \to \quad \frac{1}{r^2}&=\frac{\cos^2\theta}{h^2} \end{align*}

Putting this altogether into dBd\vec B:

dB=μ0I4πdlcosθr2z^=μ0I4π(hcos2θdθ)(cos2θh2)cosθz^=μ0I4πhcosθdθz^=dBzz^\begin{align*} d\vec B &=-\frac{\mu_0 I}{4\pi}\frac{dl\cos\theta}{r^2}\hat z\\ &= -\frac{\mu_0 I}{4\pi}\left(\frac{h}{\cos^2\theta}d\theta\right) \left( \frac{\cos^2\theta}{h^2} \right)\cos\theta\hat z\\ &=-\frac{\mu_0 I}{4\pi h}\cos\theta d\theta \hat z=dB_z\hat z \end{align*}

We define the angle, θ0\theta_0, to be the maximum amplitude of the angle θ when integrating over the wire (see Figure 2), so that we integrate θ from θ0-\theta_0 to +θ0+\theta_0:

Bz=θ0+θ0dBz=μ0I4πhθ0+θ0cosθdθ=μ0I4πh(2sinθ0)=μ0I2πhsinθ0\begin{align*} B_z&=\int_{-\theta_0}^{+\theta_0}dB_z\\ &= -\frac{\mu_0 I}{4\pi h} \int_{-\theta_0}^{+\theta_0}\cos\theta d\theta\\ &=-\frac{\mu_0 I}{4\pi h}(2\sin\theta_0)\\ &=-\frac{\mu_0 I}{2\pi h}\sin\theta_0 \end{align*}

Using the given dimensions:

sinθ0=L/2h2+L24\begin{align*} \sin\theta_0&=\frac{L/2}{\sqrt{h^2+\frac{L^2}{4}}}\\ \end{align*}

Thus, the magnetic field, B\vec B, a distance, hh, from the centre of a wire of length, LL, carrying current, II, in the positive yy direction is given by:

B=μ0I2πhL/2h2+L24z^(finite wire)\boxed{\vec B = -\frac{\mu_0 I}{2\pi h}\frac{L/2}{\sqrt{h^2+\frac{L^2}{4}}}\hat z}\quad\text{(finite wire)}

The magnetic field must be rotationally symmetric; that is, if the wire is vertical, the magnetic field at a distance hh must look the same regardless of the angle from which we view the vertical wire (we should always see the magnetic field going into the page at the point that we use in Figure 2). Thus, the magnetic field lines must form circles around the wire, as illustrated in Figure 3. Note that the direction of the magnetic field is given by the right-hand rule for axial vectors; when you align your thumb with the current, your fingers curl in the direction of the magnetic field.

The magnetic field from a current-carrying wire forms concentric circles centred on the wire.

Figure 3:The magnetic field from a current-carrying wire forms concentric circles centred on the wire.

It is of particular interest to investigate the limiting case of an infinitely long wire, in the limit of LL\to\infty, or equivalently, θ0π2\theta_0\to\frac{\pi}{2}. The latter is easiest to evaluate, since sinθ01\sin\theta_0\to 1. The magnitude of the magnetic field, B\vec B, a distance, hh, from an infinite wire carrying current, II, is given by:

B=μ0I2πh(infinite wire)\boxed{ B = \frac{\mu_0 I}{2\pi h}}\quad\text{(infinite wire)}

One can often make the approximation that the wire is infinite in length, when the distance, hh, is small compared to the length, LL, of the wire.

21.2.2Magnetic field from a circular current-carrying wire

In this section, we examine the magnetic field that is created by a circular current-carrying loop of wire. We can determine the shape of the magnetic field, by considering small sections as straight wires, with circular magnetic field lines around them. As we move closer to the centre of the ring, those fields sum together, as illustrated in Figure 4. Note that the magnetic field from a loop of current is identical to that from a bar magnet (as a bar magnet is, of course, a collection of current loops).

The magnetic field from a current-carrying loop of wire can be thought of as the sum of the fields from small straight sections of wire.

Figure 4:The magnetic field from a current-carrying loop of wire can be thought of as the sum of the fields from small straight sections of wire.

Below, we use the Biot-Savart Law to derive an expression for the magnitude of the magnetic field at a distance, hh, from the centre of a ring of radius, RR, along its axis of symmetry, when there is a current, II, in the ring. While the mathematics are much easier than the case for the straight wire, the challenge in this case is to visualize the calculation in three dimensions! Figure 5 shows the loop of current, as well as our choice of coordinate system (with the origin at the centre of the ring). In particular, we wish to calculate the magnetic field at a distance, hh, along the zz axis. The xx axis goes into the page.

Diagram to apply the Biot-Savart Law in order to determine the magnetic field along the symmetry axis of a ring carrying current, $I$. The $x$ axis goes into the page.

Figure 5:Diagram to apply the Biot-Savart Law in order to determine the magnetic field along the symmetry axis of a ring carrying current, II. The xx axis goes into the page.

In order to apply the Biot-Savart Law, we choose an element, dld\vec l, of wire at the top of the ring, as illustrated. At this position, the element, dld\vec l, points in the positive xx direction (into the page):

dl=dlx^d\vec l = dl \hat x

The vector, r\vec r, from the wire element to the point where we wish to determine the magnetic field is given by:

r=rsinθy^+rcosθz^\vec r = - r\sin\theta \hat y+r\cos\theta \hat z

and the angle θ will be the same for all wire elements along the ring. The cross-product, dl×rd\vec l \times \vec r, can be evaluated algebraically:

dl×r=(dlx^)×(rsinθy^+rcosθz^)=rdlsinθ(x^×y^)+rdlcosθ(x^×z^)=rdlsinθz^+rdlcosθ(y^)=rdlsinθz^rdlcosθy^\begin{align*} d\vec l \times \vec r &= (dl \hat x) \times ( - r\sin\theta \hat y+r\cos\theta \hat z)\\ &=-rdl\sin\theta (\hat x \times \hat y) + rdl\cos\theta (\hat x \times \hat z)\\ &=-rdl\sin\theta\hat z + rdl\cos\theta (-\hat y)\\ &=-rdl\sin\theta\hat z - rdl\cos\theta \hat y \end{align*}

so that the element of magnetic field, dBd\vec B, corresponding to that choice of dld\vec l, will lie in the yzy-z plane, as illustrated in Figure 5. Note that the vector dBd\vec B is perpendicular to the vector r\vec r (since it is the cross-product of r\vec r with another vector). The magnetic field element, dBd\vec B, is given by:

dB=μ0I4πdl×rr3=μ0I4πr3(rdlsinθz^rdlcosθy^)=μ0I4πr2(dlsinθz^dlcosθy^)=dBzz^+dByy^\begin{align*} d\vec B &= \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \vec r}{r^3}\\ &= \frac{\mu_0 I}{4\pi r^3}(-rdl\sin\theta\hat z - rdl\cos\theta \hat y )\\ &=\frac{\mu_0 I}{4\pi r^2}(-dl\sin\theta \hat z - dl\cos\theta \hat y)\\ &=dB_z\hat z + dB_y \hat y \end{align*}

As the wire element, dld\vec l, moves around the circle, the tip of the resulting magnetic field vector element traces a circle centred on the zz axis, as illustrated in Figure 6. Note that, in general, dBd\vec B will also have an xx component (the xx component was only 0 before because we chose dld\vec l to be at the top of the ring). When we sum together the magnetic field elements, the xx and yy components will cancel, so that we are left with the zz component.

As the wire element, $d\vec l$, moves along the ring, the tip of corresponding magnetic field element vector, $d\vec B$, describes a circle centred on the $z$ axis. Thus, only the (negative) $z$ component of $d\vec B$ will survive when these are all added together.

Figure 6:As the wire element, dld\vec l, moves along the ring, the tip of corresponding magnetic field element vector, dBd\vec B, describes a circle centred on the zz axis. Thus, only the (negative) zz component of dBd\vec B will survive when these are all added together.

The total magnetic field will be in the negative zz direction, as anticipated from Figure 4. Summing together the zz components of the infinitesimal magnetic fields:

dBz=μ0I4πr2dlsinθBz=dBz=μ0I4πr2dlsinθ\begin{align*} dB_z &= -\frac{\mu_0 I}{4\pi r^2}dl\sin\theta\\ B_z &= \int dB_z\\ &=-\int \frac{\mu_0 I}{4\pi r^2}dl\sin\theta \end{align*}

Note that in this case, both rr and θ are constant for all of the dld\vec l, allowing us to take them out of the integral. The integral is then just a sum of the dldl elements, which must add up to the circumference of the ring:

Bz=dBz=μ0I4πr2sinθ02πRdl=μ0I4πr2sinθ(2πR)=μ0I2r2Rsinθ\begin{align*} B_z &= \int dB_z\\ &= -\frac{\mu_0 I}{4\pi r^2}\sin\theta \int_0^{2\pi R} dl\\ &=-\frac{\mu_0 I}{4\pi r^2}\sin\theta (2\pi R)\\ &=-\frac{\mu_0 I}{2r^2}R\sin\theta \end{align*}

In terms of the variables that we are given:

r=R2+h2sinθ=Rr=RR2+h2\begin{align*} r &= \sqrt{R^2+h^2}\\ \sin\theta &=\frac{R}{r}=\frac{R}{\sqrt{R^2+h^2}}\\ \end{align*}
    B=μ0I2R2(R2+h2)32z^(field from a loop of current)\therefore\;\; \boxed{\vec B = -\frac{\mu_0 I}{2} \frac{R^2}{(R^2+h^2)^\frac{3}{2}} \hat z}\quad\text{(field from a loop of current)}

In this case, the math was relatively straightforward (no substitutions to evaluate the integral), however it is challenging to visualize the problem in three dimensions.

21.3Force between two current-carrying wires

Consider two infinite parallel straight wires, a distance hh apart, carrying upwards currents, I1I_1 and I2I_2, respectively, as illustrated in Figure 7.

Two parallel current-carrying wires will exert an attractive force on each other, if their currents are in the same direction.

Figure 7:Two parallel current-carrying wires will exert an attractive force on each other, if their currents are in the same direction.

The first wire will create a magnetic field, B1\vec B_1, in the shape of circles concentric with the wire. At the position of the second wire, the magnetic field B1B_1 is into the page, and has a magnitude:

B1=μ0I12πhB_1 = \frac{\mu_0 I_1}{2\pi h}

Since the second wire carries a current, I2I_2, upwards, it will experience a magnetic force, F2\vec F_2, from the magnetic field, B1B_1, that is towards the left (as illustrated in Figure 7 and determined from the right-hand rule). The magnetic force, F2\vec F_2, exerted on a section of length, ll, on the second wire has a magnitude given by:

F2=I2l×B1=I2lB1=μ0I2I1l2πhF_2 = I_2 ||\vec l \times \vec B_1||=I_2 l B_1 =\frac{\mu_0 I_2 I_1 l}{2\pi h}

where we used the fact that the angle between l\vec l and B\vec B is 90°90 {\rm \degree}. We expect, from Newton’s Third Law, that an equal and opposite force should be exerted on the first wire. Indeed, the second wire will create a magnetic field, B2\vec B_2, that is out of the page at the location of the first wire, with magnitude:

B2=μ0I22πhB_2 = \frac{\mu_0 I_2}{2\pi h}

This leads to a magnetic force, F1\vec F_1, exerted on the first wire, that points to the right (from the right-hand rule). On a section of length, ll, of the first wire, the magnetic force from the magnetic field, B2\vec B_2, has magnitude:

F1=I1l×B2=I1lB2=μ0I1I22πhF_1 = I_1 ||\vec l \times \vec B_2||=I_1 l B_2 =\frac{\mu_0 I_1 I_2}{2\pi h}

which does indeed have the same magnitude as the force exerted on the second wire. Thus, when two parallel wires carry current in the same direction, they exert equal and opposite attractive forces on each other.

The attractive force between two wires used to be the basis for defining the Ampère, the S.I. (base) unit for electric current. Before 2019, the Ampère was defined to be “that constant current which, if maintained in two straight parallel conductors of infinite length, of negligible circular cross-section, and placed one metre apart in vacuum, would produce between these conductors a force equal to 2×1017N2\times 10^{-17} {\rm N} per metre of length”. Recently, the definition was updated to be based on defining the Coulomb in such a way that the elementary charge has a numerical value of e=1.602176634×1019Ce=1.602176634\times 10^{-19} {\rm C}, and the Ampère corresponds to one Coulomb per second.

The force between two wires is a good system to understand how any physical quantity cannot depend on our choice of the right-hand to define cross-products. As mentioned in the previous chapter, any physical quantity, such as the direction of the force exerted on a wire, will always depend on two successive uses of the right hand. In this system, we first used the right-hand rule for axial vectors to determine the direction of the magnetic field from one of the wires. We then used the right-hand rule to determine the direction of the cross-product to determine the direction of the force on the other wire. You can verify that you get the same answer if you, instead, use your left-hand to define the direction of the magnetic field (which will be in the opposite direction), and then again for the cross-product. This also highlights that the magnetic field (and the electric field) is just a mathematical tool that we use to, ultimately, describe the motion of charges or compass needles.

21.4Ampère’s Law

Ampère’s Law is similar to Gauss’ Law, as it allows us to (analytically) determine the magnetic field that is produced by an electric current in configurations that have a high degree of symmetry. Ampère’s Law states:

Bdl=μ0Ienc\boxed{\oint \vec B \cdot d\vec l =\mu_0 I^{enc}}

where the integral on the left is a “path integral”, similar to how we calculate the work done by a force over a particular path. The circle sign on the integral means that this is an integral over a “closed” path; a path where the starting and ending points are the same. IencI^{enc} is the net current that crosses the surface that is defined by the closed path, often called the “current enclosed” by the path. This is different from Gauss’ Law, where the integral is over a closed surface (not a closed path, as it is here). In the context of Gauss’ Law, we refer to “calculating the flux of the electric field through a closed surface”; in the context of Ampère’s Law, we refer to “calculating the circulation of the magnetic field along a closed path”.

We apply Ampère’s Law in much the same way as we apply Gauss’ Law:

  1. Make a good diagram, identify symmetries.
  2. Choose a closed path over which to calculate the circulation of the magnetic field (see below for how to choose the path). The path is often called an “Amperian loop” (think “Gaussian surface”).
  3. Evaluate the circulation integral.
  4. Determine how much current is “enclosed” by the Amperian loop.
  5. Apply Ampère’s Law.

Similarly to Gauss’ Law, we need to choose the path (instead of the surface) over which we will evaluate the integral. The integral will be easy to evaluate if:

  1. The angle between B\vec B and dld\vec l is constant along the path, so that:
Bdl=Bdlcosθ=cosθBdl\oint \vec B \cdot d\vec l = \oint B dl \cos\theta = \cos\theta \oint B dl

where θ is the angle between B\vec B and dld\vec l.

  1. The magnitude of B\vec B is constant along the path, so that:
cosθBdl=Bcosθdl\cos\theta \oint B dl = B\cos\theta \oint dl

Choosing a path that meets these two conditions is only possible if there is a high degree of symmetry.

Consider an infinitely long straight wire, carrying current, II, out of the page, as illustrated in Figure 10. The magnetic field from the wire must look the same regardless of the angle from which we view the wire (“azimuthal symmetry”). Thus, the magnetic field must either form concentric circles around the wire (which we know is the case from the Biot-Savart Law) or it must be in the radial direction (pointing towards or away from the wire). These two possibilities are illustrated in Figure 10, and we will pretend, for now, that we do not know which is correct.

By symmetry, the magnetic field from a current-carrying infinite wire (illustrated with current coming out of the page), must either form concentric circles (left panel), or be in the radial direction (right panel). We know that the former (circles, left panel) is the correct choice. The dotted lines show "Ampèrian loops" that one can use to calculate the integral in Ampère's Law.

Figure 10:By symmetry, the magnetic field from a current-carrying infinite wire (illustrated with current coming out of the page), must either form concentric circles (left panel), or be in the radial direction (right panel). We know that the former (circles, left panel) is the correct choice. The dotted lines show “Ampèrian loops” that one can use to calculate the integral in Ampère’s Law.

In order to apply Ampère’s Law, we choose an Amperian loop (instead of a “Gaussian surface”). In the case of an infinite current-carrying wire, a circle that is concentric with the wire will meet the properties above, regardless of the two possible configurations of the magnetic field: with a circular Amperian loop, the angle between the magnetic field and the element dld\vec l is constant along the entire loop, and the magnitude of the magnetic field is constant along the loop. Our choice of loop is illustrated in Figure 11, where we have illustrated the magnetic field for the case where it forms concentric circles.

An Amperian loop that is a circle of radius, $h$, will allow us to determine the magnetic field at a distance, $h$, from an infinitely-long current-carrying wire.

Figure 11:An Amperian loop that is a circle of radius, hh, will allow us to determine the magnetic field at a distance, hh, from an infinitely-long current-carrying wire.

The circulation of the magnetic field along a circular path of radius, hh, is given by:

Bdl=Bdlcosθ=cosθBdl=Bcosθdl=Bcosθ(2πh)\oint \vec B \cdot d\vec l = \oint B dl \cos\theta = \cos\theta \oint B dl=B\cos\theta \oint dl=B\cos\theta (2\pi h)

where cosθ\cos\theta is 1 if the field forms circles (correct) or 0 if the field is radial (incorrect). We can now evaluate the current that is enclosed by the Amperian loop. The current that is enclosed is given by the net current that traverses the surface defined by the Amperian loop (in this case, a circle of radius hh). Since the loop encloses the entire wire, the enclosed current is simply II. Applying Ampère’s Law:

Bdl=μ0IencBcosθ(2πh)=μ0I\begin{align*} \oint \vec B \cdot d\vec l &=\mu_0 I^{enc}\\ B\cos\theta (2\pi h) &= \mu_0 I \end{align*}

At this point, it is clear that cosθ\cos\theta cannot be zero, since the right-hand side of the equation is not zero. We can thus conclude that the magnetic field must indeed make concentric circles, as we had previously determined. The magnitude of the magnetic field is given by:

B=μ0I2πhB = \frac{\mu_0 I}{2\pi h}

as we found previously with the Biot-Savart Law. Again, in analogy with Gauss’ Law, one needs to apply some knowledge of symmetry and argue in which direction the magnetic field should point, in order to use Ampère’s Law effectively.

21.4.1Interpretation of Ampère’s Law and vector calculus

In this section, we discuss Ampère’s Law in the context of vector calculus and provide a different perspective, mostly for informational purposes. The integral that appears in Ampère’s Law is called the “circulation” of the vector field, B\vec B:

Bdl\oint \vec B \cdot d\vec l

The circulation, as its name implies, is a measure of “how much rotation there is in the field”. To visualize this, imagine that the vector field is a velocity field for points in a fluid. Regions of the fluid where there are little whirlpools (so called “eddies”), correspond to regions of the field with non-zero circulation (the sign of the integral tells us the direction of rotation, using the right-hand rule for axial vectors). Examples of field with and without circulation are shown in Figure 14. You will recognize that static electric charges create electric fields with no circulation (right panel), whereas static currents create magnetic fields with circulation.

Examples of field with (left panel) and without (right panel) circulation, as evaluated along the closed loop shown with the dashed line.

Figure 14:Examples of field with (left panel) and without (right panel) circulation, as evaluated along the closed loop shown with the dashed line.

Ampère’s Law is thus a statement that an electric current will result in a field with a magnitude proportional to the current, that has some degree of rotation to it. The direction of rotation of that field corresponds to the right-hand rule for axial vectors as applied to the current (your thumb points in the direction of the current so that your fingers curl in the direction of the rotation of the associated field).

Circulation, as defined by the integral over a closed loop, is not a local property of the field, since it depends on what the field is doing as a whole over the path of the loop. Just as one can obtain a “local” version of Gauss’ Law, one can also obtain a local version of Ampère’s Law using techniques from advanced vector calculus (that are beyond the scope of this textbook).

Stokes’ theorem allows one to convert the circulation integral (a path integral on a closed loop) into a integral over the (open) surface that is defined by the loop:

CBdl=S(×B)dA\oint_C \vec B \cdot d\vec l = \int_S (\nabla \times \vec B) \cdot d\vec A

where the subscript CC indicates that the integral is over a one-dimensional path, whereas the subscript SS indicates that the integral is over a two-dimensional surface. The term, ×B\nabla \times \vec B, is called the “curl” of the magnetic field and is a local measure of the amount of rotation in the field. Applying Stokes’ theorem to Ampère’s Law yield:

Bdl=μ0IencS(×B)dA=μ0Ienc\begin{align*} \oint \vec B \cdot d\vec l &= \mu_0 I^{enc}\\ \int_S (\nabla \times \vec B) \cdot d\vec A &= \mu_0 I^{enc}\\ \end{align*}

Note that we can also write the current, IencI^{enc}, that is enclosed by the loop as the integral of the current density, j\vec j, over the surface defined by the loop:

Ienc=SjdAI^{enc}=\int _S \vec j \cdot d\vec A

Thus, we can write Ampère’s Law with integrals over the same surface on either side of the equation, implying that the integrands must be the same:

S(×B)dA=μ0SjdA\int_S (\nabla \times \vec B) \cdot d\vec A = \mu_0 \int _S \vec j \cdot d\vec A\\
    ×B=μ0j\therefore\;\;\boxed{ \nabla \times \vec B = \mu_0 \vec j}

This last equation now relates a local property (current density) to the magnetic field at that point, and is the usual form in which Ampère’s Law is presented (the so-called “differential form”, rather than the “integral form”).

The curl of the magnetic field, ×B\nabla \times \vec B, is a vector that is given by the following:

×B=(BzyByz)x^+(BxzBzx)y^+(ByxBxy)z^\nabla \times \vec B = \left(\frac{\partial B_z}{\partial y}-\frac{\partial B_y}{\partial z}\right)\hat x + \left(\frac{\partial B_x}{\partial z}-\frac{\partial B_z}{\partial x}\right)\hat y+\left(\frac{\partial B_y}{\partial x}-\frac{\partial B_x}{\partial y}\right)\hat z

and the name “curl” is chosen because this is a measure of the amount of rotation (curl) in the field. In differential form, Ampère’s Law can read as: “a current density will create a (magnetic) field that has non-zero curl”.

Since Ampère’s Law in differential form is a vector equation (both sides are vectors), it really corresponds to three equations in Cartesian coordinates, one per component. For example, the xx component of the equation is a “partial differential equation” for the yy and zz components of the magnetic field:

(BzyByz)=μ0jx\begin{align*} \left(\frac{\partial B_z}{\partial y}-\frac{\partial B_y}{\partial z}\right) &=\mu_0j_x \end{align*}

that is in general difficult to solve without a computer (and all three equations are required, as these are “coupled”, since a given component of the magnetic field appears in two of three equations).

21.5Solenoids and toroids

In order to create strong magnetic fields, the most practical method is to combine many loops of current together into a “solenoid” (a coil). Electromagnets function on this principle and are ubiquitous in our lives. Figure 15 shows the magnetic field from a single loop of current.

The magnetic field from a single loop of current.

Figure 15:The magnetic field from a single loop of current.

When several loops of current are brought close together, as in Figure 16, the magnetic field inside the solenoid becomes uniform, and the magnetic field just outside the solenoid approaches zero.

As multiple loops of current are brought together to form a solenoid, the magnetic field inside the solenoid becomes uniform and the field outside the solenoid approaches zero.

Figure 16:As multiple loops of current are brought together to form a solenoid, the magnetic field inside the solenoid becomes uniform and the field outside the solenoid approaches zero.

We can use Ampère’s Law to determine the strength of the magnetic field inside of a solenoid, under the assumption that the magnetic field is uniform in the volume of the solenoid and zero just outside. Consider a solenoid with current, II, going through it, that contains nn loops per unit length. In order to determine the magnetic field, BB, inside of the solenoid, consider the rectangular Amperian loop, abcdabcd, of length, ll, illustrated in Figure 17.

We use Ampère's Law with a rectangular loop to evaluate the strength of the magnetic field inside a solenoid.

Figure 17:We use Ampère’s Law with a rectangular loop to evaluate the strength of the magnetic field inside a solenoid.

In order to evaluate the circulation of the magnetic field around the loop, abcdabcd, we divide the loop up into segments, and evaluate the path integral (Bdl\int \vec B \cdot d\vec l) over each segment, then add those together to obtain the integral over the closed path:

abcdBdl=abBdl+bcBdl+cdBdl+daBdl\oint_{abcd} \vec B \cdot d\vec l = \int_a^b \vec B \cdot d\vec l + \int_b^c \vec B \cdot d\vec l + \int_c^d \vec B \cdot d\vec l + \int_d^a \vec B \cdot d\vec l

Over each segment, the vector dld\vec l will be parallel to that segment. Only the last term is non-zero. The integrals over the segments abab and cdcd are zero because the magnetic field is perpendicular to dld\vec l over those segments (so the scalar product is zero). The integral over the segment bcbc is zero because the magnetic field is zero just outside the solenoid. The integral over the last segment, where dld\vec l and B\vec B are parallel, is simply given by:

abcdBdl=daBdl=Bdadl=Bl\begin{align*} \oint_{abcd} \vec B \cdot d\vec l &= \int_d^a \vec B \cdot d\vec l\\ &= B \int_d^a dl\\ &= Bl \end{align*}

since the length of the segment is ll, and the magnetic field is constant in magnitude.

In order to apply Ampère’s Law, we must determine the current that is enclosed by our Amperian loop. Since the rectangular loop has a length, ll, it will enclose N=nlN=nl loops of current, II, since there are nn loops per unit length. Thus the enclosed current is Ienc=nlII^{enc}=nlI. Applying Ampère’s Law, we find the magnetic field inside a solenoid:

Bdl=μ0IencBl=μ0nIl\begin{align*} \oint \vec B \cdot d\vec l &=\mu_0 I^{enc}\\ Bl &= \mu_0 nIl\\ \end{align*}
    B=μ0nI(Field inside a solenoid)\therefore\;\; \boxed{B = \mu_0 nI}\quad \text{(Field inside a solenoid)}

which does not depend on our (arbitrary) choice of making an Amperian loop with an arbitrary length of ll. In practice, when solenoids are used as electromagnets, they are typically filled with a ferromagnetic material, which will magnetise when there is a current, resulting in a stronger magnetic field. This is usually done by winding a wire around an iron rod.

Note that if we extend the Amperian loop so that the bottom segment is also outside the solenoid, as in Figure 18, it is easy to show that the magnetic field immediately outside of the solenoid must be zero. Indeed, in this case, there are an equal number of currents coming out of the page as there are going into the page, so that the net current that is enclosed by the Amperian loop (the net current that crosses the plane of the loop) is identically zero, so that the circulation must be zero, implying that the magnetic field is zero just outside the solenoid.

By extending the Amperian loop to both sides of the solenoid, we conclude that the magnetic field just outside the solenoid must be zero, because the net current enclosed is zero.

Figure 18:By extending the Amperian loop to both sides of the solenoid, we conclude that the magnetic field just outside the solenoid must be zero, because the net current enclosed is zero.

A toroid can be thought of as a solenoid that has been bent into the shape of a circle (or rather, a torus), as illustrated in Figure 19. Inside the toroid, the magnetic field forms concentric circles (not shown).

An Amperian loop of radius $r$ to determine the magnetic field inside of a toroid. Note that the magnetic field everywhere outside the toroid must be zero (think of the current enclosed by Amperian loops).

Figure 19:An Amperian loop of radius rr to determine the magnetic field inside of a toroid. Note that the magnetic field everywhere outside the toroid must be zero (think of the current enclosed by Amperian loops).

Again, we can use Ampère’s Law to determine the strength of the magnetic field inside the toroid. Consider the circular Amperian loop of radius rr that is illustrated in Figure 19. Since the magnetic field is parallel to the Amperian loop everywhere along the loop, and the magnetic field does not change magnitude (by symmetry), the circulation is given by:

Bdl=B(2πr)\begin{align*} \oint \vec B \cdot d\vec l &= B (2\pi r) \end{align*}

If the toroid contains NN loops of current, then the enclosed current is given by Ienc=NII^{enc}=NI, since the Amperian loop include NN times the current II coming out of the page. Ampère’s Law thus gives the magnitude of the magnetic field as:

Bdl=μ0IencB(2πr)=μ0NIB=μ0NI2πr\begin{align*} \oint \vec B \cdot d\vec l &=\mu_0 I^{enc}\\ B (2\pi r) &= \mu_0 NI\\ \therefore B&=\frac{\mu_0 NI}{2\pi r} \end{align*}

which decreases in magnitude with increasing radius, as long as we are inside the toroid. It is easy to show, by using Amperian loops that are either smaller or bigger than the toroid, that the magnetic field everywhere outside of the toroid is exactly zero (as those Amperian loops will enclose no net current). In a toroid, the magnetic field lines form closed circles. For a solenoid, there must exist a magnetic field somewhere outside the solenoid, in order for the field lines inside the solenoid to close. We can usually ignore these if the solenoid is long, as the field outside will be very weak, and very close to zero very close the solenoid (as we showed with Ampère’s Law above).

21.6Summary

Magnetic fields are created by moving charges. The Biot-Savart Law allows us to determine the infinitesimal magnetic field, dBd\vec B, that is produced by the current, II, flowing in an infinitesimal section of wire, dld\vec l:

dB=μ0I4πdl×r^r2d\vec B = \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \hat r}{r^2}

where μ0\mu_0 is a constant called the permeability of free space. The vector r\vec r points from the wire element, dld\vec l, to the point at which we want to determine the magnetic field. In order to determine the magnetic field from a finite wire, one must sum (integrate) the contributions that come from each section of wire. It is often easier to work with the Biot-Savart law written without the unit vector, r^\hat r:

dB=μ0I4πdl×rr3d\vec B = \frac{\mu_0 I}{4\pi}\frac{d\vec l\times \vec r}{r^3}

The magnetic field at a distance, hh, from an infinitely long wire carrying current, II, is given by:

B=μ0I2πh\begin{align*} B&=\frac{\mu_0 I}{2\pi h} \end{align*}

The magnetic field from a straight current-carrying wire forms concentric circles centred around the wire. The direction of the magnetic field is given by the right-hand rule for axial vectors; with the thumb pointing in the direction of current, the fingers curl in the direction of the magnetic field.

The magnitude of the magnetic field, a distance, hh, from the centre of a circular loop of wire with radius, RR, carrying current, II, along the axis of symmetry of the loop is given by:

B=μ0I2R2(R2+h2)32B=\frac{\mu_0 I}{2} \frac{R^2}{(R^2+h^2)^\frac{3}{2}}

The direction of the magnetic field can also be found using the right-hand rule for axial currents. In this case, if your fingers curl in the direction of the current loop, your thumb points in the same direction as the magnetic field at the centre of the loop.

Two parallel wires carrying currents, I1I_1 and I2I_2, separated by a distance, hh, will exert equal and opposite forces on each other with a magnitude:

F=μ0I1I22πhF = \frac{\mu_0I_1I_2}{2\pi h}

The force is attractive if the two currents flow in the same direction and repulsive otherwise.

Ampère’s Law is the magnetism analogue to Gauss’ Law. Just like Gauss’ Law, it requires a high degree of symmetry to be applied analytically, although it is always valid. Ampère’s Law relates the circulation of the magnetic field around a closed path to the current enclosed by that path:

Bdl=μ0Ienc\oint \vec B \cdot d\vec l =\mu_0 I^{enc}

In order to apply Ampère’s Law, we must first choose an Amperian loop over which to compute the closed path integral (instead of choosing a Gaussian surface to calculate the flux of the electric field on a closed surface). The circulation integral will be straightforward to evaluate if:

  1. The angle between B\vec B and dld\vec l is constant along the path, so that:
Bdl=Bdlcosθ=cosθBdl\begin{align*} \oint \vec B \cdot d\vec l &= \oint B dl \cos\theta\\ &= \cos\theta \oint B dl \end{align*}

where θ is the angle between B\vec B and dld\vec l.

  1. The magnitude of B\vec B is constant along the path, so that:
cosθBdl=Bcosθdl\cos\theta \oint B dl = B\cos\theta \oint dl

The current enclosed, IencI^{enc}, corresponds to the net current that crosses the surface that is defined by the Amperian loop (a closed path always defines a surface).

Ampère’s Law is straightforward to use in situations with a high degree of symmetry, such as infinitely long wires carrying current.

Solenoids are formed by combining many loops of current together, in order to form a strong and uniform magnetic field. The magnetic field inside of a solenoid has a magnitude of:

B=μ0nIB=\mu_0nI

where, II, is the current in the solenoid, and nn, is the number of loops per unit length in the solenoid. The magnetic field just outside of a solenoid is zero, and generally, the magnetic field is negligible outside of a solenoid.

A toroid is formed by bending a solenoid into a circle to form a torus. The magnetic field lines inside of a toroid form concentric circles. The magnetic field decreases with radius inside of a toroid and is identically zero everywhere outside a toroid.

21.7Thinking about the material

21.8Sample problems and solutions

21.8.1Problems

21.8.2Solutions