If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

3D divergence theorem

Also known as Gauss's theorem, the divergence theorem is a tool for translating between surface integrals and triple integrals.

What we're building to

  • Setup
    • F(x,y,z) is a three-dimensional vector field.
      • V is some three-dimensional volume (think of a blob floating in space).
      • S is the surface of V.
Khan Academy video wrapper
  • The divergence theorem relates the divergence of F within the volume V to the outward flux of F through the surface S:
VdivFdVAdd up little bitsof outward flow in V=SFn^dΣFlux integralMeasures total outward flow through V’s boundary
  • The intuition here is that divergence measures the outward flow of a fluid at individual points, while the flux measures outward fluid flow from an entire region, so adding up the bits of divergence gives the same value as flux.

Surface must be closed

In what follows, you will be thinking about a surface in space. But unlike, say, Stokes' theorem, the divergence theorem only applies to closed surfaces, meaning surfaces without a boundary. For example, a hemisphere is not a closed surface, it has a circle as its boundary, so you cannot apply the divergence theorem.
However, if you add on the disk on the bottom of this hemisphere, and consider the disk and the hemisphere to make up a single surface, you now have a closed surfaces whose interior volume is half a ball. In this case, given some vector field, the divergence theorem can be used on this two-part surface and this half ball.
The reason for this is that we need to be able to talk about the three-dimensional volume enclosed by a surface, which doesn't make any sense for open surfaces.

The intuition

If you understand the intuition behind flux in 3d, triple integrals, and the 2d divergence theorem, you basically already understand the three-dimensional divergence theorem. It's just a matter of fitting these conceptual ideas together.

Global view of outward flow: flux

When a three-dimensional vector field F(x,y,z) is thought of as representing a fluid flow, the flux of F through a surface S is a measure of how much fluid passes through that surface per unit time. It is measured with the following integral:
You can think of this integral as breaking apart the surface into many tiny pieces, where dΣ represents the area of one of these pieces. That little hatted fellow n^ represents a function that gives a unit normal vector at each point on the surface.
Khan Academy video wrapper
When the dot product Fn^ is large, it means the fluid is flowing strongly in the same direction as n^, and hence the fluid is passing the surface rapidly at that point. Notice, this means the flux integral counts fluid flow positively when it goes in the same direction as the unit normal vectors n^, and negatively when it flows against those vectors.
For this article, think about the case where S is a closed surface, encapsulating some three-dimensional volume V. ("Closed" means it has no edges). If S is oriented with outward facing unit normal vectors, the flux of F through S measures how quickly fluid is leaving the volume V. It's like going to all the doors at the boundary of a region and adding up how much fluid leaves each one while subtracting how much fluid enters each one.
SFn^How much fluidleaves/enters?dΣTiny piece of area

Local view of outward flow: Divergence

Divergence, in any dimensions, measures the tendency for fluid to flow away from each point in space. More specifically, if you take some point in space, (x0,y0,z0), and some tiny volume around that point Vtiny, the rate at which fluid flowing along the vector field F leaves this tiny region will be roughly equal to the following expression:
(F(x0,y0,z0))Divergence|Vtiny|Volume of Vtiny
In other words, divergence gives the outward flow rate per unit volume near a point. The reason it must be multiplied by volume before estimating an actual outward flow rate is that the divergence at a point is a number which doesn't care about the size of the volume you happen to be thinking about around that point. But the outward flow rates for smaller volumes will be smaller simply by virtue of the fact that there is less fluid in them to do the flowing.

Add up local view to get a global view

Next, to bring triple integrals into the game, think of the following process:
  • Break up a three-dimensional volume V into many tiny pieces (little three-dimensional crumbs).
  • Compute the divergence of F inside each piece.
  • Multiply that value by the volume of the piece.
  • Add up what you get.
This will give a sense of the "total outward flow" due to F throughout the entire volume V. But as I mentioned above, this quantity is also measured by the flux of F through the surface S of V.
The process outlined above also describes the intuition for a triple integral:
VFDivergencedVTiny bitof volume
Setting this equal to the flux of F through the surface of V, we get the divergence theorem:
VdivFdVAdd up little bitsof outward flow in V=SFn^dΣFlux integralMeasures total outward flow through V’s boundary


Both surface integrals and triple integrals can be very nasty to compute. But the divergence theorem gives a tool for translating back and forth between them, and oftentimes it can help turn a particularly difficult surface integral into an easier volume integral. This is especially effective if the volume V is some familiar shape, like a sphere, and if the divergence turns out to be a simple function.
You can practice with examples of using this theorem in the next article.
It is also a powerful theoretical tool, especially for physics. In electrodynamics, for example, it lets you express various fundamental rules like Gauss's law either in terms of divergence, or in terms of a surface integral. This can be very helpful conceptually. Sometimes a situation is easier to think about locally, e.g. what individual charges at individual points in space are generating an electric field. But other times you want a more global view, perhaps asking how an electric field passes through an entire surface.


  • The divergence theorem says that when you add up all the little bits of outward flow in a volume using a triple integral of divergence, it gives the total outward flow from that volume, as measured by the flux through its surface.
VdivFdVAdd up little bitsof outward flow in V=SFn^dΣFlux integralMeasures total outward flow through V’s boundary

Want to join the conversation?