Unit 5
Vector Fields & Line Integrals
A vector field attaches an arrow to every point in space: the electric field around a charge, the magnetic field around a wire, the velocity of water in a pipe. This unit learns to integrate such a field along a path — which is what work, voltage and circulation all are — and then asks the question that organises all of electromagnetics: when does the answer depend only on where you start and end, and not on the route? Fields with that property have a potential; the electric field of static charges is one, and that is why voltage exists. Fields without it have curl. Two labs let you drag paths through fields and probe the curl and divergence at any point.
1 · Vector fields
| Field | Formula | Picture | Where it comes from |
|---|---|---|---|
| Uniform | \(\langle 1, 0\rangle\) | Parallel arrows, all equal | \(\mathbf{E}\) between capacitor plates; gravity near the ground |
| Radial | \(\langle x, y\rangle\) | Arrows away from the origin, growing with distance | Position field; expansion |
| Inverse-square | \(\dfrac{\langle x, y, z\rangle}{(x^2+y^2+z^2)^{3/2}} = \dfrac{\hat{\mathbf r}}{r^2}\) | Radial, fading with distance | Coulomb's law: \(\mathbf{E}\) of a point charge; gravity of a mass |
| Rotational | \(\langle -y, x\rangle\) | Counterclockwise circles, faster farther out | Rigid rotation; \(\mathbf{v} = \boldsymbol\omega\times\mathbf{r}\) |
| Vortex | \(\dfrac{\langle -y, x\rangle}{x^2+y^2}\) | Circles, slower farther out | \(\mathbf{B}\) around a straight wire (Ampère); bathtub drain |
| Gradient field | \(\nabla f\) | Perpendicular to the contours of \(f\) | \(\mathbf{E} = -\nabla V\); heat flow \(-k\nabla T\) |
A field of the form \(\mathbf{F} = \nabla f\) is called a gradient field or conservative field, and \(f\) is its potential function. Deciding whether a given field is one of these is the main business of Sections 3 and 4.
2 · Line integrals
Of a scalar function — mass of a wire
Of a vector field — work
- Parametrise \(C\): \(\mathbf{r}(t)\), \(a\le t\le b\), in the stated direction. Segment from \(A\) to \(B\): \(\mathbf{r}(t) = A + t(B - A)\), \(0\le t\le1\). Circle: \(\langle a\cos t, a\sin t\rangle\). Graph \(y = g(x)\): \(\langle t, g(t)\rangle\).
- Substitute into \(\mathbf{F}\) so it becomes a function of \(t\).
- Dot with \(\mathbf{r}'(t)\) and integrate from \(a\) to \(b\).
A piecewise path (say two sides of a triangle) is the sum of the integrals over the pieces — parametrise each separately.
The potential difference between two points is \(V_B - V_A = -\int_A^B\mathbf{E}\cdot d\mathbf{r}\) — the work per unit charge done against the field. When \(\mathbf{E}\) is conservative (Section 3) this depends only on \(A\) and \(B\), which is why a voltmeter can report a single number. The electromotive force around a closed loop is \(\mathcal{E} = \oint\mathbf{E}\cdot d\mathbf{r}\); it is zero for electrostatic fields and nonzero for the induced fields of Faraday's law.
Work along a path through a field
Choose a field and a path, then drag the endpoints. The integral \(\int_C\mathbf{F}\cdot d\mathbf{r}\) is computed numerically as you move; the graph on the right shows \(\mathbf{F}\cdot\mathbf{T}\) along the path, and the shaded area is the work. The experiment to run: pick a conservative field, keep \(A\) and \(B\) fixed, and switch between the straight segment, the arc and the detour — the work does not change. Pick the shear or rotational field and it does. Then try the closed loops.
Drag \(A\) or \(B\). Arrows show the field; the orange path is \(C\) with its direction marked.
\(\mathbf{F}\cdot\mathbf{T}\) against arc length \(s\). Shaded area (sign included) is \(\int_C\mathbf{F}\cdot d\mathbf{r}\).
3 · The fundamental theorem for line integrals
For a field defined on an open connected region, the following are equivalent — each one is a way to say conservative:
- \(\mathbf{F} = \nabla f\) for some potential \(f\).
- \(\int_C\mathbf{F}\cdot d\mathbf{r}\) is independent of path — it depends only on the endpoints.
- \(\oint_C\mathbf{F}\cdot d\mathbf{r} = 0\) for every closed curve \(C\).
The electrostatic field is conservative: \(\mathbf{E} = -\nabla V\). So \(\oint\mathbf{E}\cdot d\mathbf{r} = 0\) around any loop — go around a circuit and the voltage rises and drops sum to zero. KVL is not a circuit axiom; it is the fundamental theorem for line integrals applied to a conservative field. And it fails when there is a changing magnetic flux through the loop, because then \(\mathbf{E}\) is no longer conservative. Unit 6.
4 · Testing for a conservative field and finding the potential
The vortex \(\mathbf{F} = \langle -y, x\rangle/(x^2+y^2)\) satisfies \(P_y = Q_x\) everywhere it is defined — but the region excludes the origin, so it is not simply connected, and in fact \(\oint\mathbf{F}\cdot d\mathbf{r} = 2\pi\) around any loop enclosing the origin. Try it in the lab: Vortex field, Circle path. This field is \(\mathbf{B}\) around a wire; the \(2\pi\) is Ampère's law catching the current through the loop.
Finding \(f\) from \(\mathbf{F}\)
- Integrate \(P\) with respect to \(x\): \(f = \int P\,dx + g(y)\). The “constant” is an arbitrary function of \(y\).
- Differentiate that \(f\) with respect to \(y\) and set it equal to \(Q\). Solve for \(g'(y)\) — it must contain no \(x\) (if it does, the field is not conservative and you made an error in the test).
- Integrate \(g'\) to get \(g\), and write down \(f\). Add a constant if you like; it never matters.
In three variables, do the same with three steps: the “constant” after integrating in \(x\) is \(g(y,z)\), and after matching \(Q\) it becomes \(h(z)\).
5 · Green's theorem
Two ways to use it:
- Loop integral is ugly, region is simple: compute the double integral instead. \(\oint (y^3)\,dx + (x^3)\,dy\) around a circle becomes \(\iint 3(x^2 + y^2)\,dA\), which is trivial in polar.
- Area from a boundary walk: choose \(P, Q\) with \(Q_x - P_y = 1\):
\[ A = \oint_C x\,dy = -\oint_C y\,dx = \frac12\oint_C x\,dy - y\,dx \]A planimeter — the mechanical device surveyors used to measure map areas by tracing the outline — is this formula built in brass.
The flux form
Regions with holes are handled by cutting them into simply connected pieces; the cuts cancel, and the result is that the outer boundary goes counterclockwise while each inner boundary goes clockwise.
6 · Curl and divergence
Both Green's theorem integrands have names, and both generalise to 3D. They are the two things the del operator \(\nabla = \langle\partial_x, \partial_y, \partial_z\rangle\) can do to a vector field.
| Identity | In words | Consequence |
|---|---|---|
| \(\nabla\times(\nabla f) = \mathbf{0}\) | Gradients have no curl | Conservative ⇒ irrotational. The converse holds on simply connected regions. |
| \(\nabla\cdot(\nabla\times\mathbf{F}) = 0\) | Curls have no divergence | Since \(\nabla\cdot\mathbf{B} = 0\), \(\mathbf{B}\) can be written as a curl: \(\mathbf{B} = \nabla\times\mathbf{A}\), the vector potential. |
| \(\nabla\cdot(\nabla f) = \nabla^2 f\) | The Laplacian | \(\nabla^2 V = -\rho/\varepsilon_0\): Poisson's equation, the master equation of electrostatics. |
| \(\nabla\cdot(f\mathbf{F}) = f\,\nabla\cdot\mathbf{F} + \nabla f\cdot\mathbf{F}\) | Product rule | Used constantly in deriving energy-conservation statements. |
Divergence & curl probe
Drag the probe anywhere in the field. The small circle around it measures two things numerically: the net outward flux through the circle (divided by its area, this approaches \(\nabla\cdot\mathbf{F}\)) and the circulation around it (divided by its area, this approaches the curl). The paddle wheel spins at the rate the curl predicts. Shrink the circle and watch the estimates converge to the analytic values. The vortex field is the one to think about: the wheel does not turn anywhere — except that a circle around the origin still has circulation \(2\pi\).
Drag the probe. Green arrows: outward component of \(\mathbf{F}\) on the circle (flux). Violet: tangential component (circulation).
7 · Worked examples
1. Work along a parabola, computed directly
Find \(\int_C \mathbf{F}\cdot d\mathbf{r}\) for \(\mathbf{F} = \langle xy, y^2\rangle\) along \(y = x^2\) from \((0,0)\) to \((1,1)\).
Parametrise: \(\mathbf{r}(t) = \langle t, t^2\rangle\), \(0\le t\le1\), so \(\mathbf{r}'(t) = \langle 1, 2t\rangle\).
Is it conservative? \(P_y = x\), \(Q_x = 0\). Not equal, so no — and the answer along the straight line \(\langle t, t\rangle\) is \(\int_0^1 (t^2 + t^2)\,dt = 2/3 \ne 7/12\). Path matters here.
2. Find the potential, then use the fundamental theorem
Show \(\mathbf{F} = \langle 2xy + 3,\ x^2 - 4y\rangle\) is conservative, find \(f\), and evaluate \(\int_C\mathbf{F}\cdot d\mathbf{r}\) along any path from \((1, 0)\) to \((2, 3)\).
Test: \(P_y = 2x\), \(Q_x = 2x\). ✓ Defined everywhere, so conservative.
No parametrisation needed. Check by differentiating \(f\): \(f_x = 2xy + 3\) ✓, \(f_y = x^2 - 4y\) ✓.
3. Green's theorem turns a loop into a disk
Evaluate \(\oint_C (y^3 - \sin x)\,dx + (x^3 + e^{y^2})\,dy\), \(C\) the circle \(x^2+y^2 = 4\) counterclockwise.
Direct evaluation is hopeless (\(e^{y^2}\)). Green: \(Q_x - P_y = 3x^2 - 3y^2\cdot(-1)\)… careful: \(P = y^3 - \sin x\), so \(P_y = 3y^2\); \(Q = x^3 + e^{y^2}\), so \(Q_x = 3x^2\).
The \(\sin x\) and \(e^{y^2}\) terms never mattered — they are the \(x\)-only and \(y\)-only parts, which are conservative on their own and contribute zero around any loop. Only the \(y^3\,dx + x^3\,dy\) part could survive, and by symmetry it cancels too.
4. Area of an ellipse by Green's theorem
Find the area enclosed by \(x = a\cos t,\ y = b\sin t\).
The symmetric form \(\tfrac12\oint x\,dy - y\,dx\) is usually the cleanest because the cross terms combine into \(\cos^2 + \sin^2\). Compare doing this as \(\iint dA\) with Cartesian limits involving \(\sqrt{1 - x^2/a^2}\).
5. Curl and divergence of a 3D field
For \(\mathbf{F} = \langle xz,\ xyz,\ -y^2\rangle\) find \(\nabla\cdot\mathbf{F}\) and \(\nabla\times\mathbf{F}\).
Since the curl is not zero, \(\mathbf{F}\) is not conservative — no potential exists and its line integrals are path-dependent. Check the identity \(\nabla\cdot(\nabla\times\mathbf{F}) = 0\): \(\partial_x(-2y - xy) + \partial_y(x) + \partial_z(yz) = -y + 0 + y = 0\). ✓
6. Ampère's law from the vortex field
The magnetic field of a long straight wire carrying current \(I\) along the \(z\)-axis is \(\mathbf{B} = \dfrac{\mu_0 I}{2\pi}\dfrac{\langle -y, x, 0\rangle}{x^2+y^2}\). Compute \(\oint_C\mathbf{B}\cdot d\mathbf{r}\) around the circle of radius \(a\) centred on the wire, and show that \(\nabla\times\mathbf{B} = \mathbf{0}\) away from the wire.
Loop: \(\mathbf{r}(t) = \langle a\cos t, a\sin t, 0\rangle\), \(\mathbf{r}' = \langle -a\sin t, a\cos t, 0\rangle\). On the circle \(x^2 + y^2 = a^2\):
Independent of \(a\) — Ampère's law: the circulation of \(\mathbf{B}\) equals \(\mu_0\) times the enclosed current.
Curl: with \(P = -y/(x^2+y^2)\), \(Q = x/(x^2+y^2)\):
So \(Q_x - P_y = 0\) wherever the field is defined. Zero curl everywhere, yet nonzero circulation around the origin: the region has a hole (the wire), so the conservative test does not apply. All of the “curl” is concentrated in the wire itself — which is precisely the differential form of Ampère's law, \(\nabla\times\mathbf{B} = \mu_0\mathbf{J}\), with \(\mathbf{J}\) zero outside the wire.
Checklist
- I can parametrise segments, circles, and graphs, in the stated direction, and compute \(\int_C\mathbf{F}\cdot d\mathbf{r}\) as \(\int\mathbf{F}(\mathbf{r}(t))\cdot\mathbf{r}'(t)\,dt\).
- I know reversing the path flips the sign of a vector line integral but not a scalar one.
- I test \(P_y = Q_x\) (or \(\nabla\times\mathbf{F} = \mathbf{0}\)) and remember the simply-connected condition.
- I can construct a potential function and use \(f(B) - f(A)\) instead of parametrising.
- I can state Green's theorem with the correct orientation and use it in both directions, including for area.
- I can compute divergence and curl, and say what each measures physically.
- I know why KVL holds for electrostatics and why Ampère's law gives \(\mu_0 I\) regardless of the loop's size.