# Divergence of a Vector Field and its Sources and Sinks

## Table of contents

- Positive divergence - source of a vector field Here you learn when the vector field in the considered point is a source.
- Negative divergence - sink of a vector field Here you learn when the vector field at the considered location is a sink.
- Divergence is zero - divergence-free vector field Here you learn when the vector field at the considered location is divergence-free.
- 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.

## 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.

## Divergence is zero - divergence-free vector field

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

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.

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)\).

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 \]
`