Back to Publications
Mathematics // Vector Calculus

Surface Integrals of Scalar Fields:
Area Distortion & Numerical Integration

An investigation into the mathematics of integrating scalar functions over curved 2D manifolds embedded in $\mathbb{R}^3$. We analyze parametric mappings, local area scaling via the Jacobian determinant, and real-time numerical approximations.

T
Tensor R&D Lab
July 17, 2026
12 Min Read

01/ Integration Over Curved Manifolds

In vector calculus and physical modeling, we frequently encounter the need to accumulate physical quantities across curved surfaces. Examples range from calculating the total electrostatic charge on a curved conductor to computing heat flux or estimating the mass of a shell with variable density. These problems are solved using surface integrals of scalar fields.

Unlike integration over flat Euclidean domains, integrating over a curved surface requires translating the coordinate space of a flat 2D parameter region onto a manifold embedded in 3D space. This process introduces local geometric distortion, requiring a correction factor known as the Jacobian scaling factor to reconcile the difference between the parameter space area and the actual physical area.

Interactive 3D Calculus Sandbox

Live WebAssembly Render (Rust + Macroquad + Egui)

Initializing scalar-fields.wasm...
WASM Hardware Accelerated

Live WebAssembly interactive render. Click inside canvas to interact.

02/ Mathematical Foundations

To perform integration over a curved 2D surface $S$ in $\mathbb{R}^3$, we define a vector-valued position function $\vec{r}(s, t)$ that maps a flat parameter coordinate space $T \subset \mathbb{R}^2$ to 3D space:

$$\vec{r}(s, t) = \begin{pmatrix} x(s, t) \\ y(s, t) \\ z(s, t) \end{pmatrix}, \quad (s, t) \in T$$

At any point on the surface, moving infinitesimally in the directions of the parameters $s$ or $t$ defines two tangent vectors along the surface grid curves:

$$\vec{t}_s = \frac{\partial \vec{r}}{\partial s} = \begin{pmatrix} \partial x / \partial s \\ \partial y / \partial s \\ \partial z / \partial s \end{pmatrix}, \quad \vec{t}_t = \frac{\partial \vec{r}}{\partial t} = \begin{pmatrix} \partial x / \partial t \\ \partial y / \partial t \\ \partial z / \partial t \end{pmatrix}$$

Taking the cross product of these tangent vectors yields the surface normal vector $\vec{n}(s, t)$, which is perpendicular to the tangent plane at that point:

$$\vec{n}(s, t) = \vec{t}_s \times \vec{t}_t = \begin{pmatrix} \frac{\partial y}{\partial s}\frac{\partial z}{\partial t} - \frac{\partial z}{\partial s}\frac{\partial y}{\partial t} \\ \frac{\partial z}{\partial s}\frac{\partial x}{\partial t} - \frac{\partial x}{\partial s}\frac{\partial z}{\partial t} \\ \frac{\partial x}{\partial s}\frac{\partial y}{\partial t} - \frac{\partial y}{\partial s}\frac{\partial x}{\partial t} \end{pmatrix}$$

03/ Local Area Distortion & the Jacobian

When mapping a flat grid $(ds \times dt)$ onto a curved manifold, the area is stretched, compressed, or tilted. For example, mapping a flat grid to a sphere maps the top parameter boundary line to a single point (the pole), compressing the area.

The magnitude of the normal vector represents the local area expansion factor, which serves as the <strong>Jacobian scaling factor</strong> $J(s, t)$. Geometrically, the area of the differential parallelogram spanned by $\vec{t}_s \, ds$ and $\vec{t}_t \, dt$ is:

$$dS = \|\vec{t}_s \times \vec{t}_t\| \, ds \, dt = J(s, t) \, ds \, dt$$

Using this relationship, we define the surface integral of a scalar field $f(x, y, z)$ over a parameterized surface $S$ as:

$$\iint_S f(x, y, z) \, dS = \iint_T f\big(\vec{r}(s, t)\big) \, \left\| \frac{\partial \vec{r}}{\partial s} \times \frac{\partial \vec{r}}{\partial t} \right\| \, ds \, dt$$

04/ Numerical Calculus & Grid Discretization

To compute surface integrals programmatically over arbitrary shapes, we subdivide the parameter space $T$ into a grid of cells of size $\Delta s \times \Delta t$. For each cell centered at $(s_i, t_j)$, the simulation evaluates $\vec{t}_s$ and $\vec{t}_t$ using central finite differences:

$$\frac{\partial \vec{r}}{\partial s} \approx \frac{\vec{r}(s + \epsilon, t) - \vec{r}(s - \epsilon, t)}{2\epsilon}, \quad \epsilon = 10^{-3}$$

The sum across all discrete cells calculates the exact surface integral:

$$\iint_S f(x, y, z) \, dS \approx \sum_{i} \sum_{j} f\big(\vec{r}(s_i, t_j)\big) \, J_{i, j} \, \Delta s \, \Delta t$$