Vector Fields, Gradient, Divergence & Curl

The three differential operators behind every law of electromagnetism

ElectromagneticsElectrical Engineering Year 2Free preview
⏱️ About 16 min

An electric field is not a single vector — it is a vector attached to every point in space. To describe how fields spread out from charges, curl around currents, and change from point to point, we need three differential operators: the gradient, the divergence, and the curl.

💡
The big idea: A vector field assigns a vector to every point in space. The gradient turns a scalar field into a vector field pointing uphill, the divergence measures how much a vector field spreads outward from a point, and the curl measures how much it circulates. Together, these three operators are the entire vocabulary in which Gauss's law, Ampere's law, and Faraday's law are written.
🎯 By the end, you'll be able to
  • Explain what a vector field is and give examples relevant to electromagnetics
  • Compute the gradient of a scalar field and interpret its direction and magnitude
  • Compute the divergence of a vector field in Cartesian form and interpret it as a source or sink
  • Compute the curl of a vector field in Cartesian form and interpret it as local circulation
📎 Helpful to know first

From Single Vectors to Vector Fields

In the previous lesson, we worked with individual vectors — fixed quantities with fixed components. But the electric field E is not a single vector. At every point in space, there is a different electric field vector with its own magnitude and direction. This is a vector field: a rule that assigns a vector to every point (x, y, z).

Similarly, the temperature in a room is a scalar field — a single number assigned to every point. The distinction is fundamental: scalar fields have magnitude only, while vector fields have magnitude and direction at each point. In electromagnetics, the electric potential V(x, y, z) is a scalar field, while the electric field E(x, y, z) and magnetic field B(x, y, z) are vector fields.

To relate these fields to one another — and to the charges and currents that produce them — we need differential operators that can detect how fields change from point to point. There are exactly three such operators that matter for EM: the gradient, the divergence, and the curl.

🔑 Fields versus vectors

A vector is a single arrow. A vector field is an entire space full of arrows — one at every point. When we write E = Exx̂ + Eyŷ + Ezẑ in the context of a field, the components Ex, Ey, Ez are functions of position (x, y, z), not constants.

The Gradient: Direction of Steepest Increase

The gradient operates on a scalar field f(x, y, z) and produces a vector field ∇f. At each point, ∇f points in the direction of the steepest increase of f, and its magnitude equals the rate of increase in that direction. In Cartesian coordinates, ∇f = (∂f/∂x)x̂ + (∂f/∂y)ŷ + (∂f/∂z)ẑ.

The symbol ∇ (called 'del' or 'nabla') is a vector differential operator. When it acts on a scalar, it produces a vector. In electromagnetics, the gradient connects the scalar potential V to the electric field: E = −∇V. The electric field points in the direction of steepest decrease of potential (hence the minus sign) — a positive charge rolls 'downhill' in the potential landscape.

\[ \nabla f = \frac{\partial f}{\partial x}\,\hat{\mathbf{x}} + \frac{\partial f}{\partial y}\,\hat{\mathbf{y}} + \frac{\partial f}{\partial z}\,\hat{\mathbf{z}} \]
The gradient of a scalar field f in Cartesian coordinates.
📝 Worked example: Given the scalar field f(x, y, z) = x² + y² + z², find ∇f at the point (1, 2, 3) and compute its magnitude.
  1. Compute each partial derivative: ∂f/∂x = 2x, ∂f/∂y = 2y, ∂f/∂z = 2z.
  2. Write the gradient: ∇f = 2x x̂ + 2y ŷ + 2z ẑ.
  3. Evaluate at (1, 2, 3): ∇f = 2(1)x̂ + 2(2)ŷ + 2(3)ẑ = 2x̂ + 4ŷ + 6ẑ.
  4. Compute the magnitude: |∇f| = √(2² + 4² + 6²) = √(4 + 16 + 36) = √56 ≈ 7.483.
✓ ∇f(1,2,3) = 2x̂ + 4ŷ + 6ẑ, |∇f| = √56 ≈ 7.483
✨ The gradient points radially outward here

The function f = x² + y² + z² is the squared distance from the origin, so its gradient points radially outward everywhere — away from the origin, in the direction of increasing distance. This is the same structure as the electric field of a point charge, which also points radially. The connection is not coincidental: the potential of a point charge is proportional to 1/r, and E = −∇V.

The Divergence: Measuring Outward Flux

The divergence operates on a vector field F and produces a scalar field ∇·F. At each point, it measures how much the field 'spreads out' from (or flows into) that point — the net outward flux per unit volume. In Cartesian coordinates, ∇·F = ∂Fx/∂x + ∂Fy/∂y + ∂Fz/∂z.

If ∇·F > 0 at a point, that point is a source — the field flows outward. If ∇·F < 0, it is a sink. If ∇·F = 0 everywhere, the field is divergence-free (solenoidal). In EM, this is the heart of Gauss's law: ∇·E = ρ/ε₀, which says charge density ρ is the source of the electric field. The magnetic field, by contrast, is always divergence-free: ∇·B = 0, reflecting that there are no magnetic monopoles.

\[ \nabla \cdot \mathbf{F} = \frac{\partial F_x}{\partial x} + \frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z} \]
The divergence of a vector field F in Cartesian coordinates — a scalar result.
🔑 Divergence is a dot product with ∇

The notation ∇·F is literally the dot product of the del operator with the vector field. That is why the result is a scalar, just as any dot product yields a scalar.

The Curl: Measuring Circulation

The curl operates on a vector field F and produces another vector field ∇×F. At each point, the curl measures how much the field 'circulates' around that point — its direction is the axis of rotation (right-hand rule) and its magnitude is the strength of circulation. In Cartesian coordinates, the curl is computed as a determinant, just like the cross product.

If ∇×F = 0 everywhere, the field is irrotational. In EM, the curl is central to both Ampere's law (∇×B = μ₀J, linking circulating magnetic fields to currents) and Faraday's law (∇×E = −∂B/∂t, linking circulating electric fields to changing magnetic fields). The curl is what makes electromagnetic induction mathematically precise.

\[ \nabla \times \mathbf{F} = \left(\frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z}\right)\hat{\mathbf{x}} - \left(\frac{\partial F_z}{\partial x} - \frac{\partial F_x}{\partial z}\right)\hat{\mathbf{y}} + \left(\frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y}\right)\hat{\mathbf{z}} \]
The curl of a vector field F in Cartesian coordinates — a vector result.
⚠️ Curl is a cross product with ∇ — mind the signs

Just as the cross product has a minus sign on the middle (ŷ) term, so does the curl. The pattern is +, −, + for the x̂, ŷ, ẑ components — always verify the middle term.

✨ The three operators map to the three Maxwell equations

Gauss's law uses divergence (∇·E = ρ/ε₀). Gauss's law for magnetism uses divergence (∇·B = 0). Faraday's law uses curl (∇×E = −∂B/∂t). Ampere's law uses curl (∇×B = μ₀J + μ₀ε₀∂E/∂t). The gradient connects potential to field (E = −∇V). Master these three operators, and the mathematical content of Maxwell's equations is already in your hands.

✏️ Practice: Compute the divergence ∇ · F at the point (1, 1, 1) for the vector field F = (x², y², z²), i.e., Fx = x², Fy = y², Fz = z².
Solution
  1. Compute each partial derivative: ∂Fx/∂x = 2x, ∂Fy/∂y = 2y, ∂Fz/∂z = 2z.
  2. Sum them: ∇ · F = 2x + 2y + 2z.
  3. Evaluate at (1, 1, 1): ∇ · F = 2(1) + 2(1) + 2(1) = 6.

Check your understanding

1. The divergence ∇ · F measures:
Divergence measures how much a vector field spreads outward from (or converges into) a point — the net outward flux per unit volume. Positive divergence means a source; negative means a sink.
2. Which operator turns a scalar field into a vector field?
The gradient ∇f takes a scalar field f and produces a vector field pointing in the direction of steepest increase. Divergence and curl both operate on vector fields, not scalars.
✅ Key takeaways
  • A vector field assigns a vector to every point in space; the electric field E and magnetic field B are the primary vector fields in EM, while the electric potential V is a scalar field.
  • The gradient ∇f = (∂f/∂x)x̂ + (∂f/∂y)ŷ + (∂f/∂z)ẑ turns a scalar field into a vector field pointing in the direction of steepest increase; in EM, E = −∇V.
  • The divergence ∇ · F = ∂Fx/∂x + ∂Fy/∂y + ∂Fz/∂z measures outward flux per unit volume; it is positive at sources and negative at sinks, and appears in Gauss's law (∇ · E = ρ/ε₀).
  • The curl ∇ × F measures local circulation and appears in Faraday's law (∇ × E = −∂B/∂t) and Ampere's law (∇ × B = μ₀J); together with the gradient and divergence, it completes the vocabulary of Maxwell's equations.
➡️ You now have the full mathematical vocabulary of electromagnetics: vectors, coordinate systems, and the three differential operators. The next lesson uses these tools to define the line, surface, and volume integrals that Maxwell's equations are actually built from.
Want to test yourself on this? Try the Electrical Aptitude test →