# Session 13

#### Divergence Theorem

The Divergence Theorem expresses a basic conservation law of fundamental importance in mathematical modeling of physics:

• $\int_D \nabla\cdot q\,dxdydz =\int_B n\cdot q\, ds$   (1)

where D is a domain in 3d with boundary B with outward unit normal,

• $q = (qx,qy,qz)$ is a given flux vector depending on (x,y,z),
• $n = (nx,ny,nz)$ is the outward unit normal to B,
• $n\cdot q= nx*qx + ny*qy + nz*qz$ is the flux in the normal direction,
• $\nabla\cdot q = \frac{\partial qx}{\partial x}+ \frac{\partial qy}{\partial y}+\frac{\partial qz}{\partial z}$ is the divergence of q also denoted div(q) representing a flux source,
• ds is the element of surface area on B,

and (1) expresses that the totality of what is produced in D from the source (left) is equal to what flows through the boundary B (right), that is,  nothing is lost = conservation.

In 1d (1) is simply one way of formulating the Fundamental Theorem of Calculus as

• $\int_a^b \frac{dq}{dx}dx = q(b) - q(a) = nx(b)*q(b) +nx(a)*q(a)$  (2)

with here D the interval [a, b] and nx(b) = 1 and nx(a) = -1.

Let us prove (1) in the special case of 2d and q =(qx,0,0) in which case (1) reads

• $\int_D \frac{\partial qx}{\partial x}dxdy =\int_B qx*nx*ds$.  (3)

To prove (3) assume D is is given as the set of point (x,y) with f1(y) ≤ x ≤ f2(y) with a≤y≤b with two bounding curves x=f2(y) and x=f1(y). In this case by (2)

• $\int_D \frac{\partial qx}{\partial x}dxdy=\int_a^b qx(f2(y),y)*dy-\int_a^b qx(f1(y),y)*dy=\int_B qx*nx*ds$,

because dy = nx*ds  for x=f2(y) and dy = -nx*ds for x=f1(y) (motivate!). We see that in (3) an integral of dqx/dx with respect to dx  is expressed in terms of end-point values of qx on B as in (2). See Divergence Theorem Square.

Recall that Poisson’s equation $-\Delta u =f$ results from $\nabla q = f$ with $q=-\nabla u$ or $\Delta u = div(grad (u))$ as in Heat Equation 1d.

Notice this variant of the Divergence Theorem of particular significance for  electromagnetics based on Maxwell’s equations:

• $\int_D \nabla\times q\,dxdydz =\int_B n\times q\, ds$   (4)

with

• $\nabla\times q =(\frac{\partial qz}{\partial y}-\frac{\partial qy}{\partial z},-\frac{\partial qz}{\partial x}+\frac{\partial qx}{\partial z},\frac{\partial qy}{\partial x}-\frac{\partial qx}{\partial y})$
• $n\times q = (ny*qz - nz*qy, -nx*qz+nz*qx, nx*qy-ny*qx)$.

$\nabla\times q$ is called the rotation of q denoted by rot(q) and measures “how much q rotates”. Compare Stokes Theorem Disc.