Vector calculus

The mathematical language of electromagnetism

Foundation

Why this page exists

The equations of electromagnetism — and consequently of every model in the Lirion site — are written in the language of vector calculus. The symbols $\nabla f$, $\nabla \cdot \mathbf{F}$, and $\nabla \times \mathbf{F}$ appear everywhere from Maxwell’s equations to the telegrapher’s equations to the assembly of the bus admittance matrix.

For readers who have not seen these operators recently, the symbols can look intimidating: a triangle with a dot, a triangle with a cross, a mysterious “$\nabla$” that seems to be both an operator and a vector at once. This page exists to demystify them.

What follows is not a textbook. It is an operational refresher: enough to read the rest of the Lirion foundations without confusion, with the geometric intuition needed to understand — not merely manipulate — what each symbol does. For readers wanting deeper treatment, the Further reading section at the end recommends the standard texts.

The approach is the one used throughout this site: each concept is given a rigorous definition, a geometric picture, and at least one concrete example drawn from physics or engineering. Where useful, historical context is included — vector calculus is younger than you might think (most of its modern notation dates from the 1880s) and the story of how it emerged from a fierce nineteenth-century debate is part of why the formalism looks the way it does today.

Scalar and vector fields

Before introducing the operators themselves, two definitions.

A scalar field is a function that assigns a single number to every point in space. The temperature in a room, $T(x, y, z)$, is a scalar field: at each point, there is one temperature. So is the electric potential $V(x, y, z)$, the pressure in a fluid $p(x, y, z)$, or — to take an example more directly relevant to power systems — the voltage magnitude $|V|$ across a transmission network when we regard each bus as a point in some abstract topology.

A vector field assigns a vector (a quantity with direction and magnitude) to every point in space. The electric field $\mathbf{E}(x, y, z)$ is a vector field: at each point, there is both a magnitude and a direction (which way a positive test charge would be pushed). Wind velocity $\mathbf{v}(x, y, z)$, magnetic flux density $\mathbf{B}(x, y, z)$, and current density $\mathbf{J}(x, y, z)$ are all vector fields.

The job of vector calculus is to describe how these fields vary in space — how they grow, how they spread, how they swirl — using a small set of universal operators.

The dot product ($\mathbf{a} \cdot \mathbf{b}$)

Definition

Given two vectors $\mathbf{a} = (a_1, a_2, a_3)$ and $\mathbf{b} = (b_1, b_2, b_3)$, their dot product (also called the scalar product or inner product) is the number

$$\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.$$

Geometric meaning

Equivalently, the dot product is the projection of one vector onto the other, multiplied by the length of the second:

$$\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\theta,$$

where $\theta$ is the angle between the two vectors. The dot product is maximised when $\mathbf{a}$ and $\mathbf{b}$ point in the same direction ($\theta = 0$, $\cos\theta = 1$); it is zero when perpendicular ($\theta = 90°$); it is negative when they point in opposing directions.

Why it matters

The dot product expresses work, flux, power, and projection. The work done by a force $\mathbf{F}$ through a displacement $\mathbf{d}$ is $W = \mathbf{F} \cdot \mathbf{d}$. The electric flux through a surface is $\Phi = \int \mathbf{E} \cdot d\mathbf{A}$. In power systems, the active power is $P = \text{Re}(\mathbf{V} \mathbf{I}^*)$ in phasor notation.

Example

A 10-newton force at 30° above the floor moves a box 5 metres horizontally. The work done is

$$W = (10)(5)\cos(30°) = 50 \times 0.866 \approx 43.3 \text{ J}.$$

The vertical component of the force does no work because the box’s displacement is purely horizontal.

The cross product ($\mathbf{a} \times \mathbf{b}$)

Definition

Given two vectors in three-dimensional space, their cross product (also called the vector product) is the vector

$$\mathbf{a} \times \mathbf{b} = (a_2 b_3 - a_3 b_2,\ a_3 b_1 - a_1 b_3,\ a_1 b_2 - a_2 b_1).$$

Geometric meaning

The cross product produces a vector perpendicular to both $\mathbf{a}$ and $\mathbf{b}$, with magnitude

$$|\mathbf{a} \times \mathbf{b}| = |\mathbf{a}||\mathbf{b}|\sin\theta$$

equal to the area of the parallelogram spanned by the two vectors. The direction follows the right-hand rule: point the fingers of the right hand in the direction of $\mathbf{a}$, curl them toward $\mathbf{b}$, and the thumb gives the direction of $\mathbf{a} \times \mathbf{b}$.

The cross product is zero when $\mathbf{a}$ and $\mathbf{b}$ are parallel, and anticommutative: $\mathbf{a} \times \mathbf{b} = -\mathbf{b} \times \mathbf{a}$.

Why it matters

The cross product expresses torque, angular momentum, the magnetic force on a moving charge, and the direction of wave propagation. The Lorentz force on a charge $q$ moving with velocity $\mathbf{v}$ in magnetic field $\mathbf{B}$ is $\mathbf{F} = q\mathbf{v} \times \mathbf{B}$ — a force perpendicular to both, causing electrons in a generator to be deflected and produce current. The curl operator (met shortly) is built from cross products.

Example

A wire carrying current $I$ in the $\hat{\mathbf{x}}$ direction sits in a field $\mathbf{B} = B_0 \hat{\mathbf{y}}$. The force per unit length on the wire is

$$\frac{\mathbf{F}}{\ell} = I \hat{\mathbf{x}} \times B_0 \hat{\mathbf{y}} = I B_0 \hat{\mathbf{z}}.$$

The force points upward, out of the $x$–$y$ plane. This is the basic principle of every electric motor.

Partial derivatives

Before introducing the differential operators, a brief note on notation.

The partial derivative $\partial f / \partial x$ means: differentiate $f(x, y, z)$ with respect to $x$, treating $y$ and $z$ as constants. The symbol $\partial$ signals “partial”: we are not asking how $f$ changes overall, but how it changes in the $x$-direction only.

For example, if $f(x, y, z) = x^2 y + z$, then

$$\frac{\partial f}{\partial x} = 2xy, \quad \frac{\partial f}{\partial y} = x^2, \quad \frac{\partial f}{\partial z} = 1.$$

Partial derivatives capture how a function varies in each independent direction separately. Vector calculus is the art of combining partial derivatives into operators that describe how fields vary in space.

The nabla operator ($\nabla$)

The symbol $\nabla$ — pronounced “del” or “nabla” — is a vector of partial derivatives:

$$\nabla = \left(\frac{\partial}{\partial x}, \frac{\partial}{\partial y}, \frac{\partial}{\partial z}\right).$$

It is not a vector in the usual sense — there are no numerical components — but rather a vector-valued differential operator: an object that, when “multiplied” against a field, produces a derivative. The three operations of vector calculus arise from three different ways of multiplying $\nabla$ with a field:

OperationNotationActs onProduces
Gradient$\nabla f$scalar field $f$vector field
Divergence$\nabla \cdot \mathbf{F}$vector field $\mathbf{F}$scalar field
Curl$\nabla \times \mathbf{F}$vector field $\mathbf{F}$vector field

The gradient ($\nabla f$)

Definition

Given a scalar field $f(x, y, z)$, its gradient is the vector field

$$\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right).$$

At every point in space, the gradient is a vector built from the partial derivatives of $f$ in each coordinate direction.

Geometric intuition

The gradient points in the direction of steepest increase of $f$, with magnitude equal to the rate of change in that direction. Imagine a hilly landscape with $f(x, y)$ as elevation. At any point, $\nabla f$ points “uphill” — where the slope is steepest. Conversely, $-\nabla f$ points “downhill”, the direction a ball rolls. The gradient is always perpendicular to contour lines (lines of constant $f$).

Example: temperature

In a room with a heater in one corner, the temperature $T(x, y, z)$ decreases as you move away. The gradient $\nabla T$ is a vector pointing toward the heater. Heat flow, by Fourier’s law, is $\mathbf{q} = -k \nabla T$: heat flows from hot to cold.

Example: electric field from potential

In electrostatics, the electric field is the negative gradient of the electric potential:

$$\mathbf{E} = -\nabla V.$$

The minus sign reflects that positive charges accelerate toward lower potential. Around a point charge $q$, the potential is $V = q/(4\pi\varepsilon_0 r)$ and its negative gradient gives Coulomb’s law $\mathbf{E} = q\hat{\mathbf{r}}/(4\pi\varepsilon_0 r^2)$ — the inverse-square radial field.

The divergence ($\nabla \cdot \mathbf{F}$)

Definition

Given a vector field $\mathbf{F}(x, y, z)$ with components $(F_1, F_2, F_3)$, its divergence is the scalar field

$$\nabla \cdot \mathbf{F} = \frac{\partial F_1}{\partial x} + \frac{\partial F_2}{\partial y} + \frac{\partial F_3}{\partial z}.$$

Formally, this is the dot product of the operator $\nabla$ with the vector $\mathbf{F}$.

Geometric intuition

The divergence measures how much a vector field spreads out (or converges in) at a point. Imagine $\mathbf{F}$ as the velocity of a fluid:

  • Where the divergence is positive, fluid is being created — the point acts as a source.
  • Where the divergence is negative, fluid is being destroyed — the point acts as a sink.
  • Where the divergence is zero, the field is solenoidal. Field lines neither begin nor end at such points.

Example: source and sink

The vector field $\mathbf{F} = (x, y, z)$ has constant divergence $\nabla \cdot \mathbf{F} = 3$ everywhere — the field spreads outward like an explosion. The field $\mathbf{F} = (-x, -y, -z)$ has divergence $-3$ everywhere — flow converges inward, like an implosion.

Example: Gauss's law

The first of Maxwell’s equations, $\nabla \cdot \mathbf{D} = \rho_f$, says: the divergence of the electric displacement field at any point equals the free charge density. Where there is positive charge, the field spreads outward. Where there is no charge, field lines pass through without terminating. This is the precise statement of “charges are sources of electric fields.”

The curl ($\nabla \times \mathbf{F}$)

Definition

Given a vector field $\mathbf{F}$, its curl is the vector field

$$\nabla \times \mathbf{F} = \left(\frac{\partial F_3}{\partial y} - \frac{\partial F_2}{\partial z},\ \frac{\partial F_1}{\partial z} - \frac{\partial F_3}{\partial x},\ \frac{\partial F_2}{\partial x} - \frac{\partial F_1}{\partial y}\right).$$

Formally, this is the cross product of $\nabla$ with $\mathbf{F}$.

Geometric intuition

The curl measures how much a vector field rotates around a point. Imagine $\mathbf{F}$ as fluid velocity, and place a tiny paddle wheel at some point. Where the curl is non-zero, the paddle wheel rotates — the curl’s direction gives the axis (right-hand rule) and its magnitude equals twice the angular velocity. Where the curl is zero, the paddle wheel does not rotate; such a field is called irrotational.

A subtle point: a field can be swirling globally yet have zero curl locally (rigid rotation), and a field that looks straight can have non-zero curl if there is shear.

Example: rotating fluid

Consider water on a spinning turntable with angular velocity $\boldsymbol{\omega}$. The velocity field is $\mathbf{v} = \boldsymbol{\omega} \times \mathbf{r}$. Its curl is

$$\nabla \times \mathbf{v} = 2\boldsymbol{\omega}$$

— twice the angular velocity. Every paddle wheel placed in the water rotates at $\boldsymbol{\omega}$ around its own axis.

Example: magnetic field around a wire

A current $I$ in a long straight wire produces a magnetic field that wraps in concentric circles, with magnitude $B = \mu_0 I / (2\pi r)$. Away from the wire, $\nabla \times \mathbf{B} = 0$ even though the field looks swirly. On the wire itself, Ampère’s law gives $\nabla \times \mathbf{H} = \mathbf{J}_f$: the curl of the magnetic field is the current density.

Example: Faraday's law

The third of Maxwell’s equations, $\nabla \times \mathbf{E} = -\partial \mathbf{B} / \partial t$, says: a time-varying magnetic field induces a curling electric field. This is the principle of every generator and transformer: a changing magnetic flux produces a swirling electric field that pushes charges around a circuit.

The integral theorems (briefly)

The three differential operators come with two famous integral theorems that connect them to surfaces and volumes. We mention them here only for completeness; their derivations belong in a full textbook.

The divergence theorem (Gauss)

For any vector field $\mathbf{F}$ and any closed surface $S$ enclosing a volume $V$:

$$\iiint_V (\nabla \cdot \mathbf{F})\, dV = \oiint_S \mathbf{F} \cdot d\mathbf{A}.$$

The total divergence of $\mathbf{F}$ inside a volume equals the net flux of $\mathbf{F}$ out through the boundary. This converts the local form of Gauss’s law ($\nabla \cdot \mathbf{D} = \rho_f$) into the integral form ($\oiint \mathbf{D} \cdot d\mathbf{A} = Q_{\text{enclosed}}$) familiar from introductory physics.

Stokes' theorem

For any vector field $\mathbf{F}$ and any open surface $S$ bounded by a closed curve $C$:

$$\iint_S (\nabla \times \mathbf{F}) \cdot d\mathbf{A} = \oint_C \mathbf{F} \cdot d\boldsymbol{\ell}.$$

The integral of the curl over a surface equals the line integral of $\mathbf{F}$ around the boundary. This converts the local forms of Faraday’s law and Ampère’s law into their integral forms. The two theorems explain why Maxwell’s equations come in two equivalent forms — differential and integral.

Summary table

For quick reference, the operators and what they do. Every equation in the Maxwell foundation, and every subsequent foundation that uses field theory, is built from these five operations and nothing more.

OperatorActs onReturnsGeometric meaning
$\nabla f$scalar fieldvector fieldDirection of steepest increase of $f$
$\nabla \cdot \mathbf{F}$vector fieldscalar fieldNet outflow of $\mathbf{F}$ from a point
$\nabla \times \mathbf{F}$vector fieldvector fieldLocal rotation of $\mathbf{F}$ around a point
$\mathbf{a} \cdot \mathbf{b}$two vectorsscalarProjection of one onto the other
$\mathbf{a} \times \mathbf{b}$two vectorsvectorPerpendicular vector, area of parallelogram

Further reading

Schey, H. M. (1996). Div, Grad, Curl, and All That: An Informal Text on Vector Calculus (3rd ed.). W. W. Norton & Company. — The warmest, most accessible introduction. Recommended for readers who want a clear geometric picture before tackling formal treatments.

Griffiths, D. J. (2017). Introduction to Electrodynamics (4th ed.). Cambridge University Press. — Chapter 1 is the cleanest undergraduate refresher of vector calculus in physics.

Marsden, J. E., & Tromba, A. J. (2011). Vector Calculus (6th ed.). W. H. Freeman. — A comprehensive mathematical treatment for readers wanting full rigor and many worked examples.

Crowe, M. J. (1985). A History of Vector Analysis: The Evolution of the Idea of a Vectorial System. Dover Publications. — The definitive history of how vector analysis emerged from quaternions.

Arianrhod, R. (2024). Vector: A Surprising Story of Space, Time, and Mathematical Transformation. University of Chicago Press. — A recent and accessible history of vectors and tensors.