📊 Section 1 — Interactive Simulation
Choose a vector field $\vec F$ and a curve $C$. Watch a particle traverse $C$, accumulating work $\int_C \vec F\cdot d\vec r$ in real time. Swap to scalar mode to see arclength integrals, or flux mode for the 2D flux $\int_C \vec F\cdot \vec n\,ds$.
Animate
Vector Field F(x, y)
Curve C
Scalar f (arclength mode)
Surface (surface mode)
Parameters
Display
Tips
• Try rotation field on circle — work = $2\pi$ (perfectly tangential).
• Try gradient field on any closed curve — work = $0$ (path-independence).
• Switch to flux mode: rotation through closed curve = 0; radial = enclosed area · const.
• Increase $n$ — the discrete sum converges to the exact integral as $1/n^2$ (midpoint).
🪜 Section 2 — The Idea, Step by Step
From walking a windy trail to Maxwell's equations — building the line integral (and then the surface integral) one rung at a time, no symbols required to start.
Start — picture a windy trail. You hike a path and the wind keeps shifting. Sometimes it blows at your back and pushes you along; sometimes it cuts across the path and does nothing; sometimes it's right in your face and fights you. A line integral is just the running total of how much the wind helped or fought you, added up step by step over the whole trail. That total is what physicists call the work done on you.
Build — name the pieces. The trail is the curve $C$. The wind is a vector field $\vec F$: an arrow attached to every point of the plane. On each little step $d\vec r$ along the trail, only the part of $\vec F$ pointing along your direction of travel counts — the sideways part is wasted. "Part along your direction" is exactly the dot product $\vec F\cdot d\vec r$. Add up every step and you get the line integral $\displaystyle\int_C \vec F\cdot d\vec r$.
One worked number
Let the wind be steady, $\vec F = (1, 0)$ — blowing east with strength $1$ — and walk straight east from $(0,0)$ to $(3,0)$. Every step the wind fully helps, so the total is $1 \times 3 = 3$.
Now walk the same distance north instead. The wind is sideways the entire way, helping not at all: the total is $0$. Same field, same distance — the direction of the path is what changed the answer.
Deepen — make it exact. To actually compute, describe the trail with a parameter $t$: a position $\vec r(t)$ with velocity $\vec r\,'(t)$. Then $d\vec r = \vec r\,'(t)\dd{t}$, and the line integral collapses into an ordinary one-variable integral, $\displaystyle\int_a^b \vec F(\vec r(t))\cdot\vec r\,'(t)\dd{t}$. Drop the dot product and weight instead by the speed $\norm{\vec r\,'(t)}$ and you get the scalar line integral $\int_C f\dd{s}$ — the area of a curtain hanging under a fence of height $f$ along $C$. Step up one dimension: sweep a surface with two parameters $u, v$; each tiny patch has area $\norm{\vec r_u\times\vec r_v}\dd{u}\dd{v}$, since the cross product measures exactly how much the map stretches area. Dot $\vec F$ with that patch's normal and you have flux — the language of Gauss's and Stokes' theorems.
The sliders map straight onto this story: n sets how many steps the sum uses (the readout's $|\text{error}|$ shrinks like $1/n^2$ as you raise it), while the field and curve menus choose $\vec F$ and $\vec r(t)$.
Try this in the sim above. (1) Pick the rotation field $(-y, x)$ on the circle — the wind is tangent to the path everywhere, so the work climbs steadily to $2\pi$. (2) Pick the gradient field $(2x, 2y)$ on any closed curve — the work returns exactly to $0$, the fingerprint of a conservative field. (3) Drag n from $10$ up toward $2000$ and watch the $|\text{error}|$ readout fall by about $100\times$ each time you multiply $n$ by $10$.
📐 Section 3 — Theory & Construction
Define line and surface integrals from Riemann sums on curves and surfaces, with parametrization and the all-important arclength / surface-area element.
If $C$ is a smooth curve in $\R^n$ parametrized by $\vec r:[a,b]\to\R^n$, and $\vec F:\R^n\to\R^n$ is continuous, then $$\int_C \vec F \cdot d\vec r \;=\; \int_a^b \vec F(\vec r(t)) \cdot \vec r\,'(t)\dd{t}.$$ The value depends on the curve and its orientation but not on the choice of parametrization (provided orientation is preserved).
Interpretation: work done by force $\vec F$ on a particle traversing $C$.
If $S$ is a smooth surface parametrized by $\vec r:D\to\R^3$ with $D\subset\R^2$, and $f:\R^3\to\R$ is continuous, then $$\iint_S f \dd{S} \;=\; \iint_D f(\vec r(u,v))\,\norm{\vec r_u\times\vec r_v}\dd{u}\dd{v}.$$ For a flux integral of $\vec F$, replace $f\dd{S}$ by $\vec F\cdot \vec n\dd{S} = \vec F\cdot(\vec r_u\times\vec r_v)\dd{u}\dd{v}$.
Symbol Table
| Symbol | Meaning | Type |
|---|---|---|
| $\vec r(t)$ | Parametrization of curve $C$ | $[a,b]\to\R^n$, $C^1$ |
| $\vec r\,'(t)$ | Velocity / tangent vector along $C$ | $\R^n$-valued |
| $\vec T$ | Unit tangent $\vec r\,'/\norm{\vec r\,'}$ | Unit vector |
| $\vec n$ | Unit normal — for 2D: $(T_y, -T_x)$ (outward) | Unit vector |
| $\dd{s}$ | Arclength element $\norm{\vec r\,'(t)}\dd{t}$ | Scalar 1-form |
| $d\vec r$ | Vector line element $\vec r\,'(t)\dd{t}$ | Vector 1-form |
| $\vec r(u,v)$ | Surface parametrization $D\subset\R^2 \to \R^3$ | $C^1$ map |
| $\vec r_u\times\vec r_v$ | Surface normal (not unit), magnitude = area element | Vector in $\R^3$ |
| $\dd{S}$ | Surface area element $\norm{\vec r_u\times\vec r_v}\dd{u}\dd{v}$ | Scalar 2-form |
Derivation — From Riemann Sum to Line Integral
Simulation ↔ Symbol Mapping
tab ∫ F·dr | vector line integral; readout = work = $\int_C \vec F\cdot d\vec r$ |
tab ∫ f ds | scalar line integral; readout = $\int_C f\dd{s}$ (length-weighted average) |
tab flux | 2D flux $\int_C \vec F\cdot \vec n\dd{s}$ — total normal-component flow across $C$ |
| green arrow on particle | unit tangent $\vec T(t)$ |
| red arrow on particle | outward normal $\vec n(t)$ (2D) |
| blue arrows in plane | vector field $\vec F$ sampled on a grid |
readout F·T̂ | tangential component — integrand of work integral |
graph accumulated | running integral $\int_a^t\vec F\cdot\vec r\,'\dd{s}$ as particle moves |
slider n | number of midpoint subintervals; error decays as $O(1/n^2)$ |
Worked Example — Work in a Rotational Field
$\vec F(x,y) = (-y, x)$; $C$ = unit circle $\vec r(t) = (\cos t, \sin t)$, $t\in[0,2\pi]$, CCW.
$\vec r\,'(t) = (-\sin t, \cos t)$. $\vec F(\vec r(t)) = (-\sin t, \cos t)$. Dot product $= \sin^2 t + \cos^2 t = 1$.
$\int_C\vec F\cdot d\vec r = \int_0^{2\pi} 1\dd{t} = 2\pi$. The field is exactly tangent to the circle everywhere — every infinitesimal step "pushes" full force along the motion, so work accumulates linearly. $\boxed{W = 2\pi.}$
Worked Example — Path-Independence in a Gradient Field
Show $\vec F = (2x, 2y) = \nabla(x^2+y^2)$ has $\int_{C_1}\vec F\cdot d\vec r = \int_{C_2}\vec F\cdot d\vec r$ for any two curves $C_1, C_2$ from $(0,0)$ to $(1,1)$.
By the Fundamental Theorem for line integrals, $\int_C\nabla\phi\cdot d\vec r = \phi(B) - \phi(A)$ for any path from $A$ to $B$. Here $\phi(x,y) = x^2+y^2$, so $\int_C \vec F\cdot d\vec r = \phi(1,1)-\phi(0,0) = 2-0 = 2$, regardless of path.
Conversely, on any closed curve, $\oint_C\nabla\phi\cdot d\vec r = 0$. $\boxed{\text{Path-independence} \iff \text{conservative} \iff \vec F = \nabla\phi.}$
Worked Example — Surface Area of a Sphere
Parametrize the unit sphere by spherical coords: $\vec r(\phi,\theta) = (\sin\phi\cos\theta, \sin\phi\sin\theta, \cos\phi)$, $\phi\in[0,\pi]$, $\theta\in[0,2\pi]$.
$\vec r_\phi = (\cos\phi\cos\theta, \cos\phi\sin\theta, -\sin\phi)$, $\vec r_\theta = (-\sin\phi\sin\theta, \sin\phi\cos\theta, 0)$. Cross product magnitude: $\norm{\vec r_\phi\times\vec r_\theta} = \sin\phi$.
$\iint_S 1\dd{S} = \int_0^{2\pi}\!\int_0^\pi \sin\phi\dd\phi\dd\theta = 2\pi\cdot 2 = 4\pi$. $\boxed{\text{Area of unit sphere} = 4\pi.}$
❓ Section 4 — Frequently Asked Questions
The scalar line integral $\int_C f\dd{s}$ uses the unsigned arclength element $\dd{s} = \norm{\vec r\,'(t)}\dd{t}$. Reversing the curve's orientation does not change its value, because arclength is unsigned. Interpretation: a length-weighted average of $f$ on $C$ — or, geometrically, the area of the curtain rising vertically above $C$ to height $f$.
The vector line integral $\int_C\vec F\cdot d\vec r$ uses the directed element $d\vec r = \vec r\,'(t)\dd{t}$. Reversing orientation flips its sign, because $\vec r\,'(t)$ reverses direction. Interpretation: work done by $\vec F$, or signed circulation. Only the component of $\vec F$ tangent to $C$ contributes — perpendicular components cancel out point-by-point.
Key takeaway: $\dd{s}$ is unsigned (orientation-blind), $d\vec r$ is signed (orientation-sensitive). Scalar integrals measure size; vector integrals measure flow along.For a closed curve $C$ (e.g.\ the unit circle), $\oint_C\vec F\cdot d\vec r = 0$ if and only if $\vec F$ is conservative on a simply connected region containing $C$. Try the gradient field $(2x, 2y) = \nabla(x^2+y^2)$ — the readout sits at $0$ throughout the loop. Try the rotation field $(-y, x)$ — circulation grows to $2\pi$. Try the sink $(-x,-y)/(x^2+y^2)$ in work mode — its circulation is $0$, because the sink is actually conservative on $\R^2\setminus\{0\}$ (it has the single-valued potential $-\ln r$), so wrapping the origin doesn't help; switch that same sink to flux mode and you get $-2\pi$ (all the flow points inward through the circle). The field whose circulation the origin-singularity really does force to be nonzero is the vortex $(-y, x)/(x^2+y^2)$: $\oint_C\vec F\cdot d\vec r = 2\pi$ even though its curl vanishes everywhere off the origin — that is the genuine "not simply connected" effect.
Operationally: zero circulation on every closed loop ⇔ $\vec F = \nabla\phi$ ⇔ path-independent integrals between any two endpoints. The simulation lets you discover this empirically: try different starting/ending arcs and watch the readout.
Key takeaway: closed-loop circulation = 0 ⇔ conservative ⇔ admits a potential. Singularities can break this even when curl looks zero locally.Mechanics: work $W = \int_C\vec F\cdot d\vec r$, potential energy difference $\Delta U = -W$ for conservative forces. Electromagnetism: the four Maxwell equations are integral identities about line and surface integrals: $\oint_C\vec E\cdot d\vec r = -\frac{d}{dt}\iint_S\vec B\cdot d\vec S$ (Faraday's law); $\oint_C\vec B\cdot d\vec r = \mu_0\iint_S \vec J\cdot d\vec S + \mu_0\varepsilon_0 \frac{d}{dt}\iint_S\vec E\cdot d\vec S$ (Ampère–Maxwell); $\iint_{\partial V}\vec E\cdot d\vec S = Q_{\text{enc}}/\varepsilon_0$ (Gauss). Fluid dynamics: circulation around a curve = $\oint_C\vec v\cdot d\vec r$ — Kelvin's theorem says it's conserved for ideal fluids; flux $\iint_S\vec v\cdot d\vec S$ = mass-flow rate through $S$. Thermodynamics: heat absorbed in a Carnot cycle is a line integral in PV-space — and the fact that it's not path-independent is exactly why heat isn't a state function.
Key takeaway: every conservation law in classical physics has a line- or surface-integral formulation. Maxwell's equations are these formulations.Suppose $\vec r:[a,b]\to\R^n$ and $\vec s:[c,d]\to\R^n$ both trace out $C$ with the same orientation. Then there's a $C^1$ bijection $\phi:[c,d]\to[a,b]$, $\phi'>0$, with $\vec s(u) = \vec r(\phi(u))$. By the chain rule, $\vec s\,'(u) = \vec r\,'(\phi(u))\cdot\phi'(u)$. Substituting: $\int_c^d \vec F(\vec s(u))\cdot\vec s\,'(u)\dd{u} = \int_c^d \vec F(\vec r(\phi(u)))\cdot\vec r\,'(\phi(u))\phi'(u)\dd{u}$.
Now substitute $t = \phi(u)$, $\dd{t} = \phi'(u)\dd{u}$. Limits transform $c\to a$, $d\to b$. The integral becomes $\int_a^b\vec F(\vec r(t))\cdot\vec r\,'(t)\dd{t}$ — exactly the original.
If $\phi'<0$ (reverses orientation), the limits swap, picking up a sign — and that's the meaning of "flipping orientation flips the sign". For scalar integrals with $\dd{s} = \norm{\vec r\,'}\dd{t}$, the $\phi'$ appears inside an absolute value (via the norm), so the sign always works out — orientation-blindness emerges naturally.
Key takeaway: parametrization-independence is a chain-rule + substitution computation. The line integral depends on the curve as a geometric object, not on how you "walk" it.Pick a parametrization $\vec r(t)$, $t\in[a,b]$. The integral becomes a 1D Riemann integral of $g(t) := \vec F(\vec r(t))\cdot\vec r\,'(t)$ (or $f(\vec r(t))\norm{\vec r\,'(t)}$ for scalar). Apply standard 1D quadrature: midpoint (2nd-order), Simpson (4th-order), or adaptive Gauss-Legendre.
Practical tip: if the parametrization makes $\norm{\vec r\,'(t)}$ wildly non-uniform (e.g.\ a spiral that slows then speeds up), reparametrize by arclength first — then $\norm{\vec r\,'(s)} = 1$ and standard quadrature gives uniform sampling along $C$. Otherwise you over-sample slow parts and under-sample fast parts.
For surface integrals: parametrize $\vec r(u,v)$, integrate $f(\vec r)\norm{\vec r_u\times\vec r_v}$ over $D$ by 2D quadrature (Simpson, Gauss product, or for irregular $D$ use Monte Carlo). The cross-product magnitude is the surface element — never drop it.
Key takeaway: line/surface integrals reduce to 1D/2D Riemann integrals via parametrization. Use standard quadrature; never forget the $\norm{\vec r\,'}$ or $\norm{\vec r_u\times\vec r_v}$ factor.A vector field $\vec F = (P, Q, R)$ on $\R^3$ corresponds to a 1-form $\omega = P\dd{x} + Q\dd{y} + R\dd{z}$. The line integral $\int_C\vec F\cdot d\vec r$ is exactly $\int_C\omega$ — the integral of the form over the oriented chain $C$. Stokes' theorem in the differential-form language is a single equation: $\int_{\partial M}\omega = \int_M d\omega$ for an oriented manifold $M$ and form $\omega$ — and it specializes to Green's theorem, Stokes' theorem, and the divergence theorem depending on what $M$ and $\omega$ are.
Conservative ⇔ $\vec F = \nabla\phi$ ⇔ $\omega = d\phi$ (i.e.\ $\omega$ is exact). On simply connected domains, $d\omega = 0$ ⇔ $\omega$ is exact (Poincaré lemma). The rotational field $(-y/(x^2+y^2), x/(x^2+y^2))$ on $\R^2\setminus\{0\}$ has $d\omega = 0$ but isn't exact — it has period $2\pi$ around the origin. This obstruction is the first de Rham cohomology of the punctured plane.
Key takeaway: line and surface integrals are integrals of differential forms over chains. Stokes' theorem unifies them all. Failure of "closed = exact" measures the topology of the domain.A surface parametrization $\vec r:D\to\R^3$ maps a tiny rectangle $[u, u+\Delta u]\times[v, v+\Delta v]$ to a (slightly curved) patch on the surface. To first order, this patch is a parallelogram spanned by the vectors $\Delta u\cdot\vec r_u$ and $\Delta v\cdot\vec r_v$. The area of a parallelogram spanned by two 3D vectors $\vec a$ and $\vec b$ is exactly $\norm{\vec a\times\vec b}$ — that's the geometric definition of the cross product magnitude.
So the patch has area $\norm{\vec r_u\times\vec r_v}\Delta u\Delta v$. Summing over the partition and taking the limit gives $\iint_S f\dd{S} = \iint_D f\norm{\vec r_u\times\vec r_v}\dd{u}\dd{v}$.
The direction $\vec r_u\times\vec r_v$ (not just magnitude) is the unit normal scaled by area — when we take its dot product with $\vec F$ we get flux: signed normal-component times patch area. Reversing $u,v$ order flips the normal (and the flux sign) — that's surface orientation.
Key takeaway: $\norm{\vec r_u\times\vec r_v}\dd{u}\dd{v}$ is the area of the infinitesimal parallelogram on the surface; $\vec r_u\times\vec r_v$ also gives the oriented normal needed for flux.