Open the first chapter of Part VII and you are stepping into the language of mathematical physics. Everything we did in Part VI — partial derivatives, gradients, multiple integrals — was preparation for one idea: the vector field. A vector field is...
Prerequisites
- Chapter 30: Multivariable Chain Rule and Gradient
Learning Objectives
- Define vector fields in 2D and 3D, and distinguish them from vector-valued functions of one parameter.
- Sketch vector fields and identify streamlines (flow lines).
- Compute divergence $\nabla \cdot \mathbf{F}$ and curl $\nabla \times \mathbf{F}$, and interpret each physically.
- Recognize conservative fields ($\mathbf{F} = \nabla f$), apply the curl test, and find potentials.
- Apply vector fields to fluid flow, gravity, and electromagnetism.
In This Chapter
- 34.1 What Is a Vector Field?
- 34.2 A Gallery of Vector Fields
- 34.3 Streamlines (Flow Lines)
- 34.4 Divergence: Measuring Outflow
- 34.5 Curl: Measuring Rotation
- 34.6 Conservative Vector Fields and Potentials
- 34.7 Physical Conservative Fields and Energy
- 34.8 Conservative Fields and Path-Independence (Preview)
- 34.9 Solenoidal, Irrotational, and the Operator Zoo
- 34.10 Computation: Plotting Fields, Computing Operators
- 34.11 Application: Fluid Dynamics
- 34.12 Application: Electromagnetism and Maxwell's Equations
- 34.13 The Deeper Meaning Comes Next
- Looking Ahead
- Reflection
Chapter 34 — Vector Fields
34.1 What Is a Vector Field?
Open the first chapter of Part VII and you are stepping into the language of mathematical physics. Everything we did in Part VI — partial derivatives, gradients, multiple integrals — was preparation for one idea: the vector field. A vector field is what a velocity, a force, or a flow looks like when you draw it everywhere at once.
Here is the picture. Stand in a river and let the current push a hundred tiny corks past your hand. Each cork, at the instant it passes a given point, has a velocity — a magnitude (how fast) and a direction (which way). Now imagine drawing that velocity arrow at every point of the river simultaneously. That carpet of arrows is a vector field. Wind maps, magnetic-field diagrams, and the streamlines on an aircraft wing are all the same object.
Formally, a vector field is a function
$$\mathbf{F}: \mathbb{R}^n \to \mathbb{R}^n$$
that assigns to each point of space an $n$-dimensional vector. In the plane we write
$$\mathbf{F}(x, y) = \langle P(x, y),\, Q(x, y) \rangle,$$
so at each point $(x,y)$ an arrow $\langle P, Q\rangle$ sprouts. In space,
$$\mathbf{F}(x, y, z) = \langle P, Q, R \rangle,$$
a three-dimensional vector at each point. The functions $P$, $Q$, $R$ are the component functions — ordinary scalar fields of the kind you met in Chapter 29.
You have already built one vector field without naming it. In Chapter 30 we took a scalar function $f(x,y)$ — a scalar field, one number at each point, like temperature — and formed its gradient $\nabla f = \langle f_x, f_y \rangle$. The gradient attaches a vector to each point: it is a vector field. So gradients are our first and most important family of vector fields, and we return to them in §34.6.
The Key Insight. A vector field is a "vector at every point" picture. It is the natural object whenever a quantity at each location carries both magnitude and direction — force, velocity, flow. The two operators we build in this chapter, divergence and curl, read off the local structure of that picture: how much it spreads, and how much it spins.
A crucial distinction: vector fields vs. vector-valued functions
Do not confuse the object of this chapter with the object of Chapter 28. There we studied a vector-valued function $\mathbf{r}(t) = \langle x(t), y(t), z(t)\rangle$: a single vector for each value of a parameter $t$. As $t$ runs over an interval, the tip of $\mathbf{r}(t)$ traces one curve through space — a particle's trajectory. The input is one number, $t$; the output is one moving arrow.
A vector field is different in kind. Its input is a point of space, $(x,y)$ or $(x,y,z)$, and there is an output vector at every point, all at once — a whole field of arrows filling the room, not one arrow moving along a path.
| Vector-valued function (Ch. 28) | Vector field (this chapter) | |
|---|---|---|
| Input | a parameter $t \in \mathbb{R}$ | a point $(x,y)$ or $(x,y,z)$ |
| Output | one vector $\mathbf{r}(t)$ | a vector $\mathbf{F}$ at every point |
| Picture | one arrow tracing a curve | a carpet of arrows filling space |
| Typical use | the path of a particle | the flow or force the particle moves through |
The two are partners. A particle (a vector-valued function $\mathbf{r}(t)$) moves through a vector field $\mathbf{F}$; the field tells the particle which way to go. We make that partnership precise in §34.3 with streamlines, where the field $\mathbf{F}$ and the trajectory $\mathbf{r}(t)$ meet in one equation.
Common Pitfall. Many students write $\mathbf{F}(t)$ for a vector field, importing the single-parameter habit from Chapter 28. But a planar vector field is $\mathbf{F}(x,y)$ — two inputs — and a spatial one is $\mathbf{F}(x,y,z)$. Using $t$ as the input quietly collapses the field down to a single curve and loses the whole "vector at every point" idea. Reserve $t$ for the parameter of a path; use position variables for a field.
34.2 A Gallery of Vector Fields
The fastest way to develop intuition is to sketch a handful of fields by hand. For each, evaluate the field at a few points, draw the arrows, and read the pattern. The geometry-plus-algebra theme of this book is at its sharpest here: every formula below has an unmistakable picture.
Constant field. $\mathbf{F}(x, y) = \langle 1, 0 \rangle$. Every arrow has length $1$ and points right, everywhere. This is uniform flow — a wide, slow river with no banks.
Radial (source) field. $\mathbf{F}(x, y) = \langle x, y \rangle$. At $(x,y)$ the arrow points directly away from the origin, with magnitude $\sqrt{x^2+y^2}$ — short near the center, long far out. Picture fluid gushing outward from a spring at the origin.
Rotational field. $\mathbf{F}(x, y) = \langle -y, x \rangle$. Evaluate it: at $(1,0)$ we get $\langle 0,1\rangle$ (up); at $(0,1)$ we get $\langle -1,0\rangle$ (left); at $(-1,0)$ we get $\langle 0,-1\rangle$ (down). The arrows wheel counterclockwise around the origin, with magnitude $\sqrt{x^2+y^2}$ growing with distance — rigid rotation, like a spinning turntable.
Inverse-square (gravitational/electrostatic) field. $\mathbf{F}(x, y) = -\dfrac{1}{r^3}\langle x, y \rangle$, where $r = \sqrt{x^2+y^2}$. The arrows point inward toward the origin, and the magnitude is $\dfrac{r}{r^3} = \dfrac{1}{r^2}$ — the famous inverse-square decay. This is the planar caricature of the gravitational pull of a point mass, or the electric field of a point charge.
Vortex (irrotational circulation). $\mathbf{F}(x, y) = \dfrac{1}{x^2 + y^2}\langle -y, x \rangle$. Same circulating direction as the rotational field, but magnitude $\dfrac{1}{r}$ — strong near the center, fading outward. This is the velocity field of an idealized 2D point vortex (think of the flow around a draining bathtub far from the drain). We will return to it in §34.5 for a surprise: despite all that swirling, its curl is zero away from the origin.
Magnetic field around a wire. Run a steady current up the $z$-axis. The magnetic field circles the wire: in components, $\mathbf{B} \propto \dfrac{1}{x^2+y^2}\langle -y, x, 0\rangle$ — exactly the vortex pattern, decaying like $1/r$. We will meet this field again as a worked example of curl and divergence.
Geometric Intuition. Three patterns cover almost everything you will see: outflow (radial, arrows pointing away — divergence at work), swirl (rotational/vortex, arrows circulating — curl at work), and uniform (constant, all arrows parallel — neither). Real fields are blends. Train your eye to decompose any sketch into "how much is it spreading?" and "how much is it spinning?" — those two questions are precisely divergence and curl.
Check Your Understanding. Sketch (in your head) the field $\mathbf{F}(x,y) = \langle x, -y\rangle$ at the four points $(\pm 1, 0)$ and $(0, \pm 1)$. Is it a source, a swirl, or something else?
Answer
At $(1,0)$: $\langle 1,0\rangle$ (right); at $(-1,0)$: $\langle -1,0\rangle$ (left) — arrows flee the origin along the $x$-axis. At $(0,1)$: $\langle 0,-1\rangle$ (down); at $(0,-1)$: $\langle 0,1\rangle$ (up) — arrows rush toward the origin along the $y$-axis. The field spreads horizontally while compressing vertically: a saddle flow. It is neither a pure source nor a pure swirl. We will see in §34.4 that its divergence is $1 + (-1) = 0$: the horizontal spreading exactly balances the vertical squeezing.
34.3 Streamlines (Flow Lines)
If a vector field is a frozen snapshot of arrows, a streamline (also called a flow line or integral curve) is the path a particle follows when it surrenders to the field. By definition, a streamline is a curve $\mathbf{r}(t)$ whose velocity at each instant equals the field vector there:
$$\mathbf{r}'(t) = \mathbf{F}(\mathbf{r}(t)).$$
This is exactly where the vector-valued function of Chapter 28 (the path $\mathbf{r}(t)$) meets the vector field of this chapter (the rule $\mathbf{F}$). The equation is a system of differential equations of the kind Chapter 19 introduced; solving it produces the streamlines.
Physical reading. If $\mathbf{F}$ is a fluid's velocity field, the streamlines are the trajectories of fluid particles — the lines you see when you drop dye into a steady flow. If $\mathbf{F} = -\nabla L$ is the negative gradient of a loss function, the streamlines are the paths of gradient descent (the anchor example from Chapter 6, here in its multivariable form).
Worked streamlines.
- Constant field $\mathbf{F} = \langle 1, 0\rangle$: the system is $\dot x = 1$, $\dot y = 0$, so $x = t + x_0$, $y = y_0$. Streamlines are horizontal lines.
- Radial field $\mathbf{F} = \langle x, y\rangle$: $\dot x = x$, $\dot y = y$ give $x = x_0 e^{t}$, $y = y_0 e^{t}$, so $y/x = y_0/x_0$ stays constant. Streamlines are rays shooting out from the origin.
- Rotational field $\mathbf{F} = \langle -y, x\rangle$: the system is $\dot x = -y$, $\dot y = x$. Differentiate the first and substitute the second: $\ddot x = -\dot y = -x$, the harmonic-oscillator equation. Its solution is $x(t) = A\cos t + B\sin t$, and then $y = -\dot x = A\sin t - B\cos t$. Squaring and adding gives $x^2 + y^2 = A^2 + B^2$, a constant: the streamlines are circles about the origin, traversed counterclockwise once per $2\pi$ — uniform circular motion at angular velocity $1$.
That last calculation is worth pausing on. We solved a vector field's flow lines and got circles, confirming by calculus what the arrow sketch in §34.2 told us by eye. Geometry and algebra agreeing once more.
Real-World Application — Weather and ocean forecasting. A weather map's wind barbs are samples of a velocity vector field $\mathbf{u}(x,y)$; the smooth curves a meteorologist draws through them are streamlines. Ocean current charts, used to route ships fuel-efficiently and to predict where an oil spill or a search-and-rescue target will drift, are streamlines of the sea-surface velocity field. Integrating $\mathbf{r}'(t) = \mathbf{u}(\mathbf{r}(t))$ numerically is exactly how drift trajectories are forecast.
34.4 Divergence: Measuring Outflow
We now build the first of the two operators that read a field's local structure. For a field $\mathbf{F}(x, y, z) = \langle P, Q, R \rangle$, the divergence is the scalar
$$\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}.$$
In two dimensions, $\nabla \cdot \mathbf{F} = P_x + Q_y$. The notation $\nabla \cdot \mathbf{F}$ treats the symbol $\nabla = \langle \partial_x, \partial_y, \partial_z\rangle$ as a "vector of derivatives" and dots it into $\mathbf{F}$; the result is a number at each point, so the divergence of a vector field is a scalar field.
What divergence means
Picture $\mathbf{F}$ as fluid velocity and imagine a tiny box around a point. Divergence measures the net rate at which fluid flows out of that box, per unit volume:
- $\nabla \cdot \mathbf{F} > 0$ at a point: more flows out than in — a source. Fluid is being created (or the fluid is expanding).
- $\nabla \cdot \mathbf{F} < 0$: more flows in than out — a sink. Fluid is disappearing (or compressing).
- $\nabla \cdot \mathbf{F} = 0$: inflow balances outflow — the field is solenoidal (divergence-free).
For an incompressible fluid (water, to excellent approximation) the divergence is zero everywhere: water cannot pile up or vanish, so whatever enters a region must leave it.
Geometric Intuition. Drop a tiny balloon into the flow and let the fluid carry it. Where the divergence is positive, the balloon swells as it drifts (the fluid around it is spreading apart). Where it is negative, the balloon shrinks. Where the divergence is zero, the balloon may stretch and distort but its volume never changes. Divergence is the instantaneous rate of fractional volume change of a co-moving blob.
Worked divergences
- $\mathbf{F} = \langle x, y, z\rangle$ (radial outflow): $\nabla \cdot \mathbf{F} = 1 + 1 + 1 = 3$. Positive everywhere — every point is a source, consistent with arrows that point outward and lengthen.
- $\mathbf{F} = \langle -y, x, 0\rangle$ (rotation): $\nabla \cdot \mathbf{F} = \partial_x(-y) + \partial_y(x) + 0 = 0$. A pure swirl moves fluid in circles without spreading it — solenoidal, exactly as intuition demands.
- $\mathbf{F} = \langle x, -y, 0\rangle$ (the saddle from §34.2): $\nabla \cdot \mathbf{F} = 1 - 1 = 0$. Solenoidal despite obvious structure: horizontal spreading is exactly cancelled by vertical compression.
- $\mathbf{F} = \dfrac{\mathbf{r}}{r^3}$ (inverse-square, $\mathbf{r} = \langle x,y,z\rangle$): a direct computation gives $\nabla \cdot \mathbf{F} = 0$ for every $r > 0$. The field is sourceless away from the origin — all the "source" is concentrated at the single point $r=0$, where the formula blows up. This is the mathematical fingerprint of a point charge or point mass, and Chapter 37's Divergence Theorem will turn it into Gauss's law.
Check Your Understanding. Compute the divergence of $\mathbf{F}(x,y) = \langle x^2 y,\ -2xy \rangle$ at the point $(1, 3)$.
Answer
$P = x^2 y$ gives $P_x = 2xy$; $Q = -2xy$ gives $Q_y = -2x$. So $\nabla\cdot\mathbf{F} = 2xy - 2x = 2x(y-1)$. At $(1,3)$ this is $2\cdot 1\cdot(3-1) = 4 > 0$: a source at that point.
34.5 Curl: Measuring Rotation
The second operator detects spin. For $\mathbf{F}(x, y, z) = \langle P, Q, R \rangle$, the curl is the vector
$$\nabla \times \mathbf{F} = \left\langle \frac{\partial R}{\partial y} - \frac{\partial Q}{\partial z},\ \frac{\partial P}{\partial z} - \frac{\partial R}{\partial x},\ \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right\rangle.$$
The pattern is easiest to remember as a symbolic determinant — the cross product of $\nabla$ with $\mathbf{F}$:
$$\nabla \times \mathbf{F} = \det \begin{pmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\[2pt] \partial_x & \partial_y & \partial_z \\[2pt] P & Q & R \end{pmatrix}.$$
In two dimensions, with $\mathbf{F} = \langle P, Q\rangle$, only the $\mathbf{k}$-component survives, so the curl collapses to a single scalar, $\nabla \times \mathbf{F} = Q_x - P_y$. In three dimensions the curl is itself a vector field.
What curl means
Place a microscopic paddle wheel at a point and let the field push on its vanes:
- Non-zero curl: the wheel spins. The direction of $\nabla\times\mathbf{F}$ is the axis of spin (by the right-hand rule), and its magnitude is twice the local angular speed.
- Zero curl: the wheel does not spin. The field is irrotational.
Worked curls
- $\mathbf{F} = \langle -y, x, 0\rangle$ (rotation about the $z$-axis): $Q_x - P_y = \partial_x(x) - \partial_y(-y) = 1 - (-1) = 2$, so $\nabla\times\mathbf{F} = \langle 0, 0, 2\rangle$. The curl points along the rotation axis $z$, with magnitude $2$ — exactly twice the angular velocity $1$ we found in §34.3.
- $\mathbf{F} = \langle x, y, z\rangle$ (radial): every cross-term derivative vanishes, so $\nabla\times\mathbf{F} = \mathbf{0}$. Pure outflow has no spin.
- $\mathbf{F} = \langle 1, 0, 0\rangle$ (constant): $\nabla\times\mathbf{F} = \mathbf{0}$. Uniform translation does not rotate a paddle wheel.
- $\mathbf{F} = \langle y, 0, 0\rangle$ (a shear flow, like water faster at the top of a channel than the bottom): $Q_x - P_y = 0 - 1 = -1$, so $\nabla\times\mathbf{F} = \langle 0, 0, -1\rangle$. This one surprises people: the arrows are all horizontal and parallel, yet a paddle wheel spins. The top of the wheel is pushed harder than the bottom, so it turns clockwise. Shear is rotation in disguise.
Common Pitfall. Curl is a local measurement, not a global one. Zero curl does not mean "the field does not go around in circles." The vortex $\mathbf{F} = \dfrac{1}{x^2+y^2}\langle -y, x\rangle$ has curl equal to zero at every point except the origin — a paddle wheel dropped anywhere (off-center) translates around the vortex without spinning about its own axis — and yet the field plainly circulates around the origin. The circulation is "hidden" at the singular point. This gap between local irrotationality and global circulation is exactly what the curl-test caveat in §34.6 (and Green's Theorem in Chapter 35) is about.
Math Major Sidebar — Why "twice" the angular speed. For rigid rotation $\mathbf{F} = \boldsymbol{\omega}\times\mathbf{r}$ with constant angular-velocity vector $\boldsymbol{\omega}$, a short computation gives $\nabla\times\mathbf{F} = 2\boldsymbol{\omega}$. The factor of $2$ is not a quirk of the definition; it reflects that the curl measures the antisymmetric part of the velocity gradient matrix $\partial F_i/\partial x_j$, and the local rotation rate of a fluid element is half of that antisymmetric part (the vorticity $\boldsymbol{\omega} = \tfrac12 \nabla\times\mathbf{u}$ is the true local angular velocity). Decomposing $\partial F_i/\partial x_j$ into its symmetric part (the strain-rate tensor, governing stretching — related to divergence) and antisymmetric part (governing rotation — the curl) is the linear-algebra heart of fluid kinematics.
34.6 Conservative Vector Fields and Potentials
We return to gradients, the field family we started with. A vector field $\mathbf{F}$ is conservative (also called a gradient field) if there exists a scalar function $f$ — its potential function — with
$$\mathbf{F} = \nabla f.$$
Conservative fields are special and beautiful: knowing the single scalar $f$ tells you the entire vector field, and (as we will see) makes work integrals trivial.
The curl test
Here is the key structural fact. If $f$ has continuous second partials, then by Clairaut's theorem (Chapter 29) the mixed partials are equal, $f_{xy} = f_{yx}$. Feed $\mathbf{F} = \nabla f = \langle f_x, f_y, f_z\rangle$ into the curl: every component is a difference of equal mixed partials, so
$$\nabla \times (\nabla f) = \mathbf{0}.$$
Every conservative field is irrotational. This gives an instant necessary condition: if $\nabla\times\mathbf{F} \ne \mathbf{0}$, then $\mathbf{F}$ is not conservative — no potential can exist.
The converse needs a hypothesis on the domain. On a simply connected domain (one with no holes — every loop can be shrunk to a point), the condition is also sufficient:
Curl Test (conservative fields). If $\mathbf{F}$ has continuous partials on a simply connected domain and $\nabla \times \mathbf{F} = \mathbf{0}$ there, then $\mathbf{F}$ is conservative: a potential $f$ with $\mathbf{F} = \nabla f$ exists.
Warning. The simply-connected hypothesis is not decoration. The vortex $\mathbf{F} = \langle -y, x\rangle/(x^2+y^2)$ is irrotational ($\nabla\times\mathbf{F}=\mathbf{0}$) everywhere it is defined, yet it is not conservative on the punctured plane — because its natural domain has a hole at the origin and is not simply connected. Drop the topological hypothesis and a curl-free field can fail to have a (single-valued) potential. We will see in Chapter 35 that the work integral of this field around a loop enclosing the origin is $2\pi$, not $0$ — the smoking-gun proof that no potential exists.
Finding a potential
When the curl test passes, recover $f$ by integrating the components and reconciling them. Take $\mathbf{F} = \langle P, Q\rangle$ with $Q_x = P_y$ (the 2D curl-test condition). We want $f$ with $f_x = P$ and $f_y = Q$.
- Integrate $P$ with respect to $x$: $f(x,y) = \int P\, dx + g(y)$, where the "constant" of integration is an unknown function $g$ of $y$ alone.
- Differentiate this $f$ with respect to $y$ and set it equal to $Q$; solve for $g'(y)$.
- Integrate $g'$ to find $g$, hence $f$ (up to a genuine constant).
Example (conservative). $\mathbf{F} = \langle 2xy,\ x^2 \rangle$. Curl test: $Q_x = 2x$, $P_y = 2x$ — equal, so conservative. Now $f_x = 2xy \Rightarrow f = x^2 y + g(y)$. Differentiate: $f_y = x^2 + g'(y)$, and this must equal $Q = x^2$, so $g'(y) = 0$ and $g$ is constant. Hence $f(x,y) = x^2 y + C$, and indeed $\nabla f = \langle 2xy, x^2\rangle$. ✓
Example (not conservative). $\mathbf{F} = \langle -y, x\rangle$. Curl test: $Q_x = 1$, $P_y = -1$ — unequal, so not conservative; no potential exists. This makes geometric sense: gradients point across level curves (steepest ascent), and a field that circulates can never be everywhere perpendicular to a family of level sets. Its nonzero curl $\langle 0,0,2\rangle$ from §34.5 is precisely the obstruction.
Check Your Understanding. Is $\mathbf{F}(x,y) = \langle y^2 + 1,\ 2xy \rangle$ conservative? If so, find a potential.
Answer
Curl test: $Q_x = \partial_x(2xy) = 2y$ and $P_y = \partial_y(y^2+1) = 2y$ — equal, so conservative. Integrate $f_x = y^2+1$ in $x$: $f = xy^2 + x + g(y)$. Then $f_y = 2xy + g'(y)$, which must equal $2xy$, so $g'(y)=0$ and $f(x,y) = xy^2 + x + C$. Check: $\nabla f = \langle y^2+1,\ 2xy\rangle$. ✓
34.7 Physical Conservative Fields and Energy
Why the word "conservative"? Because for these fields, energy is conserved. Most fundamental force fields in physics are conservative, and their potential function is (up to a sign) the potential energy:
- Gravity: $\mathbf{F} = -\nabla \Phi$, with gravitational potential $\Phi = -GM/r$. The minus sign means the force points downhill in potential, toward the mass.
- Static electric field: $\mathbf{E} = -\nabla V$, with $V$ the electric potential (voltage). Voltage is, literally, a potential function in the sense of this section.
- Ideal spring: $\mathbf{F} = -\nabla U$, with $U = \tfrac12 k\|\mathbf{x}\|^2$.
For motion in a conservative field, total mechanical energy — kinetic plus potential — stays constant. That is the conservation of energy you learned in physics, and it is exactly the statement that the field is a gradient.
Non-conservative forces include friction and drag (which dissipate energy as heat) and the magnetic force on a moving charge (which depends on velocity, not position alone). These have no position-only potential, and their curl need not vanish.
Real-World Application — Spacecraft trajectory design. Mission planners exploit the gravitational potential $\Phi$ directly. Because gravity is conservative, the energy of a spacecraft along any trajectory is fixed by its position and speed, independent of the route taken. "Gravity-assist" maneuvers and low-energy transfer orbits are designed by reasoning about the level surfaces of $\Phi$ (equipotentials) and the gradient $\mathbf{F} = -\nabla\Phi$ that pushes across them — the same potential-and-gradient machinery you just used to recover $f$ from $\mathbf{F}$.
34.8 Conservative Fields and Path-Independence (Preview)
The deepest property of conservative fields concerns work, and it is the payoff of Chapter 35 — but it belongs here as a preview because it is why these fields earned their name.
The work done by a field $\mathbf{F}$ on a particle moving along a curve $C$ is the line integral $\int_C \mathbf{F}\cdot d\mathbf{r}$ (defined carefully in Chapter 35). For a conservative field $\mathbf{F} = \nabla f$, the work depends only on the endpoints, not on the route:
$$\int_C \nabla f \cdot d\mathbf{r} = f(B) - f(A).$$
This is the Fundamental Theorem for Line Integrals, and notice its shape: the integral of a derivative (here, the gradient) over a region (here, the curve $C$) equals the values of the antiderivative ($f$) on the boundary (the endpoints $A$, $B$). That is the same slogan as the Fundamental Theorem of Calculus from Chapter 14 — one dimension up. FTC is the seed; every theorem of vector calculus is a generalization of it, a thread we follow all the way to Chapter 38.
Three consequences, all equivalent for a conservative field:
- Path-independence: the work between two points is the same along every path.
- Zero loop integral: the work around any closed loop is $0$ (start and end coincide, so $f(B)-f(A)=0$).
- Energy conservation: the work done equals the drop in potential energy.
For a non-conservative field, none of these hold: the work depends on the path, a round trip can do net work, and energy is not conserved (it is dissipated or pumped in). This distinction — conservative versus not — is one of the most consequential in all of physics.
34.9 Solenoidal, Irrotational, and the Operator Zoo
Two operators give two independent properties, and naming them keeps the bookkeeping straight.
| Property | Condition | Physical meaning |
|---|---|---|
| Conservative (gradient field) | $\mathbf{F} = \nabla f$ (implies $\nabla\times\mathbf{F}=\mathbf{0}$ on simply connected domains) | path-independent work; energy conserved |
| Solenoidal (divergence-free) | $\nabla \cdot \mathbf{F} = 0$ | incompressible; no sources or sinks |
| Irrotational | $\nabla \times \mathbf{F} = \mathbf{0}$ | no local rotation; no paddle-wheel spin |
A field can be both solenoidal and irrotational at once; such a field is called harmonic, and its potential satisfies Laplace's equation (below). The static electric field in a charge-free region is the classic example.
The full operator family of vector calculus is small and worth memorizing as a table:
| Operator | Input | Output | Symbol | Formula (3D) |
|---|---|---|---|---|
| Gradient | scalar | vector | $\nabla f$ | $\langle f_x, f_y, f_z\rangle$ |
| Divergence | vector | scalar | $\nabla\cdot\mathbf{F}$ | $P_x + Q_y + R_z$ |
| Curl | vector | vector | $\nabla\times\mathbf{F}$ | $\langle R_y-Q_z,\ P_z-R_x,\ Q_x-P_y\rangle$ |
| Laplacian | scalar | scalar | $\Delta f = \nabla\cdot\nabla f$ | $f_{xx}+f_{yy}+f_{zz}$ |
The Laplacian $\Delta f = \nabla\cdot(\nabla f)$ — the divergence of the gradient — is the most important second-order operator in mathematical physics. It governs the heat equation, the wave equation, Laplace's equation $\Delta f = 0$ (steady-state and harmonic fields), and the time-independent Schrödinger equation. A function with $\Delta f = 0$ is harmonic, tying the table together.
Two identities you will reuse constantly
Two facts follow from equality of mixed partials and reappear throughout Chapter 37:
$$\nabla \times (\nabla f) = \mathbf{0} \qquad\text{(curl of a gradient is zero)},$$ $$\nabla \cdot (\nabla \times \mathbf{F}) = 0 \qquad\text{(divergence of a curl is zero)}.$$
The first we proved in §34.6; it says gradient fields are irrotational. The second says curl fields are solenoidal — which is exactly why $\nabla\cdot\mathbf{B}=0$ in Maxwell's equations is consistent with $\mathbf{B}$ arising as the curl of a vector potential. Together they are the algebraic skeleton on which Stokes' Theorem and the Divergence Theorem hang in Chapter 37.
34.10 Computation: Plotting Fields, Computing Operators
Two themes of this book meet here: hand computation builds the understanding, and the machine builds the power to see. We do both. First, draw a field and its streamlines with matplotlib; then compute divergence and curl symbolically with sympy and confirm our hand answers.
# Plot the vortex field F = (-y, x)/(x^2+y^2) as arrows (quiver)
# and as continuous streamlines (streamplot).
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-2, 2, 20)
y = np.linspace(-2, 2, 20)
X, Y = np.meshgrid(x, y)
# Add a tiny 0.1 to the denominator so the singular origin doesn't overflow.
denom = X**2 + Y**2 + 0.1
P = -Y / denom # x-component of the field
Q = X / denom # y-component of the field
fig, axes = plt.subplots(1, 2, figsize=(12, 6))
axes[0].quiver(X, Y, P, Q) # arrows: a vector at every grid point
axes[0].set_aspect('equal'); axes[0].set_title('Vortex: quiver (arrows)')
axes[1].streamplot(X, Y, P, Q, density=1.4) # streamlines: integral curves of F
axes[1].set_aspect('equal'); axes[1].set_title('Vortex: streamlines')
plt.show()
# Output: left panel shows arrows circulating counterclockwise, longest near
# the center; right panel shows nested circular streamlines around the origin.
quiver draws one arrow per grid point — the literal "vector at every point" definition — while streamplot integrates $\mathbf{r}'(t) = \mathbf{F}(\mathbf{r}(t))$ for you and draws the flow lines of §34.3. Figure 34.1 is the result: a carpet of swirling arrows on the left, and the nested circles those arrows are tangent to on the right.
Now let sympy compute the operators symbolically, so we never have to trust a hand calculation we cannot double-check.
# Symbolic divergence and curl with sympy; verify the §34.4-34.5 hand results.
import sympy as sp
x, y, z = sp.symbols('x y z')
def divergence(F): # F is a list [P, Q, R]
return sp.diff(F[0], x) + sp.diff(F[1], y) + sp.diff(F[2], z)
def curl(F):
P, Q, R = F
return [sp.diff(R, y) - sp.diff(Q, z),
sp.diff(P, z) - sp.diff(R, x),
sp.diff(Q, x) - sp.diff(P, y)]
F_rot = [-y, x, 0] # pure rotation about z
F_radial = [x, y, z] # radial outflow
print("div(rotation) =", divergence(F_rot)) # 0 -> solenoidal
print("curl(rotation) =", curl(F_rot)) # [0, 0, 2]
print("div(radial) =", divergence(F_radial)) # 3 -> source everywhere
print("curl(radial) =", curl(F_radial)) # [0, 0, 0] -> irrotational
# Confirm the master identity: curl of a gradient is always zero.
f = sp.Function('f')(x, y, z)
grad_f = [sp.diff(f, x), sp.diff(f, y), sp.diff(f, z)]
print("curl(grad f) =", [sp.simplify(c) for c in curl(grad_f)]) # [0, 0, 0]
Computational Note. The final block is the most important: sympy confirms $\nabla\times(\nabla f) = \mathbf{0}$ for a completely arbitrary twice-differentiable $f$, returning
[0, 0, 0]symbolically. That is not a numerical coincidence at a few sample points — it is a proof that every gradient field is irrotational, generated by the machine from equality of mixed partials. Whenever you suspect a vector identity, this is the fastest way to test it before reaching for a hand proof.
34.11 Application: Fluid Dynamics
Vector calculus is the language of fluid flow. Let $\mathbf{u}(x,y,z,t)$ be a fluid's velocity field. Two equations, both built from this chapter's operators, govern its motion:
- Mass conservation (incompressible): $\nabla \cdot \mathbf{u} = 0$. The fluid neither piles up nor vanishes — divergence-free, as in §34.4.
- Momentum (Navier–Stokes): $\rho\big(\partial_t \mathbf{u} + (\mathbf{u}\cdot\nabla)\mathbf{u}\big) = -\nabla p + \mu\,\Delta \mathbf{u}$, balancing pressure gradient and viscous diffusion (note the Laplacian $\Delta\mathbf{u}$ from §34.9).
The vorticity $\boldsymbol{\omega} = \nabla\times\mathbf{u}$ — the curl of the velocity — measures local spin, and turbulence is precisely the chaotic tangle of vorticity. Solving these equations numerically is computational fluid dynamics (CFD), which designs aircraft wings, models blood flow through arteries, and forecasts climate. Every CFD solver, at bottom, is computing divergences and curls on a grid, exactly as the sympy block above does symbolically.
34.12 Application: Electromagnetism and Maxwell's Equations
The crowning application of divergence and curl is Maxwell's equations — four equations that unify electricity, magnetism, and light, written entirely in the operators of this chapter:
$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0} \qquad\text{(Gauss's law: charge is the source of } \mathbf{E})$$ $$\nabla \cdot \mathbf{B} = 0 \qquad\text{(no magnetic monopoles: } \mathbf{B} \text{ has no sources)}$$ $$\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t} \qquad\text{(Faraday: a changing } \mathbf{B} \text{ curls } \mathbf{E})$$ $$\nabla \times \mathbf{B} = \mu_0 \mathbf{J} + \mu_0\varepsilon_0\frac{\partial \mathbf{E}}{\partial t} \qquad\text{(Ampère–Maxwell)}$$
Read them through this chapter's lens. The divergence equations say where field lines begin and end: $\mathbf{E}$ springs from charges ($\nabla\cdot\mathbf{E}\ne 0$ where charge sits), while $\mathbf{B}$ never does ($\nabla\cdot\mathbf{B}=0$, consistent with the identity $\nabla\cdot(\nabla\times\mathbf{A})=0$ from §34.9 — magnetic fields are curls). The curl equations say how a changing electric field spins up a magnetic one and vice versa — the feedback loop that, with no charges around, becomes a self-sustaining electromagnetic wave traveling at the speed of light $c = 1/\sqrt{\mu_0\varepsilon_0}$.
Real-World Application — Why your phone works. Every wireless signal, electric motor, MRI scanner, X-ray, and light bulb obeys Maxwell's equations. A phone antenna radiates by making charges oscillate so that $\partial_t \mathbf{E}$ and $\partial_t\mathbf{B}$ drive each other (the curl equations) into a propagating wave; the receiver reverses the process. The entire wireless world runs on divergence and curl.
Historical Note. James Clerk Maxwell assembled these equations in the 1860s, adding the crucial $\mu_0\varepsilon_0\,\partial_t\mathbf{E}$ term to Ampère's law to keep the mathematics consistent. The reward was staggering: the equations predicted electromagnetic waves traveling at $1/\sqrt{\mu_0\varepsilon_0}$ — a number Maxwell computed and recognized as the measured speed of light. Light is an electromagnetic wave, a conclusion forced by the algebra of curl and divergence. The vector-calculus notation $\nabla\cdot$ and $\nabla\times$ that makes these equations so compact was later popularized by Oliver Heaviside and J. Willard Gibbs. We meet the equations again in Chapter 37, where Stokes' and the Divergence theorems give them their integral form.
34.13 The Deeper Meaning Comes Next
Divergence and curl are defined here as formulas — sums and differences of partial derivatives — and we have read off their physical meaning (outflow and spin) intuitively. But their deepest meaning is integral, and it arrives in Chapter 37.
The Divergence Theorem will say that the total divergence inside a region equals the net flux out through its boundary surface — turning "$\nabla\cdot\mathbf{F}$ is outflow per unit volume" into an exact, global accounting. Stokes' Theorem will say that the total curl across a surface equals the circulation around its boundary curve — making "$\nabla\times\mathbf{F}$ is local spin" into a precise statement about loops. Both are higher-dimensional Fundamental Theorems of Calculus, and Chapter 38 unifies them all under one slogan: the integral of a derivative over a region equals the values on the boundary. Hold the formulas of this chapter; in three chapters they acquire their full meaning.
Add to Your Modeling Portfolio. Add a vector field to your model and analyze it with divergence and curl. Compute $\nabla\cdot\mathbf{F}$ and $\nabla\times\mathbf{F}$, classify the field (source/sink? rotational? conservative?), and sketch or
quiver-plot it. Biology: model a chemotaxis gradient field $\mathbf{F} = \nabla c$ (cells climbing a chemical concentration $c$); it is conservative by construction — find its potential. Economics: model a capital- or goods-flow field across regions; positive divergence marks a production source, negative a consumption sink. Physics: model any force field — a conservative one (gravity, spring: find the potential energy) or a non-conservative one (a magnetic or drag field: show $\nabla\times\mathbf{F}\ne\mathbf{0}$). Data Science: model the negative-gradient field $-\nabla L$ of your loss function $L(\mathbf{w})$; its streamlines are gradient-descent trajectories, and its critical points (where $\mathbf{F}=\mathbf{0}$) are your optima — the anchor example from Chapter 6, now fully multivariable.
Looking Ahead
You can now build, draw, and dissect a vector field: plot its arrows and streamlines, compute its divergence and curl, test it for conservativeness, and recover a potential when one exists. Chapter 35 puts fields to work by integrating along curves — the line integral $\int_C \mathbf{F}\cdot d\mathbf{r}$, which computes work. For conservative fields it is path-independent (the preview of §34.8 becomes a theorem); for non-conservative ones it depends on the path, and Green's Theorem ties a boundary line integral to a region integral of the curl. Chapter 36 integrates over surfaces (flux), Chapter 37 proves Stokes' and the Divergence theorems that give curl and divergence their deepest meaning, and Chapter 38 reveals them all as one generalized Fundamental Theorem of Calculus. From here on, divergence and curl are simply part of the vocabulary.
Reflection
A vector field is the mathematics of direction at every point — the carpet of arrows that turns a still snapshot of space into a portrait of flow and force. With two operators, divergence and curl, you can interrogate any such field: how much is it spreading, how much is it spinning? Those two questions, asked of the electromagnetic field, gave Maxwell light itself; asked of a fluid's velocity, they give the Navier–Stokes equations; asked of a loss function's gradient, they give the trajectory of every machine-learning model trained by descent. You have entered the language of mathematical physics. Three chapters from now, you will learn its grammar — the integral theorems — and see why every one of them is the Fundamental Theorem of Calculus wearing a new coat.