B-field lines never end
Main article: Gauss's law for magnetism
Field lines are a useful way to represent any vector field and often reveal sophisticated properties of fields quite simply.
One important property of the B-field revealed this way is that magnetic B field lines neither start nor end (mathematically, B is a solenoidal vector field); a field line either extends to infinity or wraps around to form a closed curve.[nb 8]
To date no exception to this rule has been found. (See magnetic monopole below.)
Magnetic field lines exit a magnet near its north pole and enter near its south pole, but inside the magnet B-field lines continue through the magnet from the south pole back to the north.[nb 9] If a B-field line enters a magnet somewhere it has to leave somewhere else;
it is not allowed to have an end point. Magnetic poles, therefore, always come in N and S pairs. Cutting a magnet in half results in two separate magnets each with both a north and a south pole.
More formally, since all the magnetic field lines that enter any given region must also leave that region, subtracting the 'number'[nb 10] of field lines that enter the region from the number that exit gives identically zero. Mathematically this is equivalent to:
where the integral is a surface integral over the closed surface S (a closed surface is one that completely surrounds a region with no holes to let any field lines escape). Since dA points outward, the dot product in the integral is positive for B-field pointing out and negative for B-field pointing in.
There is also a corresponding differential form of this equation covered in Maxwell's equations below.