# Shouldn’t the magnetic field of a solenoid be affected by length?

I’m in an electricity and magnetism course right now and I literally can’t find an answer to this question, so I was wondering if someone could help.

In order to find the magnetic field inside a solenoid people use Ampère's law. Say you had 2 solenoids, one with 5 turns and one with 7 turns. Both have the same current and turn density. Based on the knowledge that each turn creates a magnetic field, it would make sense that at the center of the 7 turn solenoid there is a stronger magnetic field because of more turns contributing to the magnetic field at that point.

But, if you use Ampère's law and enclosed, say, the middle 3 loops of each solenoid, in the equation

$$\oint \mathbf B \cdot \mathrm d\mathbf l = \mu_0 I$$

the $$\mathrm d\mathbf l$$ and $$I$$ enclosed would ultimately be the exact same because the Amperian loop is the same length and the same amount of turns penetrate the loop. This means the magnetic field strength B should be the same for the 2 solenoids.

Am I missing something? Does the strength of a solenoid depend on the length or not?

• You need to enclose all of the loops, ie. you just cannot take any no. of loops of the solenoid to calculate the magnetic field. And yes the field does depend on no. of turns in a solenoid. Jan 25, 2021 at 17:52
• @ThePointer He/She is referring to the Ampere Circuital law, the line integral of the magnetic field. Jan 25, 2021 at 17:56
• @buddy001 Thanks for the response! My teacher said that this was the sort of magnetism analog to gauss' law, and I know that with Gauss' law everything would still hold true no matter if you enclosed all the charge or not. Shouldn't the same thing apply here, where you can use it for a set number of turns? I'd imagine that with an infinite solenoid you have to cut off the amperian loop somewhere. Jan 25, 2021 at 18:03

The field at the center does depend on the total number of turns, but that is only relevant for a solenoid of finite length. Meanwhile, Ampère's Law only applies to a solenoid of infinite length. That's because, to turn the general integral form of the law into an equation from which you can solve for $$B$$, there must be enough symmetry for you to simplify the integral expression. That means that (a) the current distribution must have some inherent symmetry, and (b) you must choose an Amperian loop that takes advantage of that symmetry. For the infinite solenoid, an appropriate loop is illustrated in the second to last slide of this document:

https://www.classe.cornell.edu/~liepe/webpage/docs/Phys2208_lecture18.pdf

It is a rectangle with one side along the solenoid axis, and the parallel side outside the solenoid. Thus the other two sides pass through the "wall" of the solenoid and are perpendicular to its loops. Basically, by symmetry alone, you can deduce that the magnetic field (a) is everywhere parallel to the solenoid axis, and (b) is constant along the axis or any line parallel to it. (a) is true because of rotational symmetry, ie. you can rotate the solenoid about its axis without changing the picture, and (b) is true by translational symmetry -- due to its infinite length, you can slide it along its axis without changing the picture. So the magnetic field must have those same two types of symmetry. Finally, you can show that the field goes to zero outside the solenoid, and combining these facts means the Amperian integral is zero on all but the axial side, leaving:

$$Bh = \mu_0 I_{enc}$$

where $$h$$ is the length of the axial side. Only because you reduced the integral to a simple product, via symmetry, can you now solve for $$B$$.

But a finite solenoid does not have translational symmetry, so the above method can't be applied. Instead, in principle, you would have to start from the Biot-Savart law and integrate it to find the formula for the field of a current ring anywhere on its axis, then add up that formula for all the rings in your finite solenoid. Which will clearly depend on the number of rings.

So in a sense, you're right that you don't have to enclose all the current in order to apply Ampère's Law, but the application of Ampère's Law still depends on the current outside your loop, because that current establishes the symmetry which reduces the integral to a product that can be solved.

$$\textbf{EDIT}$$ A few further clarifications about the symmetries and field of an infinite solenoid:

• For an arbitrary point inside the solenoid (not necessarily on the axis), our two symmetries alone do not imply the field is axial. Here, you need to invoke Gauss' law, which says the flux of $$\mathbf{B}$$ through any closed surface is zero. If $$\mathbf{B}$$ developed a radial component as you strayed from the axis, then it would necessarily have non-zero flux through a finite cylinder concentric with the axis.
• To show the field must vanish outside, again apply Ampere's law to a rectangle with two radial and two axial sides, but this time entirely outside the solenoid. Since no current is enclosed, the circulation vanishes, meaning the two axial sides have opposite $$\mathbf{B}$$. But now split this rectangle into two with another axial segment. By the same reasoning, $$\mathbf{B}$$ on the new segment must be opposite to each of the previous two axial segments. But these are already opposite to each other, leaving us with an impossible situation unless $$\mathbf{B} = 0$$ on all 3 segments.
• There is actually a third type of symmetry here (assuming the coils are tight enough that we can treat each turn as a flat circle, which we already assumed when asserting the other symmetries): the solenoid has reflection symmetry along its axis. You might then say that $$\mathbf{B}$$ should likewise be symmetric under reflection, but this would imply its axial component must be zero, leaving us with no field at all. So why doesn't this symmetry apply to $$\mathbf{B}$$? The answer is, it does apply -- it's just that $$\mathbf{B}$$ is not truly a vector! Some call it a pseudovector, but I find it more illuminating to call it a bivector. If a vector is an oriented line with a magnitude, then a bivector is an oriented plane with a magnitude -- oriented in the sense of "clockwise/counterclockwise as viewed from above", although there are nicer intrinsic ways to define orientation. Anyway, when thought of as a bivector, $$\mathbf{B}$$ lies in the plane of the circular current loop that makes up the solenoid, and its orientation is the same as that of the current. And then you can see that, when we reflect the solenoid along its axis, we don't change the orientation of $$\mathbf{B}$$ any more than we do current direction.

This last point is absolutely crucial when it comes to more deeply understanding electromagnetism. As you probably know, electromagnetism was largely the impetus for special relativity; and in relativity, the electric and magnetic fields are unified into a single bivector, with 6 components, one for each basis plane of spacetime. (In general it can no longer be thought of as a single oriented plane, as 4D spacetime allows us to have two planes that are entirely orthogonal to each other.) Bivectors are fascinating, and they are actually part of the greater geometric algebra, which in the case of spacetime is called the spacetime algebra. But I should probably leave it at that, as I've already strayed somewhat from the scope of the question.

• Thanks, that makes a lot of sense! Jan 25, 2021 at 18:46
• +1 but maybe edit the phrase "Ampère's Law only applies to a solenoid of infinite length." Ampere's law always applies; it is whether it can be used simply to find the B-field that is in question. Jan 26, 2021 at 7:47
• Great answer. I have a relevant question. How can we argue or explain the independence of the field on the radius, in the case of an infinite solenoid? I thought about energy. If two solenoids of different radii carry the same current, they produce the same $B$. But if the radius is so large, the field point is far away from the current source, so $B$ should be less. But to maintain the same current in both solenoids, the battery would have to supply more energy to the larger radius solenoid. But that's an indirect claim about energy, not about the field itself. Any insight?
– EM_1
May 7, 2023 at 14:39
• @EM_1 If you pick a given field point and then increase the radius, the line elements of a given current loop are indeed further from the field point, but there is more length in the loop. Remember for example that the Biot-Savart law says that $d\mathbf{B} \propto \frac{Id\mathbf{\ell} \times \hat{\mathbf{r}}}{r^2}$. You are increasing both the number/length of $d\mathbf{\ell}$'s as well as $r$, and the two effects cancel. But proving this using Biot-Savart for an arbitrary field point might be impossible in closed form. May 7, 2023 at 19:42
• @EM_1 It's probably similar to proving the shell theorem for either gravitation or electrostatics: when you're inside a spherical shell of uniform charge/mass density, the net field is zero. Yes, you could do it using an integral of the Coulomb/Newton law for a point mass/charge over the distribution, but it's much easier to invoke Gauss' law, which says the flux of the field is proportional to the charge/mass enclosed in a surface. For a spherical surface somewhere inside the shell and concentric with it, symmetry thus implies that the field vanishes. May 7, 2023 at 19:51