Calculus of Vectors Calculus of Scalar and Vector Fields
Calculus of Vectors Calculus of Scalar and Vector Fields
P1 Calculus 3
Calculus of Vectors and Fields
This course on calculus is concerned with the calculus of vectors, and the calculus of
scalar and vector fields.
We start by applying calculus of single variables to individual vectors and vector rela-
tionships defined in fixed coordinate systems. We then consider how to describe curves
in 3D space and introduce spatially moving coordinates, followed by two varieties of
temporally moving systems.
We then move on to consider calculus applied to scalar and vector fields. A scalar
field is such that a scalar quantity has a defined value at each location in some space.
For example, one might define pressure P (x, y , z, t) ≡ P (x, t) at each location in
the atmosphere. The wind velocities generated by this pressure field will have different
magnitudes and directions at each location, and therefore comprise a vector field v(x, t).
The overall aim is to examine how calculus can be applied effectively in 3D without
recourse to arbitrary coordinate systems.
Notation. We will use a bold font a, b, . . . , α, β, . . . to represent vectors and the
corresponding non-bold font a, b, . . . , α, β, . . . for their magnitudes. Unit vectors will
wear hats â, b̂, . . . , α̂, β̂, . . .. The unit vector along Cartesian x, y , z axes are ı̂,̂, k̂.
Later we will require unit vectors in cylindrical and spherical coordinates. These will be
r̂, φ̂, ẑ and r̂, θ̂, φ̂.
In your written work, underline the vector symbol and be meticulous doing so. Utter
chaos ensues if you can’t distinguish vectors from scalars in expressions like r 2 r. Re-
member too that if the left hand side of an equation is a vector, then so must the right
hand side; and ditto for scalars.
0/2
Lecture Content
1. Differentiation of vectors and vector expressions. Space curves, the position vector
and its differential. Arc-length. Tangents, normals, and binormials. Coordinate
sytems that change — I: Frenet-Serret; II: vector derivatives in plane-polars; III
rotation and Coriolis.
2. Introduction to scalar and vector fields. Scalar field and the gradient operator
grad, examples and significance. Gradients, fields and potentials. An introduction
to line integrals using vectors.
3. Vectors fields and the divergence operator div: examples and significance of di-
vergence. Flux density and surface integrals. Vectors fields and the curl operator:
examples and significance. Combining vector operators.
4. Vector calculus in other coordinate systems. The position vector and its differential
in curvilinear systems, and in the polars. Metric scale parameters, and their link
to multiple integration. Some examples of the geometry, involving simple line and
surface integrals.
Tutorial Sheets
The tutorial sheet associated with this course is
Reading
• James, G. (2004) Advanced Modern Engineering Mathematics, Prentice-Hall,
3rd Ed., ISBN: 0-13-045425-7 (paperback).
• Kreyszig, E. (1999) Advanced Engineering Mathematics, John Wiley & Sons,
8th Ed., ISBN: 0-471-15496-2 (paperback).
• Sokolnikoff, I.S. and Redheffer, R.M. (1966) Mathematics and Physics of Mod-
ern Engineering, McGraw-Hill 2nd ed. (A classic.)
o
Figure 1.1: A position vector r(t) varying with time t.
A vector expression in n dimensions on the left and right hand sides of an equation is
entirely equivalent to writing n scalar equations in the components of the vector. This
indicates that the fundamental definition of the derivative must extend effortlessly to
vectors. So, if we have a vector function f(p) of some single parameter p, it must be
1
1/2 LECTURE 1. DIFFERENTIATING VECTOR FUNCTIONS OF A SINGLE VARIABLE
that
df f(p + δp) − f(p)
= lim . (1.1)
dp δp→0 δp
If we write f in terms of components relative to a FIXED coordinate system (for
example, ı̂,̂, k̂ are fixed)
df dfx dfy dfz
f(p) = fx (p)ı̂ + fy (p)̂ + fz (p)k̂ ⇒ = ı̂ + ̂ + k̂ . (1.2)
dp dp dp dp
That is, in order to differentiate a vector defined with respect to fixed axes, one simply
differentiates each component separately.
For example, suppose r(t) is the position vector of a moving object:
r(t) = x(t)ı̂ + y (t)̂ + z(t)k̂ . (1.3)
Then its instantaneous velocity and acceleration are
dr dx dy dz dv d 2x d 2y d 2z
v(t) = = ı̂ + ̂ + k̂ and a(t) = = 2 ı̂ + 2 ̂ + 2 k̂ . (1.4)
dt dt dt dt dt dt dt dt
Returning to the general problem, it is obvious that df/dp has a different magnitude
from f, but note that in general it also has a different direction. Because we are just
dividing the vector df by a scalar dp, it must be df/dp has the same direction as df
but, not surprisingly, the change df has a different direction to f.
♣ Example #1
Q: A 3D vector f of constant magnitude is varying over time. What can you say about
the direction of df/dt?
A: Using intuition: if only its direction is changing, then the vector must be tracing
out paths on the surface of a sphere. We would intuit that the derivative df/dt is
orthogonal to f.
To prove this write
d df df df
(f · f) = f · + · f = 2f · . (1.7)
dt dt dt dt
But (f · f) = f 2 which we are told is constant.
d df
⇒ (f · f) = 0 ⇒ 2f · =0 (1.8)
dt dt
and hence f and df/dt must be perpendicular when |f| is constant.
♣ Example #2
Q: The position of a vehicle is r(u) where u is the amount of fuel consumed by some
time t. Work out an expression for the acceleration.
A: The velocity and acceleration are
2
d 2 r du dr d 2 u
dr dr du d dr d dr du
v= = a= = = + . (1.9)
dt du dt dt dt dt du dt du 2 dt du dt 2
1.2 Integration of a vector function
As with scalars, integration of a vector function of a single scalar variable is the reverse
of differentiation. That is,
Z p2
df(p)
dp = f(p2 ) − f(p1 ) . (1.10)
p1 dp
However, more interesting types of integral are possible, especially when the vector is
a function of more than one variable. This requires the introduction of the concepts
of scalar and vector fields. See later.
(a) (b)
Figure 1.2: (a) δr is a secant to the curve but, in the limit as δp → 0, becomes a tangent. (b) Two
special parameters, arc-length s and time t.
0.4 2
0.6 2
1.0 3
3 10
0.8 5
0.2 4 1 4
Figure 1.3: Different parametrizations describe the same curve. Arc-length s is special as it measures
actual distance along the curve.
1.4. THE POSITION VECTOR, SPACE CURVES, AND DERIVATIVES 1/5
The difference in arc-length between two points on the curve is the actual distance
travelled along the curve. But, for infinitesimally small movements, it must be that
ds = |dr|, so that dr/ds must be of unit length.
If a curve r(s) is parametrized by the arc length s
dr
is everywhere a UNIT tangent to the curve.
ds
In general, parameter p will not be arc-length. But the chain rule tells us that
dr dr ds
= . (1.12)
dp ds dp
So, the direction of the derivative dr/dp is that of a tangent to the curve, and its
magnitude is |ds/dp|, the rate of change of arc length w.r.t the parameter.
An immediately interesting case (see Fig. 1.2b) is when p is time t. Then
dr dr ds
= (1.13)
dt ds dt
This indicates that when moving along a curve, the vector velocity is the unit tangent
(dr/ds) multiplied by the scalar speed (ds/dt). This makes sense!
Q2: Determine the unit tangent to the helix, and hence determine the relationship
between α and arc-length s given s = 0 when α = 0.
A2: The parameter α is (probably) not special. The non-unit tangent is
dr P
= −a sin(α)ı̂ + a cos(α)̂ + k̂ . (1.15)
dα 2π
Its magnitude is
dr ds p
= = a2 + (P/2π)2 . (1.16)
dα dα
Hence the unit tangent is
dr dr dα 1 P
= =p −a sin(α)ı̂ + a cos(α)̂ + k̂ . (1.17)
ds dα ds a2 + (P/2π)2 2π
Q3. Show that the unit tangent to the curve has a constant elevation angle w.r.t the
xy -plane, and determine the angle’s magnitude.
A3. The unit tangent’s projections onto the xy plane and the k̂ axis have magnitudes
a (P/2π)
p and p . (1.19)
a2 + (P/2π)2 a2 + (P/2π)2
Hence the elevation angle is e = tan−1 (P/(2πa)), which is constant.
x y
Figure 1.4: Working out the elevation angle between the tangent and the xy -plane.
1.5. MORE ON R, ITS CHANGE DR, & PARAMETERS S, P 1/7
r = xı̂ + ŷ + z k̂ or using the parameter r(p) = x(p)ı̂ + y (p)̂ + z(p)k̂ . (1.20)
But we have already noted that ds = |dr| and hence, as sketched in Fig. 1.5,
ds 2 = dx 2 + dy 2 + dz 2 . (1.22)
z
y
Figure 1.5: The curvature is WILDLY exaggerated! In the limit, δs is straight and ds 2 = dx 2 +dy 2 +dz 2 .
Where next?
So far we have referred our vectors to a coordinate system that is fixed in space.
We now come to consider three areas where the coordinate systems change ...
Our brains seem better wired for fixed coordinates, so this can be confusing at times!
1/8 LECTURE 1. DIFFERENTIATING VECTOR FUNCTIONS OF A SINGLE VARIABLE
(a) (b)
Figure 1.6: (a) A coordinate frame intrinsic to the curve. (b) The unit tangent t̂ changing as s changes.
The local system is defined by three mutually perpendicular directions. These are:
1. Tangent t̂. For the first intrinsic direction defined at at the point r(s) we can use
the unit tangent t̂. We know already that
dr
t̂ = . (1.24)
ds
2. Principal Normal n̂. Recall our earlier proof that if f was a vector with variable
direction but fixed magnitude then df/dt and f were orthogonal. But t̂ has
constant magnitude and varies over s, so that d t̂/ds must be perpendicular to t̂.
Hence for the second direction we use the principal normal n̂ defined by
d t̂
κn̂ = : where κ ≥ 0 by convention. (1.25)
ds
κ is the curvature, and κ = 0 for a straight line.
3. The Binormal b̂
The local coordinate frame is completed by defining the binormal as
b̂(s) = t̂(s) × n̂(s) . (1.26)
1.6. COORDINATE SYSTEMS THAT CHANGE (1): FRENET-SERRET RELATIONS 1/9
With t̂, n̂ and b̂ defined, the Frenet-Serret relationships emerge from differentiating
dot products between them.
First, since b̂ · t̂ = 0,
d d b̂ d t̂ d b̂
b̂ · t̂ = · t̂ + b̂ · = · t̂ + b̂ · κn̂ = 0 . (1.27)
ds ds ds ds
But b̂ · n̂ = 0, so
d b̂
· t̂ = 0. (1.28)
ds
This says d b̂/ds is perpendicular to t̂; but was also know that because b̂ has fixed
magnitude it is perpendicular to b̂. Hence it must be along the direction of n̂:
d b̂
= −τ (s)n̂(s) (1.29)
ds
where by definition τ is the curve’s torsion. (The negative sign is a matter of conven-
tion.)
Differentiating n̂ · t̂ = 0 and n̂ · b̂ = 0, we find
d n̂ d t̂ d n̂ d n̂
· t̂ + n̂ · = · t̂ + n̂ · (κn̂) = 0 ⇒ · t̂ = −κ (1.30)
ds ds ds ds
d n̂ d b̂ d n̂ d n̂
· b̂ + n̂ · = · b̂ + n̂ · (−τ n̂) = 0 ⇒ · b̂ = τ . (1.31)
ds ds ds ds
Together these give
d n̂
= −κ(s)t̂(s) + τ (s)b̂(s). (1.32)
ds
The twists and turns in a space curve are therefore described by the local curvature
and torsion, and we now have all three of
The Frenet-Serret relationships
d t̂/ds = κn̂ (1.33)
d n̂/ds = −κ(s)t̂(s) + τ (s)b̂(s) (1.34)
d b̂/ds = −τ (s)n̂(s) (1.35)
1/10 LECTURE 1. DIFFERENTIATING VECTOR FUNCTIONS OF A SINGLE VARIABLE
so that r̂ · r̂ = 1, φ̂ · φ̂ = 1, and r̂ · φ̂ = 0.
Figure 1.7:
The velocity of P is
d dr dr̂
ṙ = (rr̂) = r̂ + r (1.46)
dt dt dt
dr dφ
= r̂ + r (− sin φı̂ + cos φ̂)
dt dt
dr dφ
= r̂ + r φ̂ = radial + tangential
dt dt
The radial and tangential components of velocity of P are therefore dr /dt and r dφ/dt,
respectively.
Differentiating again gives the acceleration of P
d 2r dr dφ dr dφ d 2φ dφ dφ
r̈ = 2
r̂ + φ̂ + φ̂ + r φ̂ − r r̂ (1.47)
"dt dt dt #dt dt dt 2 dt dt
2
d 2r d 2φ
dφ dr dφ
= −r r̂ + 2 + r 2 φ̂
dt 2 dt dt dt dt
One might guess this system is convenient when there is motion related to a circle.
Three obvious cases are:
Figure 1.8: You sit in a fixed frame and observe the movement of a point P on a body which rotated.
(a) (b)
Figure 1.9: Vectors in the rotating and fixed frames when (a) P is stationary in the rotating frame, and
(b) when it is moving.
Let ρ be the position, as described in the rotating frame, of the point P The point’s
position in the translated fixed frame is just r. Now, at some instant t, let the rotating
coordinate frame be be aligned with the fixed coord system. So at instant t, and only
at instant t, r = ρ.
1/14 LECTURE 1. DIFFERENTIATING VECTOR FUNCTIONS OF A SINGLE VARIABLE
First suppose that point P is stationary in the rotating frame (Fig 1.9(a)). Its velocity
is therefore zero in the rotating frame, but at any instant in the fixed frame P’s velocity
is
dr
=ω×r =ω×ρ . (1.51)
dt
Although the frames are aligned, this is true whether or not the origins of coordinates
coincide. Notice that dr/dt will have fixed magnitude, and will always be perpendicular
to the axis of rotation.
Now let the point P move in the rotating frame. There will be two contributions to its
motion when described in the fixed frame — one due to its motion within the rotating
frame, and one due to the rotation itself. Over an interval δt the movement is
δr = δρ + (ω × ρ)δt . (1.52)
Hence the instantaneous velocity in the fixed frame is the sum of the body defined
motion and the rotational motion:
dr Dρ D
= + ω×ρ ≡ + ω× ρ. (1.53)
dt Dt Dt
Here, the capital D is used to indicate differentiation in the rotating frame. We’ve also
introduced an operator notation. Note that we could replace ρ on the RHS with r. At
the instant under consideration, they are the same.
But, again because the frames are aligned at instant t, this equation applies to any
vector. In particular, the instantaneous acceleration is
d 2r
D dr D D
= + ω× = + ω× + ω× r . (1.54)
dt 2 Dt dt Dt Dt
• The first term is the acceleration of the point P in the rotating frame measured
in the rotating frame.
• The last term is the centripetal acceleration to due to the rotation. (Yes! Its
magnitude is ω 2 r and its direction is that of −r. Check it out.)
1.8. COORDINATE FRAMES THAT MOVE (3): ROTATION & CORIOLIS 1/15
• The middle term is an extra term which arises because of the velocity of P in the
rotating frame. It is known as the Coriolis acceleration, named after the French
engineer who first identified it.
Because of the rotation of the earth, the Coriolis acceleration is of great importance
in meteorology and accounts for the occurrence of high pressure anti-cyclones and
low pressure cyclones in the northern hemisphere, in which the Coriolis acceleration
is produced by a pressure gradient. It is also a very important component of the
acceleration (hence the force exerted) by a rapidly moving robot arm, whose links whirl
rapidly about rotary joints. You’ll learn more about this in the 2nd year A3 Dynamics
of Machines course.
Our focus now turns away from individual vectors and towards scalar and vector quanti-
ties which are defined over regions in space. When a scalar function U(r) is determined
or defined at each position r in some region, we say that U is a scalar field in that
region. Similarly, if a vector function v(r) is defined at each point, then v is a vector
field in that region. Familiar examples of 2D fields are shown in Fig. 2.1.
(a) (b)
Figure 2.1: Examples of (a) a scalar field (temperature); (b) a vector field (wind velocity)
As you would guess, there are strong links between fields of each type. In heat transfer,
a scalar temperature field will give rise to vector field of heat flow, in fluid mechanics a
scalar pressure field will give rise to a vector field of velocity flow, and in electrostatics
an scalar potential field will give rise to a vector electric field.
In each case there is a sense of “flow” from a higher “potential to do something” to
a lower one — one would therefore guess that gradients, but 3D gradients, will be
involved.
1
2/2 LECTURE 2. SCALAR FIELDS AND THE GRAD OPERATOR.
This leads us to define the gradient of a scalar field using a differential vector operator.
Acting on a scalar field it delivers a vector field of gradients. (An early warning! We’ve
been talking about high to low potential, but the gradient vector field will, of course,
point from low to high values of the scalar field.)
Note that ∇ is vector operator which operates on a scalar field and returns a vector
field.
Also note, without thinking too carefully about it, that the gradient of a scalar field
tends to point in the 3D direction of greatest change of the field. Later we will be
more precise.
2: U = r 2 = x 2 + y 2 + z 2
∂ ∂ ∂
⇒ ∇U = ı̂ + ̂ + k̂ (x 2 +y 2 +z 2 ) = 2xı̂+2ŷ+2z k̂ = 2 r . (2.4)
∂x ∂y ∂z
1
del because (I guess) it’s an inverted delta, and nabla because (according to Wikipedia) nabla is Greek for a Phoenician
harp — but, heck, you knew that ...
2.3. THE SIGNIFICANCE OF GRAD 2/3
3: U = c · r, where c is constant.
∂ ∂ ∂
⇒ ∇ U = ı̂ + ̂ + k̂ (c1 x + c2 y + c3 z) = c1 ı̂ + c2 ̂ + c3 k̂ = c . (2.5)
∂x ∂y ∂z
p
4: U = U(r ), where r = (x 2 + y 2 + z 2 ).
U is a function of r alone so dU/dr exists. As U = U(x, y , z) as well,
∂U dU ∂r ∂U dU ∂r ∂U dU ∂r
= = = . (2.6)
∂x dr ∂x ∂y dr ∂y ∂z dr ∂z
∂U ∂U ∂U dU ∂r ∂r ∂r
⇒ ∇U = ı̂ + ̂ + k̂ = ı̂ + ̂ + k̂ (2.7)
∂x ∂y ∂z dr ∂x ∂y ∂z
But r = (x 2 + y 2 + z 2 )1/2 , so
∂r 1 x ∂r y ∂r z
= 2x (x 2 + y 2 + z 2 )−1/2 = and = , = .
∂x 2 r ∂y r ∂z r
!
dU xı̂ + ŷ + z k̂ dU r dU
⇒ ∇U = = = r̂ . (2.8)
dr r dr r dr
Note that it makes sense for a radially symmetric scalar field to have a gradient which
is a radially symmetric vector field.
5: From paper P2 you will recognize Φ(r ) as the electric potential a distance r from a
point charge Q in vacuum.
Q 1
Φ(r ) = .
4πo r
We can use Example 4 to find the gradient
Q r̂ Q r̂
∇Φ = − . or we could write − ∇ Φ = . (2.9)
4πo r 2 4πo r 2
You will recognize the RHS of the second expression as the electric field E around a
point charge. You already knew that in one dimension E = −dΦ/dx, and now we’ve
found out that
In 3D we write the vector electric field as the -ve gradient of the potential:
∇Φ .
E = −∇
Remember too that the potential Φ is a scalar, and the electric field is a vector.
2/4 LECTURE 2. SCALAR FIELDS AND THE GRAD OPERATOR.
(a) (b)
Figure 2.2: The directional derivative: The rate of change of U with respect to distance in direction d̂
is ∇ U · d̂.
But ∇ U = (ı̂∂U/∂x +̂∂U/∂y + k̂∂U/∂z), so that the change in U can also be written
as the scalar product
dU = ∇ U · dr . (2.11)
Now divide both sides by ds (allowed because these are total differentials):
dU dr
= ∇U · . (2.12)
ds ds
But remember that |dr| = ds, so dr/ds is a unit vector in the direction of dr.
This result can be paraphrased (Fig. 2.2(b)) as:
Statement #1: gradU has the property that the rate of change of U wrt distance
in a particular direction (d̂) is the projection of gradU onto that direction (ie, the
component of gradU in that direction).
2.3. THE SIGNIFICANCE OF GRAD 2/5
The quantity dU/ds is called a directional derivative, but note that in general it has a
different value for each direction, and so has no meaning until you specify the direction.
Now imagine sitting at one point and changing the direction of d̂. Looking at Fig. 2.2(b)
and/or Eq. (2.12) it is evident that
Statement #2: At any position r in a scalar field U, gradU points in the direction of
greatest change of U at P, and has magnitude equal to the rate of change of U with
respect to distance in that direction.
0.1
0.08
0.06
0.04
0.02
0
4
2 4
2
0
0
−2
−2
−4 −4
Figure 2.3: ∇ U is in the direction of greatest (positive!) change of U wrt distance. (Positive ⇒“uphill”.)
Another nice property emerges if we think of a surface of constant U – that is the locus
(x, y , z) for U(x, y , z) = constant. If we move a tiny amount within that iso-U surface,
there is no change in U, so dU/ds = 0. So for any dr/ds in that U=constant surface
dr
∇U · = 0. (2.13)
ds
But dr/ds is a tangent to the surface, so this result shows that (Fig. 2.4)
Statement #3: gradU is everywhere NORMAL to a surface of constant U.
We’ll assume that the start and end values of the parameter pstart,end are given or easily
found.
Finding the integral involves determining F (p) by replacing x, y , z with their correspon-
ing functions of p x(p), y (p), z(p), and then writing
Z Z pend
ds
I= F ds = F (p) dp . (2.21)
pstart dp
♣ Example.
Q: Find the line integral from points [xy z ] = [000] to [422] when F (x, y , z) = xy /z 2
and the path is [x, y , z] = [p, p 1/2 , p 1/2 ].
A:
(i) Notice that pstart = 0 and pend = 4.
(ii) Use x=p, y =p 1/2 , z=p 1/2 into F = xy /z 2 to find F (p) = p 1/2 .
(iii) Then work out
" 2 2 2 #1/2 " 2 2 #1/2 1/2
ds dx dy dz 2 1 1 1
= + + = 1 + √ + √ = 1+ (2.23)
dp dp dp dp 2 p 2 p 2p
♣ Example
R
Q: Derive the line integral L (x − y 2 )ds where s is arc length and the path L is that
segment of the straight line y = 2x between x = 0 to x = 1.
R x=1
A: We want to turn this integral into x=0 F (x)dx.
As the path lies in the x, y -plane any dz = 0, so that
s 2
p dy p √
2
ds = dx + dy = 1 + 2 dx which here = 1 + 22 dx = 5dx (2.25)
dx
Thus
√ 1
Z Z
2
I = (x − y )ds = (x − 4x 2 ) 5dx (2.26)
L x=0
1 √
√ x
2
4 3 5 5
= 5 − x =− . (2.27)
2 3 0 6
2.6. LINE INTEGRALS USING VECTORS 2/9
For example, in Fig. 2.6 the total work done by a force F as it moves a point from A
to B along a given path L is given by a line integral of this form. If the force F at r
moves by dr, then the element of work done is dW = F · dr, and the total work done
traversing the space curve is
Z
W = F · dr . (2.28)
L
Path 3: is not smooth, so we must break it into two. Along the first section, y = 0
and dy = 0, and on the second x = 1 and dx = 0, so
Z B Z x=1 Z y =1
2 2 2 y =1
1.y 2 dy = 0+ y 3 /3 y =0 = 1/3 . (2.34)
(x y dx +xy dy ) = (x 0dx)+
A x=0 y =0
Conclude: In general, line integrals depend not only the start and end points, but
on the path taken between the start and end points.
2.6. LINE INTEGRALS USING VECTORS 2/11
By the way, here is a neat check on those results. Notice that that path (2) morphs
into path (1) when n = 1, and that path (2) morphs into path (3) when n → ∞. Our
line integral result morphs too!
1 n 1 n
+ = 1/2 when n = 1 + = 1/3 when n → ∞ . (2.35)
n + 3 3n + 1 n + 3 3n + 1
♣ Another example
Q2: Now repeat path (2) from Q1, but using the force F = xy 2 ı̂ + x 2 ŷ.
A2: For the path y = x n we find that dy = nx n−1 dx, so the line integral is
Z [1,1] Z x=1
2 2
(y x dx + y x dy ) = (x 2n+1 dx + nx n−1 .x 2 .x n dx) (2.36)
[0,0] x=0
Z x=1
= (x 2n+1 dx + nx 2n+1 dx) (2.37)
x=0
1 n
= + (2.38)
2n + 2 2n + 2
1
= (2.39)
2
This result is independent of n.
In fact, for the last example field F = xy 2 ı̂ + x 2 ŷ you could try any path between the
same two points and the result would always be 1/2.
If you tried another pair of points, the line integral would (in general) not be 1/2, but
whatever result you derived would again be independent of the path.
This happens when the field F being moved through is a conservative field. Line
integrals through a conservative field depend only on the the start and end positions,
not on the path.
2/12 LECTURE 2. SCALAR FIELDS AND THE GRAD OPERATOR.
dU = y 2 xdx + y x 2 dy . (2.41)
which depends only on the difference in U between start and end points, not on the
path between them.
In other words
All scalar potential fields U have an associated vector field ∇ U, but not every vector
field F is the gradient of a scalar field.
Think for a moment about any electric field and any gravitational field. Are they
conservative?
In Lecture 2 we introduced the del operator which when applied to a scalar field U(r)
generate the vector field of gradients, ∇ U.
In this lecture we delve further into the properties of fields. We again use the del
operator, but now apply it to vector fields, to obtain the
The divergence of vector field is a scalar field, while the curl of the vector field is a
vector field. As with grad, you will need to know how to apply the operator, and its
underlying physical meaning and use. Although it might not be immediately obvious to
you, together these operators provide a powerful method of describing physics in 3D
without involving arbitrary coordinate systems.
1
3/2 LECTURE 3. VECTOR FIELDS AND THE DIV AND CURL OPERATORS
vector field:
∂ ∂ ∂
div a ≡ ∇ · a = ı̂ + ̂ + k̂ ·a . (3.2)
∂x ∂y ∂z
This reminds you that the divergence of a vector field is a scalar field. You cannot
compute the divergence of scalar field.
a div a
1) c 0
2) xı̂ 1
3) r = xı̂ + ŷ + z k̂ 3
4) r/r 3 0
5) r c, for c constant (r · c)/r
♣ Example (1)
As c = cx ı̂ + cy ̂ + cz k̂ and all the cx,y ,z are constant it is obvious on differentiation that
the divergence is zero. A field with zero divergence is described as solenoidal. In P2
you will learn that the magnetic field strength1 H inside a long thin straight solenoid
with its axis aligned, say, with k̂ is uniform with a value of
H = nIk̂ (3.3)
where n is the number of turns per unit length and I is the current flowing. The lines
of H are all parallel — they do not diverge.
I
Figure 3.1: The H (magnetic field strength) inside a solenoid fed with dc I is constant.
Note that although the solenoid is a convenient way of remembering the description,
we will now see that other non-constant fields can also have zero divergence.
1
Note the distinction between magnetic field strength H (units: A m−1 ) and flux density B (units: Tesla or Wb m−2 ).
3.3. THE SIGNIFICANCE OF THE DIVERGENCE 3/3
♣ Example (3)
Consider the x component of a = r/r 3
ax = x (x 2 + y 2 + z 2 )−3/2 . (3.4)
∂ax ∂ n 2 2 2 −3/2
o
⇒ = x (x + y + z ) (3.5)
∂x ∂x
−3 2
= 1 (x 2 + y 2 + z 2 )−3/2 + x (x + y 2 + z 2 )−5/2 2x (3.6)
2
= r −3 1 − 3x 2 r −2 .
(3.7)
Note that r/r 3 = r̂/r 2 . So a radial vector field with a 1/r 2 magnitude dependence has
zero divergence.
In Cartesian co-ordinates the volume element dV = dxdy dz. Think first about the
face of area dxdz perpendicular to the y axis and facing outwards in the negative y
direction. That is, the one with surface area dS = −dxdẑ (coloured pink in Fig. 3.2).
3/4 LECTURE 3. VECTOR FIELDS AND THE DIV AND CURL OPERATORS
The component of the vector a normal to this face is a ·̂ = ay , and is pointing inwards,
and so the its contribution to the OUTWARD flux from this surface is
a · dS = − ay (x, y , z) dx dz . (3.9)
So we see that
The divergence of a vector field is a measure of net efflux per unit volume at each
point in the field.
The divergence of a vector field is the net flux generation per unit volume at each
point in the field.
Note that flux generation must always gives rise to efflux, so there is no ambi-
guity here.
3.4. FLUX DENSITY AND FLUX 3/5
dF = B · dS . (3.13)
Figure 3.3: A dS with direction lying along the field direction captures all the available flux, while when
perpendicular it captures none.
If we want to find the total flux through some extended surface R we have to perform
a surface integral
Z
F = B · dS . (3.14)
S
We have to be aware that both B and dS will change as we moved over the surface
— B in magnitude and direction, and dS just in direction.
We will come back to deal with simple curved surfaces in Lecture 4, but here is a
simpler example where the vector surface is in a fixed direction.
3/6 LECTURE 3. VECTOR FIELDS AND THE DIV AND CURL OPERATORS
3.4.1 ♣ Example
R
Q: Evaluate the flux B · dS through the side of a unit cube at x = 1 in the direction
of increasing x when B=yı̂ + ẑ + x k̂.
Figure 3.4:
A: Refer to Fig. 3.4. dS is perpendicular to the surface. Its ± direction actually depends
on the nature of the problem, but we are told here to use the +ı̂ direction.
Hence the element of surface area is
dS = dy dz ı̂ . (3.15)
curl(a) ≡ ∇ × a . (3.21)
The best way to work it out is to follow the pseudo-determinant recipe for vector
products, so that
ı̂ ̂ k̂
∂ ∂ ∂
∇×a = (3.22)
∂x ∂y ∂z
ax ay az
∂az ∂ay ∂ax ∂az ∂ay ∂ax
= − ı̂ + − ̂ + − k̂ (3.23)
∂y ∂z ∂z ∂x ∂x ∂y
y y
a ∇×a
x x
ı̂ ̂ k̂
∂ ∂ ∂
∇×a= = (0 − 0)ı̂ − (0 − 0)̂ + (1 − (−1))k̂ = 2k̂ . (3.24)
∂x ∂y ∂z
−y x 0
3/8 LECTURE 3. VECTOR FIELDS AND THE DIV AND CURL OPERATORS
It is no surprise then that a vector field with zero curl is said to be irrotational.
Consider the circulation round the perimeter of a rectangular element. The fields in
the x direction at the bottom and top are
∂ax
ax (x, y , z) and ax (x, y + dy , z) = ax (x, y , z) + dy , (3.25)
∂y
and the fields in the y direction at the left and right are
∂ay
ay (x, y , z) and ay (x + dx, y , z) = ay (x, y , z) + dx (3.26)
∂x
where, as in the case of div, we have to be careful to calculate components at the
correct positions.
3.8. COMBINING VECTOR OPERATORS 3/9
Starting at the bottom and working round in the anticlockwise sense, the four con-
tributions to the circulation dC are therefore as follows, where the minus signs take
account of the path being opposed to the field:
dC = + [ax dx] + [ay (x+dx, y , z) dy ] − [ax (x, y +dy , z) dx] − [ay dy ] (3.27)
∂ay ∂ax
= + [ax dx] + ay + dx dy − ax (y )+ dy dx − [ay dy ]
∂x ∂y
∂ay ∂ax
= − dx dy ∇ × a) · dS
= (∇ (3.28)
∂x ∂y
∇2 is called the Laplacian, and it occurs frequently when modelling diffusion for heat
and fluid flow, electric potentials, and wave propagation in 3D.
3/10 LECTURE 3. VECTOR FIELDS AND THE DIV AND CURL OPERATORS
ı̂ ̂ k̂
∇ × ∇U = ∂/∂x ∂/∂y ∂/∂z (3.33)
∂U/∂x ∂U/∂y ∂U/∂z
2
∂ 2U
∂ U
= ı̂ − + ̂ () + k̂ () =0 , (3.34)
∂y ∂z ∂z∂y
Note that the output is a zero vector. This indicates, for example, that no electric field
E possesses circulation. Can you demonstrate why?
3.8.6 div(a × b)
∇ · (a × b) = b · (∇
∇ × a) − a · (∇
∇ × b) . (3.41)
3.9 Summary
In this lecture we have
1
4/2 LECTURE 4. VECTOR CALCULUS IN OTHER COORDINATE SYSTEMS
could be found as the modulus of the Jacobian. But you will recall that you reached
that by considering the area of parallelograms and the volumes of parallelopipeds. We
will repeat the analysis here, but your greater knowledge of vectors will provide greater
insight.
In general curvilinear coordinates we are interested in writing the position vector r and
its differential dr as a sum of terms involving the unit vectors û, v̂, and ŵ.
But the very first thing to stress is that
r =6 uû + v v̂ + w ŵ
dr = 6 √
duû + dv v̂ + dw ŵ THESE ARE BAD (4.2)
|dr| = ds 6= 2 2
du + dv + dw 2
The badness arises because length or ‘metric’ scales have been lost.
Instead we must write
dr = hu duû + hv dv v̂ + hw dw ŵ (4.3)
where the hu,v ,w are metric scale coefficients which turn du etc into proper lengths.
To find expressions for the scale parameters, remember that the position vector must
be some function of u, v , w — r = r(u, v , w ) — and so the total or perfect differential
can be written without thought as
∂r ∂r ∂r
dr = du + dv + dw . (4.4)
∂u ∂v ∂w
Now compare Eq. (4.4) that with Eq. (4.3): because u, v , and w , and hence du, dv ,
and dw are independent, we can match coefficients of du etc, and write that
∂r ∂r ∂r ∂x ∂y ∂z
hu û = and hence hu = , where = ı̂ + ̂ + k̂ . (4.5)
∂u ∂u ∂u ∂u ∂u ∂u
and similarly for v and w . This looks complicated — but for any transformation we
will know x = x(u, v , w ), etc, so can work out ∂r/∂u, etc. A grind, but not difficult.
4.2. CURVILINEAR AND ORTHOGONAL CURVILINEAR COORDINATES 4/3
To summarize so far:
and
dr = hu duû + hv dv v̂ + hw dw ŵ (4.7)
We know
∂r ∂r ∂r
dr = du + dv + dw . (4.8)
∂u ∂v ∂w
so that
∂r ∂r ∂r
hu = hv = hw = (4.9)
∂u ∂v ∂w
and
" 2 2 2 #1/2
∂r ∂x ∂y ∂z
= + + and similiarly for v , w . (4.10)
∂u ∂u ∂u ∂u
Don’t try to remember all this! The key to unlock all this is (i) writing down the perfect
differential, and making the comparison between Eq. (4.7) and Eq. (4.8).
Fig. 4.1 is a 2D illustration that under transformation vector dr remains the same, but
must be described differently in Cartesian and curvilinear coordinates. (The diagram is
similar to that in Calculus 2.1.)
y y
x x
Surface integrals: Consider the curvilinear trio û, v̂, ŵ. If you want a surface element
in the ŵ direction, use (and similarly for the other directions)
dSw = hu hv dudv (û × v̂) = h
| u hv du
{z dv ŵ} (4.12)
for an orthogonal curvilinear trio
Volume integrals: And the extension to volume elements (a scalar) is also obvious.
The volume element is a parallelopiped, given by
They are ones where the û, v̂ and ŵ vectors are mutually perpendicular. They form a
right-handed set with
û × v̂ = ŵ (4.15)
and so on, cyclically.
2. Do Jacobians still work?
Yes — and yes for all curvilinear coordinate systems, irrespective of whether orthogonal
or not.
Thinking about volume elements we know that
∂r ∂r ∂r
hu hv hw (û × v̂) · ŵ = × · (4.16)
∂u ∂v ∂w
But
∂r ∂x ∂y ∂z
= ı̂ + ̂ + k̂ (4.17)
∂u ∂u ∂u ∂u
4.3. LINE, SURFACE, VOLUME INTEGRALS, IN CURVI/ORTHOG-CURVI COORDS 4/5
and similarly for v and w . Putting the components of ∂r/∂u on the top line and those
for v and w on the second and third, the scalar triple product becomes
∂x ∂y ∂z
∂u ∂u ∂u
∂x ∂y ∂z
mod hu hv hw (û × v̂) · ŵ = mod ∂v ∂v ∂v
. (4.18)
∂x ∂y ∂z
∂w ∂w ∂w
If we were always sure that the coordinates were a right-handed trio the mod would be
unnecessary on both sides. The modulus is used as an insurance.
2. Position vector
r = rr̂ = r cos φı̂ + r sin φ̂ (4.21)
3. Metric scale coefficients
hr r̂ = ∂r/∂r = cos φı̂ + sin φ̂ ⇒hr = 1
hφ φ̂ = ∂r/∂φ = r (− sin φı̂ + cos φ̂) ⇒hφ = r
4. Differential
dr = hr drr̂ + hφ dφφ̂ = drr̂ + r dφφ̂ (4.22)
5. Surface element
The element is in the plane, but its normal sticks out of the plane — which is dodgy
in plane polars. This indicates that the scalar value will suffice here!
A: On the circle of interest r = A is fixed, and we only need φ to define exactly where
we are.
We know that
x = A cos φ and y = A sin φ , (4.25)
so that
f = −y 3 ı̂ + x 3 ̂ = A3 (− sin3 φı̂ + cos3 φ̂). (4.26)
In general,
dr = drr̂ + r dφφ̂ , (4.27)
but on the chosen path r = A and so dr = 0. Hence
dr = Adφφ̂ = Adφ(− sin φı̂ + cos φ̂) . (4.28)
Notice that we used a mixture of Cartesians for the vectors, and polars for the coeffi-
cients. This is perfectly permissible. We could have converted f to use r̂ and φ̂, etc,
but the approach taken is easier.
Notice too that we could have found dr by writing
dr = dxı̂ + dŷ = Adφ(− sin φı̂ + cos φ̂) (4.30)
4/8 LECTURE 4. VECTOR CALCULUS IN OTHER COORDINATE SYSTEMS
1. Unit vectors
These are as in plane polars, but with the addition of a ẑ axis along the Cartesian k̂
direction.
2. Pos vector
There a source of confusion here! The position vector does not point in the direction
of the radial unit vector r̂, so that r r̂ is NOT the position vector! Instead we denote
the position vector by rpos . Then
Figure 4.3:
4. The differential
drpos = dr r̂ + r dφ φ̂ + dz ẑ (4.40)
5. Surface elements
There are three, but the last very rare! The first relates to the patch on the wallr; the
second to the patch on the top (or, with a change in sign, on the base).
dSr = hφ hz dφ dz (φ̂ × ẑ) = r dφ dz r̂ (4.41)
dSz = DIY = r dr dφẑ (4.42)
dSφ = DIY = dr dz φ̂ Can you sketch this? (4.43)
6. Volume element
You know what to expect, but in full:
dV = hr hφ hz dr dφ dz (r̂ × φ̂) · ẑ (4.44)
= 1 r 1 dr dφ dz ( 1 ) = r dr dφ dz . (4.45)
Again, notice that the geometry makes sense, without resorting to the h coefficients.
4/10 LECTURE 4. VECTOR CALCULUS IN OTHER COORDINATE SYSTEMS
f = r 2 r + z 3 ẑ = r 3 r̂ + z 3 ẑ . (4.46)
dSz = r dr dφ ẑ , (4.47)
Side: Remembering that the radius is A, the surface element for the side wall is
2. Position vector
3. h parameters
∂r 1/2
hr = = sin2 θ cos2 φ + sin2 θ sin2 φ + cos2 θ =1 (4.58)
∂r
hθ = grind = r (4.59)
hφ = grind = r sin θ (4.60)
4. Differential
dr = dr r̂ + r dθ θ̂ + r sin θ dφ φ̂ (4.61)
5. Surface elements:
6. Volume element
Hence
Z Z 2π Z π
f · dS = A3 cos 3 θ A2 sin θ [k̂ · r̂] dθdφ . (4.70)
S φ=0 θ=0
4.7 Line, surface, & volume integrals involving div, grad, & curl.
♣ Q(i): The vector field v is
x y z
v= ı̂ + ̂ + k̂ . (4.72)
r r r
Find v · dS integrated over the surface of a sphere of radius A.
A(i): You notice that the problem involves spherical symmetry.
r
Thinking about the position vector r indicates that v = = r̂ .
r
But on the surface of a sphere of radius A
R
Q(ii): Find the divergence of v and derive ∇ · vdV integrated over the volume of the
same sphere.
A(ii): We have to find div v. If you were wondering, there is a formula for this which
use spherical polars directly. But we are to use only the Cartesian system.
Now think about each component of v in Cartesians ...
x x
vx = = 2 (4.75)
r (x + y + z 2 )1/2
2
A(ii) ctd: To finish, we must integrate 2/r through the volume of a sphere of radius
A. This is a straightforward multiple integral in spherical polars ...
We know
dV = r 2 sin θ dr dθ dφ (4.78)
and hence
Z Z A Z π Z 2π
2 2
∇ · vdV = r| sin θdr
{z dθ dφ} (4.79)
r =0 θ=0 φ=0 r
dV
Z A Z π Z 2π
= 2 r dr sin θ dθ dφ
r =0 θ=0 φ=0
2 A π 2π
r
= 2 (− cos θ) φ
2 0 0 0
= 4πA2
4.8 Summary
Our analysis has provided a method of using the definition of the position vector r in a
new coordinate system to find
• the metric coefficients or length scales hu,v ,w associated with each key axis
dr = hu duû + hv dv v̂ + hw dw ŵ (4.89)
which you can simplify if one or more of du, dv and dw are zero on your particular
path;
• the definition, size and direction of the surface elements dS; and
• the definition and size of volume element dV .
• for our commonly used systems of polars, the results are remarkably intuitive.