Gradient, divergence, and curl are the three vector calculus operators students mix up most often. The quick way to separate them is this: gradient tells you where a scalar field increases fastest, divergence tells you whether a vector field is acting like a source or sink, and curl tells you whether that vector field has local rotation.

One condition matters before any formula. Gradient is defined for a scalar field such as temperature T(x,y,z)T(x,y,z). Divergence and curl are defined for a vector field such as velocity F(x,y,z)\mathbf{F}(x,y,z).

What gradient, divergence, and curl mean

Think of the three operators as answering three different questions:

  1. Gradient: which way does a scalar field rise fastest?
  2. Divergence: is a vector field spreading out or collapsing inward here?
  3. Curl: would a tiny paddle wheel placed in the field tend to spin?

The outputs are different too. Gradient and curl produce vectors. Divergence produces a scalar. That single fact prevents a lot of mistakes.

Gradient, divergence, and curl formulas

If

f(x,y,z)f(x,y,z)

is a scalar field, then its gradient is

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

If

F(x,y,z)=(P,Q,R)F(x,y,z) = (P,Q,R)

is a vector field, then its divergence is

F=Px+Qy+Rz,\nabla \cdot F = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z},

and its curl is

×F=(RyQz,PzRx,QxPy).\nabla \times F = \left( \frac{\partial R}{\partial y} - \frac{\partial Q}{\partial z}, \frac{\partial P}{\partial z} - \frac{\partial R}{\partial x}, \frac{\partial Q}{\partial x} - \frac{\partial P}{\partial y} \right).

These are the standard formulas in Cartesian coordinates. If you switch to cylindrical or spherical coordinates, the coordinate formulas change.

Intuition: uphill, outflow, and a paddle wheel

Think of a hill, a fluid, and a tiny paddle wheel.

For a scalar field, the gradient points uphill. Its direction is the steepest direction, and its magnitude tells you how steep the increase is.

For a vector field, divergence tells you whether more flow is leaving a tiny region than entering it. Positive divergence means net outflow. Negative divergence means net inflow. Zero divergence means no net source or sink at that point, not that the field itself is zero.

Curl tells you whether a tiny paddle wheel placed in the field would tend to spin. In 33D, curl is a vector, and its direction gives the axis of that local rotation by the right-hand rule.

Worked example: compute all three without mixing them up

Because the operators act on different kinds of inputs, one clean example uses one scalar field and one vector field.

Let the scalar field be

T(x,y,z)=x2+y2+zT(x,y,z) = x^2 + y^2 + z

and the vector field be

F(x,y,z)=(y,x,z).\mathbf{F}(x,y,z) = (-y, x, z).

1. Gradient of TT

Compute each partial derivative:

Tx=2x,Ty=2y,Tz=1.\frac{\partial T}{\partial x} = 2x, \qquad \frac{\partial T}{\partial y} = 2y, \qquad \frac{\partial T}{\partial z} = 1.

So

T=(2x,2y,1).\nabla T = (2x, 2y, 1).

At the point (1,2,0)(1,2,0),

T(1,2,0)=(2,4,1).\nabla T(1,2,0) = (2,4,1).

So from (1,2,0)(1,2,0), the field TT increases fastest in the direction (2,4,1)(2,4,1).

2. Divergence of F\mathbf{F}

Here P=yP = -y, Q=xQ = x, and R=zR = z. So

F=(y)x+xy+zz=0+0+1=1.\nabla \cdot \mathbf{F} = \frac{\partial (-y)}{\partial x} + \frac{\partial x}{\partial y} + \frac{\partial z}{\partial z} = 0 + 0 + 1 = 1.

The answer is a scalar. Since it is positive, the field has net outflow at each point.

3. Curl of F\mathbf{F}

Now use the curl formula:

×F=(zyxz,(y)zzx,xx(y)y).\nabla \times \mathbf{F} = \left( \frac{\partial z}{\partial y} - \frac{\partial x}{\partial z}, \frac{\partial (-y)}{\partial z} - \frac{\partial z}{\partial x}, \frac{\partial x}{\partial x} - \frac{\partial (-y)}{\partial y} \right).

That becomes

×F=(00,00,1(1))=(0,0,2).\nabla \times \mathbf{F} = (0 - 0, 0 - 0, 1 - (-1)) = (0,0,2).

So the field has local rotation about the zz-axis.

This example is the point of the whole topic:

  1. T=(2x,2y,1)\nabla T = (2x,2y,1) is a vector of fastest increase.
  2. F=1\nabla \cdot \mathbf{F} = 1 is a scalar measuring outflow.
  3. ×F=(0,0,2)\nabla \times \mathbf{F} = (0,0,2) is a vector measuring rotation.

Common mistakes with gradient, divergence, and curl

The most common mistake is using the wrong operator on the wrong kind of field. Gradient takes a scalar field. Divergence and curl take a vector field.

Another mistake is focusing only on the symbols. If you connect divergence with outflow and curl with rotation, the formulas become much easier to remember.

Students also often read divergence zero as "nothing is happening." That is not correct. A vector field can be nonzero and still have zero net outflow at a point.

For curl, another trap is treating it as a test for whether a path looks curved. Curl is about local rotational tendency, not just whether a field line bends in a large-scale sketch.

Where these operators are used

Gradient appears in optimization, heat flow, and electric potential. It tells you which direction changes fastest.

Divergence appears in fluid mechanics and electromagnetism when you care about sources, sinks, or conservation.

Curl appears in fluid rotation and Maxwell's equations, where local circulation matters.

Together, they give you three different ways to measure change in space. That is why they are basic tools in vector calculus rather than three unrelated formulas to memorize.

Try a similar problem yourself

Change the fields slightly and recompute:

T(x,y,z)=x2+y2z,F(x,y,z)=(y,x,2z).T(x,y,z) = x^2 + y^2 - z, \qquad \mathbf{F}(x,y,z) = (-y, x, 2z).

Find the new gradient, divergence, and curl, then compare what changed and what stayed the same. If you want a natural next step, try your own version with a different scalar field and vector field, then check each answer against its meaning instead of only checking the algebra.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →