Home > Visualization > Vector Analysis & Curvilinear Coordinates

Module 1.4 Vector Integration, Divergence & Stokes’ Theorems

Modules Index
Simulation 1

Line Integrals in Vector Fields - Path Independence, Conservative Potential Fields, and Work Done along Alternate Paths

Python 3.11 with Matplotlib Slider Ready

Interactive Physics Ready

Click "Run Code" to launch simulation and interactive parameter sliders.


                                

Mathematical Problem Formulation

Line Integrals in Vector Fields: Path Independence, Conservative Potential Fields, and Work Done along Alternate Paths

Theoretical Background & Explanation

Line Integral and Path Independence

Figure 4.1: Vector Integration: (Top) Path independence of line integrals in a conservative field ($\int_{C_1} = \int_{C_2} = \Delta \phi$) versus path dependence when $\nabla \times \vec{F} \neq 0$. (Bottom) Surface flux decomposition across top, bottom, and curved sidewall of a closed cylinder.

Vector Line Integrals & Conservative Fields

The line integral of a vector field $\vec{F}$ along an oriented spatial curve $C$ parametrized by $\vec{r}(t)$ from $A$ to $B$ represents the cumulative tangential projection: $$W = \int_C \vec{F} \cdot d\vec{r} = \int_{t_A}^{t_B} \left( F_x \frac{dx}{dt} + F_y \frac{dy}{dt} + F_z \frac{dz}{dt} \right) dt$$

1. The Fundamental Theorem of Line Integrals

If a vector field is conservative, there exists a single-valued scalar potential $\phi(x,y,z)$ such that $\vec{F} = \nabla \phi$. By the chain rule:

$$\vec{F} \cdot d\vec{r} = \nabla \phi \cdot d\vec{r} = \frac{\partial \phi}{\partial x}dx + \frac{\partial \phi}{\partial y}dy + \frac{\partial \phi}{\partial z}dz = d\phi$$ $$\int_{C, A \to B} \vec{F} \cdot d\vec{r} = \int_A^B d\phi = \phi(B) - \phi(A)$$

The integral depends exclusively on the coordinates of the endpoints $A$ and $B$, being entirely independent of the geometric path connecting them!

2. Closed Loop Circulation & Curl Connection

If two arbitrary paths $C_1$ and $C_2$ connect $A$ to $B$, forming a closed loop $C = C_1 - C_2$:

$$\oint_C \vec{F} \cdot d\vec{r} = \int_{C_1} \vec{F} \cdot d\vec{r} - \int_{C_2} \vec{F} \cdot d\vec{r} = 0 \iff \nabla \times \vec{F} = \vec{0}$$

In the interactive simulation, notice how altering the parameter $k$ introduces a non-zero curl $\nabla \times \vec{F} = -2k \hat{k}$. The difference in work between alternate paths is exactly equal to the enclosed vortex flux $\iint (\nabla \times \vec{F}) \cdot d\vec{S} = -2k \times \text{Area}$ by Stokes' theorem!

Simulation 2

Problem - Computational Verification of Gauss's Divergence Theorem and Stokes' Circulation Theorem over a 3D Cylinder

Python 3.11 with Matplotlib Slider Ready

Interactive Physics Ready

Click "Run Code" to launch simulation and interactive parameter sliders.


                                

Mathematical Problem Formulation

Problem: Computational Verification of Gauss's Divergence Theorem and Stokes' Circulation Theorem over a 3D Cylinder

Theoretical Background & Explanation

Gauss and Stokes Theorems

Figure 4.2: The Two Master Theorems of Vector Calculus: (Left) Gauss's Divergence Theorem equating total interior source divergence $\iiint_V (\nabla\cdot\vec{F})dV$ to closed surface boundary flux $\oiint_S \vec{F}\cdot d\vec{S}$, (Right) Stokes' Circulation Theorem equating open surface vorticity flux $\iint_S (\nabla\times\vec{F})\cdot d\vec{S}$ to closed boundary line circulation $\oint_C \vec{F}\cdot d\vec{r}$.

Physics Problem Statement

Given the three-dimensional vector field $\vec{F}(x,y,z) = (ax)\hat{i} + (by)\hat{j} + (cz)\hat{k}$, verify Gauss's Divergence Theorem over the cylindrical volume $V$ bounded by the surface $x^2 + y^2 \le R^2$ and $0 \le z \le H$: $$\iiint_V (\nabla \cdot \vec{F}) dV = \oiint_S \vec{F} \cdot d\vec{S}$$

1. Volume Integral of Divergence

First, compute the scalar divergence of the field: $$\nabla \cdot \vec{F} = \frac{\partial(ax)}{\partial x} + \frac{\partial(by)}{\partial y} + \frac{\partial(cz)}{\partial z} = a + b + c$$ Because the divergence is constant everywhere in space, the volume integral factors out:

$$\iiint_V (\nabla \cdot \vec{F}) dV = (a + b + c) \iiint_V dV = (a + b + c) \left(\pi R^2 H\right)$$

2. Surface Flux Integrals over Closed Boundary

The closed bounding surface $S = \partial V$ decomposes into three smooth boundary manifolds:
• Top Circular Cap $S_1$ ($z = H$): Normal $\hat{n}_1 = +\hat{k}$, area element $dS = r dr d\theta$. $$\iint_{S_1} \vec{F} \cdot \hat{n}_1 dS = \int_0^{2\pi} d\theta \int_0^R (c H) r dr = c H (\pi R^2)$$
• Bottom Circular Cap $S_2$ ($z = 0$): Normal $\hat{n}_2 = -\hat{k}$. $$\iint_{S_2} \vec{F} \cdot \hat{n}_2 dS = \iint_{S_2} (-cz) dS = \iint_{S_2} 0 = 0$$
• Curved Sidewall $S_3$ ($r = R$): In cylindrical coordinates, outward normal $\hat{n}_3 = \cos\theta\hat{i} + \sin\theta\hat{j}$, area element $dS = R d\theta dz$. $$\vec{F} \cdot \hat{n}_3 = a(R\cos\theta)\cos\theta + b(R\sin\theta)\sin\theta = R(a\cos^2\theta + b\sin^2\theta)$$ $$\iint_{S_3} \vec{F} \cdot \hat{n}_3 dS = \int_0^H dz \int_0^{2\pi} R^2(a\cos^2\theta + b\sin^2\theta) d\theta = H R^2 (a\pi + b\pi) = (a + b)\pi R^2 H$$

3. Total Sum & Exact Equivalence

$$\oiint_S \vec{F} \cdot d\vec{S} = \iint_{S_1} + \iint_{S_2} + \iint_{S_3} = c\pi R^2 H + 0 + (a + b)\pi R^2 H = (a + b + c)\pi R^2 H$$

The sum of the surface fluxes matches the volume integral to infinite precision! This directly verifies Gauss's theorem.