Vector Fields, Curl and Divergence
Text In three dimensions, a vector field V can be expressed in terms of the functions p(x,y,z), q(x,y,z), and r(x,y,z) as V(x,y,z) = (p(x,y,z),q(x,y,z),r(x,y,z)).
Note that for the gradient vector field, p = f_{x}, q = f_{y}, and r = f_{z}.
The divergence of a threedimensional vector field V(x,y,z) is defined as div V = ∇ {cdot} V = p_{x} + q_{y} + r_{z}.
Note that divergence is a scalar value.
The curl of a threedimensional vector field V(x,y,z) is defined as curl V = ∇ {times} V = (r_{y}q_{z}, p_{z}r_{x}, q_{x}p_{y}).
Note that this is another vector field.
Demos
Vector Field with Divergence and Curl
 
This demo illustrates the curl and the divergence of a three dimensional vector field. You can enter a threedimensional vector field V by entering the three components p,q and r; the Curl window will the show the curl vector at selected points in the domain. Note that the curl of a vector field is thus a vector field.In the , you can see a color graph of the divergence; each point in the threedimensional domain is assigned a color based on the value of the divergence of V at that point. The last window color graphs the length of the curl vector at each point.

Circulation along a curve in 3D
 
In this demo, we show the circulation along a curve C(t). The window "The unit tangents" shows the vecor field V(x,y,z) and the curve C(t); the red vectors are the unit tangent at certain points on the curve. The second window, "V(x,y,z) at C(t)" shows the vector field V(x,y) evaluated at (x,y,z)=C(t).
In the third window we see a graph of the function that gives the value of the dot product of V(C(t)) with the unit tangent at C(t). The circulation along C(t) is then equal to the (signed) area under the graph, and you can read it off the readout "Circ".

Flux across a surface
 
In this demo, we show the flux across a surfaceS(t,s). The window "The unit normals" shows the vecor field V(x,y,z) and the surface S; the red vectors are the unit normals at certain points on the surface. The second window, "V(x,y) at C(t)" shows the vector field V(x,y) evaluated at (x,y,z)=S(t,s).
In the third window we see the graph of the function that gives the value of the dot product of V(S(t,s)) with the unit normal at S(t,s). The flux across S is then equal to the (signed) volume under the curve, and you can read its value off the readout "Flux".

Exercises 1. In the divergence and curl demo, enter for V the position function (V(x, y, z) = (x, y, z)). Describe the divergence and curl of this vector field.
2. Describe the divergence and curl of the vector field V(x, y, z) = (y, x, 0).
3. Find the circulation of the vector fields in 1. and 2. along the unit circle in the xyplane centered at the origin.
4. Find the flux of the vector fields in 1. and 2. across each of the following surfaces:
 The sphere of radius 1 centered the origin.
 The sphere of radius 2 centered the origin.
 The cylinder of radius 1 given by x^{2} + y^{2} = 1.
 The plane z = 1.
