Alexander Fufaev
My name is Alexander FufaeV and here I write about:

Divergence of a Vector Field and its Sources and Sinks

Table of contents
  1. Positive divergence - source of a vector field Here you learn when the vector field in the considered point is a source.
  2. Negative divergence - sink of a vector field Here you learn when the vector field at the considered location is a sink.
  3. Divergence is zero - divergence-free vector field Here you learn when the vector field at the considered location is divergence-free.
  4. Exercises with Solutions

Divergence \( \nabla \cdot \boldsymbol{F} \) of a vector field \( \boldsymbol{F} \) is defined as the scalar product between the nabla operator \( \nabla \) and the vector field \( \boldsymbol{F} \):

Here \( F_{\text x} \) is the first, \( F_{\text y} \) second and \( F_{\text z} \) the third component of the following three-dimensional vector field \( \boldsymbol{F}(x,y,z) \):

As discussed in the lesson on Maxwell's equations, the vector field \( \boldsymbol{F} \) can represent, for example, the electric field \( \boldsymbol{E} \) or the magnetic field \( \boldsymbol{B} \).

The result \(\nabla \cdot \boldsymbol{F}\) of the divergence in Eq. 1 is a scalar function (no vector quantity anymore)! So, if a concrete place is inserted for \((x,y,z)\), then the scalar function results in a usual number: \(\nabla \cdot \boldsymbol{F}(x,y,z)\). This number is a measure for the divergence of the vector field at the considered location \((x,y,z)\). It can be a positive or negative number or even zero. Depending on whether the number is positive, negative or zero, it has a different physical meaning.

Positive divergence - source of a vector field

We assume that we have inserted a concrete location \((x,y,z)\) into the divergence field \(\nabla \cdot \boldsymbol{F}(x,y,z)\) and obtained a positive number:

Then the considered point \((x,y,z)\) in space is a source of the vector field \(\boldsymbol{F}\). If this location is enclosed with an arbitrary surface (e.g. with a cube surface), then the flux of the vector field through this surface is also positive. The vector field points out of the surface.

Positive Divergenz am Ort \((x,y,z)\) ist die Quelle des Vektorfeldes.
Example: Source of the vector field

What is the divergence at the point \(1, 0, 0\) of the following vector field:

The divergence \(\nabla \cdot \boldsymbol{F}\) of this vector field is calculated by forming the three partial derivatives of the vector field as in Eq. 1 and adding them together:

Thus we have determined the divergence field in the whole space. But we want to determine the divergence at the location \((x,y,z)=(1,0,0)\) and therefore set \(x=1\), \(y=0\) and \(z=0\):

The vector field \( \boldsymbol{F} \) has a positive divergence \( \nabla \cdot \boldsymbol{F} = 5 \) at the considered location. Physically this location represents a source of vector field \(\boldsymbol{F}\). If it were an electric field \( \boldsymbol{F} = \boldsymbol{E} \), then a positive divergence would mean that there is a positive electric charge sitting at the location \((1,0,0)\).

Negative divergence - sink of a vector field

Now assume that we have obtained a negative number after inserting a concrete location into the divergence field:

Then the considered location \((x,y,z)\) is a sink of the vector field \(\boldsymbol{F}\). If this place is enclosed with an arbitrary surface, then the flux of the vector field through this surface is also negative. The vector field goes into the surface.

Negative Divergenz am Ort \((x,y,z)\) ist die Senke des Vektorfeldes.
Example: sink of a vector field

Given is the following vector field:

The divergence \(\nabla \cdot \boldsymbol{F}\) of this vector field is:

The considered vector field has at each location \((x,y,z)\) a constant negative divergence. That means, no matter which location is used for \((x,y,z)\), every location has a negative divergence with the value -1. Each location represents a sink of the vector field \(\boldsymbol{F}\). If the vector field \(\boldsymbol{F}\) were an electric field, then this result would mean that a negative electric charge sits at each location.

Divergence is zero - divergence-free vector field

Now assume that we have obtained zero after inserting a concrete location into the divergence field:

Divergenzfreies Vektorfeld am Ort \((x,y,z)\).

Then at the location \((x,y,z)\) the considered vector field is divergence-free. That means: If this point is enclosed with any surface, then the flux of the vector field through this surface is also zero. The vector field does not point into this surface, but also does not point out. Or there is just as much vector field pointing into the surface as out, so that the two opposite contributions cancel each other out and the divergence is net zero.

Example: Divergence-free vector field

Calculate the divergence at the \(1, 1, 1)\) location of the following vector field:

The divergence \(\nabla \cdot \boldsymbol{F}\) of this vector field is:

Insert the point \((x,y,z) = (1,1,1)\):

The divergence of the considered vector field at this location is zero. For example, the second Maxwell equation of electrodynamics states that divergence of the magnetic field \( \nabla \cdot \boldsymbol{B} \) is zero. Physically this means: There are no magnetic monopoles! Magnetic north pole always occurs together with a magnetic south pole.

In the examples of negative divergence and divergence-free fields, we got out a constant divergence that is independent of the location. But the divergence field \(\nabla \cdot \boldsymbol{F}\) must not necessarily result in a constant! They were just simple examples. In general the divergence field depends on all three coordinates: \(\nabla \cdot \boldsymbol{F}(x,y,z)\).

Example: Variable divergence

Given is the following vector field:

As shown in Eq. 1, calculate the partial derivatives of the vector field to determine the divergence field:

In this case we get a divergence depending on \(x\) and \(y\): \( \nabla \cdot \boldsymbol{F}(x, y) ~=~ y + 2x\, y \).

  • At the location \((1,2,0)\) the divergence is positive: \( \nabla \cdot \boldsymbol{F}(1,2,0) ~=~ 4 \).

  • At the location \((1,-2,0)\), however, the divergence is negative: \( \nabla \cdot \boldsymbol{F}(1,-2,0) ~=~ -4 \).

  • At the location \((-0.5,2,1)\) the divergence disappears: \( \nabla \cdot \boldsymbol{F}(-0.5,2,1) ~=~ 0 \).

Now you should know how divergence of a vector field is calculated and physically interpreted. This knowledge will help you grasp the Gauss integral theorem, which is incredibly important for understanding Maxwell's equations.

Exercises with Solutions

Use this formula eBook if you have problems with physics problems.

Exercise: Vector Potential of a Magnetic Dipole

Check if the divergence of the vector potential \(\boldsymbol{A}\) of a magnetic dipole equals zero: $$\nabla \cdot \left( \frac{\boldsymbol{m}\times\boldsymbol{r}}{r^3} \right)\stackrel{?}{=} 0$$

Solution to the Exercise

The divergence operator in index notation is: 1 \[ \nabla \cdot \boldsymbol{A} = \boldsymbol{\hat{e}}_{i}\, \partial_{i} \cdot \boldsymbol{\hat{e}}_i \, A_j \]

Together with the cross product in index notation and the magnitude of the position vector \(\boldsymbol{r}\) as \( r = (x_s \, x_s)^{1/2} \) you get: 2 \[ \boldsymbol{\hat{e}}_{i} \partial_i ~\cdot~ \boldsymbol{\hat{e}}_j \, \varepsilon_{jkn} \, m_k \, x_n \, (x_s \, x_s)^{-3/2} \]

You may pull constants in front of the differential operator \(\partial_i\). In this case, it acts on the components of the position vector, namely \(x\),\(y\), and \(z\). Therefore, you may pull \(m_k\) and \(\boldsymbol{\hat{e}}_j\) to the front, as they do not contain variables to differentiate with respect to. Then, you combine \( \boldsymbol{\hat{e}}_i \cdot \boldsymbol{\hat{e}}_j\) to the Kronecker delta \(\delta_{ij}\): 3 \[ \varepsilon_{jkn} \, m_k \, \delta_{ij} \, \partial_i \, x_n \, (x_s \, x_s)^{-3/2} \]

Combine, for example, \(\delta_ij \, \partial_i\) to \(\partial_j\) and apply the product rule: \[ \varepsilon_{jkn} \, m_k \left[ (x_s \, x_s)^{-3/2} \, \partial_j \, x_n ~+~ x_n \, \partial_j \, (x_s \, x_s)^{-3/2} \right] \]

Differentiating \(x_n\) with respect to the \(j\)-th variable results in zero when \(j \neq n \) (e.g., \(\partial_1 \, x_2 = 0\)), and results in one when \(j = n \) (e.g., \(\partial_3 \, x_3 = 1\)). This corresponds to the definition of the Kronecker delta: \(\delta_{jn}\). The first term thus contains \( \varepsilon_{jkn} \, \delta_{jn} \). This is always zero, as for \(j = n\), the Levi-Civita symbol is zero, and for \(j \neq n \), the Kronecker delta is zero. Therefore, the first term vanishes!

Thus, only differentiate the second term \((x_s \, x_s)^{-3/2}\) with respect to the \(j\)-th variable. However, nothing cancels out here, as there is summation over index \(s\) (e.g., when differentiating \(\partial_1 \, (x_1\,x_1 + x_2\,x_2 + x_3\,x_3)\), the term \(\partial_1 \, x_1\) remains): 4 \[ \varepsilon_{jkn} \, m_k \, x_n \, (x_s \, x_s)^{-5/2} \, \left(-\frac{3}{2}*2x_j\right) \]

Combine and rearrange: 5 \[ -3r^{-5} \, \varepsilon_{jkn} \, m_k \, x_n \, x_j \]

For the final step to the result, apply a clever trick to recognize that zero is the outcome: You can rotate indices in the Levi-Civita symbol once counterclockwise without changing the result. Then you have: 6 \[ -3r^{-5} \, \varepsilon_{knj} \, m_k \, x_n \, x_j \]

If you still don't see that the expression is zero, then you're as dumb as I am. At this point, reform the Levi-Civita symbol back into a cross product, then you have: 7 \[ -3r^{-5} \, \, m_k \, (r \times r)_k \]

The cross product of a vector with itself always results in zero. Calculate it yourself if you don't believe me! With that, you're done. Overall, the vector potential of the magnetic dipole satisfies the so-called Coulomb gauge equation: 8 \[ \nabla \cdot \boldsymbol{A} = 0 \]