# Divergence of magnetic field

Consider a point near one of the poles of a bar magnet. The magnetic field lines do appear to spread, but according to Maxwell's equations the divergence of a magnetic field is always zero. So what's wrong in my conclusion? The spreading of field lines is evident by the changes in strength of the magnetic field.

Perhaps it's more illuminating to write it in integral form.

$$\iint_S \mathbf{B} \cdot d\mathbf{A} = 0$$

So you need to enclose the region in a gaussian surface. Once you do this, you can see that every magnetic field line that exits the surface also enters. That is, magnetic field lines always come in complete loops, as explained in this answer.

• it has been known since Ulam that divB=0 does not mean that the magnetic field lines form closed loops, see e.g., Hosoda, Miyaguchi, Imagawa, Nakamura: "Ubiquity of chaotic magnetic-field lines generated by three-dimensionally crossed wires in modern electric circuits", PHYSICAL REVIEW E 80, 067202, 2009 and the references therein – hyportnex Jan 6 at 16:03
• @hyportnex interesting! Have these chaotic magnetic fields been realized yet experimentally? I've read that they could be in the sun, but that's also theoretical. – N. Steinle Jan 6 at 21:43
• @N.Steinle i know next to nothing about this subject, the article I referenced mention plasma physics as the main reason this subject is interesting, and am afraid I have already said more than I am entitled to... Anyhow, a well-known example is two cross-linked current carrying rings with orthogonal axes, this among others is analyzed in the Hosoda paper. – hyportnex Jan 6 at 22:07
1. One one hand, zero divergence $${\bf \nabla}\cdot {\bf B}=0$$ just states there are no magnetic monopoles, and hence that magnetic field lines never start or end.

2. On the other hand, the magnitude $$|{\bf B}|$$ of the magnetic field is proportional to the density of field lines (in an infinitesimal perpendicular cross-section). The magnitude $$|{\bf B}|$$ (=density of field lines) is allowed to vary from point to point.

• Or rather, that magnetic fields start where they end. :) – N. Steinle Jan 6 at 13:38
• $\uparrow$ Right :) – Qmechanic Jan 6 at 13:40

Maybe you use the term "divergence" too literally. A field of the form $$\vec A = A x \hat e_x$$ has nonzero divergence while its field lines remain perfectly parallel. Conversely, the electric field of a point charge has zero divergence (except in the center), where the lines diverge. To have a zero divergence at a point, it is necessary that the flux of the field on a small closed surface around this point is null, and that's always the case for the magnetic field.