Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random  

Gradient, Divergence, Curl, and the Geometry of Differential Operators

(Topic)

ED03: Gradient, Divergence, Curl, and the Geometry of Differential Operators

The electrical and magnetic fields in ED01 are not just vectors. They are vector fields: their magnitudes and directions may change from one point to another. ED02 developed the geometry needed to describe those changes, including local basis vectors, physical lengths, surface elements, and volume elements. We now build the three central operations of vector calculus from that geometry.

  • The gradient of a scalar field describes how rapidly that scalar changes, and in which direction it increases most strongly.
  • The divergence of a vector field measures the net outward flux per unit volume as the volume shrinks to a point.
  • The curl of a vector field measures its local oriented circulation per unit area as the loop shrinks to a point.

The goal is to understand why the familiar coordinate formulas have their particular terms. In particular, the factors 1∕s, 1∕r2, and 1∕(r sin 𝜃) in cylindrical and spherical coordinates are geometric consequences of the scale factors derived in ED02; they are not arbitrary algebraic decorations.

This article develops the local differential operators and previews their role in Electromagnetism. Full proofs of Gauss’s and Stokes’ integral theorems are reserved for ED04.

1 Three questions to ask of a field

Suppose a scalar field is

V  = V (x,y,z).
(1)

We can ask how much V changes if we take a small step. The answer is encoded by ∇V , the gradient.

Suppose instead we have a vector field

F = F (x,y,z).
(2)

We can ask whether more of the field leaves a tiny volume than enters it. This is divergence. We can also ask whether the field tends to circulate around a tiny oriented loop. This is curl.

These are different questions. A field can have zero divergence but nonzero curl, nonzero divergence but zero curl, or both zero in some region.

For a field with physical units [F], the divergence and curl have units

                    [F ]
[∇  ⋅ F] = [∇ × F ] =---,
                    m
(3)

while the gradient of a scalar f has units [f]∕m.

2 The gradient begins with a one-dimensional derivative

For a function f(x), the derivative is the limiting change per unit distance,

df-        f(x-+-Δx-)-−-f(x-)
dx =  Δlixm→0        Δx         .
(4)

For a function of three variables, a small change in x contributes

      ∂f
dfx ≈  ---dx.
      ∂x
(5)

Changes in y and z contribute similarly. Adding all three first-order contributions gives the total differential,

df = ∂f-dx + ∂f-dy +  ∂f-dz.
     ∂x       ∂y      ∂z
(6)

The differential displacement is

dr = dx ˆx + dy ˆy + dz ˆz.
(7)

Equation (6) has the form of a dot product. Define

      ∂f      ∂f     ∂f
∇f  = ---ˆx +  --yˆ+  ---ˆz.
      ∂x      ∂y     ∂z
(8)

Then the compact differential statement is

df = (∇f  ) ⋅ dr.
(9)

Equation (9) gives the gradient its geometric meaning. It is the vector whose dot product with a small displacement gives the first-order change in the scalar field.

3 Directional derivatives and the steepest direction

Consider a displacement along a unit direction u,

dr = ˆu dℓ.
(10)

Substitute into Equation (9):

df =  (∇f  ⋅uˆ)dℓ.
(11)

Dividing by dℓ and taking the limit defines the directional derivative,

       df
D ˆuf = ---=  ∇f ⋅ ˆu.
       dℓ
(12)

Let α be the angle between ∇f and u. Then

D  f = |∇f |cosα.
  ˆu
(13)

Because cos α ≤ 1, the largest possible increase per unit distance is |∇f|, attained in the direction of ∇f. The fastest decrease occurs in the opposite direction.

If a displacement is tangent to a surface on which f is constant, then df = 0, and

∇f  ⋅ drtangent = 0.
(14)

Thus the gradient is Normal to a level surface wherever the gradient is nonzero.

PIC

Figure 1. The gradient of a scalar field points normal to its level curves and toward increasing values. A tangent displacement along a level curve produces no first-order change in the scalar.

4 Worked example: a quadratic scalar field

Let

             2     2     2
f (x,y,z) = x  + 2y  + 3z .
(15)

Compute the three partial derivatives:

∂f- = 2x,     ∂f- = 4y,     ∂f- = 6z.
∂x            ∂y            ∂z
(16)

Therefore

∇f  = 2x ˆx + 4yˆy + 6zˆz.
(17)

At (1,−1, 1),

∇f  = (2,− 4,6).
(18)

Its magnitude is

        √ ------------  √ ---
|∇f | =   4 + 16 + 36 =   56.
(19)

To find the rate of change along the +y direction, choose u = y:

D  f = (2,− 4,6) ⋅ (0,1,0) = − 4.
  ˆy
(20)

So the function decreases by approximately 4 dℓ for a short positive y displacement at that point.

5 Gradient and electric potential

In electrostatics, the electric field is related to scalar electric potential by

E  = − ∇V.
(21)

The minus sign means that the electric field points in the direction of most rapid decrease of electric potential. The reason can be stated through the work done on a positive test charge q:

dW  =  qE ⋅ dr = − q dV.
(22)

Equipotential curves are therefore everywhere perpendicular to the electrostatic field where E≠0. An instrument may measure values of V at many points, and the gradient allows us to infer E from those measurements.

The relation E = −∇V is for electrostatic fields. In time-dependent electrodynamics, a vector-potential term is also required, as ED01 previewed.

6 Flux as the starting point for divergence

For a surface with oriented area element da, define the flux of a vector field as

      ∫
Φ   =    F ⋅ da.
  F    S
(23)

This dot product selects the part of F normal to the surface. A component tangent to the surface does not contribute to flux through it.

To understand divergence locally, surround a point by a small closed volume ΔV . Define the net outward flux divided by the volume, then let the region shrink to the point:

                   ∮
∇  ⋅ F =  lim  --1-     F ⋅ da.
         ΔV→0 ΔV    ∂V
(24)

The limit assumes the field is sufficiently smooth at the point. A positive value means net outward flux per unit volume; a negative value means net inward flux. Neither case requires fluid to be physically created or destroyed: divergence is a property of the vector field, and its physical interpretation depends on what F represents.

7 Deriving Cartesian divergence from a small box

Take a rectangular box of edge lengths Δx, Δy, and Δz, centered at (x,y,z). Its volume is

ΔV  =  Δx Δy  Δz.
(25)

Consider only the two faces perpendicular to x. The outward normal of the right face is +x; the left-face normal is −x.

For a sufficiently small box, the combined outward flux through those two faces is

ΔΦx ≈ Fx (            )
      Δx
  x + ---,y,z
       2 ΔyΔz (26)
− Fx (            )
      Δx--
 x −   2 ,y,z ΔyΔz. (27)

Divide and multiply by Δx:

ΔΦx ≈ Fx-(x-+-Δx-∕2)-−-Fx(x-−-Δx-∕2-)
              Δx (28)
× ΔxΔyΔz. (29)

The partial derivative appears when Δx → 0:

ΔΦx  ≈ ∂Fx- ΔV.
        ∂x
(30)

PIC

Figure 2. The outward flux through opposing faces is a difference, not a sum of unsigned arrow magnitudes. A spatial increase in the outward x component produces positive net flux through the small volume.

Repeat the same argument for the faces perpendicular to y and z:

ΔΦy ≈∂Fy
----
 ∂y ΔV, (31)
ΔΦz ≈∂Fz-
 ∂z ΔV. (32)

Adding the six-face fluxes, dividing by ΔV , and taking the limit gives

∇  ⋅ F = ∂Fx-+  ∂Fy-+  ∂Fz.
         ∂x     ∂y     ∂z
(33)

Notice that the derivative of Fx with respect to x appears because flux through x-normal faces is being compared. Divergence does not sum all nine spatial derivatives of a vector field.

8 Divergence examples and an important caution

Consider

F  = (2x,− y,3z).
(34)

Then

∇ ⋅ F = 2 − 1 + 3 = 4.
(35)

There is positive outward flux per unit volume at every point.

A uniform vector field,

F =  F ˆx,
      0
(36)

has zero divergence because the same flux that enters one side of a small box leaves the opposite side.

Do not interpret a field that points outward as necessarily having positive divergence everywhere. For example, the field

F = -C ˆr
    r2
(37)

points outward for C > 0, but has zero divergence at every point where r > 0. Its singularity at r = 0 needs separate treatment, introduced later in ED05 and ED09.

9 Circulation as the starting point for curl

The line integral

     ∮

Γ =     F ⋅ dl
      C
(38)

measures the field’s component along a closed oriented loop. The direction around the loop is chosen consistently with its normal by the right-hand rule.

To measure local circulation, shrink a loop with oriented normal n toward a point and divide by its enclosed area:

                     1  ∮
(∇ × F ) ⋅ ˆn = lim   ----    F ⋅ dl.
              ΔA →0 ΔA   ∂A
(39)

The components of curl are obtained by choosing infinitesimal loops whose normals are the coordinate basis directions. A positive normal component means positive circulation when viewed in the corresponding right-hand orientation.

10 Deriving the Cartesian z component of curl

Take a counterclockwise rectangular loop in the xy plane, with sides Δx and Δy. Its oriented normal is +z.

For the bottom edge, the displacement is along +x:

Γ bottom ≈ Fx(x,y )Δx.
(40)

On the right edge, the displacement is along +y:

Γ right ≈ Fy(x + Δx, y )Δy.
(41)

The top edge runs along −x:

Γ   ≈  − F (x,y + Δy )Δx.
 top      x
(42)

The left edge runs along −y:

Γ left ≈ − Fy (x,y)Δy.
(43)

Add the four contributions and group them:

Γ ≈ [Fy(x + Δx, y) − Fy(x,y )] Δy (44)
−[Fx (x,y + Δy ) − Fx(x,y)] Δx. (45)

Take the first-order Taylor approximations,

Fy(x + Δx,y) − Fy(x,y) ≈∂Fy-
∂xΔx, (46)
Fx(x,y + Δy) − Fx(x,y) ≈∂Fx
----
∂yΔy. (47)

Therefore

    (            )
      ∂Fy-   ∂Fx-
Γ ≈   ∂x  −  ∂y    Δx Δy.
(48)

Divide by the loop area and shrink the loop:

            ∂Fy-   ∂Fx-
(∇ × F )z = ∂x  −   ∂y .
(49)

PIC

Figure 3. Counterclockwise circulation around a shrinking xy loop defines the +z component of curl. The top and left edge contributions have minus signs because those edges are traversed in negative coordinate directions.

Repeating the procedure with loops normal to the x and y axes yields the full Cartesian expression:

∇× F = ( ∂F    ∂F  )
  --z-− ---y
  ∂y     ∂zx
+ (            )
  ∂Fx-   ∂Fz-
   ∂z  −  ∂xy
+ (            )
  ∂Fy-   ∂Fx-
   ∂x  −  ∂yz. (50)

An equivalent memory aid is the formal determinant,

         |           |
         || ˆx   ˆy    ˆz||
∇  × F = ||∂x   ∂y  ∂z||,
         |Fx   Fy  Fz|
(51)

but the shrinking-loop derivation is the geometric meaning behind that notation.

11 Curl, rotation, and the factor of two

Consider a rigidly rotating velocity field in the xy plane,

v = (− Ωy, Ωx, 0),
(52)

where Ω is a constant angular speed about +z.

Compute its curl:

(∇× v)z = ∂(Ωx-)
 ∂x −∂(−-Ωy-)
  ∂y (53)
= Ω − (−Ω) = 2Ω. (54)

Hence

∇ ×  v = 2Ω ˆz.
(55)

The curl is twice the local rigid-body angular velocity for this special velocity field. In fluid mechanics curl of velocity is called vorticity. For a circular path of radius a, the line integral gives the same answer:

     ∮
Γ =    v ⋅ dl = (Ωa )(2πa) = 2π Ωa2.
(56)

The circulation per unit area is

-Γ--= 2 Ω.
πa2
(57)

Curl measures local circulation, not necessarily whether the field lines visually look bent. A curved pattern of field lines by itself does not establish nonzero curl.

12 The Laplacian is divergence of a gradient

Once gradient and divergence are defined, a new scalar differential operator follows naturally:

∇2f  =  ∇ ⋅ (∇f ).
(58)

Substitute Equation (8) into the Cartesian divergence formula:

       ∂2f    ∂2f    ∂2f
∇2f  = ---2 + ---2 + --2-.
       ∂x     ∂y     ∂z
(59)

The Laplacian combines the spatial change of the gradient in all three directions. In electrostatics it appears in Poisson’s equation,

∇2V   = − ρ-,
          𝜖0
(60)

and in charge-free electrostatic regions as Laplace’s equation,

∇2V  =  0.
(61)

We are previewing those equations; ED09 onward will derive and solve their physical boundary-value problems.

13 Why ED02’s scale factors are the missing geometry

Let q1,q2,q3 be orthogonal coordinates, with position vector

r = r(q ,q ,q ).
       1  2  3
(62)

ED02 defined the scale factors by

     ||∂r ||
hi = ||---||,
      ∂qi
(63)

and the local unit basis vectors by

ˆe =  1--∂r .
 i   hi∂qi
(64)

An infinitesimal displacement is

dr = h1dq1ˆe1 + h2dq2eˆ2 + h3dq3 ˆe3.
(65)

The small cell volume is

dτ = h1h2h3 dq1dq2dq3.
(66)

A face normal to e1 has area

da1 = h2h3 dq2dq3,
(67)

with cyclic expressions for the other faces.

PIC

Figure 4. A coordinate increment dqi is not generally a physical length. Its physical edge is hi dqi. The product of two physical edges gives a face area, and the product of three gives a volume.

For the derivations below, we assume a smooth right-handed orthogonal coordinate basis away from coordinate singularities.

14 General gradient in orthogonal coordinates

The scalar differential is coordinate independent:

df = -∂f-dq1 + ∂f-dq2 + ∂f--dq3.
     ∂q1       ∂q2      ∂q3
(68)

Write the unknown gradient as

∇f  =  G1ˆe1 + G2 ˆe2 + G3ˆe3.
(69)

The defining relation is again

df = ∇f  ⋅ dr.
(70)

Using Equation (65) and orthonormality,

df = G1h1dq1  + G2h2dq2 +  G3h3dq3.
(71)

Compare coefficients of each independent coordinate increment:

        ∂f-
Gihi =  ∂qi.
(72)

Therefore

      ∑3
∇f =      1-∂f-ˆe .
          hi∂qi i
      i=1
(73)

The factor 1∕hi is simply the conversion from a change per unit coordinate to a change per unit physical length.

15 General divergence from a curvilinear flux balance

Write the vector field in the local orthonormal basis,

F = F1 ˆe1 + F2 ˆe2 + F3ˆe3.
(74)

Examine the two faces normal to e1. To first order, the outward flux difference is

       -∂--
dΦ1 ≈  ∂q1 (h2h3F1) dq1dq2dq3.
(75)

Notice the derivative of both F1 and the face-area factor h2h3. When the coordinate geometry changes with position, an opposing face can have a different area even if the component F1 is numerically unchanged.

Add the other two pairs of faces,

dΦ2 ≈ ∂
----
∂q2(h3h1F2) dq1dq2dq3, (76)
dΦ3 ≈-∂--
∂q3(h1h2F3) dq1dq2dq3. (77)

Divide their sum by the volume in Equation (66). The general divergence is

∇⋅ F =    1
-------
h1h2h3[  ∂
----
∂q1(h2h3F1)
+ -∂--
∂q2(h3h1F2)
+  ∂
----
∂q3(h1h2F3)]. (78)

This is the single formula from which the familiar Cartesian, cylindrical, and spherical divergence expressions follow.

16 General curl from a curvilinear loop

Take a small loop whose sides follow the q1 and q2 coordinate curves, oriented so that the normal points along +e3.

The physical edge along q1 is h1dq1, and the edge along q2 is h2dq2. A first-order circulation balance gives

dΓ3 ≈ ∂(h F  )
---2--2-
  ∂q1 dq1dq2 (79)
−∂(h1F1 )
--∂q----
    2 dq1dq2. (80)

The physical area is

da3 = h1h2 dq1dq2.
(81)

Divide circulation by area and shrink the loop:

              1  [∂ (h2F2)   ∂ (h1F1)]
(∇ × F )3 = ----- -------- − --------  .
            h1h2     ∂q1        ∂q2
(82)

Cyclic permutations supply the other components:

(∇× F)1 =   1
-----
h2h3[ ∂(h F  )   ∂(h F ) ]
  ---3--3-−  ---2--2-
    ∂q2        ∂q3, (83)
(∇× F)2 =   1
h--h-
  3 1[                    ]
  ∂(h1F1 )   ∂(h3F3)
  --∂q----−  --∂q----
      3          1. (84)

These formulas automatically account for physical edge lengths and rotating basis directions. They should be used with components referred to the local orthonormal unit vectors, not unnormalized coordinate tangent vectors.

17 General scalar Laplacian

Apply the general divergence formula to F = ∇f.

The gradient components are

      1 ∂f
Fi = -- ---.
     hi ∂qi
(85)

Substitution yields

∇2f =    1
-------
h1h2h3[ ∂
----
∂q1( h h  ∂f  )
  --2-3----
   h1  ∂q1
+ -∂--
∂q
   2(         )
  h3h1-∂f--
   h   ∂q
    2    2
+ -∂--
∂q3(         )
  h1h2-∂f--
   h3  ∂q3]. (86)

Equivalently, if H = h1h2h3,

                 (       )
  2     1 ∑3  ∂    H  ∂f
∇ f =  H--    ∂q-  h2-∂q-  .
          i=1   i   i   i
(87)

This is the scalar Laplacian. A vector Laplacian is a different, vector-valued operation and must not be obtained by blindly applying the scalar expression to curvilinear components.

18 Specialization to Cartesian coordinates

In Cartesian coordinates,

(q ,q ,q ) = (x,y,z),     (h ,h ,h ) = (1,1,1).
  1  2  3                   1  2  3
(88)

Every scale factor equals one, so the general formulas immediately reduce to

∇f  =  f ˆx + f ˆy + f ˆz,
        x     y     z
(89)

∇  ⋅ F = ∂Fx-+  ∂Fy-+  ∂Fz,
         ∂x     ∂y     ∂z
(90)

and Equation (50) for curl. The Laplacian is Equation (59).

Cartesian formulas look simpler partly because the Cartesian basis directions and coordinate areas do not change from place to place.

19 Cylindrical coordinates: derive the gradient

ED02 used

(q1,q2,q3) = (s,ϕ,z),
(91)

with scale factors

hs = 1,     hϕ = s,     hz = 1.
(92)

Insert these into Equation (73):

       ∂f    1 ∂f      ∂f
∇f  =  --ˆs + -----ˆϕ +  --ˆz.
       ∂s    s ∂ϕ      ∂z
(93)

The azimuthal derivative has the factor 1∕s because the physical distance for an angle dϕ is sdϕ. The same change of f over a longer arc length corresponds to a smaller physical gradient component.

For example, if

f (s,ϕ,z) = s2cos ϕ + 3z,
(94)

then

∂f-             ∂f-      2        ∂f-
∂s =  2scosϕ,   ∂ ϕ = − s sinϕ,   ∂z  = 3.
(95)

Therefore

∇f  = 2s cosϕ ˆs − ssinϕ ˆϕ + 3ˆz.
(96)

20 Cylindrical coordinates: derive the divergence

For (hs,hϕ,hz) = (1,s, 1), the total scale factor product is

H  = hsh ϕhz = s.
(97)

The face-area products in Equation (78) are

hϕhz =  s,    hzhs = 1,     hshϕ =  s.
(98)

Substitute carefully:

∇⋅ F = 1-
s[ -∂-
∂s(sFs) + ∂F-ϕ
 ∂ϕ
+  ∂
∂z-(sFz)]. (99)

Since s does not depend on z,

∇  ⋅ F = 1∂-(sFs-)+  1∂F-ϕ + ∂Fz-.
         s  ∂s      s ∂ϕ     ∂z
(100)

To understand the first term geometrically, consider a thin cylindrical shell. Its curved inner and outer faces have circumferences proportional to s. The larger face can carry more flux even if the radial component Fs is unchanged.

For F = Cs with constant C,

         1d (Cs )    C
∇  ⋅ F = ------- =  --,    s > 0.
         s  ds      s
(101)

Thus a field of constant radial magnitude in cylindrical coordinates does not have zero divergence. The increasing circumference matters.

21 Cylindrical coordinates: derive the curl

Use Equations (83) through (82) with (hs,hϕ,hz) = (1,s, 1).

For the radial component,

(∇× F)s = 1
--
s[ ∂Fz    ∂(sFϕ) ]
  ----−  -------
  ∂ ϕ      ∂z (102)
= 1-
s∂Fz-
 ∂ϕ −∂F-ϕ
 ∂z. (103)

For the azimuthal component,

(∇× F)ϕ = ∂Fs
----
 ∂z −∂Fz
----
 ∂s. (104)

For the axial component,

(∇× F)z = 1-
s[               ]
  ∂(sF-ϕ)−  ∂Fs-
    ∂s      ∂ϕ. (105)

Putting these components together,

∇× F = ( 1∂F     ∂F  )
  ----z − ---ϕ
  s ∂ϕ     ∂zs
+ (           )
  ∂Fs-  ∂Fz-
  ∂z  −  ∂sϕ
+ 1-
s[              ]
  ∂(sFϕ)-   ∂Fs-
    ∂s   −  ∂ϕz. (106)

The term ∂(sFϕ)∕∂s contains the geometry of circular paths. It should not be replaced by s∂Fϕ∕∂s unless the derivative of s is also included.

22 Cylindrical scalar Laplacian

The scalar Laplacian follows from either the general formula or ∇⋅ (∇f):

∇2f = 1
--
s∂
---
∂s(  ∂f )
  s---
   ∂s
+  1
s2∂2f
∂ϕ2- + ∂2f
∂z2-. (107)

If a scalar is independent of ϕ and z, only the radial term survives:

  2       1  d (  df)
∇  f(s) = -----  s--- .
          s ds    ds
(108)

This radial form will be useful for long-wire, cylindrical Conductor, and coaxial-electrode problems.

23 Spherical coordinates and their scale factors

ED02 used

(q ,q ,q ) = (r,𝜃,ϕ),
 1  2  3
(109)

where 𝜃 is the polar angle measured from +z and ϕ is the azimuth about z.

The scale factors are

hr = 1,     h𝜃 = r,    h ϕ = rsin𝜃.
(110)

Thus

H =  hrh𝜃hϕ = r2 sin 𝜃.
(111)

The factor r sin 𝜃 is the physical radius of a circle of latitude. In particular, the azimuthal distance r sin 𝜃 dϕ shrinks near the poles, even if dϕ is unchanged.

24 Spherical gradient

Insert Equation (110) into the general gradient:

      ∂f-    1-∂f-ˆ   --1---∂f-ˆ
∇f  = ∂r ˆr + r ∂𝜃 𝜃 + r sin 𝜃∂ ϕϕ.
(112)

The three terms each mean a change in f per unit physical distance along one of the local orthogonal directions.

As a check, let f = r. Then

∇r =  ˆr.
(113)

Increasing the radial coordinate by one meter increases the scalar distance r by one meter. Motion tangent to a sphere does not change r to first order.

25 Spherical divergence and its geometric interpretation

The three face-area products are

h 𝜃h ϕ = r2sin𝜃,
(114)

h h  = r sin 𝜃,    h  h =  r.
 ϕ r                r 𝜃
(115)

Substitute into the general divergence and simplify:

∇⋅ F = 1-
r2    2
∂-(r-Fr)
   ∂r
+   1
------
rsin𝜃∂(sin𝜃F 𝜃)
----------
   ∂ 𝜃
+ --1---
rsin𝜃∂F-ϕ
∂ ϕ. (116)

PIC

Figure 5. The outward flux through a spherical surface depends on both field magnitude Fr and the expanding surface area proportional to r2. The radial divergence term differentiates their product r2Fr.

For a purely radial field F = Fr(r)r, all angular terms vanish:

        1--d-  2
∇ ⋅ F = r2dr (r Fr).
(117)

Two important checks follow.

If Fr = C,

        -1 d(Cr2-)   2C-
∇ ⋅ F = r2   dr   =   r ,    r >  0.
(118)

If instead Fr = C∕r2,

         1 dC
∇ ⋅ F = -- --- = 0,     r > 0.
        r2 dr
(119)

For the inverse-square field, the growing spherical area exactly compensates for the decreasing radial magnitude. Its flux through any sphere centered at the origin is

Φ   = 4πr2 C- = 4πC.
  F        r2
(120)

This zero-divergence calculation is valid away from the origin. The singular point itself must not be discarded. Its treatment requires the Dirac delta distribution, a subject developed later in the ED sequence.

26 Spherical curl

Use the general curl equations with (hr,h𝜃,hϕ) = (1,r,r sin 𝜃).

For the radial component,

(∇× F)r =   1
r2sin𝜃-[                      ]
 ∂ (rsin 𝜃F ϕ)   ∂(rF 𝜃)
 -----∂𝜃-----−  --∂ϕ--- (121)
= --1---
rsin𝜃[                 ]
 ∂-(sin-𝜃Fϕ)   ∂F-𝜃
     ∂𝜃     −  ∂ϕ. (122)

For the polar component,

(∇× F)𝜃 = ---1--
r sin 𝜃[                   ]
 ∂Fr- − ∂(r-sin-𝜃Fϕ)-
  ∂ϕ        ∂r (123)
= 1-
r[                   ]
  -1--∂Fr- − ∂(rF-ϕ)
  sin 𝜃 ∂ϕ      ∂r. (124)

For the azimuthal component,

            1 [∂ (rF )   ∂F  ]
(∇ ×  F)ϕ = -- -----𝜃- − ---r  .
            r     ∂r      ∂𝜃
(125)

The spherical curl can therefore be assembled as

∇× F = (∇× F)rr
+ (∇× F)𝜃𝜃
+ (∇× F)ϕϕ. (126)

The component form above is often easier to read and apply than one very long three-component equation.

27 Spherical scalar Laplacian

Apply divergence to the spherical gradient:

∇2f =  1
-2
r∂
---
∂r(  ∂f )
 r2---
    ∂r
+ ---1---
r2sin𝜃-∂-
∂𝜃(        )
      ∂f-
  sin 𝜃∂ 𝜃
+ ---1----
r2sin2𝜃 2
∂-f-
∂ϕ2. (127)

For a spherically symmetric scalar f(r),

                (     )
∇2f  (r) =  1--d-  r2df- .
           r2dr     dr
(128)

This is the radial Laplacian used for the electrostatic potential of a spherically symmetric charge distribution.

28 A common trap: constant components need not mean a uniform vector

In Cartesian coordinates, a spatially constant list of components describes a constant vector. In curvilinear coordinates, basis vectors rotate with position.

For example, a uniform field in the +z direction is

F =  F0ˆz.
(129)

ED02 gives the spherical decomposition

ˆz = cos𝜃 ˆr − sin 𝜃 ˆ𝜃.
(130)

Therefore

Fr =  F0cos 𝜃,  F 𝜃 = − F0 sin𝜃,  Fϕ = 0.
(131)

Use spherical divergence:

∇⋅ F = -1
r2   2
∂(r-F0-cos𝜃)-
     ∂r
+   1
------
rsin 𝜃∂(− F0 sin2 𝜃)
-------------
     ∂ 𝜃. (132)

Evaluate each term:

2F0-cos-𝜃−  2F0-cos𝜃-= 0.
    r          r
(133)

The terms cancel, just as they must for a uniform Cartesian vector field.

If we had treated Fr alone as the whole field or omitted the angular basis contribution, we would have obtained an incorrect divergence.

29 Two useful vector-calculus identities

For any sufficiently smooth scalar field f,

∇  × (∇f ) = 0.
(134)

For example, its Cartesian z component is

(∇×∇f)z = -∂-
∂x(   )
  ∂f-
  ∂y−-∂-
∂y(    )
  ∂f-
  ∂x (135)
= fyx − fxy = 0, (136)

because mixed partial derivatives agree under the usual smoothness conditions.

Similarly, for a sufficiently smooth vector field F,

∇  ⋅ (∇ × F) = 0.
(137)

In Cartesian coordinates, substituting Equation (50) produces six mixed second derivatives that cancel in pairs.

These are local identities. Statements about global potential functions require additional care with domain topology and singularities. ED04 will connect local identities to closed-loop and closed-surface integral laws.

30 Terminology: irrotational and solenoidal fields

A vector field is called irrotational in a region if

∇  × F =  0
(138)

throughout that region.

A field is called solenoidal or divergence-free in a region if

∇ ⋅ F = 0
(139)

throughout that region.

Those properties are distinct. A rigid-rotation velocity field is divergence-free but has nonzero curl. An expanding radial field may have nonzero divergence but zero curl in a region where it is smooth.

PIC

Figure 6. Two fields can have very different local differential properties. The planar radial field shown has positive divergence and zero curl away from its center; rigid rotation has zero divergence and curl directed along the rotation axis.

31 Worked electromagnetic example 1: potential mapping

Suppose a two-dimensional electrostatic potential is modeled in a region by

V (x,y ) = V0(x2 − y2),
           L2
(140)

where V 0 has units of volts and L has units of length.

Step 1: Differentiate the potential,

∂V     2V0x      ∂V       2V0y
----=  ---2-,    ----=  − --2--.
 ∂x     L         ∂y       L
(141)

Step 2: Apply the electrostatic relation E = −∇V ,

       2V0x     2V0y
E  = − ---2-ˆx + ---2-ˆy.
        L        L
(142)

Step 3: Compute the divergence,

∇⋅ E = −2V0
L2-- + 2V0
-L2- (143)
= 0. (144)

Step 4: Compute the z component of curl,

(∇× E)z = ∂Ey
----
 ∂x −∂Ex
----
∂y (145)
= 0 − 0 = 0. (146)

Thus this example is both divergence-free and curl-free in the modeled region. It is consistent with the absence of local electrostatic charge there and with an electrostatic potential field.

PIC

Figure 7. In a potential-mapping laboratory, a voltmeter samples the scalar V at neighboring points. Differences of those samples estimate ∂V∕∂x and ∂V∕∂y, which determine the local electric-field components.

A central-difference estimate from a grid is

               V(xi + Δx, yj) − V (xi − Δx, yj)
Ex (xi,yj) ≈ − -------------------------------,
                            2Δx
(147)

and similarly

               V (xi,yj + Δy ) − V(xi,yj − Δy )
Ey (xi,yj) ≈ − -------------------------------.
                            2Δy
(148)

This is a practical example of the mathematical gradient acting on measured data. It is also a reminder that a numerical estimate depends on probe spacing, noise, and measurement resolution.

32 Worked electromagnetic example 2: charge density from divergence

Suppose a field within a region is

E  = αx ˆx + βyyˆ+  γzˆz,
(149)

where α,β,γ are constants with units V∕m2.

Compute

∇  ⋅ E = α + β + γ.
(150)

Gauss’s local electric law, previewed in ED01, is

∇ ⋅ E =  ρ-.
         𝜖0
(151)

Therefore the required charge density is

ρ = 𝜖0(α +  β + γ).
(152)

The result has correct units: 𝜖0 times V∕m2 has units C∕m3.

The curl of this field is zero, consistent with its representation by the electrostatic potential

       1-   2     2     2
V =  − 2(αx  + βy  + γz  ) + constant.
(153)

33 Worked electromagnetic example 3: azimuthal magnetic field

Consider a cylindrically symmetric field

B =  ks ˆϕ,
(154)

where k is a constant with units T∕m.

The cylindrical divergence is zero because Bs = Bz = 0 and Bϕ is independent of ϕ:

∇ ⋅ B = 0.
(155)

The axial curl is

(∇× B)z = 1-
s∂(sB-ϕ)
  ∂s (156)
= 1
--
sd(ks2)
-------
  ds (157)
= 2k. (158)

All other curl components vanish, so

∇ × B  = 2k ˆz.
(159)

For a steady magnetostatic field in vacuum, Ampere’s local law gives

∇ × B  = μ0J.
(160)

Hence this field corresponds to uniform axial current density

     2k-
J =  μ0ˆz.
(161)

This is a useful example because the azimuthal component must be differentiated together with the geometric factor s.

34 Worked example 4: direct Cartesian computation

Let

F =  (yz, xz, xy ).
(162)

Its divergence is

        ∂(yz)-   ∂(xz)-  ∂-(xy-)
∇ ⋅ F =  ∂x   +   ∂y   +   ∂z   = 0.
(163)

Compute the curl components,

(∇× F)x = x − x = 0, (164)
(∇× F)y = y − y = 0, (165)
(∇× F)z = z − z = 0. (166)

This field is the gradient of the scalar f = xyz:

∇ (xyz ) = (yz,xz, xy).
(167)

The result therefore provides a direct check of the identity ∇×∇f = 0. Note, however, that the divergence of a gradient is its Laplacian; the fact that it also vanishes here is a special property of f = xyz, not a universal property of gradients.

35 Coordinate singularities and sources

Cylindrical formulas have factors 1∕s; spherical formulas have 1∕r, 1∕r2, and 1∕ sin 𝜃. These expressions can be singular on coordinate axes or at the origin.

There are two distinct possibilities:

  • The coordinate chart is degenerate even though the underlying physical field remains smooth; a uniform Cartesian field expressed in spherical components is a common example.
  • The physical field is genuinely singular, as in the ideal electrostatic point-charge field E ∝r∕r2 at the origin.

The coordinate formulas derived here apply directly only where the coordinate basis is defined and the field is sufficiently differentiable. Distributions, point sources, line currents, and the role of the domain will receive separate treatment in later articles.

36 How to choose the right operator

Before calculating, translate the physical question into a mathematical one.

  • How does a scalar change with position? Compute ∇f. To get the rate along a specified direction, compute ∇f ⋅u.
  • Does a vector field have local net outward flux? Compute ∇⋅ F.
  • Does it have local oriented circulation? Compute ∇× F.
  • How does the gradient of a scalar spread or converge? Compute ∇2f = ∇⋅∇f.

Then choose coordinates that match the geometry. Do not substitute cylindrical or spherical components into the Cartesian formulas without accounting for basis rotation and scale factors.

37 Formula summary for Cartesian coordinates

For F = Fxx + Fyy + Fzz,

∇f = fxx + fyy + fzz, (168)
∇⋅ F = Fx,x + Fy,y + Fz,z, (169)
∇2f = f xx + fyy + fzz. (170)

Curl is given by Equation (50).

38 Formula summary for cylindrical coordinates

For (s,ϕ,z) with (hs,hϕ,hz) = (1,s, 1),

            f-ϕˆ
∇f  = fsˆs +  s ϕ + fzˆz,
(171)

∇ ⋅ F = 1∂  (sF  ) + 1∂ F  + ∂  F ,
        s  s   s    s ϕ  ϕ    z z
(172)

(∇× F)s = 1-
s∂ϕFz − ∂zFϕ, (173)
(∇× F)ϕ = ∂zFs − ∂sFz, (174)
(∇× F)z = 1-
s[∂s(sFϕ) − ∂ϕFs], (175)

and

∇2f =  1∂ (sf ) + -1f   + f  .
       s  s  s    s2 ϕϕ    zz
(176)

In these compressed formulas, subscripts s,ϕ,z on f indicate partial derivatives. Subscripts on the vector components Fs,Fϕ,Fz identify basis components.

39 Formula summary for spherical coordinates

For (r,𝜃,ϕ) with (hr,h𝜃,hϕ) = (1,r,r sin 𝜃),

            f𝜃 ˆ   --fϕ--ˆ
∇f  = frˆr +  r 𝜃 + rsin 𝜃ϕ,
(177)

∇⋅ F = 1
-2
r∂r(r2F r)
+ ---1--
r sin 𝜃∂𝜃(sin 𝜃F𝜃)
+ ---1--
r sin 𝜃∂ϕFϕ. (178)

The three spherical curl components are given explicitly in the spherical curl section, and the scalar Laplacian is Equation (127). Keeping those formulas separated avoids a long expression that is difficult to read and prone to rendering problems.

40 Common mistakes

  1. Thinking divergence is simply “arrows pointing outward.” It is a limit of net flux per volume.
  2. Thinking curved field lines automatically imply nonzero curl. Curl is a local circulation limit.
  3. Forgetting the right-hand orientation when computing circulation and curl.
  4. Treating ϕ and 𝜃 as lengths rather than angles with scale factors.
  5. Omitting the radial area factor r2 from spherical divergence.
  6. Omitting the factor s inside ∂s(sFϕ) in cylindrical curl.
  7. Treating a curvilinear basis as if its directions were fixed Cartesian basis vectors.
  8. Using the scalar Laplacian independently on vector components in a curved basis without accounting for basis variation.
  9. Concluding that ∇⋅ (Cr∕r2) = 0 everywhere, including the undefined origin.
  10. Applying electrostatic E = −∇V to a time-dependent electromagnetic field without the vector-potential term.

41 Practice exercises

  1. For f = x2y + z3, find ∇f and the directional derivative at (1, 2, 1) along (1, 1, 1)∕√3--.
  2. Compute the divergence and curl of F = (x2,−2xy,z2).
  3. Derive the x component of Cartesian curl by applying the small-loop circulation argument to a loop in the yz plane.
  4. Starting from (hs,hϕ,hz) = (1,s, 1), derive cylindrical divergence without quoting the final formula.
  5. Show that the cylindrical field F = Cs∕s has zero divergence for s > 0.
  6. Use the cylindrical curl expression to compute curl of F = Ωsϕ.
  7. Starting from the spherical scale factors, derive the r component of spherical curl.
  8. Prove that ∇⋅ (Fr(r)r) = r−2d(r2F r)∕dr for r > 0.
  9. Evaluate ∇2(rn) away from the origin for real n and identify the values of n for which it vanishes.
  10. Show that a uniform Cartesian vector F0z has zero divergence using spherical coordinates.
  11. For V (x,y) = V 0(x2 − y2)∕L2, compute E, its divergence, and its curl.
  12. Explain the physical difference between flux through a closed surface and circulation around a closed curve.

42 Companion filebox resources

The following lightweight files are intended for uploading to the ED03 PhysicsLibrary filebox:

43 Summary and bridge to ED04

The gradient, divergence, and curl are local differential operators with complementary geometric meanings:

df = ∇f  ⋅ dr,
(179)

              net-outward--flux-
∇  ⋅ F = ΔlVim→0      ΔV        ,
(180)

(∇ × F ) ⋅ ˆn = lim   oriented-circulation-.
              ΔA →0        ΔA
(181)

Their curvilinear formulas are built from the same ED02 scale factors that convert coordinate increments into physical lengths, areas, and volumes.

ED04 will establish the two major integral bridges:

∫             ∮
    ∇ ⋅ F dτ =    F  ⋅ da,
  V             ∂V
(182)

and

∫                 ∮
   (∇  × F ) ⋅ da =   F  ⋅ dl.
 S                 ∂S
(183)

Those theorems turn the local differential laws of Maxwell’s Equations into the integral forms used throughout electrodynamics and laboratory measurements.

References

References

[1]   D. J. Griffiths, Introduction to Electrodynamics, 5th ed., Cambridge University Press, 2023.

[2]   E. M. Purcell and D. J. Morin, Electricity and Magnetism, 3rd ed., Cambridge University Press, 2013.

[3]   H. M. Schey, Div, Grad, Curl, and All That, 4th ed., W. W. Norton, 2005.

[4]   M. L. Boas, Mathematical Methods in the Physical Sciences, 3rd ed., Wiley, 2006.

[5]   G. B. Arfken, H. J. Weber, and F. E. Harris, Mathematical Methods for Physicists, 7th ed., Academic Press, 2013.


"Gradient, Divergence, Curl, and the Geometry of Differential Operators" is owned by bloftin.
(view preamble)
View style:
Other names:  ED03
Also defines:  gradient, directional derivative, divergence, flux density, curl, circulation density, Laplacian, vector differential operator, scale factor, orthogonal coordinates, solenoidal field, irrotational field, source density
Keywords:  gradient, divergence, curl, directional derivative, Laplacian, vector calculus, flux, circulation, curvilinear coordinates, cylindrical coordinates, spherical coordinates, Maxwell equations, electromagnetism

Cross-references: Maxwell's Equations, electromagnetic field, section, current density, magnetostatic, representation, charge density, two-dimensional, solenoidal, domain, identities, charge, Dirac delta distribution, latitude, Conductor, cylindrical coordinates, Cartesian coordinates, unit vectors, position, position vector, operator, velocity, mechanics, angular velocity, speed, velocity field, determinant, line integral, relation, equipotential, test charge, work, electric potential, electric field, Normal, dot product, displacement, function, theorems, Electromagnetism, operators, algebraic, spherical coordinates, formulas, volume, unit, flux, scalar, operations, volume elements, ED02, magnitudes, vector fields, vectors, ED01, magnetic fields
There are 3 references to this object.

This is version 1 of Gradient, Divergence, Curl, and the Geometry of Differential Operators, born on 2026-11-20.
Object id is 1584, canonical name is GradientDivergenceCurlAndTheGeometryOfDifferentialOperators.
Accessed 2 times total.

Classification:
Physics Classification: 02.30.Em (Potential theory)
 02.40.-k (Geometry, differential geometry, and topology )
 03.50.De (Classical electromagnetism, Maxwell equations )

Pending Errata and Addenda

None.

Discussion

No messages.

Interact