# Magnetic field outside an infinite solenoid

Can someone explain to me how the magnetic field cancels outside a solenoid of infinite length mathematically (using an integration or something)?

• There are no infinite solenoids. One can make a very long solenoid where the magnetic flux trough the solenoid returns trough a very large volume, which makes the external field small. In the limit the ratio between internal and external field volume goes to infinity, but that's a mathematical trick that has no physical equivalent. A much better way to make a real configuration with very small external field is by making a torus, i.e. a skinny solenoid that is turned back on itself. Commented May 21, 2015 at 17:22

The argument below is paraphrased from Zangwill, Section 10.2.2. Set the origin of our coordinates at the spot we're trying to find the field, and let the axis of the solenoid be the $z$-axis. Consider a horizontal "slice" of the solenoid of width dz at a height $z$ above the xy-plane. By the Biot-Savart Law, the magnetic field due to this slice is just that of a current loop: $$d\vec{B} = - \frac{\mu_0 K dz}{4 \pi} \oint \frac{d\vec{\ell} \times \hat{r}}{r^2} = - \frac{\mu_0 K dz}{4 \pi} \oint \frac{d\vec{\ell} \times \vec{r}}{r^3}.$$ (The minus sign is there because $\vec{r}$ in this formula denotes the source point, not the field point.) The slice can be thought of as a parametric curve $\vec{\ell}(\lambda)$, and it can be related to $\vec{r}$ by $\vec{r} = \vec{\ell} + z \hat{z}$, where $\vec{\ell}$ is in the xy-plane. Since $\vec{\ell}$ is perpendicular to $\hat{z}$ by construction, we have $r = \sqrt{\ell^2 + z^2}$, and so we can write the full integral as $$d\vec{B} = - \frac{\mu_0 K dz}{4 \pi} \oint \frac{d\vec{\ell} \times (\vec{\ell} + z \hat{z})}{(\ell^2 + z^2)^{3/2}} = - \frac{\mu_0 K dz}{4 \pi} \left[ \oint \frac{d\vec{\ell} \times \vec{\ell} }{(\ell^2 + z^2)^{3/2}} + z \oint \frac{d\vec{\ell} \times \hat{z} }{(\ell^2 + z^2)^{3/2}} \right ]$$ When we integrate from $z = -\infty$ to $\infty$, the second term will vanish (because it is odd with respect to $z$, while the first term evaluates to $2/\ell^2$. Thus, we now have $$\vec{B} = -\frac{\mu_0 K}{2 \pi} \oint \frac{d\vec{\ell} \times \vec{\ell} }{\ell^2}.$$ Writing $\vec{\ell}$ in cylindrical coordinates, we have $\vec{\ell} = s \hat{s}$ and $d\vec{\ell} = ds \hat{s} + s \, d\phi \hat{\phi}$; thus, $-d\vec{\ell} \times \vec{\ell} = -s^2 \, d\phi \hat{z}$, and we have $$\vec{B} = \frac{\mu_0 K}{2 \pi} \hat{z} \oint \, d\phi.$$ The integral is now the net solid angle traversed when we go around the loop. If the curve $\vec{\ell}(\lambda)$ encloses the origin (i.e., we are inside the solenoid), this will be $2\pi$; otherwise, it will be zero. Thus, $$\vec{B} = \begin{cases} \mu_0 K \hat{z} & \text{inside} \\ 0 & \text{outside}.\end{cases}$$ Note that this derivation did not assume any particular shape for the cross-section of the solenoid (i.e., the shape of the curve $\vec{\ell}$.)

To preemptively address any concerns about infinite solenoids being unrealistic: how would this derivation be modified if we had a non-infinite (but long) solenoid? Return to the step where we had written $d\vec{B}$ in terms of $dz$ and two integrals. If we assume that the solenoid now stretches from $z_1$ to $z_2$ instead, the expression becomes: $$\vec{B} = - \frac{\mu_0 K}{4 \pi} \left[ \oint \frac{\sigma(z) \, d\vec{\ell} \times \vec{\ell} }{\ell^2 \sqrt{(\ell/z)^2 + 1}} - \oint \frac{d\vec{\ell} \times \hat{z} }{|z| \sqrt{(\ell/z)^2 + 1}} \right ]_{z = z_1}^{z_2}.$$ where $\sigma(z)$ is the sign of $z$. While we can't evaluate these integrals in as much generality, we still retain some important features. The first term will still point in the z-direction regardless of $z_1$ and $z_2$, and the second term will always point in the xy-plane. Moreover, the second term still vanishes so long as $z_1 = - z_2$. Thus, at the midpoint of a long solenoid, the external field still points along the axis of the solenoid (as it must by symmetry.)

If we wanted, we could expand these integrals in a power series in $\ell/z_1$ and $\ell/z_2$, assuming this quantity is small; this is saying that the perpendicular distance from the field point to the solenoid is much smaller than the distance to its ends. In this limit, we would recover the infinite-solenoid result plus corrections due to the finite length of the solenoid. The leading-order correction to the horizontal field would be $\mathcal{O}(\ell/z)$, while the leading-order correction to the vertical field will be $\mathcal{O}(\ell/z)^2$.

In short, we commonly believe no monopole, so $$\nabla \cdot \vec B = 0$$ and $$\int \vec B \cdot d\vec l = I _{free, enclosed}$$ due to symmetry, we construct a loop around solenoid, since it is infinitely long, the filed cannot point along the solenoid(otherwise the symmetry will break, both dierection treated equally), so the only possibility left now is point out or in evenly, which will have flux, which break the condition $$\nabla \cdot \vec B = 0$$ So B field must be $\vec 0$

• This argument is not correct. The flux is computed through a closed surface and your loop around the solenoid is an open surface. Commented Mar 5, 2021 at 2:04

As any other problem there is more than way to solve this one(rigorously), I'll explain one. The symmetry of the problem dictates that if you use cylindrical coordinates then the field components can only be functions of r. If you make use of the differential operators div and rot you will find that $B_r=\frac{cte}{r},B_z=cte,B_\theta=\frac{cte}{r}$. In these expressions cte represntes a constant that may be different for each component and may change when you pass from the exterior of the solenoid to the interior because there may be discontinuities over the surface. Now since for r=0 you have a singularity and this can not happen so cte=0 and you have $B_r=B_\theta=0$ in the interior of the solenoid and,because of boundary condittions, this componets must be continuous over the surface, we also have $B_r=B_\theta=0$ in the exterior region. Application of boundary conditions on $B_z$ gives: $$B_z*^{ext}-B_z^{int}=\mu_0NI$$ Now you can calculate $B_z$ in the cylinder axes and obtein $B_z^{int}=\mu_0NI$ and then using the former eqcuation gives $B_z^{ext}=0$

• Same problem as above, you take an invalid limit, this time in cylindrical coordinates... but it stays an invalid limit. The total flux on the inside of the solenoid is always the same as the flux on the outside. Commented May 21, 2015 at 22:39
• This is an ideal problem, however as such is has no contradictions and the field outside is zero, the field inside is not zero and it is constant. Commented May 22, 2015 at 1:40
• A false solutions stays a false solution, no matter how "ideal" the problems is. Why is this important to understand? Because the magnetic dipole is one of those pesky non-trivial mathematical limits that has fooled a lot of people, including, I would say, Dirac. No need to teach the young people how to get thrown off by a problem because of a handwaving "but it's an ideal problem". The field is zero, but it's important to understand why the field is zero and what the order of that zero is. Commented May 22, 2015 at 2:06
• I agree that a false solution is false no matter how ideal the problem is, however there is no handwaving here it's simply right or wrong and if wrong please explain where is the mistake. The issue of how ideal or realistic is this problem and how it can be related to at real situation is not a stake here Commented May 22, 2015 at 2:24
• The correct (some will say pedantic) "solution" is to point out that the ideal solenoid always has to be analyzed as a dipole including the ends, which satisfies the conservation of magnetic flux. One possible way to do this would be to take the limit as the limit of many small dipoles laid out next to each other. The individual fields will cancel out but the two ends would still produce a field that just spreads out into an ever larger volume. I think the problem is actually a very important learning opportunity to explain the difference between near- and far-field. Commented May 22, 2015 at 2:33

The magnetic field outside an infinitely long AC solenoid is NOT zero, as shown by explicit calculation from Maxwell's equations by Abbot & Griffiths, American Journal of Physics 53, 1203 (1985), and also independently by Jacque Templin, American Journal of Physics 63, 916 (1995).

Every demonstration I've seen that shows the magnetic field outside an infinitely long DC solenoid is zero (including those in this thread) assumes that the current of the solenoid is everywhere perpendicular to its axis, which, of course, is not true for any solenoid whose current is carried by a wire of non-vanishing dimensions. If the diameter of the wire is D and the circumference of the solenoid is C then there is a component of the current parallel to the axis of the solenoid, equal to (D/C)*I where I is the current in the wire. That component of the current makes a magnetic field outside the solenoid and though it may be a very weak field compared to that inside the solenoid, it doesn't vanish when the solenoid is infinitely long.

All these proofs pertain to an external field pointing in the same direction as the solenoid's central axis. This longitudinal field is indeed zero when the solenoid is infinite in length. But, no matter how tightly the solenoid is wound, there is a met current in the longitudinal direction. Thus, by Ampere's law, there must be an external, toroidal field that dies off as 1/r. Why have I never seen this mentioned in textbooks?