Lecture Notes: Divergence Theorem and Stokes' Theorem
Lecture Notes: Divergence Theorem and Stokes' Theorem
Yufei Tao
Department of Computer Science and Engineering
Chinese University of Hong Kong
[email protected]
1 Divergence Theorem
Theorem 1 (Divergence Theorem). Let T be a closed region in R3 that is bounded by a surface S,
which is the union of a finite number of smooth surfaces S1 , S2 , .., Sk . Let f1 , f2 , and f3 be functions
of x, y, z that have continuous partial derivatives on each Si (1 i k). If we orient S by taking
its outer side, then it holds that
f1 f2 f3
ZZZ ZZ
+ + dxdydz = f1 dydz + f2 dxdz + f3 dxdy.
T x y z S
We omit a proof for the theorem (which follows the same idea as our proof of the Greens
theorem, and is a good exercise for you). The theorem is also called Gauss Theorem.
Solution. Let T be the target ball, and S be its boundary x2 + y 2 + z 2 = 1, oriented by having its
outer side taken. Introduce f1 = 0, f2 = 0, and f3 = z. Then, by Theorem 1, we know that
ZZZ ZZ
1 dxdydz = z dxdy. (1)
T S
Denote by S1 the upper half of S satisfying z 0, and S2 the lower half of S satisfying z 0.
We thus have:
ZZ ZZ ZZ
z dxdy = z dxdy + z dxdy. (2)
S S1 S2
RR
Let us first calculate S1 z dxdy. Note that S1 is oriented with its upper side taken. Hence:
ZZ ZZ
z dxdy = z dxdy. (3)
S1 D
Let us represent S1 in a parametric form: r(u, v) = [x(u, v), y(u, v), z(u, v)] where
1
where u [0, 2] and v [0, /2]. Let R be the collection of all such (u, v). Now we change the
integral variables in (3) to u and v by the Jacobian rule:
ZZ ZZ
z dxdy = cos v sin v cos v dudv = 2/3.
D R
RR RRR
Similarly, we also have S2 z dxdy = 2/3. Thus, we know from (1) and (2) that T 1 dxdydz =
4/3.
Example 2. Let T be the cube as shown below, and S be its boundary surface with its outer side
taken.
y
z
(1, 1, 1)
Calculate
ZZ
y(x z) dydz + x2 dzdx + (y 2 + xz) dxdy.
S
We know
ZZZ Z 1 Z 1 Z 1
x dxdydz = x dx dy dz = 1/2.
T 0 0 0
RRR
Similarly, T y dxdydz = 1/2. Hence, (4) equals 1.
Remark 1. You may be wondering why Theorem 1 is called the Divergence Theorem. In fact,
if we define a vector function f (x, y, z) = [f1 , f2 , f3 ], then divf = f 1
+ f f3
y + z . Hence, the left
2
RRR x
hand side of the equation in Theorem 1 can also be written as T divf dxdydz.
Remark 2. Recall that surface integrals are inherently 2d. Hence, the divergence theorem essen-
tially reveals a relationship between a 2d integral and a 3d integral. Also recall that, in contrast,
the Greens theorem reveals a relationship between a 1d integral and a 2d integral.
2 Stokes Theorem
Consider S to be a piecewise-smooth surface with a closed boundary curve C. Note that, not all
surfaces have a boundary curve, e.g., a sphere x2 + y 2 + z 2 = 1 does not have a boundary curve.
Intuitively, S has a boundary curve C if it is not closed, namely, it does not separate R3 into an
interior part and an exterior part. The following is an example of such an S:
2
S
Fix a direction of C. Let us then orient S by choosing a side of it as shown in the above figure.
Formally, imagine that a point moves around C along the direction we have decided. Now, watch
the points movement from the side of S we have chosen (i.e., allowing normal vectors of that side
to shoot into our eyes). We should see that the point is moving in the counterclockwise direction.
Theorem 2. Let S and C be as described earlier (with the direction of C fixed, and S oriented).
Suppose that S is the union of a finite number of smooth surfaces S1 , S2 , .., Sk . Let f1 , f2 , and f3
be functions of x, y, z that have continuous partial derivatives on each Si (1 i k). Then:
f3 f2 f1 f3 f2 f1
Z ZZ
f1 dx + f2 dy + f3 dz = dydz + dzdx + dxdy.
C S y z z x x y
Proof. We first prove the theorem for the special case where S is all monotone, namely, it is
simultaneously xy-monotone, xz-monotone, and yz-monotone. In particular, we will show that
f1 f1
Z ZZ
f1 dx = dzdx dxdy (5)
z y
ZC Z ZS
f2 f2
f2 dy = dxdy dydz
x z
ZC Z ZS
f3 f3
f3 dz = dydz dzdx.
C S y x
Then, the theorem will follow from summing up both sides of the above three equations.
Due to symmetry, it suffices to prove (5). For this purpose, suppose that S is described by
z = g(x, y), and that we oriented S by taking its upper side. Introduce h(x, y, z) = z g(x, y).
Hence, S is also described by h(x, y, z) = 0. Let Cxy be the projection of C onto the xy-plane, and
Dxy be the region in the xy-plane enclosed by Cxy .
Z Z
f1 dx = f1 (x, y, z) dx
C Cxy
f1 (x, y, z)
ZZ
(by Greens Theorem) = dxdy
Dxy y
f1 f1 z
ZZ
= + dxdy. (6)
Dxy y z y
h h h
Note that h = [ x , y , z ] is a normal vector of S. Let be the angle between the directions
of h and k = [0, 0, 1], and be the angle between the directions of h and j = [0, 1, 0]. We have:
h g z
y y y
cos = = =
|g| |g| |g|
h z
z z 1
cos = = = .
|g| |g| |g|
3
Therefore:
cos z
= .
cos y
We thus have:
f1 f1 cos
ZZ ZZ
(6) = dxdy + dxdy.
Dxy y Dxy z cos
f1 f1
ZZ ZZ
= dxdy + cos dA
y z
Z ZS Z ZS
f1 f1
= dxdy + dzdx.
S y S z
= right hand side of (5).
If S is not all monotone, we can always cut S into a set of disjoint surfaces each of which is
all monotone. Then, we can obtain Theorem 2 by applying what we have proved to each of those
surfaces. The details are omitted and serve as a good exercise for you.
where C is the sequence of line segments: ACBA with points A = (1, 0, 0), B = (0, 1, 0), and
C = (0, 0, 1).
z
C = (0, 0, 1)
S
y
O B = (0, 1, 0)
A = (1, 0, 0)
Solution. Let S be the triangle ABC, oriented with its lower side taken. Introduce f1 (x, y, z) = y,
f2 (x, y, z) = z, and f3 (x, y, z) = x. We have:
f3 f2
= 0 1 = 1
y z
f1 f3
= 0 1 = 1
z x
f2 f1
= 0 1 = 1.
x y
(7)
4
Therefore, Stokes Theorem gives:
Z Z
y dx + z dy + x dz = (1) dydz + (1) dzdx + (1) dxdy. (8)
C S
Solution. We could solve this question by using the methods we learned in the lecture surface
integral by area. However, due to the special nature of the integrand function, we can apply
Stokes Theorem to convert the surface integral into a line integral, which simplifies calculation
5
significantly. The boundary curve C of S is the circle x2 + y 2 = 1 in the xy-plane, directed
counterclockwise. Hence, by (9), we have:
ZZ Z
curlf n dA = y dx + x dy + z 2 dz.
S C
ZZ
(as C is in the xy-plane) = y dx + x dy
C
ZZ
(by Greens Theorem) = 2 dxdy = 2
D
Remark 3. Note that the Stokes theorem reveals a relationship between a 1d integral and a 2d
integral. Namely, it has the same nature as the Greens theorem (which in fact is a special case of
the Stokes theorem).