1. Home
  2. Explore
  3. Engineering
  4. Divergence of Vector Field

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Divergence of Vector Field

Divergence and the Divergence Theorem

Concept of Divergence

Divergence is a vector differential operation that measures the net outward flux of a vector field from an infinitesimally small volume around a given point. It is obtained by taking the dot product of the Del operator (∇\nabla∇) with a vector field A\mathbf{A}A:

∇⋅A\nabla \cdot \mathbf{A}∇⋅A

Definition: At any point PPP, the divergence of a vector field A\mathbf{A}A is the net outward flux per unit volume as the volume shrinks to zero around PPP.

  • Positive divergence (∇⋅A>0\nabla \cdot \mathbf{A} > 0∇⋅A>0): Net flux is away from the point — the field is diverging or "spreading out".

  • Negative divergence (∇⋅A<0\nabla \cdot \mathbf{A} < 0∇⋅A<0): Net flux is toward the point — the field is converging or "sinking in".

  • Zero divergence (∇⋅A=0\nabla \cdot \mathbf{A} = 0∇⋅A=0): The incoming and outgoing fluxes are equal — the field is solenoidal.

In electromagnetic theory, divergence is essential for understanding Gauss's law for electricity and magnetism, and it plays a central role in formulating the relationship between fields and their sources.

Mathematical Representation in Cartesian Coordinates

In the Cartesian coordinate system, the Del operator is:

∇=x^∂∂x+y^∂∂y+z^∂∂z\nabla = \hat{\mathbf{x}} \frac{\partial}{\partial x} + \hat{\mathbf{y}} \frac{\partial}{\partial y} + \hat{\mathbf{z}} \frac{\partial}{\partial z}∇=x^∂x∂​+y^​∂y∂​+z^∂z∂​

For a vector field A=Axx^+Ayy^+Azz^\mathbf{A} = A_x \hat{\mathbf{x}} + A_y \hat{\mathbf{y}} + A_z \hat{\mathbf{z}}A=Ax​x^+Ay​y^​+Az​z^ (where each component is a function of x,y,zx, y, zx,y,z), the divergence is:

∇⋅A=∂Ax∂x+∂Ay∂y+∂Az∂z\nabla \cdot \mathbf{A} = \frac{\partial A_x}{\partial x} + \frac{\partial A_y}{\partial y} + \frac{\partial A_z}{\partial z}∇⋅A=∂x∂Ax​​+∂y∂Ay​​+∂z∂Az​​

Derivation from First Principles

To confirm that ∇⋅A\nabla \cdot \mathbf{A}∇⋅A indeed gives the net outward flux per unit volume, consider a small differential volume (a cube) with dimensions dxdxdx, dydydy, dzdzdz. The center of the cube is at (x,y,z)(x, y, z)(x,y,z).

  • Front surface (at x+dx/2x + dx/2x+dx/2): outward normal in +x^+\hat{\mathbf{x}}+x^ direction, area dy dzdy\,dzdydz. Flux = Ax(x+dx/2,y,z)⋅dy dzA_x(x + dx/2, y, z) \cdot dy\,dzAx​(x+dx/2,y,z)⋅dydz.

  • Back surface (at x−dx/2x - dx/2x−dx/2): outward normal in −x^-\hat{\mathbf{x}}−x^ direction, area dy dzdy\,dzdydz. Flux = −Ax(x−dx/2,y,z)⋅dy dz-A_x(x - dx/2, y, z) \cdot dy\,dz−Ax​(x−dx/2,y,z)⋅dydz.

The net flux in the xxx-direction is:

Φx=[Ax(x+dx2)−Ax(x−dx2)]dy dz\Phi_x = \left[ A_x\left(x + \frac{dx}{2}\right) - A_x\left(x - \frac{dx}{2}\right) \right] dy\,dzΦx​=[Ax​(x+2dx​)−Ax​(x−2dx​)]dydz

Using the Taylor series expansion and keeping only first-order terms (since dxdxdx is infinitesimal):

Ax(x+dx2)≈Ax+∂Ax∂xdx2,Ax(x−dx2)≈Ax−∂Ax∂xdx2A_x\left(x + \frac{dx}{2}\right) \approx A_x + \frac{\partial A_x}{\partial x} \frac{dx}{2}, \quad A_x\left(x - \frac{dx}{2}\right) \approx A_x - \frac{\partial A_x}{\partial x} \frac{dx}{2}Ax​(x+2dx​)≈Ax​+∂x∂Ax​​2dx​,Ax​(x−2dx​)≈Ax​−∂x∂Ax​​2dx​

Subtracting gives ∂Ax∂xdx\frac{\partial A_x}{\partial x} dx∂x∂Ax​​dx, so:

Φx=∂Ax∂x dx dy dz\Phi_x = \frac{\partial A_x}{\partial x} \, dx\,dy\,dzΦx​=∂x∂Ax​​dxdydz

Similarly, for the yyy-direction:

Φy=∂Ay∂y dx dy dz\Phi_y = \frac{\partial A_y}{\partial y} \, dx\,dy\,dzΦy​=∂y∂Ay​​dxdydz

For the zzz-direction:

Φz=∂Az∂z dx dy dz\Phi_z = \frac{\partial A_z}{\partial z} \, dx\,dy\,dzΦz​=∂z∂Az​​dxdydz

The total net outward flux through the closed surface is:

Φtotal=Φx+Φy+Φz=(∂Ax∂x+∂Ay∂y+∂Az∂z)dx dy dz\Phi_{\text{total}} = \Phi_x + \Phi_y + \Phi_z = \left( \frac{\partial A_x}{\partial x} + \frac{\partial A_y}{\partial y} + \frac{\partial A_z}{\partial z} \right) dx\,dy\,dzΦtotal​=Φx​+Φy​+Φz​=(∂x∂Ax​​+∂y∂Ay​​+∂z∂Az​​)dxdydz

Dividing by the volume dv=dx dy dzdv = dx\,dy\,dzdv=dxdydz gives the net outward flux per unit volume:

Φtotaldv=∂Ax∂x+∂Ay∂y+∂Az∂z=∇⋅A\frac{\Phi_{\text{total}}}{dv} = \frac{\partial A_x}{\partial x} + \frac{\partial A_y}{\partial y} + \frac{\partial A_z}{\partial z} = \nabla \cdot \mathbf{A}dvΦtotal​​=∂x∂Ax​​+∂y∂Ay​​+∂z∂Az​​=∇⋅A

Hence, ∇⋅A\nabla \cdot \mathbf{A}∇⋅A exactly represents the divergence.

The Divergence Theorem

The divergence theorem (also called Gauss's theorem) relates the volume integral of the divergence of a vector field to the closed surface integral of the field over the boundary of that volume:

∮SA⋅dS=∫V(∇⋅A) dv\oint_S \mathbf{A} \cdot d\mathbf{S} = \int_V (\nabla \cdot \mathbf{A}) \, dv∮S​A⋅dS=∫V​(∇⋅A)dv
  • Left side: total outward flux through the closed surface SSS.

  • Right side: volume integral of the divergence over the volume VVV enclosed by SSS.

This theorem provides a powerful alternative to directly evaluating surface integrals, often simplifying flux calculations.

Divergence in Cylindrical Coordinates

In the cylindrical coordinate system (ρ,ϕ,z)(\rho, \phi, z)(ρ,ϕ,z), the divergence expression is:

∇⋅A=1ρ∂∂ρ(ρAρ)+1ρ∂Aϕ∂ϕ+∂Az∂z\nabla \cdot \mathbf{A} = \frac{1}{\rho} \frac{\partial}{\partial \rho} (\rho A_\rho) + \frac{1}{\rho} \frac{\partial A_\phi}{\partial \phi} + \frac{\partial A_z}{\partial z}∇⋅A=ρ1​∂ρ∂​(ρAρ​)+ρ1​∂ϕ∂Aϕ​​+∂z∂Az​​

Intuitive Understanding

  • ρ\rhoρ-direction: The surface area perpendicular to ρ\rhoρ is ρ dϕ dz\rho\,d\phi\,dzρdϕdz, which increases with ρ\rhoρ. Therefore, the flux calculation must account for this changing area, leading to the term 1ρ∂∂ρ(ρAρ)\frac{1}{\rho} \frac{\partial}{\partial \rho}(\rho A_\rho)ρ1​∂ρ∂​(ρAρ​).

  • ϕ\phiϕ-direction: The surface area is dρ dzd\rho\,dzdρdz, independent of ϕ\phiϕ. The flux variation comes only from AϕA_\phiAϕ​, giving 1ρ∂Aϕ∂ϕ\frac{1}{\rho} \frac{\partial A_\phi}{\partial \phi}ρ1​∂ϕ∂Aϕ​​.

  • zzz-direction: The surface area is ρ dϕ dρ\rho\,d\phi\,d\rhoρdϕdρ, independent of zzz, so the term is simply ∂Az∂z\frac{\partial A_z}{\partial z}∂z∂Az​​.

The factor 1/ρ1/\rho1/ρ appears because the differential volume in cylindrical coordinates is dv=ρ dρ dϕ dzdv = \rho\,d\rho\,d\phi\,dzdv=ρdρdϕdz, and the net flux in each direction must be divided by this volume to obtain the divergence.

Divergence in Spherical Coordinates

In the spherical coordinate system (r,θ,ϕ)(r, \theta, \phi)(r,θ,ϕ), the divergence expression is:

∇⋅A=1r2∂∂r(r2Ar)+1rsin⁡θ∂∂θ(Aθsin⁡θ)+1rsin⁡θ∂Aϕ∂ϕ\nabla \cdot \mathbf{A} = \frac{1}{r^2} \frac{\partial}{\partial r} (r^2 A_r) + \frac{1}{r \sin \theta} \frac{\partial}{\partial \theta} (A_\theta \sin \theta) + \frac{1}{r \sin \theta} \frac{\partial A_\phi}{\partial \phi}∇⋅A=r21​∂r∂​(r2Ar​)+rsinθ1​∂θ∂​(Aθ​sinθ)+rsinθ1​∂ϕ∂Aϕ​​

Intuitive Understanding

  • rrr-direction: The surface area perpendicular to rrr is r2sin⁡θ dθ dϕr^2 \sin\theta \, d\theta \, d\phir2sinθdθdϕ, which grows as r2r^2r2. This necessitates the term 1r2∂∂r(r2Ar)\frac{1}{r^2} \frac{\partial}{\partial r}(r^2 A_r)r21​∂r∂​(r2Ar​).

  • θ\thetaθ-direction: The surface area is rsin⁡θ dϕ drr \sin\theta \, d\phi \, drrsinθdϕdr, and it varies with sin⁡θ\sin\thetasinθ. Hence the term 1rsin⁡θ∂∂θ(Aθsin⁡θ)\frac{1}{r \sin\theta} \frac{\partial}{\partial \theta}(A_\theta \sin\theta)rsinθ1​∂θ∂​(Aθ​sinθ).

  • ϕ\phiϕ-direction: The surface area is r dr dθr\, dr\, d\thetardrdθ, independent of ϕ\phiϕ. Only AϕA_\phiAϕ​ changes, giving 1rsin⁡θ∂Aϕ∂ϕ\frac{1}{r \sin\theta} \frac{\partial A_\phi}{\partial \phi}rsinθ1​∂ϕ∂Aϕ​​.

The differential volume in spherical coordinates is dv=r2sin⁡θ dr dθ dϕdv = r^2 \sin\theta \, dr\, d\theta\, d\phidv=r2sinθdrdθdϕ, and the factors 1/(r2)1/(r^2)1/(r2) and 1/(rsin⁡θ)1/(r\sin\theta)1/(rsinθ) arise from normalizing the net fluxes by this volume.

Example: Applying the Divergence Theorem

Given: A vector field in spherical coordinates:

A=r r^−3 θ^+5ϕ ϕ^\mathbf{A} = r\,\hat{\mathbf{r}} - 3\,\hat{\boldsymbol{\theta}} + 5\phi\,\hat{\boldsymbol{\phi}}A=rr^−3θ^+5ϕϕ^​

Closed surface defined by limits:

  • rrr: 000 to 444

  • θ\thetaθ: 000 to π/2\pi/2π/2 (top hemisphere)

  • ϕ\phiϕ: 000 to 3π/23\pi/23π/2 (three quarters of a full revolution)

This describes a three-quarter hemisphere (a spherical cap covering 3/4 of the upper half of a sphere of radius 4).

Goal: Find the total outward flux Φ\PhiΦ through this closed surface using the divergence theorem.

Step 1: Compute ∇⋅A\nabla \cdot \mathbf{A}∇⋅A

Using the spherical divergence expression:

  • Radial term: Ar=rA_r = rAr​=r

    1r2∂∂r(r2⋅r)=1r2∂∂r(r3)=1r2⋅3r2=3\frac{1}{r^2} \frac{\partial}{\partial r}(r^2 \cdot r) = \frac{1}{r^2} \frac{\partial}{\partial r}(r^3) = \frac{1}{r^2} \cdot 3r^2 = 3r21​∂r∂​(r2⋅r)=r21​∂r∂​(r3)=r21​⋅3r2=3
  • Theta term: Aθ=−3A_\theta = -3Aθ​=−3

    1rsin⁡θ∂∂θ(−3sin⁡θ)=1rsin⁡θ(−3cos⁡θ)=−3r⋅cos⁡θsin⁡θ\frac{1}{r\sin\theta} \frac{\partial}{\partial \theta}(-3 \sin\theta) = \frac{1}{r\sin\theta} (-3 \cos\theta) = -\frac{3}{r} \cdot \frac{\cos\theta}{\sin\theta}rsinθ1​∂θ∂​(−3sinθ)=rsinθ1​(−3cosθ)=−r3​⋅sinθcosθ​
  • Phi term: Aϕ=5ϕA_\phi = 5\phiAϕ​=5ϕ

    1rsin⁡θ∂∂ϕ(5ϕ)=1rsin⁡θ⋅5=5rsin⁡θ\frac{1}{r\sin\theta} \frac{\partial}{\partial \phi}(5\phi) = \frac{1}{r\sin\theta} \cdot 5 = \frac{5}{r\sin\theta}rsinθ1​∂ϕ∂​(5ϕ)=rsinθ1​⋅5=rsinθ5​

Therefore:

∇⋅A=3−3rcos⁡θsin⁡θ+5rsin⁡θ\nabla \cdot \mathbf{A} = 3 - \frac{3}{r} \frac{\cos\theta}{\sin\theta} + \frac{5}{r\sin\theta}∇⋅A=3−r3​sinθcosθ​+rsinθ5​

Step 2: Set up the Volume Integral

The divergence theorem states:

Φ=∫V(∇⋅A) dv\Phi = \int_V (\nabla \cdot \mathbf{A}) \, dvΦ=∫V​(∇⋅A)dv

In spherical coordinates, dv=r2sin⁡θ dr dθ dϕdv = r^2 \sin\theta \, dr\, d\theta\, d\phidv=r2sinθdrdθdϕ. Multiply ∇⋅A\nabla \cdot \mathbf{A}∇⋅A by dvdvdv:

(∇⋅A) dv=[3−3cos⁡θrsin⁡θ+5rsin⁡θ]r2sin⁡θ dr dθ dϕ(\nabla \cdot \mathbf{A})\, dv = \left[ 3 - \frac{3\cos\theta}{r\sin\theta} + \frac{5}{r\sin\theta} \right] r^2 \sin\theta \, dr\, d\theta\, d\phi(∇⋅A)dv=[3−rsinθ3cosθ​+rsinθ5​]r2sinθdrdθdϕ

Simplify term by term:

  • First term: 3⋅r2sin⁡θ dr dθ dϕ=3r2sin⁡θ dr dθ dϕ3 \cdot r^2 \sin\theta \, dr\,d\theta\,d\phi = 3r^2 \sin\theta \, dr\,d\theta\,d\phi3⋅r2sinθdrdθdϕ=3r2sinθdrdθdϕ

  • Second term: −3cos⁡θrsin⁡θ⋅r2sin⁡θ dr dθ dϕ=−3rcos⁡θ dr dθ dϕ-\frac{3\cos\theta}{r\sin\theta} \cdot r^2 \sin\theta \, dr\,d\theta\,d\phi = -3r \cos\theta \, dr\,d\theta\,d\phi−rsinθ3cosθ​⋅r2sinθdrdθdϕ=−3rcosθdrdθdϕ

  • Third term: 5rsin⁡θ⋅r2sin⁡θ dr dθ dϕ=5r dr dθ dϕ\frac{5}{r\sin\theta} \cdot r^2 \sin\theta \, dr\,d\theta\,d\phi = 5r \, dr\,d\theta\,d\phirsinθ5​⋅r2sinθdrdθdϕ=5rdrdθdϕ

So:

Φ=∫r=04∫θ=0π/2∫ϕ=03π/2(3r2sin⁡θ−3rcos⁡θ+5r)dϕ dθ dr\Phi = \int_{r=0}^{4} \int_{\theta=0}^{\pi/2} \int_{\phi=0}^{3\pi/2} \left( 3r^2 \sin\theta - 3r \cos\theta + 5r \right) d\phi\, d\theta\, drΦ=∫r=04​∫θ=0π/2​∫ϕ=03π/2​(3r2sinθ−3rcosθ+5r)dϕdθdr

Step 3: Evaluate the Integrals Separately

Term 1: 3r2sin⁡θ3r^2 \sin\theta3r2sinθ

Φ1=∫043r2 dr⋅∫0π/2sin⁡θ dθ⋅∫03π/2dϕ\Phi_1 = \int_0^4 3r^2 \, dr \cdot \int_0^{\pi/2} \sin\theta \, d\theta \cdot \int_0^{3\pi/2} d\phiΦ1​=∫04​3r2dr⋅∫0π/2​sinθdθ⋅∫03π/2​dϕ
  • ∫043r2 dr=[r3]04=64\int_0^4 3r^2 \, dr = \left[ r^3 \right]_0^4 = 64∫04​3r2dr=[r3]04​=64

  • ∫0π/2sin⁡θ dθ=[−cos⁡θ]0π/2=(0)−(−1)=1\int_0^{\pi/2} \sin\theta \, d\theta = \left[ -\cos\theta \right]_0^{\pi/2} = (0) - (-1) = 1∫0π/2​sinθdθ=[−cosθ]0π/2​=(0)−(−1)=1

  • ∫03π/2dϕ=3π2\int_0^{3\pi/2} d\phi = \frac{3\pi}{2}∫03π/2​dϕ=23π​

Thus Φ1=64⋅1⋅3π2=96π\Phi_1 = 64 \cdot 1 \cdot \frac{3\pi}{2} = 96\piΦ1​=64⋅1⋅23π​=96π

Term 2: −3rcos⁡θ-3r \cos\theta−3rcosθ

Φ2=∫04(−3r) dr⋅∫0π/2cos⁡θ dθ⋅∫03π/2dϕ\Phi_2 = \int_0^4 (-3r) \, dr \cdot \int_0^{\pi/2} \cos\theta \, d\theta \cdot \int_0^{3\pi/2} d\phiΦ2​=∫04​(−3r)dr⋅∫0π/2​cosθdθ⋅∫03π/2​dϕ
  • ∫04(−3r) dr=−3⋅[r22]04=−3⋅162=−24\int_0^4 (-3r) \, dr = -3 \cdot \left[ \frac{r^2}{2} \right]_0^4 = -3 \cdot \frac{16}{2} = -24∫04​(−3r)dr=−3⋅[2r2​]04​=−3⋅216​=−24

  • ∫0π/2cos⁡θ dθ=[sin⁡θ]0π/2=1\int_0^{\pi/2} \cos\theta \, d\theta = \left[ \sin\theta \right]_0^{\pi/2} = 1∫0π/2​cosθdθ=[sinθ]0π/2​=1

  • ∫03π/2dϕ=3π2\int_0^{3\pi/2} d\phi = \frac{3\pi}{2}∫03π/2​dϕ=23π​

Thus Φ2=(−24)⋅1⋅3π2=−36π\Phi_2 = (-24) \cdot 1 \cdot \frac{3\pi}{2} = -36\piΦ2​=(−24)⋅1⋅23π​=−36π

Term 3: 5r5r5r

Φ3=∫045r dr⋅∫0π/2dθ⋅∫03π/2dϕ\Phi_3 = \int_0^4 5r \, dr \cdot \int_0^{\pi/2} d\theta \cdot \int_0^{3\pi/2} d\phiΦ3​=∫04​5rdr⋅∫0π/2​dθ⋅∫03π/2​dϕ
  • ∫045r dr=5⋅[r22]04=5⋅162=40\int_0^4 5r \, dr = 5 \cdot \left[ \frac{r^2}{2} \right]_0^4 = 5 \cdot \frac{16}{2} = 40∫04​5rdr=5⋅[2r2​]04​=5⋅216​=40

  • ∫0π/2dθ=π2\int_0^{\pi/2} d\theta = \frac{\pi}{2}∫0π/2​dθ=2π​

  • ∫03π/2dϕ=3π2\int_0^{3\pi/2} d\phi = \frac{3\pi}{2}∫03π/2​dϕ=23π​

Thus Φ3=40⋅π2⋅3π2=40⋅3π24=30π2\Phi_3 = 40 \cdot \frac{\pi}{2} \cdot \frac{3\pi}{2} = 40 \cdot \frac{3\pi^2}{4} = 30\pi^2Φ3​=40⋅2π​⋅23π​=40⋅43π2​=30π2

Step 4: Sum the Contributions

Φ=Φ1+Φ2+Φ3=96π−36π+30π2=60π+30π2\Phi = \Phi_1 + \Phi_2 + \Phi_3 = 96\pi - 36\pi + 30\pi^2 = 60\pi + 30\pi^2Φ=Φ1​+Φ2​+Φ3​=96π−36π+30π2=60π+30π2

Result: The total outward flux through the given closed surface is Φ=60π+30π2\Phi = 60\pi + 30\pi^2Φ=60π+30π2. This result could also be obtained directly from a closed surface integral, but the divergence theorem offers a more systematic and often simpler approach.

The divergence and the divergence theorem are powerful tools in electromagnetics and fluid dynamics, allowing the conversion between surface and volume integrals and providing insight into the source or sink behavior of vector fields.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent