Gradient, Divergence and Curl: Vector Calculus Explained

By Engr. Henry Akpan

Calculus for Fields

Temperature in a room, pressure in the atmosphere and the height of a hill are scalar fields: a number at every point. Wind velocity, water flow and electric field strength are vector fields: a vector at every point. Vector calculus gives three operations that describe how fields change in space: the gradient, divergence and curl. They appear throughout engineering and physics, from heat flow and fluid mechanics to Maxwell's equations of electromagnetism. This tutorial defines each operation using the del operator, explains what each one means physically, works through calculations, and lists the key identities.

The Del Operator

All three operations use the vector differential operator ∇ ("del" or "nabla"):

∇ = i ∂/∂x + j ∂/∂y + k ∂/∂z.

On its own it means nothing; it acts on a field. Applied to a scalar field it gives the gradient. Dotted with a vector field it gives the divergence. Crossed with a vector field it gives the curl.

Throughout, a vector field is written F = P i + Q j + R k, where P, Q and R are functions of x, y and z.

The Gradient of a Scalar Field

For a scalar field φ(x, y, z):

grad φ = ∇φ = (∂φ/∂x) i + (∂φ/∂y) j + (∂φ/∂z) k.

Meaning. The gradient is a vector that points in the direction in which φ increases fastest, and its magnitude is that greatest rate of increase. It is perpendicular to the level surfaces (contours) of φ. On a hill, ∇h points straight uphill; water flows in the direction of −∇h.

Example 1. Find ∇φ for φ = x²y + yz³ at the point (1, 2, −1).

  • ∂φ/∂x = 2xy = 4
  • ∂φ/∂y = x² + z³ = 1 − 1 = 0
  • ∂φ/∂z = 3yz² = 6

So ∇φ = 4i + 0j + 6k, and the greatest rate of increase is |∇φ| = √(16 + 36) = √52 ≈ 7.21.

Directional derivative. The rate of change of φ in the direction of a unit vector û is ∇φ · û. In Example 1, in the direction of (1, 2, 2), whose unit vector is (1/3)(1, 2, 2), the rate is (4 × 1 + 0 × 2 + 6 × 2)/3 = 16/3 ≈ 5.33, less than the maximum of 7.21 as expected.

Example 2 (normal to a surface). Find a unit normal to the sphere x² + y² + z² = 9 at (1, 2, 2).

The sphere is a level surface of φ = x² + y² + z². ∇φ = (2x, 2y, 2z) = (2, 4, 4) at the point. Its magnitude is 6, so the unit normal is (1/3, 2/3, 2/3), pointing straight out from the centre, as you would expect for a sphere.

The Divergence of a Vector Field

div F = ∇ · F = ∂P/∂x + ∂Q/∂y + ∂R/∂z.

The divergence is a scalar.

Meaning. Divergence measures how much a field spreads out from a point, the net outflow per unit volume. Think of F as the velocity of a fluid:

  • div F > 0: a source, where fluid is being produced or expanding outwards.
  • div F < 0: a sink, where fluid is disappearing or being compressed.
  • div F = 0 everywhere: the field is solenoidal (incompressible), so whatever flows in also flows out. Magnetic fields always satisfy ∇ · B = 0, because there are no magnetic monopoles.

Example 3. Find the divergence of F = x²y i + yz j + xz² k at (1, 1, 1).

∇ · F = ∂(x²y)/∂x + ∂(yz)/∂y + ∂(xz²)/∂z = 2xy + z + 2xz. At (1, 1, 1) this is 2 + 1 + 2 = 5, so the point acts as a source.

Example 4. The field F = x i + y j + z k points directly away from the origin everywhere. Its divergence is 1 + 1 + 1 = 3 at every point: it spreads out uniformly. By contrast, G = −y i + x j has divergence 0 + 0 = 0: it swirls without spreading.

The Curl of a Vector Field

curl F = ∇ × F is found like a cross product, using the determinant with rows (i, j, k), (∂/∂x, ∂/∂y, ∂/∂z) and (P, Q, R):

∇ × F = (∂R/∂y − ∂Q/∂z) i − (∂R/∂x − ∂P/∂z) j + (∂Q/∂x − ∂P/∂y) k.

The curl is a vector.

Meaning. Curl measures rotation. Imagine a tiny paddle wheel placed in a flowing fluid: the curl points along the axis about which it spins fastest, and its magnitude is twice the angular velocity of spin. A field with zero curl everywhere is called irrotational.

Example 5. Find the curl of G = −y i + x j (a rotating flow).

P = −y, Q = x, R = 0. The i and j components are 0 − 0 = 0. The k component is ∂Q/∂x − ∂P/∂y = 1 − (−1) = 2. So ∇ × G = 2k: rotation about the z-axis, anticlockwise when viewed from above, with angular velocity 1 rad/s.

Example 6. Find the curl of F = xy i + yz j + zx k.

  • i component: ∂(zx)/∂y − ∂(yz)/∂z = 0 − y = −y
  • j component: −[∂(zx)/∂x − ∂(xy)/∂z] = −[z − 0] = −z
  • k component: ∂(yz)/∂x − ∂(xy)/∂y = 0 − x = −x

So ∇ × F = −y i − z j − x k.

Conservative Fields

A vector field F is conservative if it is the gradient of some scalar potential: F = ∇φ. Gravitational and electrostatic fields are conservative (with F = −∇V, using the potential V). For such fields:

  • ∇ × F = 0 (the field is irrotational), and
  • the work done moving between two points does not depend on the path taken.

Example 7. Show that F = 2xy i + (x² + 2z) j + 2y k is conservative and find its potential.

Curl: i component ∂(2y)/∂y − ∂(x² + 2z)/∂z = 2 − 2 = 0; j component −[∂(2y)/∂x − ∂(2xy)/∂z] = 0; k component ∂(x² + 2z)/∂x − ∂(2xy)/∂y = 2x − 2x = 0. So ∇ × F = 0.

Find φ: ∂φ/∂x = 2xy gives φ = x²y + h(y, z). Then ∂φ/∂y = x² + ∂h/∂y must equal x² + 2z, so h = 2yz + k(z). Finally ∂φ/∂z = 2y + k′(z) must equal 2y, so k is a constant. Therefore φ = x²y + 2yz + C.

Key Identities

  • ∇ × (∇φ) = 0: the curl of a gradient is always zero.
  • ∇ · (∇ × F) = 0: the divergence of a curl is always zero.
  • ∇ · (∇φ) = ∇²φ = ∂²φ/∂x² + ∂²φ/∂y² + ∂²φ/∂z², the Laplacian. Laplace's equation ∇²φ = 0 governs steady heat flow, electrostatic potential in empty space and ideal fluid flow.
  • ∇ · (φF) = φ(∇ · F) + F · ∇φ, a product rule.

Where Gradient, Divergence and Curl Appear

  • Heat flow: heat flows down the temperature gradient, q = −k∇T (Fourier's law).
  • Fluids: the continuity equation for an incompressible fluid is ∇ · v = 0; the curl of the velocity is the vorticity.
  • Electromagnetism: Maxwell's equations are written with divergence and curl, for example ∇ · E = ρ/ε₀ (Gauss's law) and ∇ × E = −∂B/∂t (Faraday's law).
  • The divergence theorem and Stokes' theorem link the divergence to flux through a closed surface and the curl to circulation around a loop.

Summary

  • ∇φ (gradient) is a vector pointing in the direction of fastest increase; it is normal to level surfaces.
  • ∇ · F (divergence) is a scalar measuring outflow: positive at sources, negative at sinks, zero for incompressible fields.
  • ∇ × F (curl) is a vector measuring rotation; zero curl means irrotational.
  • A conservative field is a gradient, has zero curl and does path-independent work.
  • curl grad = 0 and div curl = 0; div grad is the Laplacian.

Related Tutorials