Arrows at every point: flows, the work done along a path, and fields where the path does not matter
Wind, water currents, gravity and electric force all attach an arrow to every point of space. A vector field is that collection of arrows. Release particles and they trace the flow; send an object along a path and the field helps or hinders it at every step, and adding up that help gives the work done, a line integral. For some fields the route makes no difference at all.
Choose a field, or type your own P and Q, and watch the particles flow. Click to drop a blob of dye, or switch the click to trace streamlines. Colour the background by divergence or curl to see where the flow spreads out and where it swirls.
Arrows all have the same length, so they show direction; colour shows |F| relative to its typical size in the window. Particles move at a speed proportional to |F| (scaled so the flow is visible), by midpoint steps capped near singularities, and respawn at random when they leave or age. Streamlines are traced with RK4 along F/|F| in both directions and stop at zeros, singularities and the edge. Divergence and curl are differentiated symbolically; colours are scaled to the 95th percentile in view.
A vector field in the plane assigns to each point (x, y) a vector F(x, y) = (P(x, y), Q(x, y)). Read as a velocity, it moves particles: a flow line or streamline is a curve r(t) with r′(t) = F(r(t)) at every moment, a system of two differential equations. Through every point where F is smooth and nonzero there is exactly one, and streamlines never cross. Points where F = 0 are equilibria, like the centre of the rotation or the middle of the saddle.
Two combinations of the partial derivatives describe the flow near a point:
div F = ∂P/∂x + ∂Q/∂y, curl F = ∂Q/∂x − ∂P/∂y
The divergence is the rate at which a tiny patch of fluid expands (positive at a source, negative at a sink), and the scalar curl is twice the rate at which it spins. The river field comes from a stream function ψ as F = (∂ψ/∂y, −∂ψ/∂x), which makes its divergence exactly zero: incompressible flow. The gradient of a hill has zero curl, and the pendulum’s phase plane has zero divergence, the planar case of Liouville’s theorem that Hamiltonian flows preserve area. These two derivatives are what Green’s theorem is built from.
Drag the four control points to shape the path, or choose a segment, circle or spiral, and play the bead. Green stretches are where the field pushes the bead along, red where it pushes back. The strip below adds it all up; reverse the direction and watch every sign flip.
The F arrow is drawn at a fixed scale relative to the field’s typical size in the window. The strip chart uses arc length s, so its area is ∫ F · T ds; the parameter of the curve does not matter, only its direction. The running total uses Simpson’s rule on 600 steps; the reference value uses 256 panels of 8-point Gauss–Legendre on F(r(t)) · r′(t) dt. For the vortex, a path through the origin passes through a singularity, and the integral there is meaningless.
Moving a small step dr through a force F does work F · dr: only the component of F along the motion counts. Writing dr = T ds, with T the unit tangent and ds a small piece of arc length, and adding up along the curve C gives
W = ∫_C F · dr = ∫_C F · T ds = ∫ₐᵇ F(r(t)) · r′(t) dt = ∫_C P dx + Q dy
The last form is how it is computed: parametrise C by r(t) for a ≤ t ≤ b, substitute, and do an ordinary integral in t. The answer does not depend on the parametrisation, only on the curve and its direction; going backwards replaces T by −T and flips the sign. For a closed curve one writes ∮.
For the rotation field F = (−y, x) round a circle of radius R, F is always tangent with length R, so the work is R times the circumference: 2πR², twice the area enclosed. That is no coincidence, and it is the seed of Green’s theorem.
Drag the two paths into any shapes you like. For a gradient field their works stay equal to φ(B) − φ(A). Then try the rotation, where they differ, and the vortex, where they agree until the paths straddle the origin.
Drag A, B and the coloured control points: each path is a cubic Bézier curve. Integrals use 256 panels of 8-point Gauss–Legendre. The curl is differentiated symbolically and also evaluated on a grid avoiding the origin. For the vortex, a path through the origin itself passes through the singularity and its integral is meaningless; keep the paths clear of the red dot.
If F = ∇φ for some function φ, the chain rule gives d/dt φ(r(t)) = ∇φ · r′(t), and integrating along the path proves the fundamental theorem for line integrals:
∫_C ∇φ · dr = φ(B) − φ(A)
So the work depends only on the endpoints, and is zero round every closed loop. Such fields are called conservative, because a particle moving under a conservative force conserves kinetic plus potential energy; physics usually writes the force as −∇U with U the potential energy. George Green coined the term “potential function” in his essay of 1828.
To test for a potential, note that mixed partial derivatives agree: if P = φ_x and Q = φ_y then ∂Q/∂x = ∂P/∂y, so a conservative field has zero curl. The converse holds on a simply connected region, one with no holes, and fails otherwise. The vortex F = (−y, x)/(x² + y²) has zero curl everywhere except the origin, where it is not defined. Near any point away from the origin it is the gradient of the polar angle θ, but θ cannot be defined continuously all the way round: going once round the origin it increases by 2π. That is exactly the work round any loop that encircles the origin once, however large or small, and it is why the vortex has no global potential. The domain has a hole, and the integral detects it. The same idea, counting how often a loop winds round a point, underlies Cauchy’s integral formula in complex analysis.
Spot a mistake or have an idea?