Activity: Visualization of Divergence

Vector Calculus II 2022 (7 years)
Students predict from graphs of simple 2-d vector fields whether the divergence is positive, negative, or zero in various regions of the domain using the definition of the divergence of a vector field at a point: The divergence of a vector field at a point is flux per unit volume through an infinitesimal box surrounding that point. Optionally, students can use a Mathematica notebook to verify their predictions.
  • group Small Group Activity schedule 30 min. build \begin{itemize} \item Dry-erasable plastic sleeves such as C-line CLI-40620. \item Copies of vector fields for the plastic sleeves. \item (Optional) Computers running Mathematica \item (Optional) The Mathematical notebook: How do we reference this?? \end{itemize} description Student handout (PDF)
What students learn
  • Divergence of a vector field (at a point) is the flux per unit volume through an infinitesimal box.
  • How to predict the sign and relative magnitude of the divergence from graphs of a vector field.
  • (Optional) How to calculate the divergence of a vector field with Mathematica.
  • assignment Divergence through a Prism

    assignment Homework

    Divergence through a Prism
    Static Fields 2022 (4 years)

    Consider the vector field \(\vec F=(x+2)\hat{x} +(z+2)\hat{z}\).

    1. Calculate the divergence of \(\vec F\).
    2. In which direction does the vector field \(\vec F\) point on the plane \(z=x\)? What is the value of \(\vec F\cdot \hat n\) on this plane where \(\hat n\) is the unit normal to the plane?
    3. Verify the divergence theorem for this vector field where the volume involved is drawn below. (“Verify” means calculate both sides of the divergence theorem, separately, for this example and show that they are the same.)

  • assignment Divergence

    assignment Homework

    Static Fields 2022 (4 years)

    Shown above is a two-dimensional vector field.

    Determine whether the divergence at point A and at point C is positive, negative, or zero.

  • assignment Gravitational Field and Mass

    assignment Homework

    Gravitational Field and Mass
    Static Fields 2022 (3 years)

    The gravitational field due to a spherical shell of matter (or equivalently, the electric field due to a spherical shell of charge) is given by: \begin{equation} \vec g = \begin{cases} 0&\textrm{for } r<a\\ -G \,\frac{M}{b^3-a^3}\, \left( r-\frac{a^3}{r^2}\right)\, \hat r & \textrm{for } a<r<b\\ -G\,\frac{M}{r^2}\, \hat r & \textrm{for } r>b \\ \end{cases} \end{equation}

    This problem explores the consequences of the divergence theorem for this shell.

    1. Using the given description of the gravitational field, find the divergence of the gravitational field everywhere in space. You will need to divide this question up into three parts: \(r<a\), \(a<r<b\), and \(r>b\).
    2. Briefly discuss the physical meaning of the divergence in this particular example.
    3. For this gravitational field, verify the divergence theorem on a sphere, concentric with the shell, with radius \(Q\), where \(a<Q<b\). ("Verify" the divergence theorem means calculate the integrals from both sides of the divergence theorem and show that they give the same answer.)
    4. Briefly discuss how this example would change if you were discussing the electric field of a uniformly charged spherical shell.

  • assignment Electric Field and Charge

    assignment Homework

    Electric Field and Charge
    divergence charge density Maxwell's equations electric field Static Fields 2022 (3 years) Consider the electric field \begin{equation} \vec E(r,\theta,\phi) = \begin{cases} 0&\textrm{for } r<a\\ \frac{1}{4\pi\epsilon_0} \,\frac{Q}{b^3-a^3}\, \left( r-\frac{a^3}{r^2}\right)\, \hat r & \textrm{for } a<r<b\\ 0 & \textrm{for } r>b \\ \end{cases} \end{equation}
    1. Use step and/or delta functions to write this electric field as a single expression valid everywhere in space.
    2. Find a formula for the charge density that creates this electric field.
    3. Interpret your formula for the charge density, i.e. explain briefly in words where the charge is.
  • assignment Flux through a Paraboloid

    assignment Homework

    Flux through a Paraboloid
    Static Fields 2022 (4 years)

    Find the upward pointing flux of the electric field \(\vec E =E_0\, z\, \hat z\) through the part of the surface \(z=-3 s^2 +12\) (cylindrical coordinates) that sits above the \((x, y)\)--plane.

  • assignment Divergence Practice including Curvilinear Coordinates

    assignment Homework

    Divergence Practice including Curvilinear Coordinates

    Calculate the divergence of each of the following vector fields. You may look up the formulas for divergence in curvilinear coordinates.

    1. \begin{equation} \hat{F}=z^2\,\hat{x} + x^2 \,\hat{y} -y^2 \,\hat{z} \end{equation}
    2. \begin{equation} \hat{G} = e^{-x} \,\hat{x} + e^{-y} \,\hat{y} +e^{-z} \,\hat{z} \end{equation}
    3. \begin{equation} \hat{H} = yz\,\hat{x} + zx\,\hat{y} + xy\,\hat{z} \end{equation}
    4. \begin{equation} \hat{I} = x^2\,\hat{x} + z^2\,\hat{y} + y^2\,\hat{z} \end{equation}
    5. \begin{equation} \hat{J} = xy\,\hat{x} + xz\,\hat{y} + yz\,\hat{z} \end{equation}
    6. \begin{equation} \hat{K} = s^2\,\hat{s} \end{equation}
    7. \begin{equation} \hat{L} = r^3\,\hat{\phi} \end{equation}

  • assignment Differential Form of Gauss's Law

    assignment Homework

    Differential Form of Gauss's Law
    Static Fields 2022 (4 years)

    For an infinitesimally thin cylindrical shell of radius \(b\) with uniform surface charge density \(\sigma\), the electric field is zero for \(s<b\) and \(\vec{E}= \frac{\sigma b}{\epsilon_0 s}\, \hat s\) for \(s > b\). Use the differential form of Gauss' Law to find the charge density everywhere in space.

  • assignment Curl

    assignment Homework

    Static Fields 2022 (4 years)

    Shown above is a two-dimensional cross-section of a vector field. All the parallel cross-sections of this field look exactly the same. Determine the direction of the curl at points A, B, and C.

  • group Acting Out Flux

    group Small Group Activity

    5 min.

    Acting Out Flux
    Static Fields 2022 (3 years)

    flux electrostatics vector fields

    Students hold rulers and meter sticks to represent a vector field. The instructor holds a hula hoop to represent a small area element. Students are asked to describe the flux of the vector field through the area element.
  • group Flux through a Cone

    group Small Group Activity

    30 min.

    Flux through a Cone
    Static Fields 2022 (3 years)

    Integration Sequence

    Students calculate the flux from the vector field \(\vec{F} = C\, z\, \hat{z}\) through a right cone of height \(H\) and radius \(R\) .

For each of the vector fields below, decide whether the divergence is postive, negative, or zero in each quadrant. Be prepared to defend your answers.

Instructor's Guide


We precede this activity with a derivation of the rectangular coordinate expression for divergence: the divergence is the flux per unit volume through an appropriately chosen closed surface. Our derivation follows the one in Div, grad, curl and all that, Schey, 2nd edition, Norton, 1973, p. 36 or see our versions One can also use clicker questions or SWBQs about divergence to help get them started (see Visualization of Divergence).

Then the students are presented with a number of examples of 2-d vector fields in dry eraseable plastic sleeves. Most vector fields are shown as a cross-section of the field and it is assumed the the vector field is independent of the third (unshown) dimension. Students are asked to use the definition of divergence as the flux per unit volume through an infinitesimal box to predict the sign and relative magnitude of the divergence in each quadrant. Optionally, a prepared Mathematica worksheet can be used to calculate the divergence, so students can check their predictions.

Student Conversations

  • To speed up this activity, the instructor can do the first example for the class.
  • Many students are still confused about the role of the unit normal. Draw it!
  • It can help to write the formula for the flux so that students are reminded that they are taking the dot product of the vector field with the unit normal.
  • Choosing the correct shape chunks: Students should be encouraged to see that it is easier to choose a volume that respects the symmetries of the vector field, i.e. in this case, sides of pineapple chunks for the cylindrical fields.
  • Various points: Make sure to look at several different points in space for each vector field, NOT just the origin. Use this to emphasize that divergence is itself a field.
  • Positive or negative divergence: Students should should see that, for the vector fields that radiate out from the origin, different length scalings lead to different signs for the divergence, depending on whether they are adding larger vectors perpendicular to the larger arced surface or smaller vectors perpendicular to the larger arced surface. Near the end of this activity, they can be asked to discover which scaling leads to zero divergence everywhere (except at the origin). This vector field represents the electric field around a charged wire. Nature picks out this special case.


A quick whole class discussion of the items listed in Student Conversations.

Author Information
Corinne Manogue
Learning Outcomes