Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Views: 59
Image: ubuntu2204
Kernel: SageMath 10.3

The Divergence Theorem

Divergence in three dimensions

Divergence form of Green's theorem CFnds=R(Mx+Ny)dxdy\oint_C\vec F\cdot \vec n ds=\iint_R\left({\partial M\over \partial x}+{\partial N\over\partial y}\right)dxdyWe compute the net outward flux of a vector field across a simple closed curve by integrating the divergence of the field over the region enclosed by the curve.

The divergence theorem (in the 3D space) extends Green's theorem (flux density) to three dimensions.

The divergence of a vector field F=Mi+Nj+Pk\vec F=M\vec i+N\vec j+P\vec k is the scalar function divF=F=Mx+Ny+Pz.\mbox{div}\vec F = \nabla \cdot \vec F = {\partial M\over \partial x}+{\partial N\over \partial y}+{\partial P\over\partial z}.

Physical interpretation:

  • If F\vec F is the velocity field of a flowing gas, the value of divF\vec F at (x,y,z)(x,y,z) is the rate at which the gas is compressing or expanding at the point.

  • The divergence is the flux per unit volume or flux density at the point. (analogous to circulation density)

Example: Find their divergence and interpret their physical meaning

  • Expansion: F(x,y,z)=xi+yj+zk\vec F(x, y, z) = x\vec i + y\vec j + z\vec k F=3\nabla\cdot\vec F=3 The gas is undergoing constant uniform expansion at all points.

  • Compression: F(x,y,z)=xiyjzk\vec F(x, y, z) = -x\vec i - y\vec j - z\vec k F=3\nabla\cdot\vec F=-3 The gas is undergoing constant uniform compression at all points.

  • Rotation about the zz-axis: F(x,y,z)=yi+xj\vec F(x, y, z) = -y\vec i + x\vec j F=0\nabla\cdot\vec F=0 The gas is neither expanding nor compressing at any point.

  • Shearing along parallel horizontal planes: F(x,y,z)=zj\vec F(x, y, z) = z\vec j F=0\nabla\cdot\vec F=0 The divergence is zero at all points in the domain of the velocity field, so the gas is neither expanding nor compressing at any point.

Divergence theorem

Theorem (Theorem 8--Divergence theorem) If F\vec F is a vector field whose components have continuous first partial derivatives. Let SS be a piecewise smooth oriented closed surface. The flux of F\vec F across SS in the direction of the surface's outward unit normal field n\vec n equals the triple integral of the divergence F\nabla\cdot\vec F over the region DD enclosed by the surface: SFndσoutward flux=DFdV.divergence integral\underbrace{\iint_S\vec F\cdot\vec n d\sigma}_{\mbox{outward flux}}=\underbrace{\iiint_D\nabla\cdot \vec F dV.}_{\mbox{divergence integral}}

Corollary The outward flux across a piecewise smooth oriented closed surface SS is zero for any vector field F\vec F having zero divergence at every point of the region enclosed by the surface.

Examples of zero divergence: the velocity field of a circulating incompressible liquid, constant vector fields, shearing

Example: Verify the divergence theorem for the expanding vector field F=xi+yj+zk\vec F=x\vec i+y\vec j+z\vec k over the sphere x2+y2+z2=a2x^2+y^2+z^2=a^2.

Solution: DFdV=3DdV=4πa3SFndσ=Sa2adσ=Sadσ=4πa3\begin{align*} \iiint_D \nabla \cdot \vec F dV=&3\iiint_D dV=4\pi a^3\\ \iint_S\vec F\cdot \vec n d\sigma=& \iint_S{a^2\over a} d\sigma =\iint_Sa d\sigma = 4\pi a^3 \end{align*}

Example: Find the flux of F=xyi+yzj+xzk\vec F = xy \vec i + yz \vec j + xz \vec k outward through the surface of the cube cut from the first octant by the planes x=1x = 1, y=1y = 1, and z=1z = 1.

Solution: Directly computing the flux requires computing over six sides, so we compute the triple-integral using the divergence theorem instead. Fndσ=010101Fdxdydz=010101(x+y+z)dxdydz=32.\begin{align*} \iint \vec F\cdot\vec n d\sigma = \int_0^1\int_0^1\int_0^1 \nabla \cdot \vec F dxdydz=\int_0^1\int_0^1\int_0^1 (x+y+z) dxdydz={3\over 2}. \end{align*}

Example: Find the flux of F=x2i+4xyzj+zexk\vec F = x^2 \vec i + 4xyz \vec j + ze^x \vec k out of the box-shaped region D:0x3, 0y2, 0z1D:0\leq x\leq 3,~0\leq y\leq 2,~0\leq z\leq 1. Verify the divergence theorem.

Solution: DFdV=010203(2x+4xz+ex)dxdydz=18+18+2(e31)SFndσ=010232dydz+0203exdxdy+01038xzdxdz=18+2(e31)+18\begin{align*} \iiint_D \nabla \cdot \vec F dV=&\int_0^1 \int_0^2 \int_0^3 (2x+4xz+e^x)dxdydz=18+18+2(e^3-1)\\ \iint_S\vec F\cdot \vec n d\sigma=&\int_0^1\int_0^23^2dydz+\int_0^2\int_0^3 e^xdxdy+\int_0^1\int_0^3 8xzdxdz\\ =& 18+2(e^3-1)+18 \end{align*}

reset() var('x, y, z, phi, theta, a') F(x,y,z) = vector((x^2, 4*x*y*z, z*e^x)) show(html('The divergence is '), latex(F.div().full_simplify()))

The divergence is4xz+2x+ex\displaystyle \verb|The|\verb| |\verb|divergence|\verb| |\verb|is| 4 \, x z + 2 \, x + e^{x}

Divergence and the curl

Theorem If F=Mi+Nj+Pk\vec F = M \vec i + N \vec j + P \vec k is a vector field with continuous second partial derivatives, then div(curlF)=(×F)=0.\mbox{div}(\mbox{curl} \vec F)=\nabla\cdot(\nabla \times \vec F)=0.

×F=(PyNz)i+(MzPx)j+(NxMy)k\nabla \times \vec F=\left({\partial P\over\partial y}-{\partial N\over\partial z}\right)\vec i+\left({\partial M\over\partial z}-{\partial P\over\partial x}\right)\vec j+\left({\partial N\over\partial x}-{\partial M\over\partial y}\right)\vec k

If G=×F\vec{G}=\nabla \times\vec F, then SGndσ=0\iint_S\vec{G}\cdot \vec n d\sigma =0 for any closed surface SS.

Proof of divergence theorem for special regions (no holes/bubbles)

S2:z=f2(x,y),(x,y) in RxyS_2:z=f_2(x,y),\quad (x,y)\mbox{ in }R_{xy}S1:z=f1(x,y),(x,y) in RxyS_1:z=f_1(x,y),\quad (x,y)\mbox{ in }R_{xy}

Let n=(cosα)i+(cosβ)j+(cosγ)k\vec n=(\cos\alpha)\vec i+(\cos\beta)\vec j+(\cos\gamma)\vec k, then Fn=Mcosα+Ncosβ+Pcosγ\vec F\cdot\vec n=M\cos\alpha+N\cos\beta+P\cos\gamma S(Mcosα+Ncosβ+Pcosγ)dσ=D(Mx+Ny+Pz)dxdydz\iint_S{({\color{red}M\cos\alpha}+N\cos\beta+{\color{blue}P\cos\gamma})}d\sigma=\iiint_D\left({{\color{red}{\partial M\over\partial x}}+{\partial N\over\partial y}+{\color{blue}{\partial P\over\partial z}}}\right)dxdydz

We prove that SPcosγdσ=RxyP(x,y,f2(x,y))P(x,y,f1(x,y))dxdy\iint_SP\cos\gamma d\sigma=\iint_{R_{xy}}P(x,y,f_2(x,y))-P(x,y,f_1(x,y))dxdy

Divergence theorem for other regions

DD is the region between two concentric spheres. The surface of the lower half D1D_1 consists of an outer hemisphere, an inner hemisphere, and a plane washer-shaped base.

Example: Find the net outward flux of the field

F=xi+yj+zkρ3,ρ=x2+y2+z2\vec F={x\vec i+y\vec j+z\vec k\over \rho^3},\qquad \rho=\sqrt{x^2+y^2+z^2}

across the boundary of the region D:0<b2x2+y2+z2a2D: 0< b^2 \leq x^2 + y^2 + z^2 \leq a^2.

Solution: divF=F=0\begin{align*} \mbox{div}\vec F=\nabla\cdot\vec F={0} \end{align*} Fn=1ρ2\begin{align*} \vec F\cdot\vec n={1\over \rho^2} \end{align*}

What can we learn from this example?

  • F=0\nabla \cdot \vec F=0.

  • SaFndσ=4π\iint_{S_a}\vec F\cdot\vec n d\sigma=4\pi.

reset() var('x, y, z, phi, theta, a') r(phi, theta) = vector((a*sin(phi)*cos(theta), a*sin(phi)*sin(theta), a*cos(phi))) show('r(t) =', r(phi,theta), 'for 0 <= phi <= pi, 0<=theta<=2pi') F(x,y,z) = vector((x, y, z))/sqrt(x^2+y^2+z^2)^3 Ft = F(r[0], r[1], r[2]) # Note that the index starts at 0. show('F(t) =', Ft) h(x,y,z) = x^2+y^2+z^2-a^2 # Express z as a function of x and y Fcurl = F.curl((x,y,z)) vn = h.diff() vn = vn/vn.norm() # normalize it to a unit vector rphi = diff(r, phi) rtheta = diff(r, theta) show('The divergence is', F.div().full_simplify()) show('The surface integral over the ball with radius a is ', (Ft.dot_product(vn)(r[0],r[1],r[2])*rphi.cross_product(rtheta).norm()).integral(phi, 0, pi,algorithm='giac').integral(theta, 0, 2*pi,algorithm='giac'))

r(t) =(acos(θ)sin(ϕ),asin(ϕ)sin(θ),acos(ϕ))for 0 <= phi <= pi, 0<=theta<=2pi\displaystyle \verb|r(t)|\verb| |\verb|=| \left(a \cos\left(\theta\right) \sin\left(\phi\right),\,a \sin\left(\phi\right) \sin\left(\theta\right),\,a \cos\left(\phi\right)\right) \verb|for|\verb| |\verb|0|\verb| |\verb|<=|\verb| |\verb|phi|\verb| |\verb|<=|\verb| |\verb|pi,|\verb| |\verb|0<=theta<=2pi|

F(t) =(acos(θ)sin(ϕ)(a2cos(θ)2sin(ϕ)2+a2sin(ϕ)2sin(θ)2+a2cos(ϕ)2)32,asin(ϕ)sin(θ)(a2cos(θ)2sin(ϕ)2+a2sin(ϕ)2sin(θ)2+a2cos(ϕ)2)32,acos(ϕ)(a2cos(θ)2sin(ϕ)2+a2sin(ϕ)2sin(θ)2+a2cos(ϕ)2)32)\displaystyle \verb|F(t)|\verb| |\verb|=| \left(\frac{a \cos\left(\theta\right) \sin\left(\phi\right)}{{\left(a^{2} \cos\left(\theta\right)^{2} \sin\left(\phi\right)^{2} + a^{2} \sin\left(\phi\right)^{2} \sin\left(\theta\right)^{2} + a^{2} \cos\left(\phi\right)^{2}\right)}^{\frac{3}{2}}},\,\frac{a \sin\left(\phi\right) \sin\left(\theta\right)}{{\left(a^{2} \cos\left(\theta\right)^{2} \sin\left(\phi\right)^{2} + a^{2} \sin\left(\phi\right)^{2} \sin\left(\theta\right)^{2} + a^{2} \cos\left(\phi\right)^{2}\right)}^{\frac{3}{2}}},\,\frac{a \cos\left(\phi\right)}{{\left(a^{2} \cos\left(\theta\right)^{2} \sin\left(\phi\right)^{2} + a^{2} \sin\left(\phi\right)^{2} \sin\left(\theta\right)^{2} + a^{2} \cos\left(\phi\right)^{2}\right)}^{\frac{3}{2}}}\right)

The divergence is0\displaystyle \verb|The|\verb| |\verb|divergence|\verb| |\verb|is| 0

The surface integral over the ball with radius a is4π\displaystyle \verb|The|\verb| |\verb|surface|\verb| |\verb|integral|\verb| |\verb|over|\verb| |\verb|the|\verb| |\verb|ball|\verb| |\verb|with|\verb| |\verb|radius|\verb| |\verb|a|\verb| |\verb|is| 4 \, \pi

Gauss's law: one of the four great laws of electromagnetic theory

Let E(x,y,z)=q4πϵ0rr3\vec E(x,y,z)={q\over 4\pi\epsilon_0}{\vec r\over|\vec r |^3} Then, for any closed surface that encloses the origin, we have SEndσ=qϵ0.{\color{red}\iint_S\vec E\cdot\vec n d\sigma={q\over\epsilon_0}.}

Continuity equation of hydrodynamics

Let DD be a region bounded by a closed-oriented surface SS. If v(x,y,z)\vec v(x, y, z) is the velocity field of a fluid flowing smoothly through DD, δ=δ(t,x,y,z)\delta = \delta(t, x, y, z) is the fluid's density at (x,y,z)(x, y, z) at time tt, and F=δv\vec F = \delta\vec v, then the continuity equation of hydrodynamics states that

F+δt=0.\nabla\cdot\vec F+{\partial \delta\over \partial t}=0.

Let BB be a solid sphere centered at QQ: BFdVBdV=SFndσBdV=dmdtBdV{\iiint_B\nabla\cdot \vec F dV\over \iiint_B dV}={\iint_S\vec F \cdot \vec n d\sigma\over \iiint_B dV}={{dm\over dt}\over \iiint_B dV}

Conservation of mass BFdV=SFndσ\iiint_B\nabla\cdot \vec F dV=\iint_S\vec F\cdot\vec n d\sigma

Unifying

Tangential form of Green’s Theorem:CFTds=R×FkdAStokes’ Theorem:FTds=S×FndσNormal form of Green’s Theorem:CFnds=RFdADivergence Theorem:SFndσ=DFdVFundamental Theorem:f(b)f(a)=abdfdxdx\begin{align*} &\text{Tangential form of Green’s Theorem:} &&\oint_C\vec{F}\cdot\vec{T}ds=\iint_R\nabla \times \vec{F}\cdot\vec{k}dA\\ &\text{Stokes' Theorem:} &&\oint \vec{F}\cdot\vec{T}ds=\iint_S\nabla \times \vec{F}\cdot\vec{n}d\sigma\\ &\text{Normal form of Green’s Theorem:} &&\oint_C\vec{F}\cdot\vec{n}ds=\iint_R\nabla \cdot \vec{F}dA\\ &\text{Divergence Theorem:} &&\iint_S\vec{F}\cdot\vec{n}d\sigma =\iiint_D\nabla \cdot \vec{F}dV\\ &\text{Fundamental Theorem:} && f(b)-f(a)=\int_a^b{df\over dx}dx \end{align*}F(b)n+F(a)n=[a,b]Fdx{\color{red}\vec F(b)\cdot\vec n+\vec F(a)\cdot\vec n=\int_{[a,b]}\nabla\cdot\vec F dx}
  • Fundamental theorem of calculus, normal form of Green's theorem, divergence theorem

  • Stokes' theorem, tangential form of Green's theorem