# Why is the magnetic field in the center of a coil the strongest

In my current lab we were told that we should expect the magnetic field of a coil to be strongest in the center of the coil.

I was wondering why this is the case. Shouldn't the magnetic field just be constant inside of the coil becuase of the general formula: $$B=\frac{\mu NI}{L}$$ This would also make sense in my head: Because if we move an object in the center of the coil into the direction of the wires, the object will feel a stronger magnetic field from the closer wire and feel a bit weaker magentic field from the wire on the other side of the loop. Thus again, in overall, summing to the total magnetic field also experienced in the center of the coil.

I probably have a mistake in my thought process but I can't seem to find it. It would be awesome if someone could explain this a little bit better to me. Thank you!

It depends on the kind of coil...

The formula that you quote is for a solenoid whose length is much greater than its diameter. It gives the field strength (flux density) at any point in the central (uniform field) region, that is inside the solenoid but a few diameters away from the ends. [A solenoid is a coil wound on a cylindrical former, so that the wire forms a helix with closely packed turns.]

Towards the ends of the solenoid the field does decrease, so that the field strength on the axis at the geometrical end of the solenoid is half what it is in the middle.

For a 'flat' coil, for which the turns are almost in a single plane and not spread out over a cylinder, there is no region of uniform field. The flux density at the centre of a flat coil of radius $$a$$ and $$N$$ turns is $$B=\frac{\mu_0 N I}{2 a}$$

The field strength drops as we move along the axis from the centre of the coil. At distance $$z$$ along the axis from the centre $$B=\frac{\mu_0 N I a^2}{2{(a^2 + z^2)}^{3/2}}$$ On the other hand, going out radially from the centre towards the wire of the coil, the field increases.

[From the last formula we can derive the long solenoid formula that you quoted (at least for points on the axis) by regarding the solenoid as a collection of co-axial flat coils! This viewpoint also enables us to see why, in the middle region of a solenoid, the field is the same if we move along the axis from the central point. We still have flat coils on either side of us, stretching away so far that their ceasing to exist at each end isn't relevant: the fields from distant flat coils are too weak to contribute in the central region. There is no such easy explanation of why, in the central region, the field is uniform over the cross-section.]

Here is a simple way to visualize Philip Wood's (+1, Phil) excellent answer to your question, without (most of the) math.

The measured strength of a magnetic field in a particular location or little volume element near the coil that produces it is proportional to the apparent density of the field lines passing through that little volume element. Lots of field lines through a little volume element means an intense field there.

Since mathematically every magnetic field line produced by a current in a coil must loop around in space and return to its origin to form a closed path, you can readily see that the spot where the field will be most intense is at the center of the coil, where all the field lines have to get bunched together to fit through the coil.