Analysis on Manifolds V: Stokes' Theorem
Conclusion of a five-part lecture series on differential forms and the generalised Stokes theorem.
This lecture includes interactive SymPy cells that verify key results symbolically. SymPy is a Python library for symbolic mathematics. Loading it fetches a WebAssembly Python runtime (approx. 15 MB, cached after first load). You can also load it on demand from any code cell below.
0. Culmination
Five parts converge here.
Part I built analysis on from first principles: the topology of open balls and compact sets, the derivative as a linear map , the chain rule as composition of linear maps and the inverse and implicit function theorems that let one pass between coordinate descriptions. The derivative was identified as the best linear approximation to a smooth map and is a local linear-algebraic shadow of global nonlinear geometry.
Part II built the algebra of a single vector space: the dual , multilinear alternating maps, the wedge product, the basis of , determinants as top forms, the interior product and the Hodge star that turns the algebra into a metric-enriched structure.
Part III glued the algebra onto smooth manifolds: tangent spaces , cotangent bundles , differential -forms as smooth sections of , the exterior derivative satisfying and the pullback that makes differential forms covariant. The classical vector calculus operations grad, curl and div emerged as the exterior derivative at dimensions 0, 1 and 2 in .
Part IV integrated. Orientation, manifolds with boundary, the induced orientation on , partitions of unity, the integral of a -form over an oriented -manifold, the Riemannian volume form, period integrals and their relationship to topology. The de Rham cohomology emerged as the space of closed forms modulo exact forms, computed for spheres, tori, projective spaces and the Möbius band via the Mayer-Vietoris sequence. Part IV closed with Poincaré duality and a preview of this conclusion.
Stokes' theorem. The generalised Stokes theorem
holds for any compact oriented smooth -manifold with boundary and any -form . Every classical integral theorem (the fundamental theorem of calculus, Green's theorem, the divergence theorem, the classical Stokes theorem for surface integrals) is the same identity at a different value of and a different choice of .
After the proof and its classical special cases this part develops the analytic depth behind de Rham cohomology. Hodge theory reinterprets each cohomology class as containing a unique harmonic representative: a smooth form in the kernel of the Laplacian . The Hodge decomposition theorem gives the identification and is sketched here via Sobolev spaces and elliptic regularity. It implies that the Betti numbers equal the dimension of the space of harmonic forms.
The series ends with the de Rham isomorphism: the identification of with via integration, proved here for and and stated in full generality.
Notation. We follow the conventions of Parts I–IV: roman italic for points (), boldface for tangent vectors (). All manifolds are smooth, oriented and compact unless stated otherwise. We follow Bott-Tu [1], Lee [2], Warner [3], Griffiths-Harris [4], Hodge [5] and Evans [6].
1. Stokes' theorem
1.1. Statement
Let be a compact oriented smooth -manifold with boundary, and let be smooth. Then
where has the induced boundary orientation (outward normal first; Part IV §3.2).
Equation [eq:stokes] repeats [eq:stokes-main]. The proof has two steps: first on the half-space (the core computation), then globally via a partition of unity.
1.2. Proof on the half-space
Let be a compactly supported -form on the half-space with boundary . Write
where the hat denotes omission. Then
Integrating over using Fubini and the fundamental theorem of calculus in each variable (writing for and ):
For : the inner integral is by compact support. For : the inner integral is (again by compact support, the upper limit vanishes). Therefore
The boundary with the induced orientation (outward normal first, then ) has sign , since . Hence . This matches the right-hand side of [eq:half-stokes-rhs] (since ). This proves [stokes] on .

1.3. Proof via partition of unity
Global proof via partition of unity
Choose a finite oriented atlas of with charts mapping either to (interior charts) or to (boundary charts). Let be a smooth partition of unity subordinate to (Part IV, §4.2). Write . Since is linear,
Interior chart with : the form has compact support away from the boundary. Hence and .
Boundary chart with : apply the half-space result to . The pullback converts the half-space identity to .
Summing over all charts:
The half-space computation contains the entire mathematical content and the partition of unity assembles local pieces into a global result.
2. Classical theorems recovered
[stokes] has four classical names. Each is the same identity [eq:stokes] with a specific manifold and a specific form . Each corollary below identifies the manifold and the form.
2.1. Fundamental theorem of calculus
Let be smooth. Then .
Proof
Take , , and (a 0-form). Then . The boundary with induced orientation: . [stokes] gives .
from sympy import *
x = symbols('x')
# Verify FTC: int_a^b F'(x) dx = F(b) - F(a)
F = x**3 - 2*x
a, b = 0, 2
lhs = integrate(diff(F, x), (x, a, b))
rhs = F.subs(x, b) - F.subs(x, a)
print(f"F(x) = {F}")
print(f"F'(x) = {diff(F, x)}")
print(f"integral = {lhs}")
print(f"F(2) - F(0) = {rhs}")
print(f"FTC verified : {lhs == rhs}")Symbolic verification of the fundamental theorem of calculus for F(x) = x³ − 2x on [0, 2]
2.2. Green's theorem
Let be a compact region with smooth boundary, and let be smooth. Then
Proof
Take and . Compute:
Integrating: . On the induced CCW boundary, . [stokes] gives [eq:green].
from sympy import *
r, t = symbols('r t', real=True)
# Verify Green's theorem: P = -y, Q = x on the unit disk
# Interior: integrate (Q_x - P_y) = 2 over the disk in polar
interior = integrate(integrate(2*r, (r, 0, 1)), (t, 0, 2*pi))
# Boundary: parametrise unit circle x = cos t, y = sin t
x_c, y_c = cos(t), sin(t)
boundary = integrate(-y_c * diff(x_c, t) + x_c * diff(y_c, t), (t, 0, 2*pi))
print(f"Interior iint_D (Q_x - P_y) dA = {interior}")
print(f"Boundary oint P dx + Q dy = {boundary}")
print(f"Green's theorem verified: {interior == boundary}")
print(f"(Both equal 2*pi = {float(interior):.6f})")Green's theorem for P = −y and Q = x on the unit disk
2.3. Divergence theorem
Let be a compact region with smooth boundary, and let be a smooth vector field on . Then
where has the outward-normal orientation.
Proof
Take and . Compute:
On with outward-normal orientation, . [stokes] gives [eq:divergence].
2.4. Classical Stokes theorem
Let be a compact oriented surface with smooth boundary curve , and let be a smooth vector field on a neighbourhood of . Then
Proof
Take . Then (Part III §8). On the boundary curve, . [stokes] gives [eq:classical-stokes-eq].
In each of the four theorems the left side integrates the exterior derivative of over an oriented manifold , and the right side integrates over the boundary .

3. Stokes' theorem and de Rham cohomology
[stokes] gives the topological content of de Rham cohomology: integration over cycles cannot detect exact forms and the cohomology groups are diffeomorphism invariants.
3.1. Exact forms on closed manifolds
Let be a compact oriented manifold without boundary (), and let be exact. Then .
Proof
By [stokes] with and :
If is a closed manifold and , then is not exact and has non-trivial cohomological information.
3.2. Pullback functoriality
Let be smooth. The pullback commutes with and descends to a linear map
Since these maps form a ring homomorphism . If is a diffeomorphism then is an isomorphism.
Proof
Well-definedness. If then . Hence .
Preservation of periods. For a cycle in ,
by the change-of-variables formula (Part IV §5.2).
Isomorphism. When is a diffeomorphism, is the two-sided inverse.
3.3. Diffeomorphism invariance of Betti numbers
If is a diffeomorphism then for all .
Proof
By [pullback-cohom], is a linear isomorphism. Hence .
The cohomology computations of Part IV (spheres, tori, projective planes, the Möbius band) therefore depend only on the diffeomorphism type of the manifold. The de Rham theorem of §6 identifies them with singular cohomology and makes them topological facts.
4. Hodge theory
The de Rham cohomology of Part IV was defined algebraically: . This section gives it an analytic description. Hodge [5] showed that each cohomology class contains a distinguished smooth representative, the harmonic form, characterised by being killed by both and its adjoint . The existence proof requires Sobolev spaces and elliptic regularity for the Laplacian.
4.1. L² inner product on forms
Fix a compact oriented Riemannian -manifold without boundary. Recall from Part II §10 the Hodge star , defined by .
For , define
The pairing [eq:l2-ip] is a positive-definite inner product on : for .
Proof
at each point, with equality iff at that point. Since , the integral is strictly positive.
4.2. Co-differential
Define by
For all , :
Proof
The form . Compute . Integrating over and applying Stokes with :
Therefore . The sign convention in the definition of is chosen so that .
follows immediately from and the involutivity .
from sympy import *
theta, phi = symbols('theta phi', real=True)
# On T^2 with flat metric, d^*(a dtheta + b dphi) = -(a_theta + b_phi)
# Verify adjointness: <df, omega>_L2 = <f, d* omega>_L2 for
# f = cos(theta)*cos(phi),
# omega = sin(theta)*cos(phi) dtheta + cos(theta)*sin(phi) dphi
# Expected result: both integrals equal -2*pi^2 (non-trivial check)
f = cos(theta) * cos(phi)
a_val = sin(theta) * cos(phi) # coefficient of dtheta in omega
b_val = cos(theta) * sin(phi) # coefficient of dphi in omega
# df = partial_theta(f) dtheta + partial_phi(f) dphi
df_a = diff(f, theta) # = -sin(theta)*cos(phi)
df_b = diff(f, phi) # = -cos(theta)*sin(phi)
# d* omega = -(partial_theta a + partial_phi b) [flat T^2]
# = -(cos(theta)*cos(phi) + cos(theta)*cos(phi)) = -2*cos(theta)*cos(phi)
d_star_omega = -(diff(a_val, theta) + diff(b_val, phi))
# <df, omega>_L2 = int_T2 (df_a*a_val + df_b*b_val) dtheta dphi
lhs = integrate(integrate(df_a * a_val + df_b * b_val, (theta, 0, 2*pi)), (phi, 0, 2*pi))
# <f, d* omega>_L2 = int_T2 f * d*omega dtheta dphi
rhs = integrate(integrate(f * d_star_omega, (theta, 0, 2*pi)), (phi, 0, 2*pi))
print(f"f = {f}")
print(f"omega = sin(theta)cos(phi) dtheta + cos(theta)sin(phi) dphi")
print(f"d*omega = {d_star_omega}")
print(f"<df, omega> = {lhs} (= -2*pi^2)")
print(f"<f, d*omega> = {rhs} (= -2*pi^2)")
print(f"Adjointness verified: {simplify(lhs - rhs) == 0}")Co-differential adjointness on T² for explicit non-trivial forms
4.3. Hodge Laplacian and harmonic forms
The Hodge Laplacian is
A form is harmonic if . The space of harmonic -forms is denoted .
On a compact manifold without boundary: .
Proof
If and then . Conversely, if then
Both terms are non-negative and hence and .
4.4. Hodge decomposition theorem
Let be a compact oriented Riemannian manifold without boundary. Then is finite-dimensional and there is an orthogonal direct sum
where the three summands are mutually -orthogonal.
The full proof goes through Sobolev spaces and elliptic regularity. We sketch the main steps.
Proof (Sobolev spaces and elliptic regularity)
Sobolev spaces (step 1). For , define the Sobolev space as the completion of under the norm
For this is the norm.
Gårding inequality (step 2). There exists such that for all :
This follows from the ellipticity of : its principal symbol is and is positive definite for . See Evans [6] §6.2 for the scalar case.
Elliptic regularity (step 3). If satisfies weakly for , then . Bootstrapping: if is smooth then for all , hence smooth by the Sobolev embedding theorem.
Rellich-Kondrachov compactness (step 4). The inclusion is compact (Rellich's theorem). This forces the spectrum of on to be discrete:
with each eigenspace finite-dimensional and exactly when . In particular .
Orthogonal decomposition (step 5). The operator is self-adjoint on (by [codiff-adj]) and has closed range. The Fredholm alternative gives
Decomposing : for any , the two summands and are -orthogonal since . Hence . Conversely and for every . Both images therefore lie in and . By elliptic regularity the decomposition holds for smooth forms.

5. Harmonic representatives
The Hodge decomposition makes de Rham cohomology computable: every class has a canonical smooth representative, determined uniquely by the Riemannian structure.
5.1. Unique harmonic representative of each class
Every cohomology class contains exactly one harmonic form.
Proof
Existence. Let be a closed representative. By the Hodge decomposition, write with . Since is closed, . Then , and hence . Thus and .
Uniqueness. If with then . Then
since . Hence .
5.2. Betti numbers as harmonic dimensions
, and therefore .
Proof
The map sending to its harmonic representative is a linear isomorphism by [harmonic-rep]. Finite-dimensionality of was established in Step 4.
The Betti number is a topological invariant and equals the dimension of the space of smooth differential forms that solve .
from sympy import binomial, Integer
# Betti numbers of spheres and tori
print("Betti numbers b_k(S^n) [b_0 = b_n = 1, all others 0]:")
for n in range(5):
row = [1 if (k == 0 or k == n) else 0 for k in range(n + 1)]
print(f" S^{n}: {row} (chi = {sum((-1)**k * v for k,v in enumerate(row))})")
print()
print("Betti numbers b_k(T^n) [b_k = C(n,k)]:")
for n in range(5):
row = [int(binomial(n, k)) for k in range(n + 1)]
chi = sum((-1)**k * v for k, v in enumerate(row))
print(f" T^{n}: {row} (sum = 2^{n} = {2**n}, chi = {chi})")Betti numbers of Sⁿ and Tⁿ
5.3. Poincaré duality via the Hodge star
If is a compact oriented Riemannian manifold without boundary, then for all .
Proof
The Hodge star is an isomorphism: if then and , and the identity implies and . Hence . Since , is invertible and so .
![Two harmonic 1-forms dθ and dφ on the torus T², shown as uniform vector fields on the flat [0,2π]×[0,2π] representation](/figures/manifolds-5/harmonic_torus_forms-light.png)
6. De Rham isomorphism
The series has two descriptions of the same cohomological data: the analytic one (de Rham cohomology, built from differential forms) and the topological one (singular homology, built from continuous maps of simplices). The de Rham theorem says they contain identical information and integration connects them.
6.1. Period map
For a compact smooth manifold , the period map is
The period depends only on the cohomology class and the homology class .
Proof
Cohomology. If , then for any cycle (so ), [stokes] gives
Homology. If , then since is closed,
6.2. Worked cases
with generator , and with generator . The period is
Normalising by gives an isomorphism .
with generators , and with generators (the -circle) and (the -circle). The period matrix is
Since is invertible, Per is an isomorphism: .
from sympy import *
t = symbols('t', real=True)
c, a, b = symbols('c a b', real=True)
# Period of c*dtheta over [S^1]
# Parametrise S^1 as theta = t in [0, 2*pi], dtheta evaluates to dt
period_S1 = integrate(c, (t, 0, 2*pi))
print(f"Per([c dtheta])([S^1]) = int_S1 c dtheta = {period_S1}")
print(f" = 2*pi*c (= {period_S1})")
print()
# Period matrix entries for omega = a*dtheta + b*dphi on T^2
# alpha-cycle: theta varies, phi fixed => dtheta = dt, dphi = 0
per_alpha_dtheta = integrate(a, (t, 0, 2*pi)) # int_alpha a dtheta
per_alpha_dphi = integrate(0, (t, 0, 2*pi)) # int_alpha b dphi = 0
# beta-cycle: phi varies, theta fixed => dtheta = 0, dphi = dt
per_beta_dtheta = integrate(0, (t, 0, 2*pi)) # int_beta a dtheta = 0
per_beta_dphi = integrate(b, (t, 0, 2*pi)) # int_beta b dphi
P = Matrix([[per_alpha_dtheta, per_alpha_dphi],
[per_beta_dtheta, per_beta_dphi]])
print("Period matrix P for T^2:")
print(P)
print(f"P / (2*pi) = {P / (2*pi)}")
print(f"det(P) = {P.det()} (non-zero => de Rham isomorphism)")Period map on S¹ and period matrix on T²

6.3. De Rham theorem
For any compact smooth manifold , the period map
is an isomorphism for all .
Integration is the natural pairing between differential forms and cycles and the isomorphism [eq:de-rham-eq] states that it is non-degenerate.
Proof strategy (full proof: Bott-Tu [1] §15 and Lee [2] Chapter 18). Induction on the number of open sets in a good cover of (every finite intersection is contractible). Base case: a single contractible set; Poincaré lemma gives for as in singular cohomology. Inductive step: Mayer-Vietoris on both de Rham and singular cohomology, connected by period maps; the five-lemma propagates the isomorphism.
The de Rham theorem and the analytic inputs to the Hodge theorem (Gårding, elliptic regularity and Rellich compactness) are the results of this part stated without a complete proof. The proof strategy above contains the ideas: the Poincaré lemma as the base case, Mayer-Vietoris as the inductive engine and the five-lemma as the algebraic tool.
7. Epilogue
The series has one idea: a linear map that commutes with the boundary.
The derivative of Part I is the linear map. The exterior derivative of Part III is the same map on forms. The pullback of Part III is the transpose. The partition-of-unity integration of Part IV assembles local linear maps into a global pairing. Stokes' theorem states that integration commutes with the boundary.
Gauge theory rewrites Maxwell's equations as and , the language of the exterior derivative on a principal bundle. In general relativity the Riemann curvature 2-form satisfies the Bianchi identity, the gravitational analogue of . The Atiyah-Singer index theorem generalises the Hodge theorem. For an elliptic operator on a compact manifold the index is an integral of characteristic forms built from the symbol of . For the Dolbeault operator twisted by a holomorphic vector bundle over a compact complex manifold it reads
the Hirzebruch-Riemann-Roch theorem. The Euler characteristic, the signature and the Dirac index are the cases from even to odd forms, from self-dual to anti-self-dual forms and the Dirac operator on spinors. The first case rests on the Hodge decomposition of Section 4.4: its kernel and cokernel are the even and odd harmonic forms and its index is . The index theorem then returns the Gauss-Bonnet-Chern formula.
Three natural sequels follow. A series on connections and curvature takes the exterior derivative on functions and extends it to sections of vector bundles. This is the language of gauge theory and general relativity. A series on advanced PDE theory develops the Sobolev spaces and elliptic regularity used in §4 to their natural depth: spectral theory, heat kernels, the Atiyah-Singer index theorem. A series on algebraic topology gives the complete proof of the de Rham theorem and develops singular cohomology alongside de Rham, with cup products, cap products and Poincaré-Lefschetz duality.
The exterior algebra you built in Part II sits at the foundation of all of it.
References
- R. Bott and L.W. Tu, Differential Forms in Algebraic Topology, Springer, 1982. Primary reference for de Rham cohomology, Mayer-Vietoris, and the de Rham theorem. DOI
- J.M. Lee, Introduction to Smooth Manifolds, 2nd ed., Springer, 2012. Chapter 16 (Stokes' theorem), Chapter 17 (de Rham cohomology). DOI
- F.W. Warner, Foundations of Differentiable Manifolds and Lie Groups, Springer, 1983. Chapter 6 (Hodge theory). DOI
- P. Griffiths and J. Harris, Principles of Algebraic Geometry, Wiley Classics Library, 1994. Chapter 0 (Hodge theory on Kähler manifolds). (ISBN 978-0-471-05059-9)
- W.V.D. Hodge, The Theory and Applications of Harmonic Integrals, Cambridge University Press, 1941 (repr. 1989). The original source. (ISBN 978-0-521-35881-1)
- L.C. Evans, Partial Differential Equations, 2nd ed., AMS, 2010. Chapter 5 (Sobolev spaces), §6.2 (energy estimates), §6.3 (elliptic regularity). (AMS GSM 19, ISBN 978-0-8218-4974-3)