# Faraday’s law and the Biot-Savart law

References: Griffiths, David J. (2007), Introduction to Electrodynamics, 3rd Edition; Pearson Education – Problem 7.19.

As an example of the analogy between Faraday’s law and Ampère’s law, suppose we have a toroidal solenoid with inner radius ${a}$, width ${w}$ and height ${h}$, where both ${w}$ and ${h}$ are much less than ${a}$. The solenoid has ${N}$ turns in total, and carries a current ${I}$ that is increasing at the constant rate of ${\dot{I}=k}$. The magnetic field inside the solenoid is given by Griffiths in his example 5.10 and is

$\displaystyle B=\frac{\mu_{0}NI}{2\pi r} \ \ \ \ \ (1)$

where ${r}$ is the radial distance. In our case we can approximate ${r}$ by the constant ${a}$ since the torus is very thin compared to its radius, so we get

 $\displaystyle B$ $\displaystyle \approx$ $\displaystyle \frac{\mu_{0}NI}{2\pi a}\ \ \ \ \ (2)$ $\displaystyle \Phi$ $\displaystyle \approx$ $\displaystyle \frac{\mu_{0}NIhw}{2\pi a} \ \ \ \ \ (3)$

With this approximation, the change in flux is

$\displaystyle \frac{d\Phi}{dt}=\frac{\mu_{0}Nkhw}{2\pi a} \ \ \ \ \ (4)$

Since the magnetostatic case and the Faraday case are mathematically equivalent (provided there is no free charge), we can use the Biot-Savart law to calculate the electric field generated by a steady change in magnetic flux if we replace ${\mathbf{J}}$ by ${-\frac{1}{\mu_{0}}\frac{\partial\mathbf{B}}{\partial t}}$, or, in the case of a linear current in the magnetostatic case, we replace ${I}$ by ${-\frac{1}{\mu_{0}}\frac{\partial\Phi}{\partial t}}$.

For example, we can find the electric field at a point on the axis of the torus by using the Biot-Savart law:

$\displaystyle \mathbf{E}=-\frac{1}{4\pi}\frac{\partial\Phi}{\partial t}\int\frac{d\boldsymbol{\ell}^{\prime}\times\left(\mathbf{r}-\mathbf{r}'\right)}{\left|\mathbf{r}-\mathbf{r}'\right|^{3}} \ \ \ \ \ (5)$

Griffiths works this out in his example 5.6, and the derivation goes like this: the line segment ${d\boldsymbol{\ell}^{\prime}}$ is always in the ${xy}$ plane and is tangent to the torus. The vector ${\mathbf{r}-\mathbf{r}'}$ points from a point on the torus to a point on the ${z}$ axis, so it is always perpendicular to ${d\boldsymbol{\ell}^{\prime}}$. The cross product ${d\boldsymbol{\ell}^{\prime}\times\left(\mathbf{r}-\mathbf{r}'\right)}$ makes a constant angle ${\theta}$ with the ${z}$ axis, and ${\theta}$ is also the angle between ${\mathbf{r}-\mathbf{r}'}$ and the ${xy}$ plane. By symmetry, any ${x}$ and ${y}$ components of the cross product will cancel out in the integration, so we’re left with only the ${z}$ component, which is ${\left|\mathbf{r}-\mathbf{r}'\right|\cos\theta d\ell}$. Furthermore, the magnitude of ${\mathbf{r}-\mathbf{r}'}$ is always the same, and is ${\left|\mathbf{r}-\mathbf{r}'\right|=\sqrt{a^{2}+z^{2}}}$, and ${\cos\theta=a/\sqrt{a^{2}+z^{2}}}$, so

$\displaystyle \int\frac{d\boldsymbol{\ell}^{\prime}\times\left(\mathbf{r}-\mathbf{r}'\right)}{\left|\mathbf{r}-\mathbf{r}'\right|^{3}}=2\pi a\cos\theta\frac{\sqrt{a^{2}+z^{2}}}{\left(a^{2}+z^{2}\right)^{3/2}}\hat{\mathbf{z}}=\frac{2\pi a^{2}}{\left(a^{2}+z^{2}\right)^{3/2}}\hat{\mathbf{z}} \ \ \ \ \ (6)$

and the electric field is then

$\displaystyle \mathbf{E}=-\frac{\partial\Phi}{\partial t}\frac{a^{2}}{2\left(a^{2}+z^{2}\right)^{3/2}}\hat{\mathbf{z}}=-\frac{\mu_{0}Nkhw}{4\pi}\frac{a}{\left(a^{2}+z^{2}\right)^{3/2}}\hat{\mathbf{z}} \ \ \ \ \ (7)$

# Average magnetic field within a sphere

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.57.

We worked out the average electric field at the centre of a sphere earlier, so can we do something similar for the average magnetic field? Suppose we are given a steady current density within the sphere.

The starting point is the definition of the average field:

$\displaystyle \mathbf{B}_{av}=\frac{3}{4\pi R^{3}}\int_{V}\mathbf{B}d^{3}\mathbf{r} \ \ \ \ \ (1)$

We can write this in terms of the vector potential and then in terms of the current density:

 $\displaystyle \frac{3}{4\pi R^{2}}\int_{V}\mathbf{B}d^{3}\mathbf{r}$ $\displaystyle =$ $\displaystyle \frac{3}{4\pi R^{3}}\int_{V}\nabla\times\mathbf{A}d^{3}\mathbf{r}\ \ \ \ \ (2)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -\frac{3}{4\pi R^{3}}\int_{A}\mathbf{A}\times d\mathbf{a}\ \ \ \ \ (3)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -\frac{3\mu_{0}}{16\pi^{2}R^{3}}\int_{V}\int_{A}\frac{\mathbf{J}\left(\mathbf{r}\right)}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}\times d\mathbf{a}d^{3}\mathbf{r} \ \ \ \ \ (4)$

In the second line we used the vector identity ${\int_{V}\nabla\times\mathbf{A}d^{3}\mathbf{r}=-\int_{A}\mathbf{A}\times d\mathbf{a}}$ and in line 3 we used the definition of the vector potential.

We are now faced with a surface integral and a volume integral. We can do the surface integral first, but we need to be clear about which coordinates are which. If we do the surface integral first, then we are choosing a particular volume element ${d^{3}\mathbf{r}}$ and holding it constant while we integrate over the surface. That is, the observation point ${\mathbf{r}}$ points to the volume element and the source point ${\mathbf{r}^{\prime}}$ points to the surface element. This is why we’ve explicitly stated the dependence of ${\mathbf{J}\left(\mathbf{r}\right)}$ since it depends on the volume element, and not the surface element.

The only term containing ${\mathbf{r}^{\prime}}$ is therefore the ${\frac{1}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}}$ factor, so the integral we need to do is ${\int_{A}\frac{1}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}d\mathbf{a}}$. Since ${\mathbf{r}}$ is fixed, we can point it along the ${z}$ axis, making ${\theta}$ the angle between ${\mathbf{r}}$ and ${\mathbf{r}^{\prime}}$. Also, since ${\mathbf{r}^{\prime}}$ always points to a surface element, its magnitude is always ${R}$. We therefore have

$\displaystyle \frac{1}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}=\frac{1}{\sqrt{r^{2}+R^{2}-2rR\cos\theta}} \ \ \ \ \ (5)$

The surface element ${d\mathbf{a}}$ always points radially outward since it’s on the surface of a sphere, so by symmetry the integral over the ${x}$ and ${y}$ components of ${d\mathbf{a}}$ will cancel out and we’re left with only the ${z}$ component, which is ${\cos\theta\left|d\mathbf{a}\right|=R^{2}\sin\theta\cos\theta d\theta d\phi}$. The integral we must do is thus

$\displaystyle \int_{A}\frac{1}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}d\mathbf{a}=R^{2}\hat{\mathbf{z}}\int_{0}^{\pi}\int_{0}^{2\pi}\frac{\sin\theta\cos\theta d\theta d\phi}{\sqrt{r^{2}+R^{2}-2rR\cos\theta}} \ \ \ \ \ (6)$

Using software, we find that

$\displaystyle \int\frac{\sin\theta\cos\theta d\theta}{\sqrt{r^{2}+R^{2}-2rR\cos\theta}}=\frac{1}{3}{\frac{\sqrt{{r}^{2}+{R}^{2}-2\, rR\cos\left(\theta\right)}\left({r}^{2}+{R}^{2}+rR\cos\left(\theta\right)\right)}{{r}^{2}}} \ \ \ \ \ (7)$

Evaluating the limits requires specifying whether ${R}$ is larger or smaller than ${r}$. If we’re interested in currents within the sphere, then ${R>r>0}$ and we have

$\displaystyle R^{2}\hat{\mathbf{z}}\int_{0}^{\pi}\int_{0}^{2\pi}\frac{\sin\theta\cos\theta d\theta d\phi}{\sqrt{r^{2}+R^{2}-2rR\cos\theta}}=\frac{4}{3}\pi r\hat{\mathbf{z}} \ \ \ \ \ (8)$

Plugging this back into the average field formula above we get

$\displaystyle \mathbf{B}_{av}=-\frac{\mu_{0}}{4\pi R^{3}}\int_{V}\mathbf{J}\times\mathbf{r}d^{3}\mathbf{r} \ \ \ \ \ (9)$

We can write this in terms of the magnetic dipole moment as follows:

$\displaystyle \mathbf{B}_{av}=\frac{2\mu_{0}}{4\pi R^{3}}\mathbf{m} \ \ \ \ \ (10)$

If we look at currents outside the sphere, then ${R when we evaluate the limits on the integral above, giving

$\displaystyle R^{2}\hat{\mathbf{z}}\int_{0}^{\pi}\int_{0}^{2\pi}\frac{\sin\theta\cos\theta d\theta d\phi}{\sqrt{r^{2}+R^{2}-2rR\cos\theta}}=\frac{2R^{3}}{3r^{2}}\hat{\mathbf{z}} \ \ \ \ \ (11)$

Plugging this into the average field formula we get

$\displaystyle \mathbf{B}_{av}=-\frac{\mu_{0}}{4\pi}\int_{V}\frac{\mathbf{J}\times\mathbf{r}}{r^{3}}d^{3}\mathbf{r} \ \ \ \ \ (12)$

Remember that ${\mathbf{r}}$ points from the centre to the volume element, so it is the negative of the vector ${\mathbf{r}_{c}}$ from the volume element to the centre. In this form we get

$\displaystyle \mathbf{B}_{av}=\frac{\mu_{0}}{4\pi}\int_{V}\frac{\mathbf{J}\times\mathbf{r}_{c}}{r_{c}^{3}}d^{3}\mathbf{r} \ \ \ \ \ (13)$

This is just the volume form of the Biot-Savart law for calculating the field at the centre of the sphere thus for currents outside the sphere, the average of their field over the sphere is equal to the field produced at the centre of the sphere.

# Force between current loops: Newton’s third law

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.49.

We can write the force on one current loop due to a second current loop in a symmetric form by combining the Biot-Savart law and Lorentz force law. The force on loop 1 due to loop 2 is

$\displaystyle \mathbf{F}_{1}=I_{1}\oint d\mathbf{l}_{1}\times\mathbf{B}_{2} \ \ \ \ \ (1)$

The magnetic field produced by loop 2 at a point ${\mathbf{r}_{1}}$ on loop 1 is

$\displaystyle \mathbf{B}_{2}=\frac{\mu_{0}I_{2}}{4\pi}\oint\frac{d\mathbf{l}_{2}\times\left(\mathbf{r}_{1}-\mathbf{r}_{2}\right)}{\left|\mathbf{r}_{1}-\mathbf{r}_{2}\right|^{3}} \ \ \ \ \ (2)$

If we define ${\mathbf{r}\equiv\mathbf{r}_{1}-\mathbf{r}_{2}}$, we can substitute this field into the force integral to get

 $\displaystyle \mathbf{F}_{1}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I_{1}I_{2}}{4\pi}\oint\oint\frac{d\mathbf{l}_{1}\times\left[d\mathbf{l}_{2}\times\mathbf{r}\right]}{r^{3}}\ \ \ \ \ (3)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I_{1}I_{2}}{4\pi}\oint\oint\frac{d\mathbf{l}_{2}\left(d\mathbf{l}_{1}\cdot\mathbf{r}\right)-\mathbf{r}\left(d\mathbf{l}_{1}\cdot d\mathbf{l}_{2}\right)}{r^{3}}\ \ \ \ \ (4)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I_{1}I_{2}}{4\pi}\oint\oint\frac{d\mathbf{l}_{2}\left(d\mathbf{l}_{1}\cdot\hat{\mathbf{r}}\right)-\hat{\mathbf{r}}\left(d\mathbf{l}_{1}\cdot d\mathbf{l}_{2}\right)}{r^{2}} \ \ \ \ \ (5)$

where we’ve used a vector identity in line 2.

Consider now the term ${d\mathbf{l}_{1}\cdot\hat{\mathbf{r}}}$. The ${d\mathbf{l}_{1}}$ is an increment along loop 1 while ${\mathbf{r}_{2}}$ is held constant. Thus ${d\mathbf{l}_{1}}$ is the change in ${\mathbf{r}}$ as we move a bit along loop 1. The dot product ${d\mathbf{l}_{1}\cdot\hat{\mathbf{r}}}$ is the component of this change that is parallel to ${\mathbf{r}}$; that is, it is the change in the magnitude (as opposed to the direction) of ${\mathbf{r}}$. We can therefore write

$\displaystyle d\mathbf{l}_{1}\cdot\hat{\mathbf{r}}=dr \ \ \ \ \ (6)$

The first term therefore becomes

$\displaystyle \frac{\mu_{0}I_{1}I_{2}}{4\pi}\oint d\mathbf{l}_{2}\oint\frac{dr}{r^{2}} \ \ \ \ \ (7)$

where we’ve taken ${d\mathbf{l}_{2}}$ outside the first integral since the point on loop 2 is held constant in the inner integral. The inner integral is zero, since we can split the closed loop into 2 parts, one from point ${\mathbf{a}}$ to point ${\mathbf{b}}$ and the other from ${\mathbf{b}}$ back to ${\mathbf{a}}$ by carrying along in the same direction around the loop. The first integral is

$\displaystyle \int_{\mathbf{a}}^{\mathbf{b}}\frac{dr}{r^{2}}=\frac{1}{r\left(\mathbf{a}\right)}-\frac{1}{r\left(\mathbf{b}\right)} \ \ \ \ \ (8)$

That is, it depends only on the value of ${r}$ at the endpoints and not on the path taken between them. The integral on the reverse path is therefore just the negative of the first integral, so the integral around the closed loop is zero. We therefore get for the force

$\displaystyle \mathbf{F}_{1}=-\frac{\mu_{0}I_{1}I_{2}}{4\pi}\oint\oint\frac{\hat{\mathbf{r}}\left(d\mathbf{l}_{1}\cdot d\mathbf{l}_{2}\right)}{r^{2}} \ \ \ \ \ (9)$

If we interchange the loops to find the force ${\mathbf{F}_{2}}$ on loop 2 due to loop 1, everything is the same except that ${\hat{\mathbf{r}}}$ becomes ${-\hat{\mathbf{r}}}$, so ${\mathbf{F}_{2}=-\mathbf{F}_{1}}$ which is an example of Newton’s third law (equal and opposite forces).

# Magnetic field of current loop – off axis field

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.48.

The magnetic field due to a circular current loop of radius ${R}$ and current ${I}$ a distance ${z}$ above the centre of the loop is (as given by Griffiths example 5.6):

$\displaystyle B=\frac{\mu_{0}IR^{2}}{2}\frac{1}{\left[R^{2}+z^{2}\right]^{3/2}} \ \ \ \ \ (1)$

The derivation of this was made easier by restricting our attention to points on the ${z}$ axis. In principle, it’s easy enough to find the field at any other point, but the integrals prove somewhat problematical. Suppose we take our observation point ${\mathbf{r}}$ to be in the ${yz}$ plane, so that

$\displaystyle \mathbf{r}=y\hat{\mathbf{y}}+z\hat{\mathbf{z}} \ \ \ \ \ (2)$

The loop lies in the ${xy}$ plane, so

 $\displaystyle \mathbf{r}^{\prime}$ $\displaystyle =$ $\displaystyle x^{\prime}\hat{\mathbf{x}}+y^{\prime}\hat{\mathbf{y}}\ \ \ \ \ (3)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R\cos\phi^{\prime}\hat{\mathbf{x}}+R\sin\phi^{\prime}\hat{\mathbf{y}}\ \ \ \ \ (4)$ $\displaystyle \mathbf{r}-\mathbf{r}^{\prime}$ $\displaystyle =$ $\displaystyle -R\cos\phi^{\prime}\hat{\mathbf{x}}+\left(y-R\sin\phi^{\prime}\right)\hat{\mathbf{y}}+z\hat{\mathbf{z}}\ \ \ \ \ (5)$ $\displaystyle \left|\mathbf{r}-\mathbf{r}^{\prime}\right|$ $\displaystyle =$ $\displaystyle \sqrt{\left(R\cos\phi^{\prime}\right)^{2}+\left(y-R\sin\phi^{\prime}\right)^{2}+z^{2}}\ \ \ \ \ (6)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \sqrt{R^{2}+r^{2}-2yR\sin\phi^{\prime}} \ \ \ \ \ (7)$

The line element is

 $\displaystyle d\mathbf{l}^{\prime}$ $\displaystyle =$ $\displaystyle \left[-\sin\phi^{\prime}\hat{\mathbf{x}}+\cos\phi^{\prime}\hat{\mathbf{y}}\right]Rd\phi^{\prime}\ \ \ \ \ (8)$ $\displaystyle d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)$ $\displaystyle =$ $\displaystyle \left\{ z\cos\phi^{\prime}\hat{\mathbf{x}}+z\sin\phi^{\prime}\hat{\mathbf{y}}+\left[\left(R\sin\phi^{\prime}-y\right)\sin\phi^{\prime}+\left(R\cos\phi^{\prime}\right)^{2}\right]\hat{\mathbf{z}}\right\} Rd\phi^{\prime}\ \ \ \ \ (9)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \left[z\cos\phi^{\prime}\hat{\mathbf{x}}+z\sin\phi^{\prime}\hat{\mathbf{y}}+\left(R-y\sin\phi^{\prime}\right)\hat{\mathbf{z}}\right]Rd\phi^{\prime} \ \ \ \ \ (10)$

The field is then, using the Biot-Savart formula:

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{4\pi}\int_{0}^{2\pi}\frac{d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|^{3}}\ \ \ \ \ (11)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}IR}{4\pi}\int_{0}^{2\pi}\frac{\left[z\cos\phi^{\prime}\hat{\mathbf{x}}+z\sin\phi^{\prime}\hat{\mathbf{y}}+\left(R-y\sin\phi^{\prime}\right)\hat{\mathbf{z}}\right]d\phi^{\prime}}{\left(R^{2}+r^{2}-2yR\sin\phi^{\prime}\right)^{3/2}} \ \ \ \ \ (12)$

The ${x}$ component integrates easily to

 $\displaystyle B_{x}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}Iz}{4\pi y}\left.\frac{1}{\sqrt{R^{2}+r^{2}-2yR\sin\phi^{\prime}}}\right|_{0}^{2\pi}\ \ \ \ \ (13)$ $\displaystyle$ $\displaystyle =$ $\displaystyle 0 \ \ \ \ \ (14)$

The fact that ${B_{x}=0}$ isn’t terribly surprising, since the symmetry of the problem makes that fairly obvious without doing any calculations.

The other two integrals are non-trivial, however. Plugging them into software we get a blizzard of elliptic functions with no obvious way of simplifying the result. We can check that these integrals reduce to the correct form when the observation point is on the ${z}$ axis (that is, when ${y=0}$). In that case we get

 $\displaystyle B_{y}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}IR}{4\pi}\frac{z}{\left(R^{2}+z^{2}\right)^{3/2}}\int_{0}^{2\pi}\sin\phi^{\prime}d\phi^{\prime}=0\ \ \ \ \ (15)$ $\displaystyle B_{z}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{4\pi}\frac{R^{2}}{\left(R^{2}+z^{2}\right)^{3/2}}\int_{0}^{2\pi}d\phi^{\prime}=\frac{\mu_{0}IR^{2}}{2}\frac{1}{\left[R^{2}+z^{2}\right]^{3/2}} \ \ \ \ \ (16)$

# Magnetic field of a semi-circular current loop

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.45.

Another example of finding the magnetic field due to a current using the Biot-Savart law.

The system this time consists of a semi-circular wire of radius ${R}$ in the ${xy}$ plane, extending from ${\theta=-\pi}$ to ${\theta=0}$ and carrying current ${I}$ in a counter-clockwise direction. The problem is to find the magnetic field on a point on the upper semi-circle of radius ${R}$ extending from ${\theta=0}$ to ${\theta=\pi}$. (There is no wire or current on this upper semi-circle; we’re just interested in finding the field there.) Let the angle of the observation point be ${\theta=\alpha}$.

The Biot-Savart law for a line current is

$\displaystyle \mathbf{B}=\frac{\mu_{0}I}{4\pi}\int\frac{d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|^{3}} \ \ \ \ \ (1)$

Since ${d\mathbf{l}^{\prime}}$ lies on the semi-circular wire

$\displaystyle d\mathbf{l}^{\prime}=Rd\theta\left(-\sin\theta\hat{\mathbf{x}}+\cos\theta\hat{\mathbf{y}}\right) \ \ \ \ \ (2)$

For a given observation point ${\mathbf{r}}$ and source point ${\mathbf{r}^{\prime}}$

 $\displaystyle \mathbf{r}$ $\displaystyle =$ $\displaystyle x\hat{\mathbf{x}}+y\hat{\mathbf{y}}\ \ \ \ \ (3)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R\cos\alpha\hat{\mathbf{x}}+R\sin\alpha\hat{\mathbf{y}}\ \ \ \ \ (4)$ $\displaystyle \mathbf{r^{\prime}}$ $\displaystyle =$ $\displaystyle x^{\prime}\hat{\mathbf{x}}+y^{\prime}\hat{\mathbf{y}}\ \ \ \ \ (5)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R\cos\theta\hat{\mathbf{x}}+R\sin\theta\hat{\mathbf{y}}\ \ \ \ \ (6)$ $\displaystyle \mathbf{r}-\mathbf{r}^{\prime}$ $\displaystyle =$ $\displaystyle \left(x-x^{\prime}\right)\hat{\mathbf{x}}+\left(y-y^{\prime}\right)\hat{\mathbf{y}}\ \ \ \ \ (7)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R\left(\cos\alpha-\cos\theta\right)\hat{\mathbf{x}}+R\left(\sin\alpha-\sin\theta\right)\hat{\mathbf{y}}\ \ \ \ \ (8)$ $\displaystyle \left|\mathbf{r}-\mathbf{r}^{\prime}\right|$ $\displaystyle =$ $\displaystyle R\sqrt{\left(\cos\alpha-\cos\theta\right)^{2}+\left(\sin\alpha-\sin\theta\right)^{2}}\ \ \ \ \ (9)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R\sqrt{2\left(1-\sin\theta\sin\alpha-\cos\theta\cos\alpha\right)}\ \ \ \ \ (10)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \sqrt{2}R\sqrt{1-\cos\left(\alpha-\theta\right)}\ \ \ \ \ (11)$ $\displaystyle d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)$ $\displaystyle =$ $\displaystyle -R^{2}d\theta\left[\sin\theta\left(\sin\alpha-\sin\theta\right)+\cos\theta\left(\cos\alpha-\cos\theta\right)\right]\hat{\mathbf{z}}\ \ \ \ \ (12)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R^{2}d\theta\left[1-\sin\theta\sin\alpha-\cos\theta\cos\alpha\right]\hat{\mathbf{z}}\ \ \ \ \ (13)$ $\displaystyle$ $\displaystyle =$ $\displaystyle R^{2}d\theta\left[1-\cos\left(\alpha-\theta\right)\right]\hat{\mathbf{z}} \ \ \ \ \ (14)$

We can now write out the integral:

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}IR^{2}}{4\pi2^{3/2}R^{3}}\hat{\mathbf{z}}\int\frac{\left[1-\cos\left(\alpha-\theta\right)\right]d\theta}{\left(1-\cos\left(\alpha-\theta\right)\right)^{3/2}}\ \ \ \ \ (15)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{2^{3/2}4\pi R}\hat{\mathbf{z}}\int\frac{d\theta}{\sqrt{1-\cos\left(\alpha-\theta\right)}} \ \ \ \ \ (16)$

Using software, this integral comes out to

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{2^{3/2}4\pi R}\hat{\mathbf{z}}\sqrt{2}\frac{\left(1-\cos^{2}\left[\frac{1}{2}\left(\alpha-\theta\right)\right]\right)\tanh^{-1}\left(\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]\right)}{\sqrt{1-\cos^{2}\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}\sin\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}\ \ \ \ \ (17)$ $\displaystyle$ $\displaystyle$ $\displaystyle \frac{\mu_{0}I}{2^{3/2}4\pi R}\hat{\mathbf{z}}\sqrt{2}\tanh^{-1}\left(\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]\right)\ \ \ \ \ (18)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{16\pi R}\hat{\mathbf{z}}\ln\left[\frac{1+\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}{1-\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}\right] \ \ \ \ \ (19)$

where we’ve used the identity ${\tanh^{-1}x=\frac{1}{2}\ln\left(\frac{1+x}{1-x}\right)}$.

Up to now, I’ve purposely left off the limits of integration. If we use the limits as stated in the question above, we get

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{16\pi R}\hat{\mathbf{z}}\left.\ln\left[\frac{1+\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}{1-\cos\left[\frac{1}{2}\left(\alpha-\theta\right)\right]}\right]\right|_{-\pi}^{0}\ \ \ \ \ (20)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{16\pi R}\hat{\mathbf{z}}\ln\left[\frac{1+\cos\left(\frac{\alpha}{2}\right)}{1-\cos\left(\frac{\alpha}{2}\right)}\frac{1-\cos\left[\frac{1}{2}\left(\alpha+\pi\right)\right]}{1+\cos\left[\frac{1}{2}\left(\alpha+\pi\right)\right]}\right]\ \ \ \ \ (21)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{16\pi R}\hat{\mathbf{z}}\ln\left[\frac{\tan^{2}\left(\frac{1}{4}\left(\alpha+\pi\right)\right)}{\tan^{2}\left(\frac{\alpha}{4}\right)}\right]\ \ \ \ \ (22)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{8\pi R}\hat{\mathbf{z}}\ln\left[\left|\frac{\tan\left(\frac{1}{4}\left(\alpha+\pi\right)\right)}{\tan\left(\frac{\alpha}{4}\right)}\right|\right] \ \ \ \ \ (23)$

where we’ve used the trig identities ${\tan\frac{x}{2}=\frac{1-\cos x}{\sin x}=\frac{\sin x}{1+\cos x}}$.

This matches the answer given in the question in Griffiths (where his ${\theta}$ is my ${\alpha}$). However, if we choose the limits to be ${\theta=\pi}$ to ${\theta=2\pi}$, we get

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{16\pi R}\hat{\mathbf{z}}\ln\left[\frac{1-\cos\left(\frac{\alpha}{2}\right)}{1+\cos\left(\frac{\alpha}{2}\right)}\frac{1-\cos\left[\frac{1}{2}\left(\alpha-\pi\right)\right]}{1+\cos\left[\frac{1}{2}\left(\alpha-\pi\right)\right]}\right]\ \ \ \ \ (24)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{8\pi R}\hat{\mathbf{z}}\ln\left[\left|\tan\left(\frac{\alpha}{4}\right)\tan\left(\frac{1}{4}\left(\alpha-\pi\right)\right)\right|\right] \ \ \ \ \ (25)$

Since ${\left|\tan\left(x-\frac{\pi}{2}\right)\right|=\left|\frac{1}{\tan x}\right|}$ this comes out to

$\displaystyle \mathbf{B}=-\frac{\mu_{0}I}{8\pi R}\hat{\mathbf{z}}\ln\left[\left|\frac{\tan\left(\frac{1}{4}\left(\alpha+\pi\right)\right)}{\tan\left(\frac{\alpha}{4}\right)}\right|\right] \ \ \ \ \ (26)$

That is, by merely changing the limits of integration by adding ${2\pi}$, we’ve reversed the direction of ${\mathbf{B}}$. This clearly doesn’t make sense, since the integrand ${\frac{1}{\sqrt{1-\cos\left(\alpha-\theta\right)}}}$ is identical under this change, so it seems that we need to take the absolute value of the answer. We can see how this errant sign crept in by looking back at the original integral solution above. There, we cancelled off the cos and sin terms that multiplied the arctanh, but the square root term could be positive or negative (something which the software didn’t tell us), so presumably we need to select the right sign in order for the direction of the field to come out right. The correct direction can be determined from the right hand rule and for the direction of current assumed, ${\mathbf{B}}$ must point in the ${+z}$ direction.

# Solenoid field from Biot-Savart law

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.44.

We’ve used Ampère’s law to find the field inside and outside a solenoid. The fundamental formula for finding the magnetic field due to a current is the Biot-Savart law, so it should be possible to work out the solenoid field from that as well. Since we treat the current in a solenoid as cylindrical surface current, the form of the Biot-Savart law to use is

$\displaystyle \mathbf{B}=\frac{\mu_{0}}{4\pi}\int\frac{\mathbf{K}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)}{\left|\mathbf{r}-\mathbf{r}^{\prime}\right|^{3}}da^{\prime} \ \ \ \ \ (1)$

where ${\mathbf{K}}$ is the surface current density. For a solenoid with ${n}$ turns per unit length carrying a current ${I}$, ${K=nI}$.

Although the natural coordinates to use are cylindrical, I find it easier to set the problem up in rectangular coordinates and then convert to cylindrical later on. To define the problem, put the axis of the solenoid on the ${z}$ axis and place the observation point ${\mathbf{r}}$ on the ${x}$ axis. The source point ${\mathbf{r}^{\prime}}$ lies on the solenoid. If the radius of the solenoid is ${R}$, then

 $\displaystyle \mathbf{r}^{\prime}$ $\displaystyle =$ $\displaystyle x\hat{\mathbf{x}}+y\hat{\mathbf{y}}+z\hat{\mathbf{z}}\ \ \ \ \ (2)$ $\displaystyle x^{2}+y^{2}$ $\displaystyle =$ $\displaystyle R^{2}\ \ \ \ \ (3)$ $\displaystyle \mathbf{r}$ $\displaystyle =$ $\displaystyle r\hat{\mathbf{x}}\ \ \ \ \ (4)$ $\displaystyle \mathbf{r}-\mathbf{r}^{\prime}$ $\displaystyle =$ $\displaystyle \left(r-x\right)\hat{\mathbf{x}}-y\hat{\mathbf{y}}-z\hat{\mathbf{z}} \ \ \ \ \ (5)$

Since ${\mathbf{K}}$ points around the circumference of the solenoid,

 $\displaystyle \mathbf{K}$ $\displaystyle =$ $\displaystyle nI\hat{\mathbf{\boldsymbol{\phi}}}\ \ \ \ \ (6)$ $\displaystyle$ $\displaystyle =$ $\displaystyle nI\left(-\sin\phi\hat{\mathbf{x}}+\cos\phi\hat{\mathbf{y}}\right)\ \ \ \ \ (7)$ $\displaystyle \mathbf{K}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)$ $\displaystyle =$ $\displaystyle nI\left[-z\cos\phi\hat{\mathbf{x}}-z\sin\phi\hat{\mathbf{y}}+\left(y\sin\phi-\left(r-x\right)\cos\phi\right)\hat{\mathbf{z}}\right] \ \ \ \ \ (8)$

From the symmetry of the setup, if we replace ${z}$ by ${-z}$ in the source point ${\mathbf{r}^{\prime}}$, ${\mathbf{K}}$ remains unchanged, but the ${x}$ and ${y}$ components of ${\mathbf{K}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)}$ change sign. Thus these components cancel out and the net field must lie in the ${z}$ direction, so we can restrict our attention to that from now on.

We can now make the conversion to cylindrical coordinates using

 $\displaystyle y$ $\displaystyle =$ $\displaystyle R\sin\phi\ \ \ \ \ (9)$ $\displaystyle x$ $\displaystyle =$ $\displaystyle R\cos\phi\ \ \ \ \ (10)$ $\displaystyle da^{\prime}$ $\displaystyle =$ $\displaystyle Rd\phi dz \ \ \ \ \ (11)$

We get

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}nI}{4\pi}\hat{\mathbf{z}}\int_{0}^{2\pi}\int_{-\infty}^{\infty}\frac{R\left(\sin^{2}\phi+\cos^{2}\phi\right)-r\cos\phi}{\left[\left(r-x\right)^{2}+y^{2}+z^{2}\right]^{3/2}}Rdzd\phi\ \ \ \ \ (12)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}nI}{4\pi}\hat{\mathbf{z}}\int_{0}^{2\pi}\int_{-\infty}^{\infty}\frac{R^{2}-rR\cos\phi}{\left[R^{2}+r^{2}-2rR\cos\phi+z^{2}\right]^{3/2}}dzd\phi \ \ \ \ \ (13)$

At this point it’s important to do the integrals in the right order. Attempting to do the ${\phi}$ integral first leads to a mess containing elliptic functions. If we do the ${z}$ integral first, we get

$\displaystyle \mathbf{B}=\frac{2\mu_{0}nI}{4\pi}\hat{\mathbf{z}}\int_{0}^{2\pi}\frac{R^{2}-rR\cos\phi}{R^{2}+r^{2}-2rR\cos\phi}d\phi \ \ \ \ \ (14)$

Using software, this integral comes out to

$\displaystyle \mathbf{B}=\begin{cases} \mu_{0}nI\hat{\mathbf{z}} & rR \end{cases} \ \ \ \ \ (15)$

This reproduces, after a lot of effort, the result obtained from Ampère’s law.

# Magnetic field of square current loop

Required math: calculus

Required physics: electrostatics & magnetostatics

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.37.

Earlier we worked out the magnetic field at the centre of a square loop (side length ${w}$) of current which lies in the ${xy}$ plane with its centre at the origin. We can generalize this a bit by working out the field at any point on the ${z}$ axis. Start with the Biot-Savart law for linear currents:

$\displaystyle \mathbf{B}\left(\mathbf{r}\right)=\frac{\mu_{0}I}{4\pi}\int\frac{d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}'\right)}{\left|\mathbf{r}-\mathbf{r}'\right|^{3}} \ \ \ \ \ (1)$

Now consider the edge that extends from ${y=-w/2}$ to ${y=+w/2}$ at ${x=+w/2}$. Along this edge we have

 $\displaystyle \mathbf{r}-\mathbf{r}'$ $\displaystyle =$ $\displaystyle -x^{\prime}\hat{\mathbf{x}}-y^{\prime}\hat{\mathbf{y}}+z\hat{\mathbf{z}}\ \ \ \ \ (2)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -\frac{w}{2}\hat{\mathbf{x}}-y^{\prime}\hat{\mathbf{y}}+z\hat{\mathbf{z}}\ \ \ \ \ (3)$ $\displaystyle d\mathbf{l}^{\prime}$ $\displaystyle =$ $\displaystyle dy^{\prime}\hat{\mathbf{y}}\ \ \ \ \ (4)$ $\displaystyle d\mathbf{l}^{\prime}\times\left(\mathbf{r}-\mathbf{r}'\right)$ $\displaystyle =$ $\displaystyle \left(z\hat{\mathbf{x}}+\frac{w}{2}\hat{\mathbf{z}}\right)dy^{\prime} \ \ \ \ \ (5)$

The integral is then

 $\displaystyle \mathbf{B}_{1}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{4\pi}\left(z\hat{\mathbf{x}}+\frac{w}{2}\hat{\mathbf{z}}\right)\int_{-w/2}^{w/2}\frac{dy^{\prime}}{\left(\frac{w^{2}}{4}+y^{\prime2}+z^{2}\right)^{3/2}}\ \ \ \ \ (6)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{4\pi}\left(z\hat{\mathbf{x}}+\frac{w}{2}\hat{\mathbf{z}}\right)\frac{8w}{\sqrt{2w^{2}+4z^{2}}\left(w^{2}+4z^{2}\right)} \ \ \ \ \ (7)$

By symmetry, the opposite edge at ${x=-w/2}$ will contribute the same ${z}$ component and the opposite ${x}$ component. Similarly, the two edges at ${y=\pm w/2}$ will contribute two more ${z}$ components with the ${y}$ components cancelling. Thus the total field is

 $\displaystyle \mathbf{B}$ $\displaystyle =$ $\displaystyle 4\frac{\mu_{0}I}{4\pi}\frac{w}{2}\frac{8w}{\sqrt{2w^{2}+4z^{2}}\left(w^{2}+4z^{2}\right)}\hat{\mathbf{z}}\ \ \ \ \ (8)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{4w^{2}\mu_{0}I}{\pi\sqrt{2w^{2}+4z^{2}}\left(w^{2}+4z^{2}\right)}\hat{\mathbf{z}} \ \ \ \ \ (9)$

As a check, when ${z=0}$ this reduces to

$\displaystyle \mathbf{B}\left(0\right)=\frac{2\sqrt{2}\mu_{0}I}{\pi w}\hat{\mathbf{z}} \ \ \ \ \ (10)$

This matches the earlier post (where ${w=2R}$).

The dipole moment of the square is ${\mathbf{m}=I\mathbf{a}=w^{2}\hat{\mathbf{z}}}$, so the dipole component of the field is

 $\displaystyle \mathbf{B}_{1}$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}}{4\pi z^{3}}\left[3\left(\mathbf{m}\cdot\hat{\mathbf{r}}\right)\hat{\mathbf{r}}-\mathbf{m}\right]\ \ \ \ \ (11)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}I}{4\pi z^{3}}\left(3w^{2}-w^{2}\right)\hat{\mathbf{z}}\ \ \ \ \ (12)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}w^{2}I}{2\pi z^{3}}\hat{\mathbf{z}} \ \ \ \ \ (13)$

If we take ${z\gg w}$ in the exact formula, it reduces to

 $\displaystyle \mathbf{B}$ $\displaystyle \rightarrow$ $\displaystyle \frac{4w^{2}\mu_{0}I}{\pi\sqrt{4z^{2}}\left(4z^{2}\right)}\hat{\mathbf{z}}\ \ \ \ \ (14)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{\mu_{0}w^{2}I}{2\pi z^{3}}\hat{\mathbf{z}} \ \ \ \ \ (15)$

Thus the dipole term is a good approximation for large distances.

# Solenoid with arbitrary cross-section

Required math: calculus

Required physics: electrostatics & magnetostatics

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.17.

We calculated the magnetic field of a solenoid with a circular cross-section and found that, for an infinite solenoid

$\displaystyle B=\mu_{0}nI \ \ \ \ \ (1)$

where ${n}$ is the number of turns per unit length and ${I}$ is the current flowing through the wire wrapped around the cylinder.

We can actually find the magnetic field of an infinite solenoid of any cross-section, provided that cross-section is constant over the entire length. First, we use the Biot-Savart law to find the direction of the field. We’ll choose a rectangular coordinate system such that the axis of the solenoid is parallel to the ${y}$ axis. This means that the cross-section of the solenoid is parallel to the ${xz}$ plane, so the current has no ${y}$ component (well, OK, it does have a very slight ${y}$ component since the wire is wound as a helix and current does flow down the length of the solenoid, but we can assume here that we’ve got an idealized solenoid where the current flows in closed loops around the axis). That is

$\displaystyle \mathbf{I}=I_{x}\hat{\mathbf{x}}+I_{z}\hat{\mathbf{z}} \ \ \ \ \ (2)$

Now pick a point on the solenoid at position ${\mathbf{r}_{1}^{\prime}=x^{\prime}\hat{\mathbf{x}}+y^{\prime}\hat{\mathbf{y}}+z^{\prime}\hat{\mathbf{z}}}$. If we put the observation point ${\mathbf{r}}$ in the ${xz}$ plane, then it has coordinates ${\mathbf{r}=x\hat{\mathbf{x}}+z\hat{\mathbf{z}}}$. Then the Biot-Savart law says that the contribution to the magnetic field from a line element ${dl^{\prime}}$ at point ${\mathbf{r}^{\prime}}$ is

$\displaystyle d\mathbf{B}=\frac{\mu_{0}}{4\pi\left|\mathbf{r}-\mathbf{r}^{\prime}\right|^{3}}\mathbf{I}\times\left(\mathbf{r}-\mathbf{r}^{\prime}\right)dl^{\prime} \ \ \ \ \ (3)$

The cross product is what interests us, and we get for the current element under consideration

 $\displaystyle \mathbf{I}\times\left(\mathbf{r}-\mathbf{r}_{1}^{\prime}\right)$ $\displaystyle =$ $\displaystyle \left[I_{x}\hat{\mathbf{x}}+I_{z}\hat{\mathbf{z}}\right]\times\left[\left(x-x^{\prime}\right)\hat{\mathbf{x}}-y^{\prime}\hat{\mathbf{y}}+\left(z-z^{\prime}\right)\hat{\mathbf{z}}\right]\ \ \ \ \ (4)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -y^{\prime}I_{z}\hat{\mathbf{x}}-\left[I_{x}\left(z-z^{\prime}\right)-I_{z}\left(x-x^{\prime}\right)\right]\hat{\mathbf{y}}+y^{\prime}I_{x}\hat{\mathbf{z}} \ \ \ \ \ (5)$

Because of the symmetry of the solenoid, there is a point on the solenoid at position ${\mathbf{r}_{2}^{\prime}=x^{\prime}\hat{\mathbf{x}}-y^{\prime}\hat{\mathbf{y}}+z^{\prime}\hat{\mathbf{z}}}$ which has the same current and (since ${\mathbf{r}}$ has no ${y}$ component) the same value of ${\left|\mathbf{r}-\mathbf{r}^{\prime}\right|}$. Thus the only difference is that the sign of ${y^{\prime}}$ has changed, so we get

$\displaystyle \mathbf{I}\times\left(\mathbf{r}-\mathbf{r}_{2}^{\prime}\right)=y^{\prime}I_{z}\hat{\mathbf{x}}-\left[I_{x}\left(z-z^{\prime}\right)-I_{z}\left(x-x^{\prime}\right)\right]\hat{\mathbf{y}}-y^{\prime}I_{x}\hat{\mathbf{z}} \ \ \ \ \ (6)$

When we add the contributions from these symmetric elements, only the ${y}$ component is left, so we conclude that the field must be entirely in the ${y}$ direction.

The magnitude of the field could be worked out from the Biot-Savart law if we knew the shape of the cross-section, but using Ampère’s law, we can choose a rectangular loop of unit length parallel to the ${yz}$ plane. If this loop has both edges outside the solenoid, with the nearer edge in the plane ${z=a}$ and the farther edge at ${z=b}$, then there is no enclosed current so since the contribution from the two edges parallel to the ${z}$ axis cancel (the path along one of these edges is equal and opposite to the path along the other), we get

 $\displaystyle \oint\mathbf{B}\cdot d\mathbf{l}$ $\displaystyle =$ $\displaystyle B\left(b\right)-B\left(a\right)\ \ \ \ \ (7)$ $\displaystyle$ $\displaystyle =$ $\displaystyle 0 \ \ \ \ \ (8)$

That is, the field outside the solenoid is constant. At this point, the assumption is made that the field must go to zero at infinite distance (something that doesn’t sit quite right, since we are dealing with an infinite solenoid after all, but anyway) therefore be zero everywhere outside the solenoid.

Inside the solenoid, we could set up another loop that doesn’t cross the current and conclude again that the field inside is also constant. To get its magnitude, we use a loop that does cross the current, with one edge inside and one outside. The enclosed current for a unit length is ${nI}$ and the only edge that contributes to the line integral is the edge inside the solenoid so we have

 $\displaystyle \oint\mathbf{B}\cdot d\mathbf{l}$ $\displaystyle =$ $\displaystyle B_{in}\ \ \ \ \ (9)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \mu_{0}nI \ \ \ \ \ (10)$

Thus the magnetic field inside an infinite solenoid is independent of the cross-sectional shape.

Using a similar technique (example 5.10 in Griffiths), it is possible to show that the magnetic field inside a torus-shaped solenoid (again, the cross-section doesn’t matter) is

$\displaystyle B_{torus}=\frac{\mu_{0}NI}{2\pi s} \ \ \ \ \ (11)$

where ${s}$ is the radial distance from the axis of the torus, if this places the observation point inside the torus (the field is again zero outside). In this case, the field inside is not constant, but falls off linearly with distance from the axis. For a torus with a radius large compared with its cross-sectional dimensions, we can take ${s}$ to be essentially ‘the’ radius of the torus, so that ${N/2\pi s=n}$ and the formula reduces to that for a linear solenoid.

# Magnetic field of a solenoid

Required math: calculus

Required physics: electrostatics & magnetostatics

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.11.

A solenoid is a helical coil of wire wound round an insulating cylinder. We can find the magnetic field due to a solenoid carrying a steady current ${I}$ as follows. First, we work out the field due to a single circular loop of radius ${a}$ as measured at a point ${P}$ on the axis (which we’ll take to be the ${z}$ axis) of the loop. The diagram below shows a side view of the solenoid.

In the diagram, we’ll take the circular loop to be the first loop in the solenoid (closest to ${P}$), whose radius subtends an angle ${\theta_{1}}$ at ${P}$. The distance from ${P}$ along the axis to the centre of the circle is ${z}$. (We’ll refer to the other parts of the diagram later.)

By symmetry, the components of the field in the ${x}$ and ${y}$ directions cancel, so we need calculate only the ${z}$ component. The Biot-Savart law in this case is

$\displaystyle \mathbf{B}\left(\mathbf{r}\right)=\hat{\mathbf{z}}\frac{I\mu_{0}}{4\pi}\int\frac{d\mathbf{l}\times\left(\mathbf{r}-\mathbf{r}'\right)}{\left|\mathbf{r}-\mathbf{r}'\right|^{3}} \ \ \ \ \ (1)$

The line element ${d\mathbf{l}}$ is tangent to the circle, and the vector ${\mathbf{r}-\mathbf{r}'}$ is always perpendicular to it. Look at the point on the loop where the tail of the${\theta_{1}}$ vector meets the current loop, and assume the current is coming out of the page at this point. Then applying the right-hand rule, we see that the field vector lies in the plane of the figure, and points diagonally to the upper right, making an angle of ${\frac{\pi}{2}-\theta_{1}}$ with the ${z}$ axis. To project out the ${z}$ component of the field, we multiply by ${\cos\left(\frac{\pi}{2}-\theta_{1}\right)=\sin\theta_{1}=\frac{a}{\left|\mathbf{r}-\mathbf{r}'\right|}}$. This angle is a constant, as is ${\left|\mathbf{r}-\mathbf{r}'\right|}$, and the integration extends round the circumference of the circle, so we get

 $\displaystyle B_{z}$ $\displaystyle =$ $\displaystyle \frac{I\mu_{0}}{4\pi}\frac{a}{\left|\mathbf{r}-\mathbf{r}'\right|}\frac{2\pi a}{\left|\mathbf{r}-\mathbf{r}'\right|^{2}}\ \ \ \ \ (2)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{I\mu_{0}}{2a}\sin^{3}\theta_{1} \ \ \ \ \ (3)$

Now suppose the solenoid has ${n}$ turns per unit length, and that this number is large enough that we can approximate the solenoid by a circular surface current density of ${In}$ per unit length, and thus use integration to determine the overall field. To do the integral, we need to work out relation between a change in ${\theta}$ and a change in ${z}$, as shown in the diagram. An increase of ${dz}$ means a decrease in angle of ${-d\theta}$ as shown. To work out the relation:

 $\displaystyle \sin\theta$ $\displaystyle =$ $\displaystyle \frac{a}{\sqrt{a^{2}+z^{2}}}\ \ \ \ \ (4)$ $\displaystyle \sin\left(\theta-d\theta\right)$ $\displaystyle =$ $\displaystyle \frac{a}{\sqrt{a^{2}+\left(z+dz\right)^{2}}} \ \ \ \ \ (5)$

We can expand the second equation in a Taylor series and retain only first terms in the differentials, and we get

$\displaystyle \sin\theta-\cos\theta d\theta=\frac{a}{\sqrt{a^{2}+z^{2}}}-\frac{az}{\left(a^{2}+z^{2}\right)^{3/2}}dz \ \ \ \ \ (6)$

Replacing the terms on the right by trig functions, we get

$\displaystyle \frac{a}{\sqrt{a^{2}+z^{2}}}-\frac{az}{\left(a^{2}+z^{2}\right)^{3/2}}dz=\sin\theta-\frac{1}{a}\cos\theta\sin^{2}\theta dz \ \ \ \ \ (7)$

Thus we get

$\displaystyle dz=\frac{a}{\sin^{2}\theta}d\theta \ \ \ \ \ (8)$

The current in an infinitesimal slice of the solenoid is therefore

$\displaystyle Indz=\frac{Ina}{\sin^{2}\theta}d\theta \ \ \ \ \ (9)$

We can now find the total field by doing the integral

 $\displaystyle B_{z}$ $\displaystyle =$ $\displaystyle \int_{\theta_{2}}^{\theta_{1}}\frac{\mu_{0}}{4\pi a}\sin^{3}\theta_{1}\frac{Ina}{\sin^{2}\theta}d\theta\ \ \ \ \ (10)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{n\mu_{0}I}{2}\left(\cos\theta_{2}-\cos\theta_{1}\right) \ \ \ \ \ (11)$

This might look like it’s independent of the radius ${a}$, but this dependence is included in the angles.

For an infinite solenoid, ${\theta_{1}\rightarrow\pi}$ and ${\theta_{2}\rightarrow0}$ and we get

$\displaystyle B_{\infty}=n\mu_{0}I \ \ \ \ \ (12)$

# Biot-Savart law: force on other currents

Required math: calculus

Required physics: electrostatics & magnetostatics

Reference: Griffiths, David J. (2007) Introduction to Electrodynamics, 3rd Edition; Prentice Hall – Problem 5.10.

Here are a couple more examples of calculating the magnetic field due to a steady current in a wire.

Suppose we have an infinite straight wire on the ${x}$ axis carrying a current ${I}$ in the ${+x}$ direction. A square loop of side length ${a}$ (also carrying current ${I}$ flowing clockwise around the square as viewed from above) is placed in the ${xy}$ plane so that the side nearest the wire is parallel to the wire and along the line ${y=-s}$. What is the force on the loop due to the wire?

First, we need to work out the magnetic field caused by the current in the wire. We can apply the result we used earlier in calculating the magnetic field due to a wire segment. In this case, we get, for a wire a perpendicular distance ${d}$ from the observation point ${\mathbf{r}}$:

 $\displaystyle \mathbf{B}_{1}\left(\mathbf{r}\right)$ $\displaystyle =$ $\displaystyle \hat{\mathbf{z}}\frac{I\mu_{0}}{4\pi}\int\frac{\left|\mathbf{r}-\mathbf{r}'\right|\sin\theta}{\left|\mathbf{r}-\mathbf{r}'\right|^{3}}dl'\ \ \ \ \ (1)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \hat{\mathbf{z}}\frac{I\mu_{0}}{4\pi}\int_{-\infty}^{\infty}\frac{d}{\left(d^{2}+x^{2}\right)^{3/2}}dx\ \ \ \ \ (2)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \hat{\mathbf{z}}\frac{I\mu_{0}}{2\pi d} \ \ \ \ \ (3)$

The magnetic field points in the ${+z}$ direction above the ${x}$ axis (that is, where ${y>0}$) and in the ${-z}$ direction on the other side of the ${x}$ axis. Since the loop is on the lower side of the ${x}$ axis and the current flows clockwise as seen from above, ${\mathbf{I}}$ is in the ${+x}$ direction on the side of the loop nearest the wire and in the ${-x}$ direction on the side farthest from the wire. From the symmetry of the problem the forces on the two sides of the square that are perpendicular to the wire cancel, so we need to work out only the forces on the two edges parallel to the wire. We get, using the form of the Lorentz force law for linear currents

 $\displaystyle \mathbf{F}$ $\displaystyle =$ $\displaystyle \int\mathbf{I}\times\mathbf{B}dl\ \ \ \ \ (4)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{aI^{2}\mu_{0}}{2\pi}\left(\frac{1}{s}-\frac{1}{s+a}\right)\hat{\mathbf{y}} \ \ \ \ \ (5)$

Now suppose we have an equilateral triangle (side length ${a}$) with its base aligned with the wire, and along the line ${y=-s}$.. As before, the current flows clockwise around the triangle.

The force on the edge nearest the wire is the same as for the square, namely

$\displaystyle \mathbf{F}_{1}=-\frac{aI^{2}\mu_{0}}{2\pi s}\hat{\mathbf{y}} \ \ \ \ \ (6)$

To calculate the force on one of the other edges, we can take the coordinates of the vertex on this edge nearest the wire to be ${\left(0,-s\right)}$. Then the equation of the line of which that edge is a part is

 $\displaystyle y$ $\displaystyle =$ $\displaystyle -x\tan\frac{\pi}{3}-s\ \ \ \ \ (7)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -\sqrt{3}x-s \ \ \ \ \ (8)$

The line increment along this edge is

 $\displaystyle dl$ $\displaystyle =$ $\displaystyle \sqrt{dx^{2}+dy^{2}}\ \ \ \ \ (9)$ $\displaystyle$ $\displaystyle =$ $\displaystyle 2dx \ \ \ \ \ (10)$

The integral we need to do to figure out the force on this one edge is

$\displaystyle F_{2}=\frac{I^{2}\mu_{0}}{2\pi}\int\frac{dl}{d} \ \ \ \ \ (11)$

where ${d}$ is the perpendicular distance from a point on the edge of the triangle to the infinite wire. In our coordinates, ${d=\left|y\right|}$ and over the extent of this edge ${x}$ varies from 0 to ${\frac{a}{2}}$ so we get

 $\displaystyle F_{2}$ $\displaystyle =$ $\displaystyle \frac{I^{2}\mu_{0}}{2\pi}\int_{0}^{\frac{a}{2}}\frac{2dx}{\sqrt{3}x+s}\ \ \ \ \ (12)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{I^{2}\mu_{0}}{\sqrt{3}\pi}\ln\left(1+\frac{\sqrt{3}a}{2s}\right) \ \ \ \ \ (13)$

This is the total force on the edge, which from the cross product right hand rule is perpendicular to the edge and pointing towards the interior of the triangle. The force on the third edge will, by symmetry, point in a direction that is the mirror image of ${F_{2}}$ (reflected about the line ${x=a/2}$). Thus the components of these two forces parallel to the wire cancel, and the net force from these two edges is twice the perpendicular component of ${F_{2}}$. Since ${F_{2}}$ is perpendicular to the edge of the triangle, which in turn makes an angle of ${\pi/3}$ with the ${x}$ axis, ${F_{2}}$ makes an angle of ${\pi/6}$ with the ${x}$ axis (draw a little diagram if this isn’t clear), so its perpendicular component is ${F_{2}\sin\frac{\pi}{6}=\frac{F_{2}}{2}}$ and the total perpendicular component from the two edges of the triangle is ${2\times\frac{F_{2}}{2}=F_{2}}$. This component is directed in the ${+y}$ direction while the force on the bottom edge is in the ${-y}$ direction, so the net force is

 $\displaystyle \mathbf{F}$ $\displaystyle =$ $\displaystyle \left[\frac{I^{2}\mu_{0}}{\sqrt{3}\pi}\ln\left(1+\frac{\sqrt{3}a}{2s}\right)-\frac{aI^{2}\mu_{0}}{2\pi s}\right]\hat{\mathbf{y}}\ \ \ \ \ (14)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{I^{2}\mu_{0}}{2\pi}\left[\frac{2}{\sqrt{3}}\ln\left(1+\frac{\sqrt{3}a}{2s}\right)-\frac{a}{s}\right]\hat{\mathbf{y}} \ \ \ \ \ (15)$