Skip to content
Tutorials Center
My learning

Topics

Lesson 33 of 39 · The Big Theorems

Divergence and Curl

Learn the meaning and formulas of divergence (sources and sinks) and curl (rotation) for 3D vector fields, key identities, and SymPy computations.

Two derivatives describe how a vector field behaves locally. Divergence measures whether the field spreads out from a point (a source) or flows in toward it (a sink). Curl measures how much the field rotates around a point. Both are built from the partial derivatives of the components, and they are the quantities that appear inside the integrals of Stokes' theorem and the divergence theorem.

Notation: the del operator

Define the symbolic vector

Text
∇ = ⟨∂/∂x, ∂/∂y, ∂/∂z⟩

It is not a vector in the usual sense; it is an operator waiting for something to act on. We use it to remember formulas by treating it like a vector.

Divergence

For F = ⟨P, Q, R⟩, the divergence is the scalar

Text
div F = ∇ · F = ∂P/∂x + ∂Q/∂y + ∂R/∂z

Meaning. Imagine F as the velocity of a fluid. If div F > 0 at a point, the fluid is expanding there (more leaves a tiny box than enters): a source. If div F < 0, it is compressing: a sink. If div F = 0 everywhere, the flow is incompressible.

Examples.

  • F = ⟨x, y, z⟩: div F = 1 + 1 + 1 = 3. Constant outward expansion.
  • F = ⟨-y, x, 0⟩: div F = 0 + 0 + 0 = 0. Pure rotation does not expand or compress.
  • F = ⟨x², y², z²⟩: div F = 2x + 2y + 2z.

Curl

The curl is a vector:

Text
curl F = ∇ × F = | i    j    k   |
                 | ∂x   ∂y   ∂z  |
                 | P    Q    R   |
       = ⟨ ∂R/∂y - ∂Q/∂z,  ∂P/∂z - ∂R/∂x,  ∂Q/∂x - ∂P/∂y ⟩

Meaning. Place a tiny paddle wheel in the flow. The curl points along the axis about which the wheel spins (by the right-hand rule), and its length is twice the angular speed. If curl F = 0 everywhere, the field is irrotational.

Examples.

  • F = ⟨-y, x, 0⟩: curl F = ⟨0 - 0, 0 - 0, 1 - (-1)⟩ = ⟨0, 0, 2⟩. Counterclockwise rotation about the z-axis at angular speed 1.
  • F = ⟨x, y, z⟩: curl F = ⟨0, 0, 0⟩. Radial fields have no rotation.

In the plane, F = ⟨P, Q, 0⟩ has curl ⟨0, 0, ∂Q/∂x - ∂P/∂y⟩, and the third component is exactly the integrand in Green's theorem.

Python Divergence and curl in SymPy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Two identities worth knowing

For any twice continuously differentiable scalar function f and vector field F:

Text
curl (∇f) = 0
div (curl F) = 0

The first says gradient fields have no rotation: this is the 3D version of the "mixed partials agree" test, and it shows that a conservative field must have zero curl. The second says a curl field never has sources or sinks. Both come from the equality of mixed partial derivatives.

The Laplacian of f combines divergence and gradient:

Text
∇²f = div(∇f) = ∂²f/∂x² + ∂²f/∂y² + ∂²f/∂z²

It appears in heat flow, waves and electrostatics.

Python Verify the identities on sample functions

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Testing a field for conservativeness in 3D

A field with curl F = 0 on a simply connected region (like all of space) is conservative, so a potential exists. For example, F = ⟨y z, x z, x y⟩ has curl ⟨x - x, y - y, z - z⟩ = 0, and indeed f = xyz is a potential. The field ⟨-y, x, 0⟩ has curl ⟨0, 0, 2⟩, so it is not conservative.

Divergence as flux per volume

Surround a point with a tiny box of volume ΔV and compute the outward flux of F through its faces. The ratio flux/volume tends to div F as the box shrinks. Dually, curl is the circulation per area around a small loop: (curl F · n) is the limit of the circulation around a small loop with unit normal n, divided by the loop's area. These limit definitions are the reason the big theorems work: add up the tiny pieces and the interior contributions cancel.

Python Divergence as outward flux per unit volume

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. The divergence of F = ⟨x, y, z⟩ is:

    div F = ∂x/∂x + ∂y/∂y + ∂z/∂z = 3, a scalar.
  2. 2. The curl of F = ⟨-y, x, 0⟩ is:

    The z-component is ∂Q/∂x - ∂P/∂y = 1 - (-1) = 2.
  3. 3. Which identity is always true for smooth f?

    Mixed partial derivatives are equal, so the curl of a gradient vanishes. The divergence of a gradient is the Laplacian, which is not always zero.
  4. 4. A field with div F = 0 everywhere is called:

    Zero divergence means no net expansion or compression, like an incompressible fluid. Irrotational refers to zero curl.

Summary

  • div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z is a scalar measuring source/sink strength.
  • curl F = ∇ × F is a vector measuring local rotation (axis and twice the angular speed).
  • curl(∇f) = 0 and div(curl F) = 0.
  • Zero curl on a simply connected region means conservative.
  • The Laplacian ∇²f = div(∇f) appears throughout physics.

Next: Stokes' Theorem