Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 31

Divergence Theorem: Relating Volume and Surface Integrals

Recommended resources

Hello! Welcome to your seventh lesson in our module on Mathematical Methods for Physics.

In our last two lessons, you mastered the tools for integrating over surfaces (calculating flux) and volumes (calculating total quantities like mass or charge). Today, we will unite these two powerful concepts with one of the most important theorems in vector calculus.

This lesson's learning outcome is to apply the Divergence Theorem (also known as Gauss's Theorem) to relate volume and surface integrals. You will learn the statement of the theorem, understand its profound physical intuition, and see how it becomes the engine for deriving fundamental laws of physics, like Gauss's Law for electricity and the continuity equation for fluid flow. This theorem provides a deep connection between the behavior of a vector field inside a region and the net flow across its boundary.

1. The Statement of the Divergence Theorem

Let's begin with the formal statement. In our previous lessons, we learned to calculate two distinct quantities:

  1. The flux of a vector field through a surface :
  2. The volume integral of the divergence of that field, , over a volume :

The Divergence Theorem makes a remarkable claim: for a sufficiently smooth vector field and a closed surface that encloses a volume , these two quantities are equal.

Divergence Theorem (Gauss's Theorem) Visual and Formula
This diagram illustrates the core idea of the Divergence Theorem. The total flux of a vector field \(\mathbf{F}\) flowing out of a closed surface \(S\) is equal to the integral of the divergence of \(\mathbf{F}\) throughout the enclosed volume \(V\).

Mathematically, the theorem is written as:

A few points on notation:

  • The circle on the surface integral symbol, , indicates that is a closed surface—it has no boundary and completely encloses the volume (like a sphere or a cube, but not an open-ended cylinder).
  • The surface element is, by convention, taken to point outward from the volume.
  • is the divergence of the vector field, which you'll recall measures the "spreading out" or "source strength" of the field at a point.

Let's ground this with a formal definition from a trusted source.

4 The Integral Theorems

The following section from David Tong's lecture notes on Vector Calculus provides a concise and formal statement of the theorem and an important reinterpretation of divergence.

Please read the introduction and the first subsection, 'The Divergence Theorem', up to the 'Example' (pages 67-68). Pay close attention to equation (4.1) and the re-definition of divergence in equation (4.2).

As the notes highlight, the Divergence Theorem gives us a coordinate-independent definition of divergence: it's the net flux per unit volume, in the limit that the volume shrinks to a point.


2. The Intuitive Reason: Why the Theorem is True

How can an integral over a 3D volume be equal to an integral over its 2D boundary? The intuition lies in a powerful cancellation argument.

Imagine dividing the total volume into a vast number of infinitesimally small cubes. For each tiny cube, we can calculate the net flux out of its six faces.

Now, consider two adjacent cubes. The flux leaving one cube through a particular face is precisely the flux entering the adjacent cube through their shared face. Since the normal vectors are in opposite directions (), these internal flux contributions perfectly cancel out when we sum them up.

Conceptual Proof of Divergence Theorem
This image illustrates the cancellation argument. When summing the flux from all the tiny cubes that make up the volume V, the contributions from all interior faces cancel out, leaving only the flux through the outer boundary surface S.

This cancellation occurs for every single internal face within the volume. The only contributions that don't cancel are from the faces on the very edge of the volume—the faces that collectively make up the outer surface .

The following video gives an excellent visual and conceptual walkthrough of this idea.

Gauss's Divergence Theorem

Steve Brunton's video on Gauss's Divergence Theorem offers a fantastic, physics-oriented explanation of the theorem's intuition and significance.

Please watch from 2:43 to 14:41. The first part (2:43 - 8:30) translates the theorem from words to its mathematical form. The second part (8:30 - 14:41) provides the crucial intuitive picture using the 'cancellation of little boxes' argument. This visualization is key to truly understanding the theorem.

Test your understanding!

Imagine a vector field representing the flow of an incompressible fluid (like water). For such a fluid, the density is constant, and the fluid can't be created or destroyed at any point. What can you say about ? Using the Divergence Theorem, what does this imply about the total flux of the fluid through any closed surface?

Show answer

For an incompressible fluid, the amount of fluid entering any infinitesimal volume must equal the amount leaving it. This means there are no "sources" or "sinks" of fluid. Therefore, the divergence must be zero everywhere: .

According to the Divergence Theorem, the total flux out of a closed surface is . Since , the volume integral is zero. This implies that the total flux through any closed surface is also zero. Physically, this means that for any closed region, the rate at which fluid flows in must exactly balance the rate at which it flows out.


3. Application 1: Deriving Gauss's Law in Differential Form

Your request for high mathematical rigor and physical applications finds its perfect confluence here. The Divergence Theorem is not just an elegant mathematical statement; it's the tool used to transform "global" integral laws into "local" differential laws. The most famous example is Gauss's Law from electrostatics.

You know Gauss's Law in its integral form:

This states that the total electric flux out of a closed surface is proportional to the total charge enclosed within it.

We can also express the enclosed charge as the volume integral of the charge density :

So, Gauss's Law becomes:

Now, we apply the Divergence Theorem to the left-hand side:

Rearranging, we get:

This is the critical step: this equation must hold for any arbitrary volume we choose. The only way for an integral to be zero for every possible integration domain is if the integrand itself is zero everywhere.

Thus, we arrive at the differential form of Gauss's Law:

This is a much more powerful, local statement. It tells us that the divergence of the electric field at a specific point is directly proportional to the charge density at that very same point. Electric charges are the sources and sinks of the electric field.

Electromagnetism I: Electrostatics

For a concise derivation that mirrors what we just did, let's look at these high-level physics notes. This reinforces the logic and shows how it's presented in advanced contexts.

Please read 'Example 2: Show that the two forms of Gauss’s law are equivalent' on pages 2-3. The text provides a geometric argument for why divergence is flux per unit volume, directly connecting the integral and differential forms.

The same logic applies to gravity. The gravitational field obeys an analogous law, , where is the mass density. Mass is the "source" of the gravitational field.


4. Application 2: The Continuity Equation

The Divergence Theorem is the foundation for all conservation laws in physics. Let's derive the continuity equation, which expresses the local conservation of a quantity like mass or charge.

Consider a density (e.g., mass per unit volume) and a current density (e.g., mass flow rate per unit area, where is velocity).

The principle of conservation states that the rate of change of the total amount of stuff inside a volume must be equal to the rate at which stuff flows across the boundary surface .

  1. Rate of change inside V:
  2. Rate of flow across S: (The minus sign is because an outward flux decreases the amount inside).

Equating these gives the integral conservation law:

This is where the theorem comes in. We apply it to the right side:

Assuming the volume is fixed, we can move the time derivative inside the integral on the left:

Again, because this must hold for any volume , the integrand must be zero. This gives us the famous continuity equation:

This local law states that the density at a point can only decrease if there is a positive divergence of current away from that point.

Gauss's Divergence Theorem

Let's return to Steve Brunton's video, which provides a masterclass on this exact derivation.

Please watch from 14:41 to the end. This section walks through the derivation of the mass continuity equation step-by-step, exactly as we outlined above. The final summary (from 24:13) powerfully explains the general pipeline from a physical conservation principle to a partial differential equation using the Divergence Theorem.


5. A Worked Example

To solidify your computational skills, let's verify the Divergence Theorem for a specific case.

Problem:
Consider the vector field . Let be the sphere of radius centered at the origin, and let be its surface. Verify that .

Test your understanding! Try to solve this yourself before looking at the solution.

Solution:

Part 1: The Volume Integral (RHS)

First, we calculate the divergence of :

The divergence is a constant! Now we integrate this over the volume of the sphere:

The integral is simply the volume of the sphere, which is .

Part 2: The Surface Integral (LHS)

Now we compute the flux through the surface of the sphere. We need to parametrize the surface. For a sphere of radius , the outward normal vector is simply , the radial unit vector. The surface element is .

The vector field is just the position vector . On the surface of the sphere, the position vector has magnitude , so .

Now we compute the dot product :

The flux integral becomes:

The integral is the total surface area of the sphere, which is .

Conclusion:
Both sides of the equation yield . The Divergence Theorem holds. Notice how in this case, both integrals were relatively simple, but in other cases, one might be vastly easier than the other, making the theorem a powerful computational tool.


Conclusion

This lesson has introduced you to the Divergence Theorem, one of the pillars of vector calculus and theoretical physics.

Key Takeaways:

  • The Statement: The total flux of a vector field out of a closed surface is equal to the volume integral of the divergence of the field within that volume: .
  • The Intuition: The theorem works because the fluxes across all internal, adjacent sub-regions of the volume cancel out, leaving only the flux through the outer boundary.
  • The Application: Its primary use in physics is to convert global integral conservation laws into local partial differential equations. We saw this in action by deriving the differential form of Gauss's Law () and the general continuity equation ().

Preview of the Next Lesson:
We have now connected a surface integral to a volume integral. What about a line integral and a surface integral? In our final lesson of this module, we will explore Stokes' Theorem, which does exactly that. It relates the line integral of a vector field around a closed loop to the flux of the curl of that field through the surface bounded by the loop. This will complete our trio of fundamental theorems and equip you with the full mathematical arsenal for studying electromagnetism and fluid mechanics.