Learning Objectives
By the end of this section you will be able to:
- Parametrise a surface in 3D and read off its area element directly from the parametrisation.
- Evaluate scalar surface integrals over parametric surfaces, including surface area as a special case.
- Compute flux integrals , measuring how much of a vector field passes through a curved surface.
- Reason about orientation and the role of the unit normal in determining the sign of flux.
- Connect the formalism to electromagnetism (Gauss's law), fluid dynamics (mass flow rate) and the change-of-variables formula in machine-learning normalising flows.
Why this matters: Surface integrals are how calculus measures stuff that lives on a curved skin in space — the mass of a soap bubble, the wind passing through a kite, the electric field threading a Gaussian pillbox, the probability mass squeezed by a generative model. Every "flow through a boundary" in physics is a flux integral in disguise.
The Big Picture
Calculus keeps doing the same trick — chop, evaluate, sum, take the limit — only the shape of the domain changes. Surface integrals are the natural next step:
| Dimension | Domain | Integral | Geometric meaning |
|---|---|---|---|
| 1-D straight | Interval | Signed area under a curve | |
| 1-D curved | Curve in | or | Mass along wire / work along path |
| 2-D flat | Region in | Signed volume under a graph | |
| 2-D curved | Surface in | or | Mass on a shell / flux through it |
Just as line integrals split into "scalar along a curve" and "vector circulation along a curve", surface integrals split into two species:
Scalar surface integral
Integrates a scalar density against area. Used for the mass of a curved sheet of uneven thickness, the average temperature on a satellite's skin, or just the surface area when .
Vector surface integral (flux)
Integrates the normal component of a vector field. Measures "how much of " pierces the surface. Used for electric flux, magnetic flux, fluid flow rate, heat current.
The single core idea
A surface integral asks: what is the total of some quantity distributed over a curved 2-D sheet? For scalars we weight the function by area. For vectors we weight by the component pointing through the sheet.
Historical Context
Surface integrals were invented to answer concrete questions in 19th-century physics: how does an electric field surround a charge? how does fluid mass move through a pipe? The mathematics was forged by three names you will meet again in this chapter.
Carl Friedrich Gauss (1777–1855)
Gauss spotted the deep link between flux through a closed surface and the sources sitting inside it. His electrostatic statement is one of Maxwell's four equations and the cleanest example of a flux integral doing real work.
George Green (1793–1841)
A self-taught miller's son who introduced the function we now call Green's function and connected surface integrals to volume integrals through what we now call Green's identities. Modern PDE theory begins with him.
George Gabriel Stokes (1819–1903)
Stokes proved the theorem now bearing his name (next section), tying the circulation of a vector field around a curve to the flux of its curl through a spanning surface.
One principle behind them all
Stokes' theorem, the divergence theorem, Green's theorem and the fundamental theorem of calculus are all special cases of the same deep statement — the integral of a derivative over a region equals the integral of the original function over the boundary of that region. Surface integrals are the boundary half of the 3-D version.
Parametric Surfaces Review
Before integrating over a surface we have to be able to describe it. A parametric surface is a vector function from a flat 2-D parameter rectangle into 3-D space:
As sweeps through the rectangle , the tip of traces out the surface in 3-D.
A small atlas of parametrisations
| Surface | Parametrisation | Parameter domain |
|---|---|---|
| Plane | Bounded rectangle in | |
| Sphere of radius | ||
| Cylinder radius , height | ||
| Graph | in the domain of | |
| Paraboloid | ||
| Torus |
The Surface Area Element
Once we have , the central object of the whole section is the area element:
where and are the partial derivatives of the parametrisation. Equivalently, the vector area element is — a normal vector whose magnitude is the area scale.
Where Comes From (Intuition)
Imagine the parameter rectangle ruled with a fine grid of cells, each of width and . The map sends one such cell — a tiny square — to a tiny curved patch of the surface . Two edges of that patch are
- — the local edge in the -direction;
- — the local edge in the -direction.
Those two edges span a small parallelogram living tangent to the surface. The area of a parallelogram with edges and is — that is exactly the magnitude of . Take the limit as and you obtain the area element. The direction of the cross product also gives a normal vector to the surface — that is going to matter the moment we talk about flux.
A geographic intuition
Take the sphere parametrisation with . Near the equator, , so a one-degree by one-degree patch of is genuinely big. Near a pole, and the same parameter square shrinks to a tiny spherical triangle. The factor in is exactly the "Mercator distortion" you see on flat world maps.
Interactive: Parametric Surfaces
Drag the surface, change the parametrisation, and watch how the constant- and constant- curves rule the surface. The shape itself is global; the parametrisation is a chart we paint on top of it.
Scalar Surface Integrals
Definition and Intuition
A scalar surface integral of a function over a surface is the limit of Riemann sums of against the surface area:
Physical reading. If is a mass density per unit area (), the sum gives the total mass of the shell. If is a temperature, dividing the integral by the total area gives the average temperature on the surface. The pattern "integrand times area element, summed" is universal.
Computing Scalar Surface Integrals
Pull everything back to the parameter rectangle :
Recipe:
- Pick a parametrisation matched to the symmetry.
- Differentiate to get and .
- Take the cross product and its magnitude.
- Substitute the parametrisation into .
- Evaluate a familiar double integral over .
Surface Area as a Special Case
Setting gives total surface area:
For a sphere of radius , this immediately reproduces :
Worked Example — Center of Mass of a Hemisphere
We will compute the z-coordinate of the centroid of the upper hemisphere , assumed to be a thin shell of uniform area density. Hand-work below — try it yourself before peeking.
▶ Solution (click to expand and work it by hand)
Setup. For uniform density the centroid coordinate is , where is the area of the hemisphere.
Area. Half a sphere has area .
Numerator. Use the spherical parametrisation with and , integrating from to :
The inner integral is , so the numerator is .
Divide.
Sanity check. The centroid of a solid hemisphere is at ; a thin shell is "weighted higher", so is reasonable. For the numerator is — the very number that the Python integrator below reproduces.
Interactive: Scalar Surface Integrals
Pick a surface, pick an integrand, and watch the Riemann sum colour-code each patch by its contribution. The running total is the surface integral.
Vector Surface Integrals (Flux)
Flux Through a Surface
The flux of a vector field through an oriented surface with unit normal is the scalar surface integral of the normal-component of :
Physical reading. If is the momentum density of a fluid ( mass density, velocity), then is the mass flow rate through the surface in kg/s. If is the electric field, is the electric flux — by Gauss's law equal to the enclosed charge divided by .
Flux as a Dot Product (Intuition)
The dot product filters to its component through the surface. Three cases say it all:
- (perpendicular to the surface): — maximal flux per area.
- (parallel to the surface): — the field slides along the surface and contributes nothing to flux.
- General angle : — only the cosine projects through.
That is why a window perpendicular to a uniform wind catches the maximum air flow, while a window aligned with the wind catches none.
Surface Orientation
Every smooth surface has two sides. Choosing one — and therefore one of the two unit normals — is called fixing the orientation. Conventions:
Closed surfaces
For a sphere, an ellipsoid, the boundary of a cube — the outward normal is the default. Positive flux means net flow out of the enclosed region.
Open surfaces with a boundary curve
Use the right-hand rule: curl the fingers along the boundary curve in its chosen direction, and the thumb points to the positive normal side. This is the convention Stokes' theorem (next section) requires.
Sign flips with orientation
Reverse the choice of normal and every flux integral flips sign. So is well-defined only once we have committed to an orientation.
Computing Flux Integrals
Pull back to the parameter rectangle using the vector area element :
Key observation. The cross product already encodes both the direction of the normal and the magnitude of the area scale — so no unit vector and no extra norm appear in this version of the formula. The price is that you must check the sign of the cross product against your chosen orientation; flip the order of arguments if it points the wrong way.
Worked Example — Flux of Through a Paraboloid
Compute for through the paraboloid , oriented upward. Try it yourself before expanding.
▶ Solution (click to expand and work it by hand)
Polar parametrisation. for .
Tangent vectors.
Cross product.
The z-component , so this normal points upward. Good — matches our orientation.
Dot with .
Integrate.
Sanity check. The maximum flux per area happens where aligns with — at the apex where and the normal is straight up. Near the rim, kills the integrand. Both endpoints vanish, the middle dominates, and the total comes to .
Interactive: Flux Through Surfaces
Drag the vector field, change the surface, and watch every patch's contribution light up red (positive flux, out) or blue (negative flux, in). When you tilt the surface to be parallel to the field, the running total drops to zero — the visual proof of the projection.
Important Surface Types
Surfaces as Graphs
When the surface is the graph of a function, the parametrisation is free and the formulas simplify dramatically:
Parametrisation:
Cross product (upward normal):
Area element:
For flux through a graph with upward normal, writing :
Spheres and Cylinders
| Surface | Outward normal | Orientation note | |
|---|---|---|---|
| Sphere radius | Standard: outward from centre | ||
| Cylinder radius | Outward from the axis | ||
| Cone | Outward (or downward) per choice |
Pick the parametrisation to match the symmetry
Spheres love spherical coordinates. Cylinders love cylindrical. Graphs love Cartesian. The wrong choice can turn a one-line integral into a multi-page mess.
Gauss's Law as a Surface Integral
The electric field of a point charge at the origin is . Compute the flux of through any sphere of radius centred at the origin.
▶ Solution (click to expand)
On the sphere, the outward unit normal is and is the same constant everywhere on the surface.
So and
Take-away. The answer is independent of — the same flux pierces every concentric sphere. The geometric reason: as the sphere grows, drops as , but the area grows as . They cancel exactly, which is the geometric content of Gauss's law.
Real-World Applications
Physics: Electric and Magnetic Flux
Maxwell's equations are written almost entirely in the language of flux:
- Gauss's law (electric): — the electric flux out of a closed surface counts the charge inside.
- Gauss's law (magnetic): — no magnetic monopoles, so magnetic flux out of any closed surface is always zero.
- Faraday's law: a changing magnetic flux through a surface induces an electromotive force around its boundary — surface integrals show up on the right-hand side directly.
Fluid Dynamics: Mass Flow Rate
For a fluid of density and velocity , the mass flow rate through a surface is the flux of :
This is the equation used to size pipes, sketch ventilation, compute lift on an airfoil, and check conservation of mass in a control volume.
Machine Learning: Normalising Flows
In a normalising flow, an invertible neural network maps samples from a simple distribution to samples from a target distribution . The change-of-variables formula
is the local, infinitesimal version of "probability is conserved through a flow". The global version — integrating mass through a closed surface — is exactly the Divergence Theorem we will prove in section 19.9. Surface integrals are the bridge that turns local conservation into a global accounting law.
Coming next
The Divergence Theorem says : the flux out of a closed surface equals the total source strength inside. That is how Gauss's law gets its name and how conservation of probability gets its proof.
Python Implementation
Scalar surface integral over a hemisphere
Flux integral through a paraboloid
Normalising-flow Jacobian (the ML link)
PyTorch Implementation
With the plain-Python intuition in hand, here is the vectorised PyTorch version of the flux integral. We let autograd build the tangent vectors and symbolically through the graph — no algebraic differentiation by us. The same idea scales to learnable surface parametrisations inside a neural network.
Test Your Understanding
Summary
We extended integration to 2-D curved sheets sitting in 3-D space. Two flavours, one idea: chop the parameter rectangle, evaluate, weight by area, sum, take the limit.
Key formulas
| Integral | Formula | What it measures |
|---|---|---|
| Surface area | Total area of | |
| Scalar surface integral | Density weighted by area | |
| Flux integral | Field flow through | |
| Graph | Area element for explicit graphs | |
| Sphere | Spherical-coords area element |
Key takeaways
- A parametric surface turns a flat rectangle into a curved sheet in .
- The cross product carries both the local normal direction and the area scale.
- Scalar surface integrals add up a density. Mass, average value, surface area — all the same recipe with different .
- Flux integrals project the field onto the surface normal and accumulate. Orientation is part of the data — flip it and the sign flips.
- The same algebra is the engine of Maxwell's equations, fluid mass-balance, and the change-of-variables formula in normalising flows.
- Surface integrals are one side of two great theorems: Stokes (next section) and the Divergence Theorem (section 19.9).
Coming next: Stokes' theorem ties the circulation of a vector field around a closed curve to the flux of its curl through any spanning surface — the 3-D upgrade of Green's theorem.