In short

Vector calculus studies how scalar and vector quantities change across space. The gradient tells you the direction a scalar field increases fastest. Divergence measures how much a vector field spreads out from a point. Curl measures how much it swirls. Line integrals add up a field's contribution along a path. Together, these four tools let you describe everything from heat flow to electromagnetism.

You are standing on a hillside. The ground under your feet has a temperature — say the rock is warm from the afternoon sun. Every point on the hill has its own temperature. That is a scalar field: a single number assigned to every point in space.

Now think about the wind. At every point on the hill, the wind blows in some direction with some strength. That is a vector field: a vector (direction and magnitude) assigned to every point.

You already know how to differentiate a function of one variable — that is the derivative, and it tells you the rate of change along a single line. But temperature on a hillside is a function of three variables (x, y, z). Wind is a vector that depends on position. How do you talk about rates of change when the input is a point in space and the output might be a vector?

That is what vector calculus answers. It gives you four new tools — gradient, divergence, curl, and line integrals — each one a natural extension of the derivative or integral you already know, adapted for fields that live in two or three dimensions.

The gradient: which way is uphill?

Start with the simplest question you can ask about a scalar field. You are standing at a point on that hillside, and the temperature varies from place to place. In which direction should you walk to warm up the fastest?

Take a concrete scalar field in two dimensions:

T(x, y) = 100 - x^2 - 2y^2

Think of this as the temperature at every point (x, y) on a metal plate. At the origin, T(0, 0) = 100 — the hottest point. As you move away from the origin in any direction, the temperature drops (both x^2 and 2y^2 are positive, so they subtract from 100).

You already know partial derivatives. The partial derivative \partial T / \partial x = -2x tells you how fast T changes as you move in the x-direction alone. The partial derivative \partial T / \partial y = -4y tells you the same for the y-direction.

The gradient packages both of these into one vector:

\nabla T = \left(\frac{\partial T}{\partial x},\; \frac{\partial T}{\partial y}\right) = (-2x,\; -4y)

At the point (1, 1), the gradient is \nabla T = (-2, -4). This vector points in the direction of steepest increase of T. Its magnitude |\nabla T| = \sqrt{4 + 16} = \sqrt{20} = 2\sqrt{5} tells you how steep that increase is.

Since \nabla T = (-2, -4) at (1, 1), the temperature increases fastest in the direction toward the origin — back toward the hot centre. That matches the picture: the origin is the maximum, and the gradient always points uphill.

Gradient vectors on the temperature field T = 100 - x squared - 2y squared A grid of arrows showing the gradient of the scalar field T equals 100 minus x squared minus 2y squared. All arrows point toward the origin, the location of maximum temperature. Arrows near the origin are short because the surface is nearly flat there. Arrows farther out are longer, showing a steeper rate of change. Contour ellipses at T equals 90 and T equals 70 are drawn as dashed curves. x y 2 −2 2 −2 T = 90 T = 70 T = 100
Gradient vectors on the temperature field $T(x, y) = 100 - x^2 - 2y^2$. Every red arrow points toward the origin — the direction of fastest temperature increase. Arrows farther from the centre are longer, meaning the field changes more steeply there. The dashed ellipses are **contours** (curves of constant temperature). Notice that every gradient arrow crosses the contours at right angles — this is always true: the gradient is perpendicular to the level curves.

Two things to notice in the picture. First, every gradient arrow is perpendicular to the nearest contour ellipse. This is not a coincidence — the gradient is always perpendicular to level curves. A level curve is a path along which T does not change, and the gradient points in the direction T changes fastest, so they have to be at right angles.

Second, the gradient is zero at the origin, where the field has its maximum. That is the multivariable version of f'(x) = 0 at a maximum or minimum.

Gradient

For a scalar field f(x, y, z) with continuous partial derivatives, the 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 each point, \nabla f points in the direction of steepest increase of f, and its magnitude |\nabla f| equals the rate of increase in that direction.

The symbol \nabla is called nabla or del. It behaves like a vector of differentiation operators: \nabla = (\partial/\partial x, \;\partial/\partial y, \;\partial/\partial z). On its own, \nabla is not a vector and not a number — it is an operator that needs a function to act on. When you "multiply" it by a scalar field f, you get the gradient \nabla f. When you take its "dot product" with a vector field, you get something called the divergence. When you take its "cross product" with a vector field, you get the curl. The notation is compact and powerful.

Divergence: is the field spreading out?

Now move from scalar fields to vector fields. A vector field \mathbf{F}(x, y, z) assigns a vector to every point in space — think of it as the velocity of a flowing fluid at each location.

Here is a natural question: is the fluid spreading out from a point, or piling up at it? If you imagine a tiny box around a point, is more fluid leaving the box than entering it?

Take a concrete vector field in two dimensions:

\mathbf{F}(x, y) = (x, \; y)

At (1, 0), the vector is (1, 0) — pointing right. At (0, 2), the vector is (0, 2) — pointing up. At (3, 1), the vector is (3, 1) — pointing away from the origin. Every vector points directly outward from the origin, and vectors farther from the origin are longer.

If this field represented fluid flow, the fluid is clearly spreading outward from the origin in all directions. The divergence is the number that measures this spreading.

Divergence

For a vector field \mathbf{F} = (F_1, F_2, F_3) in three dimensions, the 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}

It measures the rate at which the field "spreads out" from each point. Positive divergence means the field is a source (expanding). Negative divergence means the field is a sink (contracting). Zero divergence means the field is incompressible — nothing is being created or destroyed.

For \mathbf{F}(x, y) = (x, y): the divergence is \partial x / \partial x + \partial y / \partial y = 1 + 1 = 2. A constant, positive everywhere. The field is uniformly expanding — every tiny box has more flow leaving than entering, at the same rate everywhere.

Now take a different field: \mathbf{G}(x, y) = (-y, x). At (1, 0) the vector is (0, 1) — pointing up. At (0, 1) it is (-1, 0) — pointing left. At (-1, 0) it is (0, -1) — pointing down. The vectors go around the origin in a circle, anticlockwise. The divergence is \partial(-y)/\partial x + \partial(x)/\partial y = 0 + 0 = 0. No spreading, no compressing — the fluid just circulates. This field has zero divergence but is clearly doing something. What it is doing is called curl.

Two vector fields: one with positive divergence, one with zero divergence Left panel shows the vector field F equals (x, y) with arrows pointing outward from the origin in all directions, illustrating positive divergence. Right panel shows the field G equals (negative y, x) with arrows circling the origin anticlockwise, illustrating zero divergence. $\mathbf{F} = (x,\, y)$ div = 2 (source) $\mathbf{G} = (-y,\, x)$ div = 0 (circulation)
Two vector fields, side by side. Left: $\mathbf{F} = (x, y)$ has divergence $2$ everywhere — the arrows spread outward from the origin like water from a sprinkler. Right: $\mathbf{G} = (-y, x)$ has divergence $0$ everywhere — the arrows circle the origin without spreading or contracting. The same amount of fluid enters any small region as leaves it.

A physical way to remember divergence: imagine placing a tiny sponge at a point in the flow. If the sponge absorbs fluid (flow converges), the divergence is negative. If it gets pushed outward (flow diverges), the divergence is positive. If the flow just slides past without the sponge getting fatter or thinner, the divergence is zero.

Curl: is the field spinning?

The field \mathbf{G} = (-y, x) has zero divergence, but it is clearly rotating. The curl is the tool that detects rotation.

Imagine placing a tiny paddlewheel in the flow at some point. If the flow pushes one side of the paddlewheel harder than the other, the wheel spins — and the curl measures how fast it spins and around which axis.

For a vector field \mathbf{F} = (F_1, F_2, F_3) in three dimensions, the curl is defined as:

Curl

\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)

The curl of a vector field is itself a vector field. At each point, the direction of the curl vector is the axis around which the field rotates, and its magnitude measures how fast the rotation is.

This formula looks intimidating, but there is a clean way to remember it. Arrange \nabla and \mathbf{F} as a 3 \times 3 determinant:

\nabla \times \mathbf{F} = \begin{vmatrix} \hat{\mathbf{i}} & \hat{\mathbf{j}} & \hat{\mathbf{k}} \\[4pt] \dfrac{\partial}{\partial x} & \dfrac{\partial}{\partial y} & \dfrac{\partial}{\partial z} \\[4pt] F_1 & F_2 & F_3 \end{vmatrix}

Expand this determinant exactly the way you expand any 3 \times 3 determinant, and you get the formula above. The determinant is a mnemonic device — it is not literally a determinant of numbers — but it always gives the right answer.

For the circulating field \mathbf{G} = (-y, x, 0) in three dimensions (treating it as a 2D field lying in the xy-plane):

\nabla \times \mathbf{G} = \left(\frac{\partial(0)}{\partial y} - \frac{\partial(x)}{\partial z},\;\; \frac{\partial(-y)}{\partial z} - \frac{\partial(0)}{\partial x},\;\; \frac{\partial(x)}{\partial x} - \frac{\partial(-y)}{\partial y}\right) = (0, 0, 2)

The curl points straight up out of the xy-plane — that is the axis of rotation. Its magnitude is 2, which is twice the angular velocity. The paddlewheel spins anticlockwise (following the right-hand rule), which is exactly what you see in the picture of \mathbf{G}.

For the expanding field \mathbf{F} = (x, y, 0):

\nabla \times \mathbf{F} = \left(0, 0, \frac{\partial(y)}{\partial x} - \frac{\partial(x)}{\partial y}\right) = (0, 0, 0)

Zero curl everywhere. The field spreads out but does not rotate. A paddlewheel placed in this flow would be pushed outward but would not spin.

These two examples illustrate the central distinction: divergence detects sources and sinks; curl detects rotation. A field can have one, both, or neither.

A compact notation: the del operator

You have now seen \nabla f (gradient), \nabla \cdot \mathbf{F} (divergence), and \nabla \times \mathbf{F} (curl). The operator \nabla appears in all three, playing different roles:

This is the power of the nabla notation. Three conceptually different operations are unified into one symbol used three different ways. There are even deeper identities connecting them. For instance, the curl of a gradient is always zero: \nabla \times (\nabla f) = \mathbf{0} for any smooth scalar field f. And the divergence of a curl is always zero: \nabla \cdot (\nabla \times \mathbf{F}) = 0 for any smooth vector field \mathbf{F}. These are not coincidences — they reflect a deep mathematical structure that becomes fully visible in differential geometry.

Line integrals: adding up along a path

Ordinary integration adds up the values of a function along the x-axis — a straight line. A line integral adds up the values of a field along a curve in space.

Here is the physical picture. A force field \mathbf{F} acts on a particle. The particle moves along a curved path C from point A to point B. How much work does the field do on the particle?

At each tiny step along the path, the work done is \mathbf{F} \cdot d\mathbf{r} — the component of the force in the direction of motion, times the tiny distance moved. The total work is the sum of all these tiny contributions:

W = \int_C \mathbf{F} \cdot d\mathbf{r}

This is the line integral of \mathbf{F} along the curve C.

To compute it, you need to parametrise the curve — write it as \mathbf{r}(t) = (x(t), y(t)) for t running from some start value a to some end value b. Then d\mathbf{r} = (x'(t), y'(t))\,dt, and the line integral becomes an ordinary single-variable integral:

\int_C \mathbf{F} \cdot d\mathbf{r} = \int_a^b \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t)\, dt

That is the computational formula. The right-hand side is just a definite integral of a scalar function — something you already know how to evaluate.

Computing them: two worked examples

Example 1: Gradient and line integral of a force field

Consider the force field \mathbf{F}(x, y) = (2x, \; 4y). A particle moves along the straight line from (0, 0) to (3, 1). Find the work done by the force.

Step 1. Parametrise the path. A straight line from (0, 0) to (3, 1) can be written as \mathbf{r}(t) = (3t, \; t) for t \in [0, 1].

Why: at t = 0, the point is (0, 0); at t = 1, the point is (3, 1). The parametrisation sweeps out the line segment.

Step 2. Compute \mathbf{r}'(t) = (3, 1), the tangent vector to the path.

Why: you need d\mathbf{r} = \mathbf{r}'(t)\,dt to set up the line integral.

Step 3. Evaluate \mathbf{F} along the path. At the point \mathbf{r}(t) = (3t, t):

\mathbf{F}(\mathbf{r}(t)) = (2 \cdot 3t, \; 4 \cdot t) = (6t, \; 4t)

Why: you substitute the parametric coordinates into the force field to get the force at each point along the path.

Step 4. Compute the dot product \mathbf{F}(\mathbf{r}(t)) \cdot \mathbf{r}'(t):

(6t, 4t) \cdot (3, 1) = 18t + 4t = 22t

Why: the dot product picks out the component of force in the direction of motion — only that component does work.

Step 5. Integrate from t = 0 to t = 1:

W = \int_0^1 22t \, dt = 22 \cdot \frac{t^2}{2}\Bigg|_0^1 = 11

Result: The work done by \mathbf{F} along the straight-line path from the origin to (3, 1) is 11 units.

The straight-line path from $A = (0, 0)$ to $B = (3, 1)$. Red arrows show the force $\mathbf{F} = (2x, 4y)$ sampled at three points along the path — each arrow has a component along the path that contributes to the work integral. The total work is $11$ units.

Notice something: the field \mathbf{F} = (2x, 4y) is actually the gradient of the scalar field \phi(x, y) = x^2 + 2y^2. So W = \phi(3, 1) - \phi(0, 0) = (9 + 2) - 0 = 11. When the force is a gradient, the work depends only on the endpoints, not on the path taken — a fact that connects directly to the idea of conservative fields and potential energy in physics.

Example 2: Curl and circulation around a loop

Take the vector field \mathbf{G}(x, y) = (-y, \; x) — the swirling field from earlier. Compute the line integral of \mathbf{G} around the unit circle, traversed anticlockwise.

Step 1. Parametrise the unit circle: \mathbf{r}(t) = (\cos t, \; \sin t) for t \in [0, 2\pi].

Why: as t goes from 0 to 2\pi, the point traces the full circle anticlockwise.

Step 2. Compute \mathbf{r}'(t) = (-\sin t, \; \cos t).

Why: differentiating the parametric equations gives the tangent vector at each point of the circle.

Step 3. Evaluate \mathbf{G} along the circle:

\mathbf{G}(\mathbf{r}(t)) = (-\sin t, \; \cos t)

Why: substitute x = \cos t, y = \sin t into \mathbf{G} = (-y, x).

Step 4. Dot product:

\mathbf{G}(\mathbf{r}(t)) \cdot \mathbf{r}'(t) = (-\sin t)(-\sin t) + (\cos t)(\cos t) = \sin^2 t + \cos^2 t = 1

Why: the Pythagorean identity collapses the dot product to 1 at every point on the circle. The force is always perfectly aligned with the direction of motion.

Step 5. Integrate:

\oint_C \mathbf{G} \cdot d\mathbf{r} = \int_0^{2\pi} 1 \, dt = 2\pi

Result: The circulation of \mathbf{G} around the unit circle is 2\pi.

The unit circle with the swirling field $\mathbf{G} = (-y, x)$ sampled at four points. At every point, the field vector is tangent to the circle and has the same magnitude — the field pushes perfectly along the circle everywhere. The total circulation is $2\pi$, the circumference of the circle.

The result 2\pi is exactly the circumference of the unit circle. That is because \mathbf{G} is a unit-length vector field on the circle that points exactly in the direction of motion at every point — so the integrand is 1 everywhere, and the integral just measures the length of the path. This is a special case of a general pattern: the circulation of a field around a closed loop is related to the curl enclosed inside the loop — a fact known as Green's theorem (or Stokes' theorem in three dimensions).

Common confusions

Going deeper

If you came here to understand what gradient, divergence, curl, and line integrals are, you have the picture — you can stop here. What follows is for readers who want to see the deeper connections tying these four ideas together.

The fundamental theorem of line integrals

In single-variable calculus, the fundamental theorem says:

\int_a^b f'(x)\, dx = f(b) - f(a)

The multivariable analog is:

\int_C \nabla \phi \cdot d\mathbf{r} = \phi(B) - \phi(A)

If a vector field \mathbf{F} is the gradient of some scalar function \phi — called a potential function — then the line integral of \mathbf{F} along any path from A to B equals \phi(B) - \phi(A). The path does not matter.

This is why conservative forces in physics (gravity, electrostatics) have potential energy: the work done depends only on where you start and end, not on which route you take. Friction is not conservative precisely because its "field" is not a gradient — it has nonzero curl.

How do you tell whether a field is conservative? In a simply connected region, a field is conservative if and only if its curl is zero. So \nabla \times \mathbf{F} = \mathbf{0} is the test. For the field \mathbf{F} = (2x, 4y) from Example 1, the curl is \partial(4y)/\partial x - \partial(2x)/\partial y = 0 - 0 = 0, confirming it is conservative with potential \phi = x^2 + 2y^2.

Green's theorem: connecting line integrals to curl

Green's theorem says that the circulation of a field around a closed curve C equals the total curl inside the region R bounded by C:

\oint_C \mathbf{F} \cdot d\mathbf{r} = \iint_R \left(\frac{\partial F_2}{\partial x} - \frac{\partial F_1}{\partial y}\right) dA

Check this against Example 2. The field \mathbf{G} = (-y, x) has \partial F_2/\partial x - \partial F_1/\partial y = 1 - (-1) = 2. The region inside the unit circle has area \pi. So the double integral on the right is 2\pi — matching the circulation 2\pi that you computed directly.

Green's theorem is a two-dimensional case of the more general Stokes' theorem, which relates the circulation of a field around a boundary curve to the flux of the curl through the surface bounded by that curve. It is one of the cornerstones of physics, connecting local behaviour (what the field does at each point) to global behaviour (what happens when you integrate around a boundary).

The Laplacian

Apply the divergence to the gradient: \nabla \cdot (\nabla f). The result is a scalar called the Laplacian of f:

\nabla^2 f = \frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} + \frac{\partial^2 f}{\partial z^2}

The Laplacian appears everywhere in physics. The heat equation (\partial T / \partial t = k \nabla^2 T) says that temperature diffuses at a rate proportional to its Laplacian. Laplace's equation (\nabla^2 \phi = 0) describes gravitational and electric potentials in free space. The wave equation, quantum mechanics, fluid dynamics — the Laplacian is the single most important second-order differential operator in all of mathematical physics.

For the temperature field T(x, y) = 100 - x^2 - 2y^2:

\nabla^2 T = \frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} = -2 + (-4) = -6

The negative Laplacian tells you the origin is a maximum: the function curves downward in every direction.

Where this leads next

You now have the vocabulary and intuition for vector calculus. Each of these ideas opens its own door.