Lesson 2: Vector Calculus
Introduction to Lesson 2
Once single-variable calculus has become second nature, the next great leap is learning how quantities change and accumulate across space itself. That leap is vector calculus—one precise language that the physical world speaks to us in. You have now mastered the essential tools of ordinary calculus and the first ideas of linear algebra. Those tools let you describe how a single quantity changes with respect to one independent variable and how to accumulate those changes. In the real world, however, almost nothing of physical interest depends on only one variable. Temperature, pressure, velocity, electric and magnetic fields, gravitational influence—all of these vary from place to place as well as from moment to moment. They are fields, and to understand how they behave we must learn how to differentiate and integrate them when they point in different directions and live in two or three dimensions of space.
In this lesson you will meet the powerful operator nabla ∇ and discover what it means to take its “derivative” in three distinct but intimately related ways: the gradient of a scalar field, the divergence of a vector field, and the curl of a vector field. These three operations are not arbitrary mathematical inventions; each has a clear physical meaning. The gradient tells you the direction and steepness of steepest change. Divergence measures the net “outflow” or “source strength” at a point. Curl measures the local rotation or swirling of a field.
You will then learn how to integrate vector and scalar fields along curves, over surfaces, and throughout volumes. The three great theorems of vector calculus—Green’s theorem, Gauss’s divergence theorem, and Stokes’s theorem—will appear as magnificent generalizations of the Fundamental Theorem of Calculus that you already know. They convert difficult global questions about flow and circulation into much simpler local questions about derivatives, and vice versa. In later lessons these theorems will become the mathematical backbone of Newtonian gravity, Maxwell’s equations, fluid dynamics, and the very formulation of physical laws in both flat and curved spacetime.
We will also practice these ideas in Mathematica, so that the beautiful but sometimes tedious calculations of vector calculus become transparent and you can focus on the physics.
By the end of this lesson the ordinary derivative and integral of Lesson 1 will feel like special cases of far more general and powerful ideas. You will be ready to step into the first true physical field theory of the course—Newtonian gravitational fields—with the right language already in hand.
The path ahead is both practical and beautiful. Let us begin.
Finishing Linear Algebra
Linear Mappings
In physics we are almost always confronted with problems that are, strictly speaking, nonlinear. Yet we solve an enormous number of them by first treating them as if they were linear. The reason is simple and profound, linear problems are the only ones we can usually solve exactly and completely. Once we understand how linear mappings work, we gain the power to approximate almost any smooth physical situation locally by a linear one. This is the idea that lets us linearize the equations of motion near equilibrium, study small deformations in solids, or describe the first-order behavior of fields. In this subsection we make that idea precise.
A mapping that takes vectors from one vector space and sends them to another while preserving the two fundamental operations of vector arithmetic—addition and scalar multiplication—is called a linear mapping (or linear transformation).
Definition 2.1 Linear Mapping: Let V and W be vector spaces. A mapping T:V→Wis called linear if, for any scalars
and any vectors
,
(2.1)
This single equation encodes the entire idea where straight lines are mapped to straight lines, the origin is fixed, and the mapping respects the vector-space structure. You will meet linear mappings everywhere in theoretical physics—from the way a small displacement transforms under rotation or strain, to the way the electromagnetic field acts on a charged particle in the linear approximation.
The most familiar linear mappings in three-dimensional space are rotations, uniform scalings, and projections onto a plane or line. Each of these can be represented by a matrix once we choose a basis. In continuum mechanics, the deformation of a small material element is described (to first order) by a linear mapping called the deformation gradient. In special relativity, Lorentz transformations are linear mappings of four-vectors.
Two important subspaces are associated with any linear mapping T:V→W.
Definition 2.2 Kernel: The kernel of T, written ker(T), is the set of all vectors in V that are mapped to the zero vector in W
(2.2)
Physically, the kernel tells you which “inputs” produce no output. In the context of forces or displacements, elements of the kernel correspond to motions or configurations that leave the system unchanged to linear order.
Definition 2.3 Image: The image of T, written im(T), is the set of all vectors in W that are actually reached by T
(2.3)
The image tells you the “reach” of the mapping—everything that can actually happen as a result of the linear process.
To work concretely with vector spaces we need a basis.
Definition 2.4 Basis and Dimension: A set of vectors
that are elements of the vector space V, and a set of unique scalars
, if any arbitrary vector
in V can be written in the form of a linear combination
(2.4)
then the set of vectors is a basis of the vector space and can be rewritten
, and we write
(2.5)
The Cardinal number of the basis is the dimension of the vector space, written dim(V).
If we have a set of vectors and the condition that
(2.6)
then we say the set of vectors is linearly independent.
A linearly independent set of basis vectors is said to span the vector space.
Theorem 2.1 The Rank Nullity Theorem: The dimension of a vector space is the sum of the dimensions of the kernel and image.
(2.7)
The dimension of the kernel is often called the nullity and the dimension of the image is called the rank. This theorem tells you that the “loss of information” (kernel) plus the “new information created” (image) must add up to the original dimension. It is one of the most powerful bookkeeping tools in linear algebra and appears repeatedly when we count degrees of freedom in physical systems.
Definition 2.5 Linear Operator: A linear mapping from a vector space into itself is called a linear operator, T:V→V.
A mapping I that operates on another mapping T that leaves T unchanged is called the identity mapping,
(2.8)
A mapping
that gives the identity mapping when applied to T, is called the inverse mapping,
(2.9)
Principle 2.1: Linear mappings are the simplest nontrivial transformations that still capture essential physical behavior. Almost every advanced theory in physics begins by studying the linear case and then adding corrections.
Principle 2.2: The kernel and image together give a complete accounting of what a linear process “destroys” and what it “preserves.”
Principle 2.3: The rank-nullity theorem is your constant companion when counting independent physical degrees of freedom.
Principle 2.4: Every smooth nonlinear mapping looks linear when you zoom in close enough. This is why linear algebra is indispensable even when the ultimate problem is nonlinear.
Linear Mappings as Matrices
In the physical world, as we have seen, many of the most important transformations are linear. When you scale a force by a constant factor, or add two velocity fields together, the result behaves in a beautifully simple way, the whole is exactly the sum of the parts, with no unexpected cross terms. Linear mappings capture this idea with perfect precision.
To turn an abstract linear mapping into something we can calculate with, we represent it as a matrix. This is one of the most useful translations in all of theoretical physics because it converts geometry into arithmetic.
In order to represent a linear transformation, T:V→Was a matrix we need to do several things:
Fix a basis for V,
. We can write any vector that is an element of V as a linear combination,
(2.10)
this is called basis for the domain.
Fix a basis for W,
. We can write any vector that is an element of W as a linear combination,
(2.11)
In order to transform one column vector into another column vector requires a transformation matrix. In this case the transformation converts
into
. For this choice of basis, we have,
(2.12)
Each image
is itself a vector in W, so it can be expanded in the chosen basis of W
(2.13)
The coefficients
are simply numbers. Collecting them into an array gives the matrix representation of T with respect to the two chosen bases
(2.14)
With this matrix in hand, the action of the linear mapping on any vector becomes ordinary matrix multiplication. If
has components
, then the components
of T(v) are given by
(2.15)
or in matrix notation
(2.16)
Principle 2.5: A linear mapping is completely determined by where it sends the basis vectors. Once you know
for each basis vector, linearity does all the rest of the work for you.
Principle 2.6: The matrix representation of a linear mapping depends on the bases you choose. Different bases give different matrices for the same mapping—just as different coordinate systems give different numbers for the same physical vector.
You now have a concrete, calculable object—a matrix—that faithfully represents any abstract linear transformation. This construction will reappear frequently—when we differentiate vector fields, when we describe rotations and boosts in special relativity, and when we build the stress-energy tensor in general relativity. The matrix is not the transformation itself, it is the transformation expressed in a particular language. Once you are comfortable switching between the geometric picture and the matrix picture, you will move through the rest of the course with far greater ease.
Theorem 2.2: The Fundamental Theorem of Linear Algebra
Linear algebra reveals its deepest unity when we discover that many different-sounding questions about matrices and transformations are, in truth, the same question asked in different languages. In Lesson 1 you met the basic ideas of matrices as tools for handling linear relationships. Now, as we move into vector calculus, you will need a deeper and more flexible understanding of when a linear transformation can be “undone.” The Fundamental Theorem of Linear Algebra gives you precisely that understanding. It tells you that a remarkably large collection of statements—some phrased in the language of matrices, others in the language of abstract vector spaces and linear maps—are actually equivalent. Once you grasp this theorem, checking whether a transformation is invertible becomes a matter of choosing the most convenient test for the problem at hand.
When we work directly with an n×n matrix A, the following statements are all equivalent. Any one of them being true guarantees that all the others are true as well.
A is invertible.
det(A)≠0.
ker(A)={0}.
If
is a column vector in
,
that satisfies
.
The transpose
is invertible.
These five conditions give you five different practical ways to decide whether A can be inverted. In calculations you will often choose the one that is easiest to check in the moment.
A more abstract but ultimately more powerful viewpoint treats linear algebra in terms of vector spaces and linear mappings rather than concrete matrices. Let T:V→V be a linear map on a finite-dimensional vector space V. The following statements are again all equivalent:
T is invertible.
det(T)≠0. Here the determinant is defined by a choice of basis on V.
ker(T)={0}.
If
is a column vector in V,
that satisfies
.
Given a basis set
of V, the set of image vectors
is linearly independent.
Given a basis set
of V, if
, the set of image vectors
is linearly independent.
The transpose of T is invertible. Here the transpose is defined by a choice of basis on V.
Notice how the last two statements involve the transpose. Just as in the matrix case, the invertibility of a map is intimately connected to the invertibility of its transpose. This symmetry will reappear many times when we work with differential operators and their adjoints in later lessons.
The power of the Fundamental Theorem lies in its flexibility. Sometimes it is easiest to compute a determinant. Sometimes it is easiest to check whether the kernel is trivial. Sometimes the most physical question is whether every possible “output” vector can be reached (surjectivity). The theorem assures you that all these routes lead to the same conclusion.
You will see this theorem in action repeatedly: when we change coordinates in vector fields, when we decide whether a linear system of differential equations has unique solutions, and when we later construct the machinery of tensors. Mastering these equivalent characterizations now will save you a great deal of unnecessary work later.
Eigenvalues and Eigenvectors
In the study of linear mappings, most matrices scramble directions in complicated ways. Yet for every square matrix there exist special directions in which the transformation acts with beautiful simplicity where it stretches or compresses a vector without rotating it. These special directions are called eigenvectors, and the factors by which they are stretched or compressed are called eigenvalues. Understanding them gives you a powerful way to see the essential behavior of any linear map.
Let’s say we have a square matrix O representing a linear mapping, a nonzero vector
, and a scalar λ. Consider the matrix equation
(2.17)
This simple statement says that when the transformation O acts on
, the result is just a scaled copy of
itself. Rearranging gives
(2.18)
where I is the identity matrix. This is a homogeneous system of linear equations. One solution is always the zero vector
this is the trivial solution and is of no interest to us. Nontrivial solutions exist only when the matrix (A−λ I) is singular, which occurs precisely when its determinant vanishes
(2.19)
This is the characteristic equation of O. Expanding the determinant produces a polynomial of degree n (for an n×n matrix) in the unknown λ
(2.20)
This is the characteristic polynomial. By the fundamental theorem of algebra it has exactly n roots in the complex numbers (counting multiplicities). Each root
is an eigenvalue of O. For every eigenvalue there exists at least one corresponding nonzero vector
that satisfies the original equation; such a vector is called an eigenvector belonging to
.
We can express the same idea in the language of linear mappings. Let T:V→V be a linear mapping on a vector space V. A nonzero vector
is an eigenvector of T with eigenvalue λ if
(2.21)
The eigenvalue tells us how much the transformation stretches or shrinks lengths along the direction of
, while the eigenvector identifies the direction that remains unchanged (apart from scaling).
Principle 2.7: Eigenvalues and eigenvectors reveal the intrinsic stretching and preferred directions of a linear transformation. They allow us to understand the action of a matrix by decomposing space into simpler, independent pieces.
You will meet eigenvalues and eigenvectors again and again throughout this course—in the diagonalization of tensors, in the normal modes of oscillating systems, in the classification of critical points in dynamical systems, and in the Lorentz transformations of special relativity. Mastering them now will make those later appearances feel natural and inevitable.
Exercise 2.1: Find the eigenvalues and corresponding eigenvectors of the matrix
![]()
Verify your answers by substituting each eigenvector back into the equation
.
Exercise 2.2: Consider the matrix
![]()
1) Find its eigenvalues and eigenvectors.
2) Describe geometrically what this linear transformation does to vectors in the plane
3) What do the eigenvalues tell you about stretching or compression along the eigenvector directions?
Exercise 2.3: Let A be a 2×2 matrix with eigenvalues
and
, and corresponding eigenvectors
and
. Without computing the matrix A explicitly, determine the result of applying the transformation three times to the vector
. That is, find
.
Exercise 2.4: In physics we often encounter linear transformations that describe how quantities change under small displacements, rotations, or deformations. Eigenvalues and eigenvectors frequently appear when we look for the “natural” or “principal” directions of these transformations.
Scalar and Vector Fields
Now that we have learned how linear transformations act on vectors, the next natural step is to allow those vectors—and other quantities—to vary from point to point throughout space. In the physical world, most quantities we care about are not single fixed numbers. Instead, they take on different values at different locations. The temperature in a room, for example, is generally not the same everywhere; it changes as you move from one place to another. The velocity of the air in the wind also changes from point to point—both its speed and its direction can be different at different locations.
When a quantity is described by assigning a single number to every point in a region of space, we say that the quantity forms a scalar field. Temperature is a classic example of a scalar field. Other common examples include pressure in an isotropic fluid, density, and the gravitational potential.
When the quantity at each point is a vector, we say that it forms a vector field. The velocity of a fluid is a vector field, as is the gravitational force field around a planet or the electric field around a charged object. These directed quantities play a central role in almost every branch of physics.
In this section we will develop the mathematical tools needed to work with both kinds of fields—especially in the ways they change from one point in space to another. These tools will prove essential when we later study gravitational fields, electromagnetic fields, fluid flow, and the geometric description of spacetime itself.
By learning to think in terms of fields that live throughout space, you are moving from the calculus of single numbers and single vectors into the richer language required for classical field theory and relativity.
The Operator Nabla
Once we have fields that vary across space, we need a systematic way to describe how they change from one point to another. The tool that does this most elegantly is a single differential operator that works on both scalar and vector fields. In this section we have seen that physical quantities can be described by assigning either a number or a vector to every point in space. To understand how these quantities behave, we must be able to measure their rates of change in different directions. The mathematical object that lets us do this in a compact and powerful way is the nabla operator.
(2.22)
In Cartesian coordinates this becomes
(2.23)
More generally, in n dimensions with coordinates
(where i=1,2,…,n), we can write
(2.24)
Nabla is not a number or a vector in the usual sense. It is an operator. This means it has no meaning by itself—it must always act on something that follows it. When we write an expression involving ∇, the operator is applied to the field or function written immediately after the symbol.
You will soon see that applying nabla to a scalar field produces a vector field, while applying it to a vector field can produce either a scalar or another vector field, depending on how the operation is performed. These three operations—gradient, divergence, and curl—form the core toolkit of vector calculus and appear throughout classical field theory and relativity.
Principle 2.8: The nabla operator packages the idea of directional change into a single, reusable symbol. This allows us to write the fundamental laws of physics in a compact and coordinate-independent way.
We are now ready to see what happens when we apply this operator.
The Gradient of a Scalar Field
Now that we have introduced the nabla operator, we can begin to see what it does when it acts on the fields we discussed earlier. The simplest and most important case is when we apply ∇ to a scalar field.
Consider a scalar field φ that assigns a number to every point in space. When we apply the nabla operator to this scalar field, the result is a vector field. We call this vector field the gradient of φ and denote it by ∇φ.
In three-dimensional Cartesian coordinates, the gradient takes the explicit form
(2.25)
Each component is simply the partial derivative of the scalar field with respect to one of the coordinates. The gradient therefore encodes how the scalar quantity changes as we move in each direction. In general three-dimensional coordinates,
(2.26)
Definition 2.6 Gradient of a Scalar Field: If
is a scalar field, then its gradient is the vector field whose components are the partial derivatives of φ with respect to each coordinate
(2.27)
Physically, the gradient has a very clear meaning. At any point, the vector ∇φ points in the direction where φ increases most rapidly. Its magnitude |∇φ| gives the rate of that increase. If you imagine φ as the height of a hill, then ∇φ at any point points directly uphill, and its length tells you how steep the slope is.
The gradient obeys a simple and useful linearity property. For any two scalar fields φ and θ,
(2.28)
This follows directly from the linearity of partial differentiation.
Exercise 2.5: Show this to be true.
Principle 2.9: The gradient converts a scalar field into a vector field that describes the direction and steepness of change. It is one of the most frequently used objects in theoretical physics because it appears in the expression for forces derived from potentials, in the equations of fluid flow, and in the variational principles that govern field theories.
Exercise 2.6: Consider the scalar field
.
1) Compute the gradient.
2) Evaluate the gradient at the point (1,2,-1).
3) At this point, in which direction does φ increase most rapidly, and what is the rate of that increase?
Exercise 2.7: The gradient of a scalar field points in the direction of steepest increase and is perpendicular to the surfaces on which the scalar field has a constant value (the level surfaces). Choose a simple physical example of a scalar field (such as temperature in a room, gravitational potential, or pressure in a isotropic fluid) and explain, in your own words, why the gradient must be perpendicular to the level surfaces of that field. What would it mean physically if the gradient were not perpendicular to these surfaces?
The Einstein Summation Convention
When working with vectors (and we will see the applied to tensors eventually), we often need to deal with many components and their interactions. Writing every term out in full can make expressions long and difficult to read. The Einstein summation convention is a widely used shorthand that greatly simplifies notation without sacrificing clarity.
Definition 2.7 Einstein Summation Convention: If an index appears exactly twice in a term — once as a subscript and once as a superscript (or both as subscripts in Cartesian coordinates) — then that index is understood to be summed over its full range.
For example, in n dimensions the expression
(2.29)
is understood to mean
(2.30)
The repeated index i is called a dummy index because its specific letter does not matter—it is simply a placeholder for summation. An index that appears only once is called a free index and labels the components of the resulting object.
A particularly important object that appears frequently with the summation convention is the Kronecker delta.
Definition 2.8 Kronecker Delta: The Kronecker delta
is
(2.31)
It functions as the components of the identity matrix. When contracted with a vector, it simply selects or renames components. For example,
(2.32)
This means that multiplying by the Kronecker delta leaves the free index unchanged (it effectively “renames” the index). The Kronecker delta is also useful for expressing orthogonality. For instance, the scalar product of two basis vectors can be written as
(2.33)
Principle 2.10: The Einstein summation convention and the Kronecker delta together provide a compact and systematic language for handling components of vectors and tensors. Once mastered, they make the expressions of vector calculus—and later those of differential geometry and relativity—significantly cleaner and easier to manipulate.
Exercise 2.9: Assume we are working in three-dimensional space. Expand the following expressions explicitly (i.e., write out all the terms without using the summation convention):
1)
2) ![]()
3) ![]()
4)
(This one is important).
Exercise 2.10: In the Einstein summation convention, an index that appears exactly twice in a term is called a dummy index, while an index that appears only once is called a free index.
1) Explain, in your own words, why it is important that a dummy index appears exactly twice (and not once or three times) in a given term.
2) Consider the expression
. . Identify which index is free and which is dummy. What does this expression simplify to?
The Divergence of a Vector Field
We have seen that applying the nabla operator to a scalar field produces a vector field called the gradient. We now turn to the case where we apply nabla to a vector field using the scalar product. This operation yields a scalar quantity known as the divergence. Physically, the divergence of a vector field measures the extent to which the field is expanding or contracting at a given point. If you imagine the vector field as representing the flow of a fluid, a positive divergence indicates a source (fluid is being created or spreading outward), while a negative divergence indicates a sink (fluid is disappearing or converging). A divergence of zero means the flow is incompressible—what flows in must flow out with no net gain or loss.
Definition 2.9 Divergence of a Vector Field: Let
be a vector field. The divergence of
is the scalar field obtained by taking the scalar product of the nabla operator with
How do we apply the Nabla operator to a vector field. In a sense the nabla operator is like a vector. So we combine it with a vector through multiplication. We will first do this with the scalar product. In a three-dimensional Cartesian system with axes
a vector field
that is operated on by Nabla will look like this,
(2.34)
where i=1,2,...,n.
The divergence obeys two important linearity properties. For any two vector fields
and
,
(2.35)
If a(x) is a scalar field, the product rule gives
(2.36)
These rules follow directly from the corresponding properties of partial derivatives.
Exercise 2.11: Show these ideas to be valid.
Principle 2.11: The divergence extracts a single number from a vector field that describes its local expansion or contraction. It is one of the fundamental quantities in the description of conserved flows, whether of mass, charge, or momentum.
We now have two important operations involving the nabla operator: the gradient (which turns scalars into vectors) and the divergence (which turns vectors into scalars). There remains one more fundamental operation—the curl— which we will examine next.
Exercise 2.12: Consider the vector field
.
1) Compute the divergence
.
2) Evaluate the divergence at (1,-1,2).
3) Based on the value you found, does the field appear to have a source, a sink, or neither at this point? Briefly explain your reasoning.
Exercise 2.13: In physical terms, the divergence of a vector field describes the net rate at which “stuff” is leaving or entering a point in space. Give one clear physical example of a vector field that has zero divergence everywhere (or almost everywhere). Explain why having zero divergence is important or meaningful in that context. What would change physically if the divergence were not zero?
The Curl of a Vector Field and the Levi-Civita Symbol
We have already seen how the nabla operator can be combined with a vector field using the scalar product to give the divergence. When we instead combine it using the vector product, we obtain another vector field that describes the local rotational character of the original field. This operation is called the curl.
Before writing the curl in index notation, we introduce a new mathematical object that makes this possible.
Definition 2.10 Levi-Civita Symbol: The Levi-Civita symbol
is a totally antisymmetric object in three dimensions. Antisymmetry means that if any two indices are swapped, the value of the symbol changes sign. For example,
(2.37)
Because it is totally antisymmetric, the symbol is automatically zero whenever any two indices are equal (since swapping those two indices would have to both change the sign and leave the value unchanged). Its non-zero values are completely determined by its value on the indices (1, 2, 3):
(2.38)
One of the most useful identities involving the Levi-Civita symbol is its contraction with itself
(2.39)
This identity will be particularly helpful when we manipulate expressions involving curls and vector products.
Using the Levi-Civita symbol, the curl of a vector field
takes the compact form
(2.40)
In expanded Cartesian components, this is equivalent to
(2.41)
Definition 2.11 Curl of a Vector Field: Let
be a vector field. The curl of
is the vector field obtained by taking the vector product of the nabla operator with
(2.42)
Physically, the curl measures the local rotation (or circulation) of the vector field at each point. A vector field whose curl vanishes everywhere is called irrotational.
The curl obeys the standard linearity rules. For any two vector fields
and
,
(2.43)
The curl of a scalar multiple is an application of the product rule
(2.44)
The divergence of a vector product is
(2.45)
The curl of a vector product is
(2.46)
The gradient of a scalar product is
(2.47)
Exercise 2.15: Using the definition of the Levi-Civita symbol, evaluate the following:
1)
,
, and ![]()
2)
,
, and ![]()
3) (c) Explain, using the property of antisymmetry, why
whenever any two indices are equal.
Exercise 2.16: Verify (2.39). This can be called the Contraction Identity of the Levi-Civita Symbol.
Exercise 2.17: Consider the vector field v(x,y,z)=-y,x,0).
1) Compute the curl using the expanded Cartesian form.
2) Compute the curl using the index form.
3) What does the result tell you about the rotational character of this vector field?
Exercise 2.18: A vector field whose curl vanishes everywhere) is called irrotational. Give one physical example of an irrotational vector field and explain why the absence of curl is important in that context. What would change physically if the field had a non-zero curl?
Products of Nabla
We have now introduced the three fundamental ways of applying the nabla operator to fields. When these operations are applied in succession, they obey a number of useful identities. These identities simplify many calculations and reveal deep structural relationships between the different operations.
The divergence of a gradient is
(2.48)
The operator
is called the Laplacian. It appears in many fundamental equations in physics, including Poisson’s equation for the gravitational and electrostatic potentials, the heat equation, and the wave equation.
The curl of a gradient is zero.
(2.49)
This result shows that gradient fields are irrotational. It is the reason why certain physical forces (such as the gravitational and electrostatic forces) can be derived from a scalar potential.
Exercise 2.19: Explain why this is so.
The curl is divergenceless, that is the divergence of the curl is zero.
(2.50)
This identity implies that the curl of a vector field is always divergenceless (sourceless). It plays an important role in electromagnetism, where it is responsible for the fact that magnetic monopoles do not exist in classical theory.
The curl of the curl is
(2.51)
This identity is extremely useful because it relates the curl operation back to the divergence and the Laplacian. It can be verified by direct (though somewhat tedious) expansion in components. It can also be confirmed symbolically using computer algebra systems, as demonstrated below.
Principle 2.12: The various products of the nabla operator are not independent. They are connected by a small set of fundamental identities. These relations allow us to move freely between different representations of physical laws and are essential when deriving the wave equations for the electromagnetic field or when working with the vector potential in both classical and quantum theory.
These identities complete our study of the differential operations involving the nabla operator. We are now ready to move from local differential operations to global integral theorems.
Exercise 2.20: Let ![]()
1) Compute the gradient.
2) Compute the divergence of the gradient, also known as the Laplacian.
Exercise 2.21: Let
.
1) Compute the gradient.
2) Compute the curl of the gradient.
3) What does your result in 2) illustrate about gradient fields?
Exercise 2.22: Let
.
1) Compute the curl.
2) Compute the divergence of the curl.
3) What does your result in 2) demonstrate?
Exercise 2.23: The curl of any gradient field vanishes. Explain, in physical terms, why this identity is important. Give one example from physics where this property plays a significant role (for example, in the description of conservative forces or in the existence of a scalar potential).
Integration of Vector Fields
Up to this point in our study of vector calculus, we have focused on how fields change from point to point. Using the gradient, divergence, and curl, we have learned to describe the local behavior of scalar and vector fields with precision. These differential operations tell us, at each individual location, how a field is increasing, expanding, or rotating.
However, many of the most important questions in physics are not purely local. We often need to know how a field behaves over an extended region—how much total flux passes through a surface, how much work is done along a path, or how much circulation a field has around a closed loop. To answer these questions, we must integrate vector fields.
In this section, we develop the theory of integration for vector fields. We begin with the basic ideas of double and triple integrals, which extend the single-variable integration you already know to two and three dimensions. We then introduce the line integral, which allows us to integrate a vector field along a curve. This naturally leads us to consider closed curves and the important distinction between simply-connected and multiply-connected regions.
The heart of this section consists of three powerful theorems that connect the differential operations we have already studied with these new integral operations:
Green’s Theorem relates the line integral around a closed curve in the plane to a double integral over the region it encloses.
Gauss’s Divergence Theorem relates the flux of a vector field through a closed surface to the triple integral of its divergence throughout the volume.
Stokes’s Theorem relates the line integral of a vector field around a closed curve to the surface integral of its curl over any surface bounded by that curve.
These theorems are among the most important results in vector calculus. They allow us to convert difficult integrals of one type into easier integrals of another type, and they provide deep physical insight into conservation laws, circulation, and flux. You will see them appear repeatedly in electromagnetism, fluid dynamics, and later in the formulation of physical laws in both flat and curved spacetime.
By the end of this section, you will have a complete set of tools — both differential and integral — for working with vector fields in three-dimensional space.
Double Integrals
If we have a region in two dimensions, we can determine quantities associated with that region—such as its area or the total amount of some quantity distributed over it—by extending the ideas we developed for curves in one dimension. Instead of integrating along a line, we now integrate over an area.
If we have a region in two dimensions, R, we can determine its area the same sort of way we did for the area under a curve in one dimension.
Figure 2.1 A region in a plane.
Except here instead of filling the area with rectangular strips we fill it with square area elements of area
, for the area of the ith square.
Figure 2.2: Area element in a region.
For a function of two variables
we then have the Riemann sum
(2.52)
We perform the same limiting process as for the one-dimensional case, where as
the discrete sum becomes the continuous double integral
Definition 2.12 Double Integral: The double integral of a function
over the region R
(2.53)
Exercise 2.24: Consider the square region R defined by
and
, and the function
.
1) Divide the region into 4 smaller squares of equal size. Choose the sample point at the center of each small square and write the corresponding Riemann sum.
2) What happens to this sum as we increase the number of squares while keeping the region fixed?(c) What does the limiting value of the Riemann sum represent?
Exercise 2.25: In one dimension, the definite integral
can be interpreted as the signed area under the curve y=f(x). Explain, in your own words, what the double integral
represents when
is a positive function defined over a region R in the plane. Give one physical example of a quantity that could be calculated using a double integral.
Iterated Integrals
When we have a region R in the plane, we can evaluate the double integral by dividing the region into thin vertical or horizontal strips. This approach leads to iterated integrals, which allow us to compute a double integral by performing two successive single-variable integrations.
Consider a region R in the
plane. Suppose that any line parallel to the
-axis intersects the region in at most two points. We can then describe the region by two curves that bound it from below and above.
Bounding the Region with Curves
We show a region in the plane.
Figure 2.3: Dividing a region into a pair of curves.
Here we see that any line perpendicular to the
axis intersects R in at most two points. We can then bound R by two curves. The first we will label A B C and the second A D C.
Figure 2.4: Labeling the pair of curves.
The curve A B C we can write as the function
and A D C as the function
. We can define the interval over which these functions are single-valued and continuous as
, over this interval both functions are single-valued and continuous. Suppose the projection of R onto the
-axis extends from
to
. We can cover the region with thin vertical strips. For a fixed value of
, the variable
ranges from the lower curve
to the upper curve
. The area element in each strip can be written as
.
Figure 2.5: Partitioning the region into vertical strips.
If we use these functions as the boundary, we can evaluate the double integral by filling the region with small squares like
formed by making a mesh of lines perpendicular to one axis and then the other.
Definition 2.12 Iterated Integral: The double integral of a function
over the region R can be expressed as the iterated integral
(2.54)
where the integral in the square brackets is evaluated first.
This process corresponds to first integrating with respect to
along each vertical strip, and then integrating the result with respect to
across the full width of the region. The same idea can be applied by slicing the region with horizontal strips instead, leading to an iterated integral with the order of integration reversed.
Exercise 2.26: Consider the region R in the
plane bounded below by the curve
and above by the curve
, with
.
1) Sketch the region and clearly label the lower and upper bounding curves.
2) Write the double integral
as an iterated integral with respect to
first.
3) If the function is
, set up (but do not evaluate) the iterated integral.
Exercise 2.27: When converting a double integral over a region R into an iterated integral, we must carefully determine the limits of integration. Explain why it is important to identify the lower and upper bounding curves (or left and right boundaries) before writing the iterated integral. What could go wrong if the limits are chosen incorrectly? Give a brief physical or geometric example to illustrate your answer.
Triple Integrals
The ideas we developed for double integrals extend naturally to three dimensions. When we have a quantity distributed throughout a three-dimensional region, we can accumulate its total value by dividing the region into small volume elements and taking a limit.
Riemann Sums in Three Dimensions
Consider a region R in three-dimensional space. We divide this region into small volume elements
. For each small volume, we choose a sample point
and evaluate the function
at that point. The contribution from the ith volume element is then
.
Summing over all volume elements gives the three-dimensional Riemann sum
(2.55)
Definition 2.13 Triple Integral: The triple integral of a function
over a three-dimensional region R is defined as the limit of the Riemann sum as the volume of each element approaches zero
(2.56)
provided the limit exists. This integral represents the total accumulation of the quantity F throughout the entire volume R.
Iterated Integrals in Three Dimensions
As in the two-dimensional case, we can evaluate the triple integral by performing three successive single-variable integrations. We integrate first with respect to one variable while holding the others fixed, then with respect to the second variable, and finally with respect to the third.
Suppose the region R is bounded in the
-direction by surfaces
and
, in the
-direction by curves that may depend on
, and extends from
to
. The triple integral can then be written as the iterated integral
(2.57)
where the inner integral is evaluated first. The limits of integration for each variable generally depend on the variables that are integrated later. This process corresponds to filling the volume with thin slabs, then strips, and finally small volume elements, taking the appropriate limits at each stage.
Exercise 2.28: Consider the region R in three-dimensional space bounded below by the plane
, above by the plane
, and with projection onto the
plane given by the triangle
,
.
1) Sketch or describe the region clearly.
2) Write the triple integral
as an iterated integral with the order of integration
.
3) If
, set up (but do not evaluate) the iterated integral.
Exercise 2.29: When setting up a triple integral as an iterated integral, the limits of integration for the inner integrals often depend on the outer variables.
Explain why the limits in a triple integral are generally more complicated than those in a single or double integral. What physical or geometric information do these variable limits represent? Give one example of a three-dimensional region where the limits would depend on two variables.
The Line Integral
We can integrate a scalar or vector field along a curve or path in space. Such an integral is called a line integral (or path integral). When the integration is performed with respect to arc length along the curve, it is sometimes called a line integral with respect to arc length.
Definition 2.14 Line Integral: The line integral of a scalar field
along a curve C is given by
(2.58)
where ds is the infinitesimal arc-length element along the curve.
To evaluate a line integral, we parametrize the curve and convert the integral into an ordinary definite integral with respect to the parameter.
Evaluating a Line Integral
Suppose we have a scalar field
and we wish to integrate it along the curve C given by the position vector
.
We begin by writing the line integral
(2.59)
To evaluate this, we parametrize the curve using t. The arc-length element is
(2.60)
We can integrate over a curve or path with respect to the length element of that curve. Such an integral is called a line integral, or a path integral. (Some textbooks call this a line integral with respect to arc length). The line integral of a scalar,
, along some curve C is given as,
How do we calculate a line integral? We write this out and perform any necessary changes in variables. Then we integrate over the region of the curve, C.
For example, if we have the scalar function
, and we want to integrate it over a curve described by the position vector
. First we write Eq. (2.42)
(2.61)
Substituting x=t and
, we get
(2.62)
We also express the integrand in terms of t
(2.63)
The line integral then becomes
(2.64)
Evaluating this integral yields
(2.65)
So, here is the procedure for calculating line integrals:
Formulate the integral
Specify the curve
Obtain the end-point parameters
Calculate the parameter-derivative of the curve (speed curve)
Calculate the norm of the speed curve
Note the parametric integral
Where applicable substitute the curve into the integrand
Perform the scalar product
Calculate the integral
Line Integrals over Closed Curves
There is an important connection between line integrals and the gradient of a scalar field. This is expressed in the following theorem, which is a direct generalization of the Fundamental Theorem of Calculus
Note that in the example above we used, implicitly, a generalization of the Fundamental Theorem of Calculus from basic calculus. Here is a formal statement of the theorem:
Theorem 2.3: Let f be a differentiable scalar function defined on a domain D. Let
and
be two points in D connected by a piecewise smooth curve C lying entirely in D. Then
(2.66)
This result shows that the line integral of a gradient field depends only on the endpoints of the path and is therefore independent of the specific curve taken between them (provided the field is conservative).
A similar line integral can be defined for vector fields. For a vector field
, the line integral along a curve C is written as
(2.67)
Exercise 2.30: Consider the scalar field σ(x,y)=x+y and the curve C given by the straight line from (0,0) to (2,3), parametrized by r(t)=(2t,3t) for t∈[0,1].
1) Compute the arc-length element.
2) Evaluate the line integral.
Exercise 2.31: Let
be a scalar function, and let C be any smooth curve connecting the point A=(0,1) to the point B=(2,3).
1) Compute the gradient.
2) Use the Fundamental Theorem for Line Integrals to evaluate the line integral of the gradient.
3) What does your result imply about the value of the line integral if a different path is taken from A to B?
Exercise 2.32: Consider the vector field
and two different paths from (1,0) to (-1,0)
1) Path
: The upper semicircle of radius 1 centered at the origin.
2) Path
: The lower semicircle of radius 1 centered at the origin.
Compute the line integral along each path. Are the results the same? What does this tell you about the field
?
Exercise 2.33: The Fundamental Theorem for Line Integrals states that the line integral of a gradient field between two points depends only on the endpoints of the path.
Explain, in physical terms, why this property is important. Give one example from physics where path independence of a line integral plays a significant role (for example, in mechanics or electromagnetism).
Simple Closed Curves
When working with line integrals over closed paths, it is important to distinguish between different types of curves. Not all closed curves behave in the same way, and this distinction becomes especially significant when we later apply Green’s Theorem.
A curve is said to be closed if its starting point and ending point coincide. Among closed curves, we are particularly interested in those that do not cross themselves.
Definition 2.15 Simple Closed Curve: A simple closed curve is a closed curve that does not intersect itself except at its endpoints. In other words, it forms a loop without any self-crossings.
Simple closed curves are sometimes called Jordan curves. A fundamental result in topology, known as the Jordan Curve Theorem, states that any simple closed curve in the plane divides the plane into two distinct regions, a bounded interior region and an unbounded exterior region. This separation is what allows us to meaningfully speak of the “inside” and “outside” of a closed curve.
Orientation of Closed Curves
When integrating over a simple closed curve, we must also specify its orientation. By convention, a simple closed curve is said to be positively oriented (or traversed counterclockwise) if, as one walks along the curve in the direction of the parametrization, the interior of the region lies to the left. The opposite direction is called negative or clockwise orientation.
This distinction is important because the value of many line integrals over closed curves changes sign when the direction of traversal is reversed.
Common examples of simple closed curves include circles, ellipses, and smooth irregular loops that do not cross themselves. In contrast, a figure-eight curve is closed but not simple, because it intersects itself at one point. Self-intersecting curves generally require more care when applying integral theorems and are often excluded from the basic statements of Green’s Theorem.
Principle 2.12: Simple closed curves provide a natural setting for relating line integrals around a boundary to integrals over the region they enclose. Their non-self-intersecting nature ensures a clear distinction between the interior and exterior, which is essential for the integral theorems that follow.
Simply- and Multiply-Connected Regions
Consider a region in the plane. If we draw a closed curve entirely within the region, we can ask a natural question: can this curve be continuously shrunk down to a single point while remaining entirely inside the region? The answer to this question determines whether the region is simply connected or multiply connected.
Definition 2.16 Simply-Connected Region: A region R is said to be simply connected if every closed curve lying entirely within R can be continuously contracted to a single point without leaving the region.
In a simply connected region, there are no holes. Any loop drawn inside the region can be shrunk away completely while staying inside R. Common examples include the interior of a circle, a disk, a rectangle, or any convex region.
Definition 2.17 Multiply-Connected Region: A region R is said to be multiply connected if it is not simply connected — that is, if there exist closed curves in R that cannot be continuously shrunk to a point without leaving the region.
Multiply-connected regions contain one or more holes. The simplest example is an annulus (the region between two concentric circles). A closed curve that encircles the inner hole cannot be contracted to a point while remaining inside the annulus. Regions with multiple holes are said to have higher connectivity.
Imagine walking along a closed curve inside a region. In a simply connected region, you can always pull the curve tighter and tighter until it disappears into a point, all while staying inside the region. In a multiply-connected region, some curves are “trapped” around a hole and cannot be shrunk without crossing the hole (which lies outside the region).
This distinction is not merely technical. It has important consequences for the behavior of vector fields and line integrals. In particular, certain powerful results — such as the path independence of line integrals of conservative fields — hold throughout simply connected regions but may fail in multiply-connected ones.
Principle 2.13: The connectivity of a region determines whether every closed curve within it is “contractible.” This topological property strongly influences the validity and form of integral theorems and the existence of scalar potentials for vector fields.
Green’s Theorem in the Plane
We have now developed the concepts of line integrals, simple closed curves, and the distinction between simply-connected and multiply-connected regions. These ideas come together in one of the most important and useful results in vector calculus: Green’s Theorem.
Green’s Theorem provides a profound connection between a line integral around the boundary of a region and a double integral over the region itself. It allows us to convert a difficult line integral into a more manageable double integral (or vice versa), and it reveals a deep relationship between the circulation of a vector field around a closed curve and the behavior of the field inside the region.
Theorem 2.4 Green’s Theorem: Let R be a simply-connected region in the plane bounded by a positively oriented, simple closed curve C. Let
and
be functions that are continuously differentiable throughout R. Then
(2.68)
In words, the line integral of the vector field (P, Q) around the closed curve C is equal to the double integral over the region R of the quantity
The expression
is the two-dimensional version of the curl of the vector field (P, Q). Thus, Green’s Theorem states that the circulation of a vector field around the boundary of a region is equal to the integral of the curl of the field over the interior of the region.
Green’s Theorem requires that the region R be simply connected and that the boundary curve C be a simple closed curve traversed in the positive (counterclockwise) direction. If the curve is traversed clockwise, the sign of the integral reverses. The theorem can be extended to multiply-connected regions, but this requires additional care when handling the boundaries around any holes.
Green’s Theorem has a clear physical meaning. The left-hand side represents the circulation of the vector field around the closed curve—how much the field “goes around” the boundary. The right-hand side measures the total rotation (or vorticity) of the field inside the region. The theorem tells us that the net circulation around the boundary is determined entirely by the rotation occurring within the region.
This result is fundamental in fluid dynamics, where it relates the circulation around a closed path to the vorticity inside, and in electromagnetism, where it is closely related to Faraday’s law and Ampère’s law.
Principle 2.14: Green’s Theorem bridges the local differential properties of a vector field (its curl) with its global integral behavior around closed paths. It is one of the central tools for converting between line integrals and area integrals in the plane.
Give me two exercises
Exercise 2.34: Let C be the circle of radius 2 centered at the origin, traversed counterclockwise, and let R be the disk enclosed by C. Consider the vector field with components
and
.
1) Compute the line integral
directly by parametrizing the circle.
2) Use Green’s Theorem to evaluate the same integral by converting it to a double integral over R.
. 3) Verify that both methods give the same result.
Exercise 2.35: Green’s Theorem relates the circulation of a vector field around a closed curve to the integral of a certain expression (related to the curl) over the region enclosed by the curve.
Explain, in your own words, why Green’s Theorem requires the region to be simply connected. What could go wrong if we tried to apply the theorem directly to a multiply-connected region (for example, an annulus)? How might one modify the application of the theorem in such cases?
Surface Integrals
The flux of a scalar field
is the quantity of the field that exits through a surface element d σ. This is represented as the integral
(2.69)
We can rewrite this by considering the surface element to be the product of the angle of the normal line to the surface θ (always pointing outward in a positive sense) and the
axis and the area element, so we write
(2.70)
where we can also write
(2.71)
The surface integral can then be written,
(2.72)
where
.
If the equation for σ is of a homogeneous form,
, then we can write,
(2.73)
Exercise 2.36: Consider the scalar field φ(x,y,z)=x+y+z and the surface Σ given by
for 0≤x≤1, 0≤y≤1.
1) Write the surface integral
as an ordinary double integral over the projection of Σ onto the x y-plane.
2) Set up (but do not evaluate) the resulting iterated integral.
Exercise 2.37: When computing a surface integral of a scalar field, we often project the surface onto one of the coordinate planes and introduce a factor involving the partial derivatives of the surface function.Explain, in physical or geometric terms, what this factor
represents. Why is it necessary when converting the surface integral into a double integral over the projected region?
Gauss’s Divergence Theorem
We have seen how to integrate vector fields over surfaces and how the divergence measures the local expansion or contraction of a vector field at each point. Gauss’s Divergence Theorem provides a powerful connection between these two ideas. It relates the total flux of a vector field leaving a closed surface to the integral of the divergence of the field throughout the volume enclosed by that surface.
This theorem is the three-dimensional counterpart of Green’s Theorem and is one of the most important results in vector calculus. It allows us to convert a surface integral over a closed boundary into a volume integral over the interior, and vice versa.
Theorem 2.5 Gauss’s Divergence Theorem: Let V be a volume in three-dimensional space bounded by a closed surface Σ, and let n be the outward-pointing unit normal vector on Σ. For a vector field
that is continuously differentiable throughout V and on Σ,
(2.74)
In words, the triple integral of the divergence of
over the volume V is equal to the flux of
through the closed surface Σ.
The left-hand side of the theorem measures the total “source strength” or net expansion of the vector field inside the volume. The right-hand side measures the total amount of the vector field flowing out through the surface. Gauss’s Divergence Theorem therefore states that the net flux leaving a closed surface is exactly equal to the total divergence (net source) contained within the volume.
This result has direct physical significance in many areas. In fluid dynamics, it relates the rate at which fluid is leaving a region to the expansion of the flow inside. In electromagnetism, it is equivalent to Gauss’s law, which connects the electric flux through a closed surface to the charge enclosed within it.
The theorem requires that the surface Σ be closed and oriented with the outward normal, and that the vector field
be sufficiently smooth (continuously differentiable) inside and on the boundary of the volume. The region V is typically assumed to be simply connected, although the theorem can be extended to more general regions with appropriate modifications.
Principle 2.15: Gauss’s Divergence Theorem converts the local information contained in the divergence of a vector field into a global statement about the net flux through the boundary of a volume. It is one of the central tools for relating volume integrals to surface integrals in three dimensions.
Exercise 2.38: Let V be the unit ball
bounded by the sphere Σ. Consider the vector field
.
1) Compute the flux
directly (this is possible but tedious).
2) Use Gauss’s Divergence Theorem to evaluate the same flux by converting it to a triple integral over the volume V
3) Which method is easier? What does the result tell you about the divergence of
.
Exercise 2.39: Gauss’s Divergence Theorem states that the net flux of a vector field out of a closed surface is equal to the integral of the divergence of the field over the enclosed volume.
Explain, in physical terms, what this theorem tells us about the relationship between local expansion (or contraction) of a vector field and the total flow through its boundary. Give one example from physics where this relationship is particularly useful or meaningful.
Stokes’s Theorem
We have already seen how Green’s Theorem relates a line integral around a closed curve in the plane to a double integral over the region it encloses. Stokes’s Theorem is the natural three-dimensional generalization of this idea. It connects the circulation of a vector field around a closed curve to the flux of the curl of that field through any surface bounded by the curve.
This theorem is remarkably powerful because the surface appearing on the right-hand side can be any surface whose boundary is the given curve. This flexibility often allows us to choose a surface that makes the calculation significantly easier.
Theorem 2.6 Stokes’s Theorem: Let C be a positively oriented, simple closed curve, and let Σ be any oriented surface whose boundary is C. For a vector field
that is continuously differentiable on an open region containing Σ and C,
(2.75)
where
is the unit normal vector to the surface consistent with the orientation of C via the right-hand rule.
In words, the line integral of
around the closed curve C (its circulation) is equal to the surface integral of the curl of
over any surface bounded by C.
The orientation of the surface Σ must be chosen so that it is consistent with the direction of traversal of the curve C. If you walk along C in the positive direction with your head pointing in the direction of
, the surface should lie to your left. Because the theorem holds for any surface with boundary C, one can often simplify calculations by choosing the most convenient surface (for example, a flat disk instead of a curved surface).
The left-hand side of Stokes’s Theorem measures the circulation of the vector field around the curve—how much the field “goes around” the loop. The right-hand side integrates the curl of the field over the surface, which represents the total rotation or vorticity of the field passing through the surface. Stokes’s Theorem therefore states that the circulation around a closed curve is determined by the vorticity of the field through any surface it bounds.
This result has important applications in fluid dynamics (relating circulation to vorticity) and in electromagnetism (it is the differential form of Faraday’s law).
Principle 2.16: Stokes’s Theorem provides a deep connection between the circulation of a vector field around a closed path and the flux of its curl through a surface. It generalizes Green’s Theorem to three dimensions and is one of the fundamental tools for relating line integrals to surface integrals.
Together with Green’s Theorem and Gauss’s Divergence Theorem, Stokes’s Theorem completes the major integral theorems of vector calculus. These results form the foundation for much of classical field theory and appear repeatedly in both physics and engineering.
Exercise 2.40: Let C be the circle
in the x y-plane, traversed counterclockwise when viewed from above. Let Σ be the upper hemisphere
, z≥0, with upward orientation. Consider the vector field
.
1) Compute the line integral directly by parametrizing the circle.
2) Use Stokes’s Theorem to evaluate the same integral by converting it to a surface integral over Σ.
3) Verify that both methods give the same result.
Doing This Stuff in Mathematica
Scalar and Vector Fields
Given a scalar field in three dimensions, we can find the gradient,
We can specify an orthogonal coordinate system
We can also find the Laplacian
Given a vector field we can find the divergence
or the Curl,
Multiple Integrals
Multiple integrals are handled using the Integrate command
or an indefinite integral
Line Integrals
Here we will calculate the line integral example from above, we symbolically work it out to the integration point
In the most recent versions of Mathematica, from version 13.3, there is a new command, LineIntegrate.
For the example above, we write.
Surface Integrals
In the most recent version of Mathematica, there is a new command, SurfaceIntegrate.
For example, we want the surface integral of a scalar field over a surface. We begin by writing our scalar function.
We can establish a surface.
We can see what this surface looks like.
For Further Reading
Klaus Jänich, (1993), Vector Analysis, Springer