Proof of the Divergence Theorem
DOCX · 132.9 KB
Open DOCX file
A short expository document by Phil (dated 8.11.09, with a warning added 1.4.11) proving the divergence theorem by filling a region with small boxes. Internal walls cancel exactly, leaving only outward-facing boundary terms. It starts with a 1D case, treats the 2D case including angled boundaries and a notation caveat for dl, then 3D and nD, and ends with comments. It notes the companion Stokes theorem proof is separate.
AI-written summary; may contain errors.
Extracted text (machine-read; may contain errors)
Proof of the Divergence Theorem PhL 8.11.09
This is one of two theorems which underlie all the other integral theorems in my "integral theorems.doc". The other theorem is Stokes Theorem which I will prove in a separate document.
Divergence theorem: ∫dV A = ∫dS A
All proofs must eventually come down to the primitive level given here. I like the idea of starting with a 1D proof, even though it is a little artificial. It does make the ground floor linkage between multi and one dimensional worlds. I think I am mostly following Purcell E&M but have not looked at that recently.
CONTENTS
1. Divergence theorem in 1D. 1
2. Divergence theorem in 2D. 2
3. Divergence theorem in 3D. 6
4. Divergence theorem in nD. 8
5. Comments on the Divergence Theorem 9
1. Divergence theorem in 1D.
Here is our 1D picture and we have A = ∂Ax/∂x = dA/dx.
We have a line interval (a,b) broken into short horizontal segments about which I draw boxes. One would normally draw these boxes as little horizontal line segments, since the vertical dimension of the boxes has no meaning, but I keep the boxes anyway. Our vector field in 1D is just some scalar function A(x). The LHS of the (discrete) divergence theorem is this:
LHS = Σall boxes dx div A(x) where divA(x) = dA/dx in 1D
The main point is that as you do this addition across the line of boxes that make up the line segment, you get exact cancellation at each internal "wall" between boxes. That really is the main idea. For example
dx div A(x+dx) + dx div A(x+2dx) = [ A(x+dx) - A(x) ] + [ A(x+2dx) - A(x+dx) ]
= [A(x+2dx) - A(x)] // A(x+dx) cancelled away
When you do this for an entire row of 3 boxes, you get two cancellations at the 2 internal walls. If you do this for a large number N of boxes, you get cancellation at the N-1 internal walls, and you are left only with the "boundary terms" which in this case would be:
Σ dx div A(x) = A(b) - A(a)
In the limit of lots of small boxes, this becomes [ dV = dx ]
∫dV div A = [ A(b) - A(a) ]
In 1D, this result is of course just a restatement of this obvious fact:
∫dx (dA/dx) = A(x)|ba = A(b) - A(a)
but we have managed to express this result in a "divergence theorem context".
In our 1D proof of the divergence theorem, we have to make this connection:
∫dSA = A(b) - A(a)
The problem of course is that if dV is a 1D integration, then dS is a 0D integration. We have to interpret this 0D integration as just a sum of endpoint values, with normal (area) vector to the right at the right end and to the left at the left end.
We could perhaps "soup up" our derivation by giving the box walls a small finite area D and then take the limit D → 0 to achieve the real line. In this case we can imagine dV being Ddx, the "volume" of one of our little boxes. So we have upgraded dV to be a 2D thing. Then we would have dS = D, just the area of a box wall. Then we would write our divergence theorem this way:
LHS = Σall boxes (Ddx)div A(x) → D ∫dx div A
RHS = ∫dSA = DA(b) - DA(a) = D [A(b) - A(a) ]
Then we equate the two sides and cancel the D.
In any event, we know what we mean in the 1D case. Notice that there is no issue of "what to do at the boundaries" as there will be in the 2D case (and higher cases).
2. Divergence theorem in 2D.
Our "volume" is now true 2D "area" and our "surface" is a 1D contour (contours are always called C! )
Here is our opening picture, where we try to fill the "volume" with boxes:
We have focused on one particular square whose lower left corner is at (x,y) and have taken note of the value of A (a 2D vector field) at the midpoint of the four sides of this square. Notice that various factors of 1/2.
A reasonable way to write the divergence in terms of incrementals is this:
div A(x,y) = [Ax(x+dx/2,y) - Ax(x-dx/2,y)]/dx + [Ay(x,y+dy/2) - Ay(x,y-dy/2)]/dy
With this form, we can evaluate the divergence at the center of our box
divA(x+dx/2,y+dy/2)= [Ax(x+dx,y+dy/2) - Ax(x,y+dy/2)]/dx + [Ay(x+dx/2,y+dy) - Ay(x+dx/2,y)]/dy
= [Ax(right) - Ax(left)]/dx + [Ay(top) - Ay(bottom)]/dy
where now what appears are values of Ai at the center of each of the four walls. To summarize
divA(center) = [Ax(right) - Ax(left)]/dx + [Ay(top) - Ay(bottom)]/dy
or if we multiply through by our "volume",
dxdy divA(center) = [Ax(right) - Ax(left)]dy + [Ay(top) - Ay(bottom)]dx
Now when we sum up over all the little boxes in our region, we can examine:
Σall boxes dxdy divA(center) (*)
Just as in the 1D case, we are now going to get exact cancellation at all the internal walls! For our little square of interest, the value Ay(top) will be exactly cancelled by Ay(bottom) when we add in dxdydivA from the square above our square. And the value Ax(right) will be exactly cancelled by Ax(left) when we add in divA from the box to the right of our square. When all is said and done, everything cancels exact on those box walls which face the perimeter (and thus have no walls to cancel against). So our full sum (*) is going to be this:
+ Σright outfacing walls Ax(right) dy – Σleft outfacing walls Ax(left) dy
+ Σtop outfacing walls Ay(top) dx – Σbottom outfacing walls Ay(bottom) dx
where now locations like "top" refer to the centers of box walls along the top row of boxes, etc.
Now we want to define a vector small surface "area" as follows:
dS = dS = (dSx, dSy)
such that for the right wall, points to the right, and for the left wall it points to the left, and so on. It is the out-pointing unit vector. So consider these claims (really just facts):
dSx = dy right outfacing walls since = and dSy = 0
dSx = -dy left outfacing walls since = - and dSy = 0
We refer to dS as an "area" but in our current case it is a 1D area, the edge of a box. And of course
dSy = dx top outfacing walls since = and dSx = 0
dSy = -dx bottom outfacing walls since = - and dSx = 0
So let's write our four sums above as
+ Σright outfacing walls Ax(right) dSx + Σleft outfacing walls Ax(left) dSx
+ Σtop outfacing walls Ay(top) dSy + Σbottom outfacing walls Ay(bottom) dSy
where now we have all plus signs. But we can write all four sums as one sum:
Σall outfacing walls A dS
Thus we have our infinitesimal 2D divergence theorem:
Σall boxes dxdy divA(center) = Σall outfacing walls A dS (**)
In our picture above, we see a certain amount of our "volume" which is not filled by boxes. As the boxes are made smaller and smaller, this unfilled volume decreases. When the boxes are 1 micron on edge, the unused area would not even be visible in our picture. So the upshot is that we don't really have to worry about the details at the walls, we can just take the limit as the box size goes to zero. We assume of course that the walls are "smooth" in some sense. It would be OK to have a place where the wall slope is discontinuous, but not a place where the wall contains some kind of delta function animal. The ultimate boundary C is of course "continuous" in that it has no gaps. So here then is the limit of (**) above
∫dV A = ∫dS A
In this 2D case we can of course express this "surface term integral" in different notation
∫dS A = C dl A // see improved notation below
but in either notation it is the same thing. We can identify dS = dl .
WARNING (added 1.4.11). When we write dS A for dS a piece of 2D surface area, we of course imply that the direction of the vector dS is perp to the surface patch. When dS is a 1D piece of surface which we are writing above as dl, and we write dl A, we imply that the vector dl is perp to our contour. It is not along our contour! This is very dangerous, because elsewhere we do imply that dl is along the contour! An example of this is in the theorem !Syntax Error, Iφ dl = φ(B) - φ(A). In this case, φ dl = (∂φ/∂l) dl. So I need to come up with a better notation!!! Here is my improved notation:
∫dS A = C dl A // improved notation
Of course in our limit of tiny boxes, this line integral follows a sequence of vertical and horizontal segments only. One might wonder about the limit where we then allow l to be at an arbitrary angle which is tangent to curved boundary C. So let's look at what happens at an edge (I guess we have to worry a little bit about the edges) :
As the boxes become very small, the curved boundary becomes straight as shown. It is true that no matter how small the boxes are made, there will be some "unfilled space", so this picture looks the same no matter how small we scale the boxes. The black dots mark locations where we will want to evaluate our vector field A, but when the boxes are very small, A will have the same value at all four points (we are assuming that A itself is smooth). For this reason, we don't show arguments of Ai below.
The reader might casually be concerned that the length of the three dotted internal box edges is longer than the length of the diagonal edge dl and this will be true no matter how small the boxes are made. So let's examine the piece of our "line integral" that jags along the three dotted box edges. We will go bottom to top here just to avoid minus signs (ie, opposite the usual contour integral direction convention)
Σthree outfacing walls A dS = Aydx + Axdy + Axdy
= Aydx + 2 Axdy = Aydx + Ax Δy
But of course dl = (dx, Δy) so the above becomes just A dl . But this represents a piece of contour running at some angle along our curve C, so there is no problem thinking of dl as "being at an angle". The point is that we have shown in this little detail that, although there is always "unfilled space" at an angled boundary like this, the limit of the jagged contour integral is in fact the smooth continuous contour integral.
Note that we never encounter the isolated boundary length which is dl one way, and dx+2dy the other. If our integral of interest were ∫dl f(x) where f was a scalar field, then we could get f ∫dl and then there would be a difference in the two paths for computing ∫dl, but here we don't have ∫dl f(x) , we instead have ∫dl A(x) which is a completely different beast.
So our claim is that we have now proven the divergence theorem in 2D where it takes this form:
∫dV A = ∫dS A = C dl A 2D
∫dV A = ∫dS A = A(b) - A(a) 1D
and we can compare with the 1D form. You can see the meaning of ∫dS A in these two cases.
3. Divergence theorem in 3D.
Nothing conceptually new arises compared to the 2D case. We fill our 3D volume as best we can with little cubes (3D boxes), and we quickly arrive at this generalization of our previous result
divA(center) = [Ax(right) - Ax(left)]/dx
+ [Ay(top) - Ay(bottom)]/dy
+ [Ay(front) - Ay(back)]/dz
where we assume a z axis coming out to the viewer, so x,y,z are a right handed system. If we multiply through by our "volume", we get
dxdydz divA(center) = [Ax(right) - Ax(left)]dydz
+ [Ay(top) - Ay(bottom)]dxdz
+ [Ay(front) - Ay(back)]dxdy
We can then sum over all our cubes to get (always imitating the 2D derivation)
Σall boxes dxdydz divA(center) =
+ Σright outfacing walls Ax(right) dydz – Σleft outfacing walls Ax(left) dydz
+ Σtop outfacing walls Ay(top) dxdz – Σbottom outfacing walls Ay(bottom) dxdz
+ Σfront outfacing walls Ay(top) dxdy – Σback outfacing walls Ay(bottom) dxdy
We then define our vector differential surface area, imitating and extending what we did in the 2D case
dS = dS = (dSx, dSy, dSz)
dSx = dydz right outfacing walls since = and dSy = dSz = 0
dSx = -dydz left outfacing walls since = - and dSy = dSz = 0
dSy = dxdz top outfacing walls since = and dSx = dSz = 0
dSy = -dxdz bottom outfacing walls since = - and dSx = dSz = 0
dSz = dxdy front outfacing walls since = and dSx = dSy = 0
dSz = -dxdy rear outfacing walls since = - and dSx = dSy = 0
We can then write our 6 sums above with all plus signs:
Σall boxes dxdydz divA(center) =
+ Σright outfacing walls Ax(right) dSx + Σleft outfacing walls Ax(left) dSx
+ Σtop outfacing walls Ay(top) dSy + Σbottom outfacing walls Ay(bottom) dSy
+ Σfront outfacing walls Ay(top) dSz + Σback outfacing walls Ay(bottom) dSz
= Σall outfacing walls A dS
and then we take the limit of tiny cubes to get.
∫dV A = ∫dS A
where of course dV = dxdydz and dS is the 2D vector area as shown above.
We can then consider the issue at the boundary similar to that encountered in the 2D case. Our surface integral is really a "jagged" integral over all the outfacing cube faces, not a smooth surface integral where the vector dS takes arbitrary angles. But we show that in the limit, we do in fact get this smooth surface integral. Imitating the 2D presentation, we could draw a complicated 3D picture and then write
Σcavity outfacing walls A dS = NxAxdydz + NyAydzdx + NzAzdxdy
where the Ni are some integers which reflect the way the cubes fit against the boundary, which for small cubes is a plane. Imagine the little 3D cavity between the boundary wall and the filling cubes. Then Nx is the number of cubes which have faces to the left lining the cavity, and so on. Here is the picture in cross section only (in a z=constant plane) of what we are talking about:
We then rewrite our 3D result in this way
Σcavity outfacing walls A dS = Ax(Nxdydz) + Ay(Nydzdx) + Az(Nzdxdy)
= AxΔSx + AyΔSy + AzΔSz
where for example ΔSx is the combined x-direction surface area facing the boundary from Nx cubes which form a wall of the cavity in our little 3D picture.
We then write the above as AdS where dS = (ΔSx, ΔSy, ΔSz) is now a differential area vector that points normal to the direction of the plane (which could be any direction). So again, the point here is that we can replace the jagged cavity surface integral piece with a single integral piece AdS which is for the piece of the boundary plane facing our cavity. We can only do this to the extent that the cubes are very small so that the value of A is the same at all places we need to consider it on the surface of our cavity.
4. Divergence theorem in nD.
The reader can imagine how we could add a fourth dimension t to our 3D case just the way we added the third z dimension to our 2D case. The pictures cannot be drawn in 3D space of course, but the various equations can be written out nevertheless, if one invents a suitable notation. Most of the problem in writing down a proof is just in defining the notation, nothing new happens. The end result will be:
∫dV A = ∫dS A
where
A = Σi=1n ∂Ai/∂xi = Σi=1n ∂iAi
dV = piece of volume in n dimensions = Πi=1n dxi
dS = vector area = (dS1, dS2.....dSn) dSi = Πj≠i dxj
LHS = n-dimensional integral over some region R in Rn
RHS = n-1 dimensional integral over the closed boundary σ which encloses region R.
I could imagine a formal "induction" proof for the stickler, but see no reason to bother with such a formality.
Notice in all our cases that the bounding surface must fully enclose the region of interest. If there is some place where the boundary is missing a piece, then our theorem is wrong because the derivation will fail in the region of the missing boundary piece. We will have some "cubes" there with outfacing faces which will not be picked up by the surface integral over the incomplete surface.
5. Comments on the Divergence Theorem
Somewhere I think I have done all of the above for general curvilinear coordinates based on M&M stuff, but let's not worry about that here where we are in Cartesian coordinates.
The divergence theorem and the divergence itself have nothing really to do with "electromagnetism" or "heat" or " fluid flow". The divergence is just a property of an arbitrary vector field A. If a vector field has the property that A(x) = s(x), where s is some scalar field, then the divergence theorem says
∫dV s(x)= ∫dS A
We can "think" of A as some kind of "flux field" being somehow caused by s.
I think the best general way to think of this stuff is to let A be a "current" of tiny particles or of some continuous fluid. It helps me to call it J instead of A. If we can write J(x) = dρ(x)/dt , then we can regard ρ as the density of particles or fluid at point x. We then say
∫dV dρ(x)/dt = = d/dt [∫dV ρ(x)] = ∫dS J
the integral on the left in square brackets is the total fluid enclosed in our region at some time t. If this is changing in time, it must be because it is flowing in or out through the boundary, assuming it is not being created somehow within the region. This total flow out through the boundary is ∫dS J .
So for this particular vector field J, the divergence dρ/dt is a property of J at a point in space -- it is the rate at which the density is increasing. The current is "diverging" from this point in space because we are losing fluid density there.
This view of the divergence theorem necessarily involves "time" in its description, and we are dealing with a conserved current ∂μJμ = 0. We can sort of "see" the fluid and know how it works.
In electrostatics we have E = ρ and there is no time involved. The presence of electric charge density at some point in space "generates electric field" and we can draw little "flux lines" which is just an arrow (gradient) mapping of the E vector field. Everything is static in time, but we still sometimes talk about flux "flowing through a surface". Our divergence theorem then says Q = ∫dSE which we interpret as saying that the surface integral of the electric field is the "total flux" emerging from our volume, and this is equal to the electric charge Q the volume encloses. This is Gauss's Law.
But we are interested in evaluating this at the center of our square, so write
div A(x+dx/2,y+dy/2) = [Ax(x+3/2dx,y) - Ax(x+1/2,y)]/(dx) + [Ay(x,y+3/2dy) - Ay(x,y)]/(dy)
div A(x+dx/2,y+dy/2) = ∂Ax/∂x + ∂Ay/∂y = [Ax(x+dx,y) - Ax(x,y)]/dx + [Ay(x,y+dy) - Ay(x,y)]/dy
div A(x,y) = ∂Ax/∂x + ∂Ay/∂y = [Ax(x+dx/2,y) - Ax(x,y)]/(dx/2) + [Ay(x,y+dy/2) - Ay(x,y)]/(dy/2)