In order to establish some properties of the magnetic field, we must review some of the principles of vector calculus. These principles will be our guidance in the next section.

### Divergence of a Vector Field and Gauss' Theorem

Consider a three dimensional vector field defined by F = (P, Q, R), where P, Q and R are all functions of x, y and z. A typical vector field, for example, would be F = (2x, xy, z2x). The divergence of this vector field is defined as:

diverge = + + Thus the divergence is the sum of the partial differentials of the three functions that constitute the field. The divergence is a function, not a field, and is defined uniquely at each point by a scalar. Speaking physically, the divergence of a vector field at a given point measures whether there is a net flow toward or away the point. It is often useful to make the analogy comparing a vector field to a moving body of water. A nonzero divergence indicates that at some point water is introduced or taken away from the system (a spring or a sinkhole). Recall from electric forces and fields that the divergence of an electric field at a given point is nonzero only if there is some charge density at that point. Point charges cause divergence, as they are a "source" of field lines.

Divergence is mathematically significant because it allows us to relate volume integrals and surface integrals, through Gauss' Theorem. Given a closed surface that encompasses a certain volume, this theorem states that:  ·da =  dv

where the left side is a surface integral over a and the right side is a volume integral. We don't really deal with volume integrals in electricity and magnetism, so some of this theorem is irrelevant. However, when the divergence of a vector field is zero, this equation tells us that the integral through any surface in the field must also be zero.

### The Curl of a Vector Field and Stokes' Theorem

The second major concept from vector calculus that applies to magnetic fields is that of the curl of a vector function. Take again our vector field F = (P, Q, R). The curl of this vector field is defined as: =  - , - , -  Clearly this equation is a bit more complicated, but it gives us a lot more information. The curl, unlike the divergence, is itself a vector field, defined by a single vector at each point. Physically speaking, curl measures the rotational motion of a vector field. Again using our water analogy, a nonzero curl indicates an eddy or a whirlpool. At a given point in the field, the curl at that point tells us the axis of rotation of the field about that point. If the curl is zero, there is no axis of rotation, and thus no circular motion.

Unlike magnetic fields, electric fields never have curls. Recall that the line integral over any closed loop in an electric field is zero, implying that the field cannot "curve" around, as a field with a nonzero curl would.

Just as Gauss' Theorem relates surface integrals and volume integrals using divergence, Stokes' Theorem relates surface integrals and line integrals using curl. Given a closed curve that encompasses a surface,  ·ds =  ·da

where the left side is a line integral and the right side is a surface integral. Again, we pay special attention to the special case in which the curl is zero. In this case, the integral of the field around any closed loop is zero. Electric fields have this property.