vector calculus notes

43
MSE 201: Mathematics 1 Vector calculus Dr Peter Haynes 1 Motivation This course combines two topics that were covered in year 1, namely vectors (dealing with quantities that possess magnitude and direction) and calculus (differentiation and integration). So vector calculus includes the differentiation and integration of vectors e.g. the velocity of a body is the time derivative of its position vector: v r. However it is a much richer and more powerful topic than that. In year 1 an introduction was also given to functions of more than one variable, such as functions of three coordinates in space e.g. f (x, y, z ) or f (r). Such functions of position are known as fields and they can themselves be scalar or vector in nature. Some examples are listed in Table 1. Scalar fields Vector fields Carrier concentration at a p-n junction Velocity fields in fluid dynamics Electrostatic potentials Electric fields Temperature distribution in this room Magnetic fields Table 1: Examples of scalar and vector fields. The topic of vector calculus concerns itself with differentiating and integrating scalar and vector fields with respect to position (or another vector argument). The mathematical framework that will be developed provides a universal way of describing physical laws very elegantly. In particular it is essential for the study of fluid dynamics and electromagnetism. 2 Vector algebra This course assumes knowledge and understanding of the following: rules for vector addition, subtraction and multiplication by a scalar magnitude of a vector and unit vectors basis vectors and Cartesian coordinates scalar (dot) and vector (cross) products and their geometric interpretation Unfamiliarity with any of the above should be addressed as a matter of priority by reading the notes from the year 1 “Vectors” course. However a few topics are reviewed below in order to clarify the notation used in this course. Department of Materials, Imperial College London

Upload: malsgom

Post on 28-Nov-2014

1.534 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Vector Calculus Notes

MSE 201: Mathematics 1

Vector calculusDr Peter Haynes

1 Motivation

This course combines two topics that were covered in year 1, namely vectors (dealing with quantities thatpossess magnitude and direction) and calculus (differentiation and integration). So vector calculus includesthe differentiation and integration of vectors e.g. the velocity of a body is the time derivative of its positionvector: v = r.

However it is a much richer and more powerful topic than that. In year 1 an introduction was also given tofunctions of more than one variable, such as functions of three coordinates in space e.g. f(x, y, z) or f(r).Such functions of position are known as fields and they can themselves be scalar or vector in nature. Someexamples are listed in Table 1.

Scalar fields Vector fields

Carrier concentration at a p-n junction Velocity fields in fluid dynamicsElectrostatic potentials Electric fieldsTemperature distribution in this room Magnetic fields

Table 1: Examples of scalar and vector fields.

The topic of vector calculus concerns itself with differentiating and integrating scalar and vector fields withrespect to position (or another vector argument). The mathematical framework that will be developedprovides a universal way of describing physical laws very elegantly. In particular it is essential for the studyof fluid dynamics and electromagnetism.

2 Vector algebra

This course assumes knowledge and understanding of the following:

• rules for vector addition, subtraction and multiplication by a scalar

• magnitude of a vector and unit vectors

• basis vectors and Cartesian coordinates

• scalar (dot) and vector (cross) products and their geometric interpretation

Unfamiliarity with any of the above should be addressed as a matter of priority by reading the notes fromthe year 1 “Vectors” course. However a few topics are reviewed below in order to clarify the notation usedin this course.

Department of Materials, Imperial College London

Page 2: Vector Calculus Notes

2 Vector calculus

2.1 Cartesian coordinates

Vectors may be specified by their components with respect to an underlying set of basis vectors, which alsodefine a coordinate system. The most convenient basis sets consist of orthonormal vectors i.e. vectors thatare both orthogonal (they intersect at right angles) and normalised (they are unit vectors).

In three dimensions, the Cartesian system is defined by three orthonormal vectors i, j and k which definethe x-, y- and z-axes respectively. (Note that the ‘hat’ that is sometimes used to denote unit vectors, e.g.n, is omitted here since the properties of the Cartesian basis are well known). A general vector a may thenbe denoted

a =

ax

ay

az

= axi + ayj + azk

z

y

x

axi

ayj

azka

Figure 1: Cartesian coordinates and components of a vector.

2.2 Scalar product

The scalar or dot product of two vectors a and b is defined as:

a · b = a b cos θ

where a and b denote the magnitudes of the vectors a and b respectively and θ is the angle between them.

a

b

θ

Figure 2: Definition of the scalar product.

Department of Materials, Imperial College London

Page 3: Vector Calculus Notes

MSE 201: Mathematics 3

In particular:

• a and b are orthogonal ⇔ a · b = 0

• a · a = a2, the squared length of a

• a · b = b · a

and hence

• i · j = j · k = k · i = 0

• i · i = j · j = k · k = 1

From these results it is straightforward to prove that in terms of Cartesian components:

a · b = axbx + ayby + azbz

which may also be written using matrix notation as:

a · b = aTb =(ax ay az)

bxbybz

= axbx + ayby + azbz

2.3 Vector product

The vector or cross product of two vectors a and b is defined as:

a× b = a b sin θ n

where a and b denote the magnitudes of the vectors a and b respectively, θ is the angle between them andn is a unit vector orthogonal to both a and b, whose direction is determined in a right-hand sense.

a

b

θ

n

Figure 3: Definition of the vector product.

In particular:

Department of Materials, Imperial College London

Page 4: Vector Calculus Notes

4 Vector calculus

• a and b are parallel or antiparallel ⇔ a× b = 0

• a× a = 0

• a× b = −b× a

and hence

• i× j = k , j× k = i and k× i = j

• i× i = j× j = k× k = 0

From these results it is straightforward to prove that in terms of Cartesian components:

a× b = (aybz − azby) i + (azbx − axbz) j + (axby − aybx)k =

aybz − azbyazbx − axbzaxby − aybx

which may also be written as a determinant :

a× b =

∣∣∣∣∣∣∣

i j kax ay az

bx by bz

∣∣∣∣∣∣∣

2.4 Vector area

Consider the parallelogram shown in Fig. 4, bounded by the vectors a and b. The area of such a parallel-ogram is a scalar equal to the magnitude of the vector product of a and b, |a× b|. The orientation of theplane may be specified by a unit normal vector i.e. the direction of the vector product of a and b. These twoproperties of the area may be combined into a single vector whose magnitude gives the scalar area andwhose direction gives the orientation. Such a vector area S is given conveniently by

S = a× b

a

b

S

Figure 4: Definition of vector area.

Note that the sense of the direction is ambiguous since a plane has two faces i.e. in Fig. 4 S could pointup or down – this ambiguity is usually resolved by the context in which the vector area is used or otherwisehas to be specified explicitly.

Department of Materials, Imperial College London

Page 5: Vector Calculus Notes

MSE 201: Mathematics 5

This definition is not restricted to areas that are plane parallelograms. For example, the unit circle in thexy-plane has vector area πk. In this case the magnitude and direction of the vector area are calculatedseparately. The direction is given by a normalised cross product of any two vectors in the plane of the areae.g. i× j = k.

Vector area permits easy calculation of the projection of the area of a surface onto another plane. This issimply achieved using the scalar product i.e. the area of the projection of the vector area S onto a planewith unit normal n is S · n.

Example

• On holiday in the tropics I set up my parasol (circular and of 1 m radius) in the morning so it pointsstraight at the sun, at that time 45◦ above the horizon. By noon when the sun is straight overhead,how much shadow is cast?

Set up a Cartesian coordinate system such that the ground lies in the xy-plane and the sun movesin the zx-plane. The parasol has vector area S = π(i + k)/

√2 m2 (it will be shown later that this is

correct even if the parasol is curved). The unit normal to the ground is simply n = k so the area ofthe shadow at noon is S · n = π/

√2 i.e. about 70% of the maximum shadow it could cast at that time.

Since it is a vector quantity, vector area is additive, and this allows the vector area of a surface that is notconfined to a single plane to be calculated. Consider the three unit squares in the xy-, yz- and zx-planes,with vector areas k, i and j respectively (all pointing into the octant x > 0, y > 0, z > 0 as shown on the leftof Fig. 5). The total vector area of the surface is i + j + k which has magnitude

√3 and direction along the

line x = y = z.

x

y

z

ij

kx y

z

Figure 5: Left: three unit squares and associated vector areas; right: the projection of the sum of these vector areasonto the plane x+ y + z = 0.

Note that the magnitude of the vector area does not equal the scalar sum of the individual areas (whichis 3). The interpretation of the magnitude of such a vector area is that it equals the (scalar) area of theprojection of the surfaces onto a plane perpendicular to its direction, as shown on the right of Fig. 5. In thiscase the projection is a regular hexagon with sides

√2/3 and area

√3.

Conversely, the vector area of a general (i.e. non-planar) surface may be found by considering its projectiononto planes perpendicular to i, j and k (ensuring that the senses of the vector areas making up the surfaceare taken into account – some parts may contribute positively, others negatively).

Department of Materials, Imperial College London

Page 6: Vector Calculus Notes

6 Vector calculus

Examples

• Show that the total vector area of the faces of a cube (with vector areas all chosen to point out of thecube) is zero. Does this result apply to all closed surfaces?

• Find the vector area of a hemisphere of radius r whose base is the xy-plane.

3 Coordinate systems

The most convenient and hence commonly used coordinate systems are those that are orthogonal i.e. allthe coordinate axes intersect at right angles. The Cartesian coordinate system is the simplest becausethe unit vectors i, j and k that define it are constant in space i.e. at every position they point in the samedirection. However, symmetry sometimes dictates that other coordinate systems are more convenient, inwhich the unit vectors that point along the coordinate axes vary in direction throughout space. There aremore than ten orthogonal coordinates systems in three dimensions that are used for physical problems:here attention is restricted to the most commonly-used for cylindrical and spherical symmetries. By way oforientation, the familiar example of plane polar coordinates in two dimensions is considered first.

3.1 Plane polar coordinates

A point in the xy-plane with Cartesian coordinates (x, y) may also be defined by plane-polar coordinates ρand φ defined by:

ρ =√x2 + y2

tanφ = y/x

} {x = ρ cosφy = ρ sinφ

where ρ is the distance of the point from the origin and φ is the angle the vector x i + y j makes with thex-axis (conventionally chosen to lie in the interval 0 ≤ φ < 2π).

x

y

ρ

φ

i

j

(x, y)

Figure 6: Plane-polar coordinates in two dimensions.

The plane-polar coordinate system may also be defined in terms of unit vectors eρ and eφ that point in thedirections of increasing ρ and φ respectively. In terms of i and j these vectors are defined by:

eρ = cosφ i + sinφ jeφ = − sinφ i + cosφj

} {i = cosφ eρ − sinφ eφ

j = sinφ eρ + cosφ eφ

Department of Materials, Imperial College London

Page 7: Vector Calculus Notes

MSE 201: Mathematics 7

i.e. {eρ, eφ} are obtained by rotating {i, j} anticlockwise by an angle φ. Conversely, {i, j} are obtained byrotating {eρ, eφ} clockwise by φ. Transformations of this form were covered in the year 1 “Matrices” course.

It is often helpful to visualize coordinate systems in terms of the locus of points generated by holding onecoordinate constant and varying all the others. In two dimensions, these loci form lines, whereas in threedimensions they form surfaces. The loci for plane polar coordinates are shown in Fig. 7: ρ = constant(where the constant is greater than zero) traces out a circle centred on the origin, φ = constant tracesout a straight line from the origin. Note that the origin itself is a singularity in this coordinate system: itcorresponds to ρ = 0 and φ is undefined there.

x

y

ρ = constant

φ = π/4

Figure 7: Examples of lines of constant ρ (dashed) and lines of constant φ (dotted).

A couple of features are worth remarking on: the lines always intersect at right angles. Also at any givenpoint, eρ is perpendicular to the tangent to the line of constant ρ and eφ is perpendicular to the line ofconstant φ. These are general features of orthogonal coordinate systems.

Example

• The point P has Cartesian coordinates x = 4 and y = 3.

◦ Find the plane polar coordiates of P .

◦ Express eρ and eφ at P in terms of i and j.

◦ The vector u has Cartesian components ux = uy = 5. Find its components in terms of the basis{eρ, eφ} at P . [Hint: use the scalar product.]

In Cartesian coordinates, both x and y have the same dimensions e.g. length. Thus if a small change ismade in these coordinates e.g. x→ x+ dx and y → y+ dy then the position vector l = x i+ y j changes bydl = dx i + dy j and

dl2 = dl · dl = dx2 + dy2.

However the physical dimensions of ρ and φ are not the same: ρ is a length whereas φ is an angle andhence dimensionless. Consider the position of a point P given by plane polar coordinates (ρ = ρ0, φ = φ0),as shown in Fig. 8. If ρ is increased from its initial value ρ0 whilst φ is held constant, then the point movesradially outwards along the straight line φ = φ0. If ρ changes from ρ0 to ρ0 + δρ then the point moves by adistance δρ. However, if φ is increased from its initial value φ0 whilst ρ is held constant, then the point moves

Department of Materials, Imperial College London

Page 8: Vector Calculus Notes

8 Vector calculus

along the arc of the circle ρ = ρ0. If φ changes from φ0 to φ0 + δφ then the point moves an arc distanceρ0 δφ. In the limit that δφ → 0 the arc becomes indistinguishable from a straight line. Thus infinitesimalchanges in the coordinates ρ and φ of l result in a change dl = dρ eρ + ρ dφ eφ. This defines scale factorshρ = 1 and hφ = ρ for ρ and φ respectively: these scale factors are the quantities by which the coordinatechanges should be multiplied to convert them into distances. This is quite intuitive: the larger ρ, the greaterthe distance caused by a small change in φ since the lines of constant φ diverge with radius. Note that thedirections in which P moves in response to changes in ρ and φ are orthogonal, hence the distance movedby a general change ρ→ ρ+ dρ and φ→ φ+ dφ is

dl2 = dρ2 + ρ2dφ2.

x

y

ρ = ρ0

ρ = ρ0 + δρ

φ = φ0

φ = φ0 + δφ

P

Figure 8: The effect of small changes in plane polar coordinates (ρ, φ) on position.

Small changes in two-dimensional coordinates also map out an area of the y-plane. For Cartesians, varyingx and y in the intervals x0 ≤ x ≤ x0 + dx and y0 ≤ y ≤ y0 + dy sweeps out a rectangle of area dA = dx dy.As shown in Fig. 8, varying ρ and φ in the intervals ρ0 ≤ ρ ≤ ρ0 + δρ and φ0 ≤ φ ≤ φ0 + δφ maps out ashape outlined in bold. However, in the limit of infinitesimal changes, this shape tends to a rectangle withsides dρ and ρ0 dφ. In general then dA = ρ dρ dφ: note the role again played by the scale factor for φ.

3.2 Cylindrical polar coordinates

The cylindrical polar coordinate system is essentially a three-dimensional extension of plane polar coor-dinates, with the addition of the z-coordinate from Cartesians. For a point P , z gives its height abovethe xy-plane, and its projection onto the xy-plane is described by plane polar coordinates ρ and φ. Forcompleteness the relationship between Cartesians and cylindrical polars is:

ρ =√x2 + y2

tanφ = y/xz = z

x = ρ cosφy = ρ sinφz = z

The unit vectors are related by:

eρ = cosφ i + sinφ jeφ = − sinφ i + cosφ j

ez = k

i = cosφ eρ − sinφ eφ

j = sinφ eρ + cosφ eφ

k = ez

Department of Materials, Imperial College London

Page 9: Vector Calculus Notes

MSE 201: Mathematics 9

x

y

z

P

z

ρφ

l

Figure 9: Cylindrical polar coordinates.

and the scale factors are hρ = 1, hφ = ρ and hz = 1.

It is clear from its description that cylindrical polars form an orthogonal coordinate system: the positionvector of P , denoted l in Fig. 9, is l = ρ eρ + z ez with magnitude l =

√ρ2 + z2. Infinitesimal changes in

coordinates results in dl = dρ eρ + ρdφ eφ + dz ez and thus

dl2 = dρ2 + ρ2 dφ2 + dz2

In three dimensions, the locus of points mapped out when one coordinate is held constant forms a surface.In this case, the surfaces of constant ρ are cylinders (hence the name) centred on the z-axis. Surfaces ofconstant φ are half-planes that contain the z-axis and make an angle φ with the zx-plane, and surfaces ofconstant z are planes parallel to the xy-plane.

Consider an infinitesimal change in ρ and φ made while z is held constant. As in plane polar coordinates,this sweeps out an area dAz = ρ dρ dφ. However in three dimensions this may now be represented by thevector area dSz = ρ dρ dφ ez. Similarly if ρ is held constant while φ and z vary, a vector area dSρ = ρ dφ dz eρ

is obtained. Likewise dSφ = dρ dz eφ.

The general situation would involve changes in all three coordinates, but subject to a single constraint thatconfines points to a surface i.e. dρ, dφ and dz are not all independent. In this case the element of surfacearea is

dS = ρ dφ dz eρ + dρ dz eφ + ρ dρ dφ ez

Example

• Consider a cylindrical surface with its axis parallel to the z-axis.

◦ Write down the equation for a surface of radius a in cylindrical polar coordinates and hence findan equation for dρ satisfied by infinitesimal change of coordinates that remain on this surface.

◦ Write down an expression for dS for this surface and mark it on a sketch.

Finally consider an unconstrained infinitesimal change in all three coordinates. This maps out an infinitesi-mal volume, or volume element. For infinitesimal changes the shape of this volume tends to a cuboid, withsides of length dρ, ρdφ and dz (the scale factors come into play again). Thus

dV = ρ dρ dφ dz.

Department of Materials, Imperial College London

Page 10: Vector Calculus Notes

10 Vector calculus

3.3 Spherical polar coordinates

Figure 10 is identical to Fig. 9 except that the polar angle θ has been marked. Spherical polar coordinatesconsist of r = |l|, θ and φ. φ is the same azimuthal angle as in cylindrical polar coordinates. Whereas φranges from 0 to 2π, θ is restricted to the range 0 to π.

x

y

z

P

z

ρφ

lr

θ

Figure 10: Spherical polar coordinates.

From the diagram it is clear that z = r cos θ and ρ = r sin θ. From these results the relationship betweenspherical polars and Cartesians may be derived:

r =√x2 + y2 + z2

cos θ = z/√x2 + y2 + z2

tanφ = y/x

x = r sin θ cosφy = r sin θ sinφz = r cos θ

and the unit vectors are given by:

er = sin θ cosφ i + sin θ sinφ j + cos θ keθ = cos θ cosφ i + cos θ sinφ j− sin θ k

eφ = − sinφ i + cosφ j

i = sin θ cosφ er + cos θ cosφ eθ − sinφ eφ

j = sin θ sinφ er + cos θ sinφ eθ + cosφ eφ

k = cos θ er − sin θ eθ

Surfaces of constant r are obviously spherical (hence the name) and as before, surfaces of constant φare half-planes containing the z-axis and make an angle φ with the zx-plane. Surfaces of constant θ arecones swept out when a line along l is rotated around the z-axis. The curves obtained when the surfacesof constant θ and φ intersect a sphere resemble a map of the world: constant θ corresponds to constantlatitude (although latitude is measured from the equator whereas θ = 0 at the North Pole; constant φcorresponds to constant longitude (although the customary range of longitude corresponds to−π < φ ≤ π.)

From the previous examples it has been seen that the scale factors are the key quantities. r has dimensionsof length, and a small change δr moves P a distance δr, so hr = 1. A small change δθ sweeps out a smallarc of length r δθ and so hθ = r. From cylindrical polar coordinates it is already known that hφ = ρ = r sin θ.

Knowledge of the scale factors enables the expressions for the line, surface and volume elements to bewritten down:

dl = hr dr er + hθ dθ eθ + hφ dφ eφ = dr er + r dθ eθ + r sin θ dφ eφ

⇒ dl2 = h2r dr

2 + h2θ dθ

2 + h2φ dφ

2 = dr2 + r2 dθ2 + r2 sin2 θ dφ2

Department of Materials, Imperial College London

Page 11: Vector Calculus Notes

MSE 201: Mathematics 11

dS = hθ hφ dθ dφ er + hφ hr dφ dr eθ + hr hθ dr dθ eφ

= r2 sin θ dθ dφ er + r sin θ dφ dr eθ + r dr dθ eφ

dV = hr hθ hφ dr dθ dφ = r2 sin θ dr dθ dφ

These expressions can be generalized to all orthogonal coordinate systems once the scale factors areknown.

A word of warning: in these notes cylindrical polar coordinates have been denoted {ρ, φ, z} and sphericalpolar coordinates {r, θ, φ}. However it is also fairly common to refer to the cylindrical polar coordinates as{r, θ, z} i.e. to use r instead of ρ and θ instead of φ. This is obviously a potential source of great confusion!

Examples

• Two points P and Q have Cartesian coordinates (3, 4,−2) and (−1, 3, 2) respectively. Specify theirpositions in terms of:

(i) cylindrical polar coordinates

(ii) spherical polar coordinates

• Two vectors are defined by u = urer +uθeθ +uφeφ and v = vrer +vθeθ +vφeφ in terms of unit vectorsassociated with spherical polar coordinates at the same point in space.

◦ Show that in this case the scalar product u · v = urvr + uθvθ + uφvφ.

◦ Would this result still hold if u and v were defined in terms of unit vectors associated with spher-ical polar coordinates at different points in space?

◦ What happens to the three unit vectors:

(i) as φ changes while θ = π/2?(ii) as θ changes while φ = π/4?(iii) as r changes?

4 Partial differentiation

The notion of a partial derivative was introduced last year for functions of more than one variable. Thiscourse is primarily concerned with fields: functions of spatial position, and hence functions of three vari-ables which might be Cartesian coordinates e.g. f(x, y, z) or another coordinate system e.g. spherical polarcoordinates g(r, θ, φ).

Recall the notation of ‘curly’ ∂’s used to denote that a derivative is being taken with respect to one variablewhile the others are held constant. For f(x, y, z)

(∂f

∂y

)

z,x

= limδy→0

f(x, y + δy, z)− f(x, y, z)δy

means “differentiate f with respect to y holding z and x constant.” Sometimes the subscript showing whichvariables are held constant is omitted if it is obvious from the context (e.g. for cylindrical polar coordinatesit would be understood that a partial derivative with respect to z was taken holding ρ and φ constant.)

Department of Materials, Imperial College London

Page 12: Vector Calculus Notes

12 Vector calculus

Second and higher derivatives may also be defined and recall that if a function is differentiable then thesecond ‘crossed’ derivatives are equal i.e.

(∂2f

∂x∂y

)=

(∂2f

∂y∂x

)

Examples

• A scalar field V is defined in terms of spherical polar coordinates {r, θ, φ} as V (r, θ, φ) = r2 sin2 θ cos 2φ.Calculate:

◦(∂V

∂r

)=

◦(∂V

∂θ

)=

◦(∂V

∂φ

)=

◦(∂2V

∂θ2

)=

◦(∂2V

∂r∂θ

)=

◦(∂2V

∂r∂φ

)=

◦(∂2V

∂φ∂r

)=

◦(∂2V

∂θ∂r

)=

• Express V from the previous example in terms of Cartesian coordinates i.e. as a function V (x, y, z).Verify that the crossed second partial derivatives with respect to x and y are equal.

4.1 Total differentials

The partial derivatives so far give the rate of change of a function when only one of its arguments changes.However in general, several or all of the arguments may change simultaneously. The total differential givesthe infinitesimal change in a function in response to infinitesimal changes in all of its arguments e.g. for afunction f(x, y, z) the total differential is

df =(∂f

∂x

)

y,zdx+

(∂f

∂y

)

z,x

dy +(∂f

∂z

)

x,ydz

This definition extends in an obvious way to different numbers of arguments.

Examples

• Find the total differentials of the following functions:

◦ f(x, y) = exp(x+ y)

◦ φ(x, y, z) = x2 + 3yz

◦ V (ρ, φ, z) = ρ cosφ exp(−z)

Department of Materials, Imperial College London

Page 13: Vector Calculus Notes

MSE 201: Mathematics 13

4.2 Exact differentials

The previous section shows how to obtain the total differential of a known function. However sometimes itis desirable to reverse this process i.e. to find the function that differentiates to a known differential.

Consider the differentialx2 dy + 2xy dx.

Integrating the first term with respect to y gives x2y + c1(x) – note that the arbitrary constant of normalintegration becomes a function of one variable since it comes from a partial derivative. Integrating thesecond term with respect to x gives x2y + c2(y). So f(x, y) = x2y + c is the required function (c1(x) =c2(y) = c for consistency). This differential is therefore said to be exact since it can be directly integrated inthis way. Those that cannot are inexact differentials.

Now consider the general case involving two variables. The general form for the total differential of afunction f(x, y) is

df = u(x, y) dx+ v(x, y) dy

whereu(x, y) =

(∂f

∂x

)

yand v(x, y) =

(∂f

∂y

)

x

The equality of second cross derivatives of f(x, y):(∂2f

∂x∂y

)=

(∂2f

∂y∂x

)

requires (∂u

∂y

)

x

=(∂v

∂x

)

y

and this is the necessary and sufficient condition for the differential to be exact.

For functions of more than two variables, all of the second cross derivatives must be equal, resulting inmore conditions e.g. for u(x, y, z) dx+ v(x, y, z) dy + w(x, y, z) dz to be exact,

(∂u

∂y

)

z,x

=(∂v

∂x

)

y,zand

(∂v

∂z

)

x,y=

(∂w

∂y

)

z,x

and(∂w

∂x

)

y,z=

(∂u

∂z

)

x,y

In general, for n variables there will be 12n(n− 1) conditions.

The importance of the distinction between exact and inexact differentials will become clear later in thecourse.

Examples

• Establish whether or not the following differentials are exact or inexact. For each one that is exact,find the function from which it originates.

◦ x dy + y dx

◦ x dy + 2y dx

◦ dx/x+ dy/y

◦ 2xz dx− 2yz dy + (x2 − y2) dz

Department of Materials, Imperial College London

Page 14: Vector Calculus Notes

14 Vector calculus

4.3 Chain rule

The chain rule for partial differentiation was covered in year 1. It is worth revisiting here because of its rolein enabling the changes of variable that occur when moving from one coordinate system to another.

A convenient way of remembering the chain rule is to start from the total differential e.g. for f(x, y, z)expressed in terms of Cartesian coordinates:

df =(∂f

∂x

)

y,zdx+

(∂f

∂y

)

z,x

dy +(∂f

∂z

)

x,ydz

Consider transforming to spherical polar coordinates. The required first partial derivatives are(∂f

∂r

)

θ,φ,

(∂f

∂θ

)

φ,rand

(∂f

∂φ

)

r,θ

.

For instance, to obtain the expression for (∂f/∂r)θ,φ, take the expression for the total differential and “divideby ∂r at constant θ and φ” i.e.

(∂f

∂r

)

θ,φ=

(∂f

∂x

)

y,z

(∂x

∂r

)

θ,φ+

(∂f

∂y

)

z,x

(∂y

∂r

)

θ,φ+

(∂f

∂z

)

x,y

(∂z

∂r

)

θ,φ

Note the form of the expression: for three variables there are three terms, each the product of two partialderivatives. In each term, the first partial derivative is taken from the total differential. The second partialderivative is with respect to the same variable (here r) holding the same variables constant (here θ and φ)as the left-hand side.

Examples

• Write down the chain rule for the remaining partial derivatives of f : (∂f/∂θ)φ,r and (∂f/∂φ)r,θ. Eval-uate them for the function f(x, y, z) = x+ y + z.

• For f(x, y, z) = xyz calculate the first partial derivatives with respect to the cylindrical polar coordi-nates ρ, φ and z and express the results in terms of these variables only.

(∂f

∂ρ

)

φ,z

=

(∂f

∂φ

)

z,ρ

=

(∂f

∂z

)

ρ,φ=

5 Multidimensional integration

Having discussed how to differentiate functions of more than one variable, the logical next step is to con-sider how to integrate a function with respect to more than one variable. This is a technique that wasintroduced briefly in year 1.

Department of Materials, Imperial College London

Page 15: Vector Calculus Notes

MSE 201: Mathematics 15

5.1 Double integrals

Consider a double integral involving two variables x and y. The limits of integration can usually be repre-sented by the boundary of some region R as shown in Fig. 11 and the integral I is denoted

I =∫

Rf(x, y) dA

where dA denotes an infinitesimal element of area. In Cartesian coordinates, the area element is dA =dx dy and hence the integral may also be written

I =∫ ∫

Rf(x, y) dx dy

x

y

R

dA = dx dyymax

ymin

xmin(y) xmax(y) x

y

R

ymax(x)

ymin(x)

xmin xmax

Figure 11: Two-dimensional integration.

As indicated in Fig. 11 there are two ways to proceed. In each we consider the integral as the limit of a suminvolving elements of area. The left-hand diagram represents the case where the region R is split first intostrips of width dy in the x-direction. The contribution from each strip is obtained by integrating with respectto x, and then the contributions of the strips are summed by integrating with respect to y:

I =∫ ymax

y=ymin

[∫ xmax(y)

x=xmin(y)f(x, y) dx

]dy

ymin and ymax define the extent of R in the y-direction whereas xmin(y) and xmax(y) give the limits of thestrip at position y.

Equivalently, the order of integration may be reversed, as illustrated in the right-hand diagram:

I =∫ x=xmax

x=xmin

[∫ y=ymax(x)

y=ymin(x)f(x, y) dy

]dx

Examples

• Evaluate the double integral

I =∫ ∫

Rxy2 dx dy

where R is the triangle bounded by the x-axis, y-axis and the line x + y = 1. Show that the order ofintegration does not matter.

Department of Materials, Imperial College London

Page 16: Vector Calculus Notes

16 Vector calculus

x

y

0 1

1

x+ y = 1

x

y

0 1

1

1. Perform x integration first (left-hand diagram):

I =∫ 1

y=0

[∫ x=1−y

x=0xy2 dx

]dy =

∫ 1

y=0

[12x2y2

]x=1−y

x=0dy =

12

∫ 1

y=0(1− y)2y2 dy

=12

∫ 1

y=0

(y2 − 2y3 + y4

)dy =

12

[13y3 − 1

2y4 +

15y5

]1

y=0=

160

2. Perform y integration first (right-hand diagram):

I =∫ 1

x=0

[∫ y=1−x

y=0xy2 dy

]dx =

∫ 1

x=0

[13xy3

]y=1−x

y=0dx

=13

∫ 1

x=0

(x− 3x2 + 3x3 − x4

)dx =

13

[12x2 − x3 +

34x4 − 1

5x5

]1

x=0=

160

• Integrate the function f(x, y) = xy over the rectangular region defined by the points (0, 0),(a, 0),(0, b)and (a, b).

5.2 Triple integrals

The triple integral involves a function integrated over a three-dimensional region R i.e.

I =∫

Rf(x, y, z) dV =

∫ ∫ ∫

Rf(x, y, z) dx dy dz

As with the double integral, the order of integration does not matter and the limits are determined by theboundary of R.

Examples

• Calculate the volume bounded by the four planes x = 0, y = 0, z = 0 and x/a+ y/b+ z/c = 1.Perform the integration first along columns parallel to z, then combine these columns into vertical

slabs by integrating along y and then finally integrate along x. So the limits on x are simply 0 ≤ x ≤ a.

Department of Materials, Imperial College London

Page 17: Vector Calculus Notes

MSE 201: Mathematics 17

x

a

yb

z

c

The line x/a + y/b = 1 defines the upper limit on the y-integration, and the column height is definedby x/a+ y/b+ z/c = 1.

V =∫ a

x=0

{∫ b(1−x/a)

y=0

[∫ c(1−x/a−y/b)

z=0dz

]dy

}dx

= c

∫ a

x=0

[∫ b(1−x/a)

y=0

(1− x

a− y

b

)dy

]dx

= c

∫ a

x=0

[y − xy

a− y2

2b

]b(1−x/a)

y=0

dx

= bc

∫ a

x=0

[(1− x

a

)− x

a

(1− x

a

)− 1

2

(1− x

a

)2]dx

= bc

∫ a

x=0

(12− x

a+

x2

2a2

)dx

= bc

[x

2− x2

2a+

x3

6a2

]a

x=0

=abc

6

5.3 Changing variables

The concept of a substitution or change of variables to make one-dimensional integrals more tractable wascovered in year 1 e.g. consider substituting x = sin θ to calculate

∫ 1

x=0

√1− x2 dx =

∫ π/2

θ=0

√1− sin2 θ

dx

dθdθ =

∫ π/2

θ=0cos2 θ dθ

=12

∫ π/2

θ=0[1 + cos(2θ)] dθ =

12

[θ +

12

sin(2θ)]π/2

θ=0=π

4

In this case, dx has been replaced by (dx/dθ) dθ. For similar reasons it is desirable to be able to makesubstitutions or changes of variable in multidimensional integrals e.g. to change coordinate system.

First consider a two-dimensional integral in terms of Cartesian coordinates∫ ∫

Rf(x, y) dx dy

Department of Materials, Imperial College London

Page 18: Vector Calculus Notes

18 Vector calculus

that is to be transformed to plane polar coordinates ρ and φ. Define the Jacobian of x and y with respect toρ and φ as

J =∂(x, y)∂(ρ, φ)

=(∂x

∂ρ

)

φ

(∂y

∂φ

)

ρ

−(∂x

∂φ

)

ρ

(∂y

∂ρ

)

φ

which may also be written as the determinant:

J =∂(x, y)∂(ρ, φ)

=

∣∣∣∣∣(∂x/∂ρ)φ (∂y/∂ρ)φ

(∂x/∂φ)ρ (∂y/∂φ)ρ

∣∣∣∣∣

The change of variables then involves the replacement

dx dy = |J |dρ dφ =∣∣∣∣∂(x, y)∂(ρ, φ)

∣∣∣∣ dρ dφ

For the transformation from Cartesian to plane polar coordinates:

J =∂(x, y)∂(ρ, φ)

=

∣∣∣∣∣cosφ sinφ−ρ sinφ ρ cosφ

∣∣∣∣∣ = ρ(cos2 φ+ sin2 φ

)= ρ

Thus this change of variables involves the replacement:

dx dy = ρdρ dφ

which of course simply replaces the expression for an area element dA in Cartesians with that for planepolar coordinates. The Jacobian is simply a formal device for manipulating the scale factors, and the sameresult could be obtained from physical reasoning.

Hence ∫ ∫

Rf(x, y) dx dy =

∫ ∫

R′g(ρ, φ)

∣∣∣∣∂(x, y)∂(ρ, φ)

∣∣∣∣ dρ dφ

where R′ is a region of integration with respect to ρ and φ that corresponds to R and g(ρ, φ) is the functionthat results when f(x, y) is re-written in terms of ρ and φ.

Examples

• Consider the integral

I =∫ ∫

Ry

√x2 + y2 dx dy

where R is the top right quadrant of the unit circle.

◦ Calculate I directly using Cartesian coordinates.

I =∫ 1

x=0

∫ √1−x2

y=0y

√x2 + y2 dx dy =

∫ 1

x=0

[13

(x2 + y2

)3/2]√1−x2

y=0dx

=13

∫ 1

x=0

(1− x3

)dx =

13

[x− 1

4x4

]1

x=0=

14

◦ Change variables to plane polar coordinates and repeat the calculation.

Since ρ =√x2 + y2 and y = ρ sinφ the function being integrated transforms to ρ2 sinφ. The

Jacobian for this transformation is ρ and so

I =∫ 1

ρ=0

∫ π/2

φ=0ρ3 sinφdρ dφ

Department of Materials, Imperial College London

Page 19: Vector Calculus Notes

MSE 201: Mathematics 19

which is separable and much more straightforward to evaluate:

I =[14ρ4

]1

ρ=0[− cosφ]π/2

φ=0 =14

• CalculateI =

∫ ∫

R

1√x2 + y2

dx dy

where R is the unit circle.

• Calculate

I =∫ ∫

Rexp

(−

√x2 + y2

)dx dy

where R is the unit semicircle in the upper-half plane (y > 0).

5.4 Properties of Jacobians

The definition of the Jacobian as a determinant generalises to more than two dimensions. For example inthree dimensions, the Jacobian for transforming from x, y and z to a new set of variables u, v and w is

∂(x, y, z)∂(u, v, w)

=

∣∣∣∣∣∣∣

(∂x/∂u)v,w (∂y/∂u)v,w (∂z/∂u)v,w

(∂x/∂v)w,u (∂y/∂v)w,u (∂z/∂v)w,u

(∂x/∂w)u,v (∂y/∂w)u,v (∂z/∂w)u,v

∣∣∣∣∣∣∣

and

dV = dx dy dz =∣∣∣∣∂(x, y, z)∂(u, v, w)

∣∣∣∣ du dv dw

A property of Jacobians (stated in three dimensions for illustration but completely general) is

∂(x, y, z)∂(u, v, w)

=∂(x, y, z)∂(p, q, r)

∂(p, q, r)∂(u, v, w)

Setting u ≡ x, v ≡ y and w ≡ z then yields

1 =∂(x, y, z)∂(p, q, r)

∂(p, q, r)∂(x, y, z)

or∂(p, q, r)∂(x, y, z)

= 1/∂(x, y, z)∂(p, q, r)

which can sometimes be useful in calculating Jacobians.

Examples

• Evaluate the Jacobian for transforming from Cartesian coordinates x, y and z to cylindrical polarcoordinates ρ, φ and z. Hence confirm the expression for the volume element dV in section 3.2.

• Evaluate the Jacobian for transforming from plane polar coordinates to Cartesian coordinates. Showthat

∂(x, y)∂(ρ, φ)

∂(ρ, φ)∂(x, y)

= 1

Department of Materials, Imperial College London

Page 20: Vector Calculus Notes

20 Vector calculus

6 Derivatives of vectors

Consider a vector v that is a function of a scalar variable t e.g. this might be the velocity as a function oftime. This function maps the scalar t onto a vector v(t). The vector may be expressed in terms of a set ofscalar functions e.g. in terms of Cartesian components v = vx(t) i + vy(t) j + vz(t)k.

The derivative of v(t) (which is also a vector) may be defined as a limit in the same way as the derivativeof a scalar function:

dvdt

= limδt→0

v(t+ δt)− v(t)δt

For this limit to exist (and therefore for the function to be differentiable) the individual components must alsobe differentiable.

Since the Cartesian unit vectors i, j and k are constant,

dvdt

=dvx

dti +

dvy

dtj +

dvz

dtk.

Example

• A particle moving in a helix has position vector r(t) = ρ cos(ωt) i+ρ sin(ωt) j+utk where ω and u areconstants. Calculate the velocity v(t) and acceleration a(t) of the particle and show that at all timesa · r = −ρ2ω2.

The situation is not so straightforward when using non-Cartesian coordinates, as not only the componentsbut also the basis vectors change with position. Consider cylindrical polar coordinates

eρ = cosφ i + sinφ j

eφ = − sinφ i + cosφ j

ez = k

These expressions can be differentiated:

deρ

dt= − sinφ

dti + cosφ

dtj =

dteφ

deφ

dt= − cosφ

dti− sinφ

dtj = −dφ

dteρ

dez

dt= 0

6.1 Product rule

The product rule for differentiation is familiar when two scalar functions are involved. However it generalisesreadily to the products involving vector functions. If f(t) is a scalar function of a single variable t, and a(t)and b(t) are both vector functions of t, then

d

dt(fa) = f

dadt

+df

dta

d

dt(a · b) = a · db

dt+dadt· b

d

dt(a× b) = a× db

dt+dadt× b

Department of Materials, Imperial College London

Page 21: Vector Calculus Notes

MSE 201: Mathematics 21

Note that it is important to maintain the order of the vectors in the cross product since a×b 6= b×a. Theseresults are straightforward (if a little tedious) to prove by expanding in terms of Cartesian components.

Examples

• Reconsider the previous example, but now in cylindrical polars where r(t) = ρeρ + utk and theazimuthal angle φ = ωt. Calculate the velocity v(t) and acceleration a(t) of the particle and show thata · r = −ρ2ω2 still holds – why is this not a surprise?

• Angular momentum is defined as L = r ×mv for a particle of mass m with velocity v at position r.Find an expression for the rate of change of angular momentum (with respect to time) L.

6.2 Partial derivatives

As the rules for standard derivatives of scalar functions readily generalise to vector functions, so do therules for partial derivatives e.g. for a vector field. In terms of Cartesian components of the vector functiona(x, y, z) ≡ a(r) i.e. ax(x, y, z), ay(x, y, z) and az(x, y, z):

(∂a∂x

)

y,z=

(∂ax

∂x

)

y,zi +

(∂ay

∂x

)

y,zj +

(∂az

∂x

)

y,zk

and so on.

The total derivative can therefore be written

da =(∂a∂x

)

y,zdx+

(∂a∂y

)

z,x

dy +(∂a∂z

)

x,ydz

which, if expanded in terms of Cartesian components of a, involves nine different partial derivatives sincein general each component depends on all three coordinates.

Finally the chain rule for partial differentiation also applies e.g.(∂a∂r

)

θ,φ=

(∂a∂x

)

y,z

(∂x

∂r

)

θ,φ+

(∂a∂y

)

z,x

(∂y

∂r

)

θ,φ+

(∂a∂z

)

x,y

(∂z

∂r

)

θ,φ

Example

• The vector field F = exp(−x) exp(−y) cos z k.

◦ Calculate the partial derivatives of F with respect to the Cartesian coordinates x, y and z.

◦ Hence write down an expression for the total derivative dF.

Department of Materials, Imperial College London

Page 22: Vector Calculus Notes

22 Vector calculus

7 Gradient

Consider a scalar field f(r) expressed in terms of the Cartesian coordinates of r i.e. f(x, y, z). The totaldifferential is

df =(∂f

∂x

)

y,zdx+

(∂f

∂y

)

z,x

dy +(∂f

∂z

)

x,ydz

This can be written as the scalar product between the total differential of the position vector r:

dr = dx i + dy j + dz k

and the vector field g(r) defined by

g =(∂f

∂x

)

y,zi +

(∂f

∂y

)

z,x

j +(∂f

∂z

)

x,yk

g is called the gradient of f . It contains all of the information about the rate of change of f with respect toposition in any direction (i.e. for an arbitrary dr.)

df = g · dr

Examples

• Calculate the gradients of the following scalar fields:

◦ f(x, y, z) = 1/√x2 + y2 + z2

◦ φ(x, y, z) = (x2 − y2)z

7.1 Notation

The gradient of a function f may be denoted

g = grad f

but a more compact notation involves introducing the vector differential operator known as del or nabla. Itis denoted by an upside-down capital Greek letter delta and in Cartesian coordinates is

∇ = i∂

∂x+ j

∂y+ k

∂z

Using this notationg = grad f ≡ ∇f

Since ∇ possesses the properties of both a vector and a differential operator, it does not obey all the rulesof vector algebra. For example ∇ · a 6= a · ∇.

Department of Materials, Imperial College London

Page 23: Vector Calculus Notes

MSE 201: Mathematics 23

7.2 Geometric interpretation

The gradient was introduced as a scalar product

df = ∇f · dr = |∇f | dr cos θ

where θ is the angle between ∇f and dr. Moving a fixed distance dr = |dr| therefore produces the largestchange df if θ = 0 i.e. dr is parallel to ∇f . Hence ∇f points in the direction of steepest ascent i.e. thedirection in which f increases most rapidly.

The equation f = constant defines a surface in three dimensions. If dr lies along this surface (i.e. istangential to it) then f cannot change and df = 0. From above this implies that θ = π/2 i.e. ∇f isperpendicular to the surfaces of constant f .

Figure 12: Field lines (solid) and contours (dashed) intersect at right angles.

A scalar field may be represented by contours, lines along which the field is constant, shown by the dashedlines in Fig. 12. A vector field may be represented by field lines, shown by the solid lines in Fig. 12: thedirection of the vector field is tangential to the field line at that point, and the magnitude of the field isrepresented by the spacing between the field lines: the more closely spaced the field lines, the stronger thefield. For a vector field that is the gradient of a scalar field, the field lines of the vector field always intersectthe contours of the scalar field at right angles, due to the results above.

7.3 Other coordinate systems

Consider a non-Cartesian coordinate system e.g. cylindrical polar coordinates for illustration. Write thetotal differential of a function V (ρ, φ, z):

dV =(∂V

∂ρ

)

φ,z

dρ+(∂V

∂φ

)

z,ρ

dφ+(∂V

∂z

)

ρ,φdz

In this coordinate system, the total differential of the position vector r involves the scale factors:

dr = hρ dρ eρ + hφ dφ eφ + hz dz ez

where of course hρ = hz = 1 and hφ = ρ.

Department of Materials, Imperial College London

Page 24: Vector Calculus Notes

24 Vector calculus

The equation df = ∇f · dr involves vectors and is therefore independent of coordinate system, from whichit is clear that

∇ =eρ

∂ρ+

∂φ+

ez

hz

∂z= eρ

∂ρ+

ρ

∂φ+ ez

∂z

and similarly in spherical polar coordinates

∇ =er

hr

∂r+

∂θ+

∂φ= er

∂r+

r

∂θ+

r sin θ∂

∂φ

Note that whatever coordinate system is used, the gradient vector of a given scalar field is the same at allpoints in space.

Examples

• Calculate the gradients of the scalar fields:

◦ V (ρ, φ, z) = λ ln ρ (cylindrical polar coordinates)

◦ f(r, θ, φ) = cos θ/r (spherical polar coordinates)

8 Divergence

The divergence of a vector field F(r), div F, is itself a scalar field. In terms of Cartesian coordinatesF = Fx i + Fy j + Fz k, where each of the three components Fx, Fy and Fz is itself a function of threevariables x, y and z:

div F =(∂Fx

∂x

)

y,z+

(∂Fy

∂y

)

z,x

+(∂Fz

∂z

)

x,y

This expression is a scalar product between the del operator ∇ and the vector field F and is thereforedenoted

div F ≡ ∇ · F

Examples

• Calculate the divergence of the following vector fields:

◦ F = ax i + by j + cz k where a, b and c are constants.

◦ E =x i

y2 + z2

◦ g = exp(−xyz)[

iyz

+jzx

+kxy

]

Department of Materials, Imperial College London

Page 25: Vector Calculus Notes

MSE 201: Mathematics 25

8.1 Geometric interpretation

Field lines begin at a source and end at a sink. In electrostatics with point charges, electric field lines canonly begin at positive charges (sources) and end at negative charges (sinks), as illustrated in Fig. 13. Fora continuous charge distribution the situation is more complicated, but in general a positive charge densitywill act as a source of field lines and a negative charge density will act as a sink. The strength of the sourceor sink is determined by the magnitude of the charge density.

+ −

Figure 13: Electric field lines begin on positive charges (sources) and end on negative charges (sinks).

The geometric interpretation of the divergence is that it measures the rate at which electric field lines arebegin created or destroyed at a point – in other words, it is proportional to the density of sources or sinksat a point in space.

In free space there are no sources or sinks, and hence the divergence of a field vanishes. A vector fieldwith zero divergence is said to be solenoidal.

8.2 Other coordinate systems

In other coordinate systems the expressions for the divergence are more complicated, since it is necessaryto take the change in the basis vectors as well as the change in components into account, and so the scalefactors come into play again. Here the results are simply stated.

In cylindrical polar coordinates, the divergence of a vector field F = Fρ eρ + Fφ eφ + Fz ez takes the form

∇ · F =1ρ

∂ρ(ρFρ) +

∂Fφ

∂φ+∂Fz

∂z

In spherical polar coordinates where F = Fr er + Fθ eθ + Fφ eφ:

∇ · F =1r2

∂r

(r2Fr

)+

1r sin θ

∂θ(sin θ Fθ) +

1r sin θ

∂Fφ

∂φ

Department of Materials, Imperial College London

Page 26: Vector Calculus Notes

26 Vector calculus

Examples

• Calculate the divergence of the following vector fields:

◦ r = r er

◦ F = rn er

It is significant that the divergence vanishes for the case n = −2 since this corresponds to theinverse square law for electric and gravitational fields.

◦ u =eφ

2πρ◦ E = exp(id · r)k

9 Curl

The divergence of a vector field was defined in terms of the scalar product betwen the del operator ∇ andthe vector field. Another alternative is clearly to take the vector product between del and the vector field,the result being itself a vector field. This is called the curl (or sometimes the rotation) of a vector field andis denoted

curlF ≡ ∇× F

As a vector product it can be calculated from a determinant. In Cartesian coordinates

∇× F =

∣∣∣∣∣∣∣

i j k∂/∂x ∂/∂y ∂/∂zFx Fy Fz

∣∣∣∣∣∣∣

=

[(∂Fz

∂y

)

z,x

−(∂Fy

∂z

)

x,y

]i +

[(∂Fx

∂z

)

x,y−

(∂Fz

∂x

)

y,z

]j +

[(∂Fy

∂x

)

y,z−

(∂Fx

∂y

)

z,x

]k

Examples

• Calculate the curl of the following vector fields:

◦ F = yz i + zx j + xy k

◦ A = 12B0 (x j− y i)

◦ E = exp(id · r)k

9.1 Geometric interpretation

As implied by the fact that the curl is also known as the rotation, the geometric interpretation of the curlhas to do with the way in which field lines rotate around a given point. As illustrated in Fig. 14 this can bevisualised in terms of the rate at which a paddle wheel would turn if placed in the field. A field which haszero curl is said to be irrotational.

The magnitude of the curl at a point is proportional to the speed with which the paddle wheel rotates. Thedirection of the curl points along the axis of rotation: in Fig. 14 this points out of the plane of the paper.

Department of Materials, Imperial College London

Page 27: Vector Calculus Notes

MSE 201: Mathematics 27

Figure 14: Geometric interpretation of the curl of a vector field as the rate at which a paddle wheel would turn.

9.2 Other coordinate systems

As with the divergence, the expressions for the curl are more complicated in non-Cartesian coordinatesystems and involve the scale factors. In cylindrical polar coordinates

∇× F =1ρ

∣∣∣∣∣∣∣

eρ ρ eφ ez

∂/∂ρ ∂/∂φ ∂/∂zFρ ρFφ Fz

∣∣∣∣∣∣∣

and in spherical polar coordinates

∇× F =1

r2 sin θ

∣∣∣∣∣∣∣

er r eθ r sin θ eφ

∂/∂r ∂/∂θ ∂/∂φFr rFθ r sin θFφ

∣∣∣∣∣∣∣

The whole determinant is divided by the product of the scale factors, and in the top and bottom rows ofeach column the scale factor for that coordinate appears.

Examples

• Calculate the curl of the following vector fields:

◦ F = rn er

◦ g =eφ

r2

◦ u =eφ

2πρ

◦ B =eφ

ρ2+ v ez

Department of Materials, Imperial College London

Page 28: Vector Calculus Notes

28 Vector calculus

10 Combinations of grad, div and curl

The gradient, divergence and curl are the three building blocks of vector calculus, all based upon thedel vector differential operator ∇. However they are often combined or modified to create other vectoroperators, for example consider a · ∇ where a is a vector field. As mentioned earlier, although the scalarproduct is usually commutative (a · b = b · a) this does not hold when vector operators are involved. Interms of Cartesian coordinates

a · ∇ = ax∂

∂x+ ay

∂y+ az

∂z

which is a scalar differential operator.

10.1 Laplacian

The most commonly encountered combination is the Laplacian, a second order scalar differential operatorthat can in fact operate on either a scalar or vector field. When operating on a scalar field it is equivalentto taking the gradient to obtain a vector field whose divergence is then taken to obtain the result, a scalarfield i.e.

div grad f ≡ ∇ · (∇f) ≡ ∇2f ≡ ∆f

where the ∇2 notation has been introduced (as well as the capital delta symbol ∆ that is less common). InCartesians ∇ ≡ i ∂/∂x+ j ∂/∂y + k ∂/∂z so

∇ · (∇f) =[i∂

∂x+ j

∂y+ k

∂z

]·[i∂f

∂x+ j

∂f

∂y+ k

∂f

∂z

]

=∂2f

∂x2+∂2f

∂y2+∂2f

∂z2

and therefore

∇2 ≡ ∂2

∂x2+

∂2

∂y2+

∂2

∂z2

In other coordinate systems the scale factors are involved. In cylindrical polar coordinates

∇2 ≡ 1ρ

∂ρ

(ρ∂

∂ρ

)+

1ρ2

∂2

∂φ2+

∂2

∂z2

and in spherical polar coordinates

∇2 ≡ 1r2

∂r

(r2∂

∂r

)+

1r2 sin θ

∂θ

(sin θ

∂θ

)+

1r2 sin2 θ

∂2

∂φ2

The Laplacian occurs in many physical equations, including those listed in Table 2.

Examples

• Calculate the Laplacian of the following scalar fields:

◦ φ(x, y, z) = sin(πx

a

)cos

(πy

b

)exp (−kz)

◦ V (r, θ, φ) = r sin θ cosφ◦ f(ρ, φ, z) = ρ2 cos(2φ) + z2

Department of Materials, Imperial College London

Page 29: Vector Calculus Notes

MSE 201: Mathematics 29

∇2φ = 0 Laplace equation

∇2φ = %(r) Poisson equation

∇2ψ + k2ψ = 0 Helmholtz equation

D∇2c =∂c

∂tDiffusion equation

∇2ψ =1c2∂2ψ

∂t2Wave equation

− h2

2m∇2ψ + V (r)ψ = Eψ Schrodinger equation

Table 2: Physical equations involving the Laplacian operator.

10.2 Vector operator identities

A number of identities involving ∇ can be derived, including the following, where u and v are scalar fields,and a and b are vector fields:

∇(uv) = u∇v + v∇u∇(a · b) = a× (∇× b) + b× (∇× a) + (a · ∇)b + (b · ∇)a∇ · (ua) = u∇ · a + a · ∇u

∇ · (a× b) = b · (∇× a)− a · (∇× b)∇× (ua) = ∇u× a + u∇× a

∇× (a× b) = a(∇ · b)− b(∇ · a) + (b · ∇)a− (a · ∇)b

These identities (and more) may be proved using Cartesian coordinates: as the identity involves physicalquantities (scalars, vectors and operators) without reference to a particular coordinate system they are validwhichever coordinate system is employed.

As an example consider ∇× (∇× F) where F = Fx i + Fy j + Fz k is a vector field.

∇× F =

[(∂Fz

∂y

)

z,x

−(∂Fy

∂z

)

x,y

]i +

[(∂Fx

∂z

)

x,y−

(∂Fz

∂x

)

y,z

]j +

[(∂Fy

∂x

)

y,z−

(∂Fx

∂y

)

z,x

]k

Consider the x-component of ∇× (∇× F) i.e.

i · [∇× (∇× F)] =∂

∂y[k · (∇× F)]− ∂

∂z[j · (∇× F)]

=∂

∂y

[(∂Fy

∂x

)

y,z−

(∂Fx

∂y

)

z,x

]− ∂

∂z

[(∂Fx

∂z

)

x,y−

(∂Fz

∂x

)

y,z

]

=∂2Fy

∂y∂x+∂2Fz

∂z∂x− ∂2Fx

∂y2− ∂2Fx

∂z2

Department of Materials, Imperial College London

Page 30: Vector Calculus Notes

30 Vector calculus

Adding and subtracting ∂2Fx/∂x2, and using the property of second crossed derivatives:

i · [∇× (∇× F)] =∂2Fx

∂x2+∂2Fy

∂x∂y+∂2Fz

∂x∂z− ∂2Fx

∂x2− ∂2Fx

∂y2− ∂2Fx

∂z2

=∂

∂x

[(∂Fx

∂x

)

y,z+

(∂Fy

∂y

)

z,x

+(∂Fz

∂z

)

x,y

]−

{∂2Fx

∂x2+∂2Fx

∂y2+∂2Fx

∂z2

}

The term in square brackets is simply the divergence ∇ ·F while the term in curly brackets is the Laplacianof the x-component ∇2Fx. Therefore

i · [∇× (∇× F)] =∂

∂x(∇ · F)−∇2Fx

The y- and z-components yield similar results and hence

∇× (∇× F) =[i∂

∂x(∇ · F) + j

∂y(∇ · F) + k

∂z(∇ · F)

]

−{∇2Fx i +∇2Fy j +∇2Fz k

}

The term in square brackets is just the gradient of ∇ · F while the term in curly brackets while the term incurly brackets defines the Laplacian of a vector field. The identity is therefore

∇× (∇× F) = ∇(∇ · F)−∇2F

In Cartesian coordinates the Laplacian of a vector field is simply the vector obtained by taking the Laplacianof each component i.e.

∇2F =

∇2Fx

∇2Fy

∇2Fz

However this is not true in a general coordinate system. In this case the Laplacian of a vector field mustbe calculated by manipulating the previous identity:

∇2F = ∇(∇ · F)−∇× (∇× F)

Examples

• Using Cartesian coordinates, prove the following identities:

◦ ∇(uv) = u∇v + v∇u where u and v are scalar fields

◦ ∇ · (ua) = u∇ · a + a · ∇u where u is a scalar field and a is a vector field

11 Line integrals

A line integral is a one-dimensional integral where the integrand is evaluated along a general path or curve,as illustrated in Fig. 15. Here the path C joins the points A and B along a curve that can be split into vectorline elements dl as shown.

The integrand for a line integral may involve a scalar or vector field, and the result itself may be a scalar ora vector:

Department of Materials, Imperial College London

Page 31: Vector Calculus Notes

MSE 201: Mathematics 31

x

y

A

B

C

dl

Figure 15: A path for a line integral in two dimensions.

•∫

Cf(r) dl is a vector quantity derived from a scalar field f

•∫

CF(r) · dl is a scalar quantity derived from a vector field F

•∫

CF(r)× dl is a vector quantity derived from a vector field F

The second of these is the most common. For example, consider the work done when a force moves anobject along a path C. The work done when a constant force F causes a displacement l is W = F · l. Ifthe force is caused by a field, then in general it will vary in space and will not be constant. Split the path upinto line elements dl along which the force may be considered constant: the work done for the line elementis dW = F · dl and the total work for the whole path is therefore

∫C F · dl.

An example of the third kind is the Biot-Savart law for calculating magnetic fields – there is a problem onQuestion Sheet 3 about this.

11.1 Properties

From vector summation it is clear that for a path that runs from point A to point B∫

Cdl =

−→AB

Reversing the sense of the contour involves making the change dl → −dl and hence∫

A→B

along C. . . dl = −

∫B→A

along C. . . dl

If the points A and B coincide, then C is a closed path, which may be denoted by placing a circle on theintegral sign: ∮

C. . . dl

Department of Materials, Imperial College London

Page 32: Vector Calculus Notes

32 Vector calculus

11.2 Scalar line integrals

Consider first line integrals of the form ∫

CF · dl

where F is a vector field that in three-dimensional Cartesian coordinates may be written F = Fx i+Fy j+Fz kwhereas the line element is dl = dx i + dy j + dz k and hence

CF · dl =

C(Fx dx+ Fy dy + Fz dz)

The path C defines a relationship between dx, dy and dz. For example, for a straight line defined by

x− x0

x1 − x0=

y − y0

y1 − y0=

z − z0z1 = z0

that runs between the points r0 = x0 i + y0 j + z0 k and r1 = x1 i + y1 j + z1 k:

dy =y1 − y0

x1 − x0dx and dz =

z1 − z0x1 − x0

dx

so ∫

CF · dl =

∫ x1

x=x0

[Fx + Fy

(y1 − y0

x1 − x0

)+ Fz

(z1 − z0x1 − x0

)]dx

More generally, if the equation of the path C between r0 and r1 can be written as y = y(x) and z = z(x)then ∫

CF · dl =

∫ x1

x=x0

[Fx + Fy

dy

dx+ Fz

dz

dx

]dx

More generally still, the path C may be defined parametrically i.e. the points on the path C are defined bythe equations x = x(u), y = y(u) and z = z(u) in terms of a parameter u that varies between u0 and u1.Then ∫

CF · dl =

∫ u1

u=u0

[Fxdx

du+ Fy

dy

du+ Fz

dz

du

]du

In all of the above, the components of the vector field being integrated must be written in terms of theintegration variable alone.

Examples

• Calculate the line integrals∫

CF · dl where F = x i + y j + z k and:

◦ C runs along the x-axis from x = 0 to x = 1.

C is a straight line parallel to the x-axis and hence along C: dy = dz = 0. Also on C, y = z = 0and so F = x i in the integral:

CF · dl =

∫ 1

x=0x dx =

[12x2

]1

x=0=

12

◦ C is a straight line from the origin to the point a i + b j + ck.

Department of Materials, Imperial College London

Page 33: Vector Calculus Notes

MSE 201: Mathematics 33

The equation of this straight line is x/a = y/b = z/c and hence along C, dy/dx = b/a anddz/dx = c/a. Along C the field F can be written in terms of x only as

F = x i +b

ax j +

c

axk

Putting this all together:

CF · dl =

∫ a

x=0

[x+

(b

a

)2

x+(c

a

)2

x

]dx =

{1 +

(b

a

)2

+(c

a

)2} [

12x2

]a

0

=12

(a2 + b2 + c2

)

◦ C is a straight line between the points r0 = a i + b j and r1 = a i + b j + ck.

◦ C is a single turn of a helix defined parametrically by x = a cosφ, y = a sinφ and z = uφ.

From the parametric equations, dx/dφ = −a sinφ, dy/dφ = a cosφ and dz/dφ = u. Hence∫

CF · dl =

∫ 2π

0[(a cosφ)(−a sinφ) + (a sinφ)(a cosφ) + (uφ)u] dφ

= u2∫ 2π

0φdφ = 2π2u2

In non-Cartesian coordinates the same ideas apply as above: the vector field F is expanded in the appro-priate basis vectors and the relevant expression for the line integral involving the scale factors is used. Forcylindrical polar coordinates: ∫

CF · dl =

C[Fρ dρ+ Fφρ dφ+ Fz dz]

and in spherical polar coordinates:∫

CF · dl =

C[Fr dr + Fθr dθ + Fφr sin θ dφ]

Non-Cartesian coordinates are generally chosen when the symmetry of the path C may be exploited tosimplify the integration.

Example

• Consider the previous example with the helical path in cylindrical polar coordinates.

First note that F = r and hence F = ρ eρ + z ez. A more long-winded derivation of the aboveuses the expressions from section 3.2:

F = x i + y j + z k

= (ρ cosφ)(cosφ eρ − sinφ eφ) + (ρ sinφ)(sinφ eρ + cosφ eφ) + z ez

= ρ(cos2 φ+ sin2 φ) eρ + ρ(sinφ cosφ− cosφ sinφ) eφ + z ez

= ρ eρ + z ez

The expression for the line element in cylindrical polar coordinates is

dl = dρ eρ + ρdφ eφ + dz ez

Department of Materials, Imperial College London

Page 34: Vector Calculus Notes

34 Vector calculus

and hence ∫

CF · dl = [ρdρ+ zdz]

Along the helical path C, ρ is a constant a so dρ = 0. The integral can be performed by making theparametric substitution for z, but in this case this is unnecessary:

CF · dl =

∫ 2πu

z=0z dz =

[12z2

]2πu

z=0= 2π2u2

• Consider the line integral∫

CB · dl where B = I/(2πρ) eφ and C is a circle of radius a in the xy-plane.

11.3 Conservative fields

The integrands in the scalar integrals considered previously take the form of differentials Fx(x, y, z) dx +Fy(x, y, z) dy+Fz(x, y, z) dz. If the differential is exact then it can be written as the total differential of somescalar function f(x, y, z) i.e. df = Fx(x, y, z) dx+ Fy(x, y, z) dy + Fz(x, y, z) dz. In this case the line integralbecomes rather simple:

CF · dl =

C[Fx dx+ Fy dy + Fz dz] =

Cdf = f(B)− f(A)

where A and B are again the beginning and end points, respectively, of the path C. The value of the lineintegral is simply the difference in the scalar field f between the end points, and is independent of theparticular path C taken between A and B.

The conditions for an exact differential involving three variables are

∂Fx

∂y=∂Fy

∂x,

∂Fy

∂z=∂Fz

∂yand

∂Fz

∂x=∂Fx

∂z

Compare the expression for the curl of F:

∇× F =(∂Fz

∂y− ∂Fy

∂z

)i +

(∂Fx

∂z− ∂Fz

∂x

)j +

(∂Fy

∂x− ∂Fx

∂y

)k

which must vanish if the above conditions are satisfied. Hence a scalar line integral will correspond to anexact differential (and thus depend only upon its end points) if and only if the curl of the vector field vanishesat all points. Such a vector field is said to be a conservative field and corresponds to many (but not all)physical fields: electrostatic and gravitational fields are conservative, but magnetic fields are not.

In the previous section it was stated that the curl of the gradient of any scalar field vanishes i.e. ∇ × ∇f .Indeed since the definition of the gradient of a scalar field f was df = ∇f · dl then it is clear that aconservative field must be the gradient of some scalar field – in physics this scalar field is known as thepotential and gives the potential energy of a unit test particle at a given point in the field. In summary, if avector field F is conservative then:

• ∇ × F ≡ 0 at all points in space;

• there exists some scalar field f such that F = ∇f .

For a conservative field F, it is also obvious that∮

CF · dl = 0

since any closed path C starts and ends at the same point.

Department of Materials, Imperial College London

Page 35: Vector Calculus Notes

MSE 201: Mathematics 35

11.4 Green’s theorem in the plane

Consider the two-dimensional case of a simple closed path C in the xy-plane, taken in an anticlockwisesense as shown in Fig. 16, and the scalar line integral

CF · dl

for a vector field F = Fx(x, y) i + Fy(x, y) j.

x

y

x

y

C C

Figure 16: Closed line integral used for the proof of Green’s theorem in the plane.

Note that the line integral may be split into two parts:∮

CF · dl = Ix + Iy =

CFx dx+

CFy dy

Now consider the double integral ∫ ∫

R

(∂Fy

∂x− ∂Fx

∂y

)dx dy

where R is the region bounded by C. As in section 5 the order in which the x and y integrations areperformed is arbitrary. For the first term, perform the x integration first, as shown on the left of Fig. 16, andconsider the contribution from a single strip located at y:

∫ xmax(y)

x=xmin(y)

∂Fy

∂xdx = [Fy]

xmax(y)x=xmin(y) = Fy(xmax(y), y)− Fy(xmin(y), y)

Multiplying by the strip height dy gives a contribution towards Iy: Fy(xmax(y), y) dy is the contribution fromthe right-hand edge of the strip to Iy. −Fy(xmin(y), y) dy is the left-hand edge where the minus sign ac-counts for the fact that C is in a downward sense on the left-hand side.

For the second term, perform the y integration first, as shown on the right of Fig. 16, and consider thecontribution from a single strip located at x:

−∫ ymax(x)

y=ymin(x)

∂Fx

∂ydy = − [Fx]ymax(x)

y=ymin(x) = Fx(x, ymin(x))− Fx(x, ymax(x))

Multiplying by the strip width dx gives a contribution towards Ix: Fx(x, ymin(x)) dx is from the bottom edge(where the sense of C is in the positive x-direction) and −Fx(x, ymax(x)) dx is from the top edge (where Cis in the negative x-direction).

Thus Green’s theorem in the plane is established:∮

C(Fx dx+ Fy dy) =

∫ ∫

R

(∂Fy

∂x− ∂Fx

∂y

)dx dy

Department of Materials, Imperial College London

Page 36: Vector Calculus Notes

36 Vector calculus

where C is the anticlockwise path that bounds the region R: this sometimes denoted C = ∂R.

Embedding the xy-plane in three-dimensional space as usual, it may be noted that the integrand on theright-hand side is the z-component of the curl of F. dx dy is the area element dA that may be representedby an element of vector area dS = dAk. Thus Green’s theorem in the plane could be rewritten as

CF · dl =

R(∇× F) · dS

where C and R are restricted to lie in the xy-plane. This is a special case of Stokes’ theorem.

Note that for a conservative field (for which ∂Fy/∂x = ∂Fx/∂y and Fx dx+Fy dy is an exact differential) thisconfirms that a line integral around a closed path vanishes.

Example

• Confirm Green’s theorem in the plane for the field F = 3x dy + y dx integrated anticlockwise aroundthe unit square in the xy-plane.

This is not a conservative field so the integrals must be evaluated explicitly.

The line integral (starting from the origin) consists of four parts:

CF · dl =

∫ 1

x=0Fx(x, 0) dx+

∫ 1

y=0Fy(1, y) dy +

∫ 0

x=1Fx(x, 1) dx+

∫ 0

y=1Fy(0, y) dy

= 0 +∫ 1

y=03 dy −

∫ 1

x=0dx− 0 = 3− 1 = 2

and only the right and top edges contribute.

The integrand for the area integral is ∂Fy/∂x − ∂Fx/∂y = 3 − 1 = 2 which is a constant so theintegral is simply ∫

R2 dx dy = 2

from the area of the unit square.

Hence both sides of Green’s theorem in the plane equal two.

11.5 Vector line integrals

Consider a line integral of the form ∫

Cf(r) dl

where f is a scalar field. In terms of Cartesian coordinates,∫

Cf(r) dl = i

(∫

Cf(x, y, z) dx

)+ j

(∫

Cf(x, y, z) dy

)+ k

(∫

Cf(x, y, z) dz

)

i.e. a sum involving three scalar line integrals along the same path C, which may be parameterised asbefore.

Department of Materials, Imperial College London

Page 37: Vector Calculus Notes

MSE 201: Mathematics 37

Examples

• Calculate the following line integrals∫

Cfdl where f(x, y, z) = x2 + y2 and:

◦ C is a straight line from the origin to the point 2 i + j− 3k.

This straight line may be parameterised by x = 2λ, y = λ and z = −3λ where 0 ≤ λ ≤ 1.dx/dλ = 2, dy/dλ = 1 and dz/dλ = −3. Along C, f = (2λ)2 + λ2 = 5λ2. Hence

Cfdl = i

∫ 1

λ=010λ2 dλ+ j

∫ 1

λ=05λ2 dλ− k

∫ 1

λ=015λ2 dλ =

53

(2 i + j− 3k)

◦ C is the unit circle in the xy-plane, taken anticlockwise.

At first glance, plane-polar coordinates might seem to be suitable for this. Along C, f = ρ2 = 1.The general line element is dl = dρ eρ + ρdφ eφ but since ρ is constant (unity) along C, dρ = 0.Thus for C, dl = dφ eφ and hence

Cf(r) dl =

∫ 2π

φ=0eφ dφ

However there is a problem: the direction of eφ changes along C – it is not a constant in theintegrand. In fact, for every point on C, the point diametrically opposite has eφ pointing in exactlythe opposite direction. Thus the integral is in fact zero.

This can be confirmed using Cartesian coordinates (with the azimthual angle φ as a param-eter to define C) or even more straightforwardly, since f = 1 on C so this is a constant duringthe integration: ∮

Cf dl = f

Cdl = 0

since the start and end points are the same for a closed path.

Extra care must be taken when using non-Cartesian coordinate systems in vector line integrals.

Finally consider line integrals of the form ∫

CF(r)× dl

which, in terms of Cartesian coordinates, may be written∫

CF(r)× dl = i

C(Fy dz − Fz dy) + j

C(Fz dx− Fx dz) + k

C(Fx dy − Fy dx)

again a sum involving scalar line integrals along the same path C.

Consider the following special case: ∮

C

12r× dr

illustrated in Fig. 17.

From section 2.4 it is known that 12r× dr is the vector area of the triangle with vertices at the origin and the

points with position vectors r and r + dr. The line integral thus sums up these elements of vector area dSto obtain the total vector area of a surface bounded by the path C:

S =12

Cr× dr

Department of Materials, Imperial College London

Page 38: Vector Calculus Notes

38 Vector calculus

C

r

dr

O

r + dr

Figure 17: Vector area as a vector line integral.

This confirms the previous result that the vector area of a surface depends only upon the rim bounding it,and also uniquely defines the direction of the vector area (since the positive sense of the line integral iswhen C is traversed anticlockwise).

12 Surface and volume integrals

12.1 Surface integrals

A surface integral is a double integral where the integrand is evaluated over a general surface whoseorientation as well as area is taken into account by the use of the vector area. As with line integrals, scalarand vector fields may be involved:

•∫

Sf(r) dS is a vector quantity derived from a scalar field f

•∫

SF · dS is a scalar quantity derived from a vector field F

•∫

SF× dS is a vector quantity derived from a vector field F

The second these is of primary interest because of its physical interpretation as the flux of the field Fthrough the surface S. For example, in fluid dynamics, an incompressible fluid with density % and velocity

field v(r) would give rise to a flux (mass per unit time) J = %

Sv · dS. Attention is restricted to this case in

the following.

The surfaces over which the integral is performed may either be open i.e. bounded by a closed path Cwhose anticlockwise circuit defines the positive sense of the vector area associated with the surface, orclosed. In the latter case, the

∮notation is sometimes used. Of course it has already been determined that

the total vector area of a closed surface vanishes:∮dS = 0

The calculation of surface integrals is best illustrated by example.

Department of Materials, Imperial College London

Page 39: Vector Calculus Notes

MSE 201: Mathematics 39

Examples

• Calculate the surface integral of the vector field F = sin(x + y) i + cos(x + y) j + exp(−x − y)k overthe quadrant x ≥ 0, y ≥ 0 of the xy-plane.

In this case an element of vector area is dx dy k so only the z-component of F contributes and thesurface integral reduces to a separable double scalar integral:

SF · dS =

∫ ∞

x=0

∫ ∞

y=0exp(−x− y) dy dx

= [− exp(−x)]∞x=0 [− exp(−y)]∞y=0

= 1

• Calculate the surface integral of the vector field F = yz i+ zx j+xy k over the surface S consisting ofthat part of the plane 2x+ y − z = 0 bounded by 0 ≤ x ≤ a and 0 ≤ y ≤ b.

In Cartesian coordinates, F · dS = Fx dy dz + Fy dz dx+ Fz dx dy so this integral separates into threedouble integrals: ∫

SF · dS =

∫ ∫

Syz dy dz +

∫ ∫

Szx dz dx+

∫ ∫

Sxy dx dy

Since the boundary of S is determined by constraints on x and y, use z = 2x + y on S to eliminatez from the integrands. From this same equation, dz = 2dx + dy. In the first double integral, asubstitution for z in terms of x can be made, with dz = 2dx (y is constant during the z integration sody = 0). Whereas in the second double integral, a substitution for z in terms of y can be made i.e.dz = dy (since x is constant during the z integration so dx = 0). Hence

SF · dS =

∫ a

x=0

∫ b

y=0[2y(2x+ y) + (2x+ y)x+ xy] dx dy

=∫ a

x=0

∫ b

y=0

[2x2 + 6xy + 2y2

]dx dy

=23a3b+

32a2b2 +

23ab3

• Calculate the surface integral of the vector field E = x sin(πy/b) sin(πz/c) i over the part of the planex = a that satisfies 0 ≤ y ≤ b, 0 ≤ z ≤ c.

• Calculate the surface integral of the vector field g = (λ/ρ) eρ over the closed surface of a cylinder ofradius a and length L.

The closed surface of a cylinder consists of three parts: the curved surface and the two planar ends.For the ends, the surface element is parallel (or antiparallel) to ez and therefore perpendicular to g.These surfaces make no contribution to the surface integral.

The surface element of the curved surface ρ = a is a dφ dz eρ and so

Sg · dS =

∫ L

z=0

∫ 2π

φ=0

λ

aa dφ dz = 2πλL

• Calculate the surface integral of the vector field F = ρ2 ez over that part of the plane z = h satisfyingρ ≤ R.

Department of Materials, Imperial College London

Page 40: Vector Calculus Notes

40 Vector calculus

• Evaluate the surface integral I =∫

Sv · dS where v = y j and S is the upper surface of a hemisphere

of radius a.

The surface S is x2 + y2 + z2 = a2 with z ≥ 0 i.e. 0 ≤ θ ≤ π/2. The element of surface area fora spherical surface is dS = r2 sin θ dθ dφ er. From section 3.3:

j · er = sin θ sinφ and y = r sin θ sinφ

Hence

I =∫

Sv · dS =

∫ π/2

θ=0

∫ 2π

φ=0a3 sin2 θ sin2 φ sin θ dθ dφ

=

[∫ π/2

θ=0sin3 θ dθ

] [∫ 2π

φ=0sin2 φdφ

]

=

[∫ π/2

θ=0

(sin θ − cos2 θ sin θ

)dθ

] [∫ 2π

φ=0

12

(1− cos 2φ) dφ]

=[− cos θ +

13

cos3 θ]π/2

θ=0

2− 1

4sin 2φ

]2π

φ=0

=2π3

• Calculate the surface integral∮

SF ·dS where F = Q/(4πr2) er and S is the closed surface of a sphere

of radius R.

12.2 Stokes’ theorem

Stokes’ theorem may be stated as follows:∫

S(∇× F) · dS =

CF · dl

where S is the open surface bounded by the path C. Green’s theorem in the plane is a special case whenthe path C and surface S are confined to a plane, however the theorem is more general than that.

Consider splitting the surface S into tiny planar tiles. The surface integral may be approximated by the sumof the contribution of each tile. Naturally, the dimensions will be made vanishingly small to obtain the limitin which this sum approaches the integral. Consider a single tile PQRS outlined in bold in Fig. 18. Theneighbouring tiles that share edges with the bold tile are also shown, with an artificial gap between themfor clarity.

Since the tile is planar, Green’s theorem in the plane applies:∮

PQRSF · dl =

PQRS(∇× F) · dS

Consider the four neighbouring tiles that share edges with PQRS e.g. the one sharing the edge PQ. ForPQRS the contribution of this edge to the line integral is in the direction

−→PQ whereas for the neighbouring

tile it is in the opposite direction−→QP . Hence when the contributions of these two tiles are added together,

the contributions to the line integrals from the edge PQ cancel, and the remaining line integral runs anti-clockwise around the perimeter of both tiles. This cancellation will continue for all edges shared by tiles –in fact all the edges of all tiles except those which make up the boundary C of the whole surface S.

Department of Materials, Imperial College London

Page 41: Vector Calculus Notes

MSE 201: Mathematics 41

P Q

R

S

Figure 18: Diagram of a single tile surface element in the derivation of Stokes’ theorem.

Examples

• Verify Stokes’ theorem for the vector field F = −y i + x j + zk

◦ for the hemispherical surface x2 + y2 + z2 = a2, z ≥ 0:

Consider the left-hand side:∫

S(∇ × F) · dS. ∇ × F = 2k. In spherical polar coordinates

the surface element for the hemisphere is dS = a2 sin θ dθ dφ er. Since er · k = cos θ,

S(∇× F) · dS = 2

∫ π/2

θ=0

∫ 2π

φ=0(a2 sin θ) cos θ dθ dφ

= a2

[∫ π/2

θ=0sin 2θ dθ

] [∫ 2π

φ=0dφ

]

= 2πa2[−1

2cos 2θ

]π/2

θ=0= 2πa2

For the right-hand side:∮

CF ·dl, F ·dl = x dy−y dx Use plane polar coordinates to parameterise

C: x = a cosφ, y = a sinφ:

CF · dl =

∫ 2π

φ=0[(a cosφ)(a cosφ)− (a sinφ)(−a sinφ)] dφ = a2

∫ 2π

φ=0dφ = 2πa2

Hence Stokes’ theorem is verified.

◦ for the square planar surface z = 0 where 0 ≤ x ≤ a, 0 ≤ y ≤ a

◦ for the square planar surface x = a where 0 ≤ y ≤ b, 0 ≤ z ≤ b

• Prove that∮

S(∇× u) · dS = 0 for any vector field u over any closed surface S.

12.3 Volume integrals

Volume integrals are triple integrals and much simpler than line or surface integrals since dV is a scalar.There are therefore only two possibilities:

Department of Materials, Imperial College London

Page 42: Vector Calculus Notes

42 Vector calculus

•∫

Vf(r) dV is a scalar quantity derived from a scalar field f

•∫

VF(r) dV is a vector quantity derived from a vector field F

Examples

• Calculate the volume integral of %(r) = αr over the sphere of radius a centred on the origin.

• Calculate the volume integral of σ(ρ, z) = ρ2 + z2 over the cylinder defined by ρ ≤ a and |z| ≤ L/2.

• Calculate the volume integral of the vector field F = x2 i + xy j + z k over the cube 0 ≤ x ≤ L,0 ≤ y ≤ L, 0 ≤ z ≤ L.

12.4 The divergence theorem

The divergence theorem may be stated as follows:

V∇ · F dV =

SF · dS

where V is the volume bounded by the closed surface S. The derivation of the divergence theorem followsa similar argument to that used for Stokes’ theorem. Consider splitting the volume V into tiny cuboids ofvolume δV = δx δy δz with a corner located at (x0, y0, z0). Then

δV∇ · F dV =

∫ x0+δx

x=x0

∫ y0+δy

y=y0

∫ z0+δz

z=z0

(∂Fx

∂x+∂Fy

∂y+∂Fz

∂z

)dx dy dz

For the first term in the integrand, integrate with respect to x first. For the second and third terms firstintegrate with respect to y and z respectively:

δV∇ · F dV =

∫ y0+δy

y=y0

∫ z0+δz

z=z0

[Fx(x0 + δx, y, z)− Fx(x0, y, z)] dy dz

+∫ z0+δz

z=z0

∫ x0+δx

x=x0

[Fy(x, y0 + δy, z)− Fy(x, y0, z)] dz dx

+∫ x0+δx

x=x0

∫ y0+δy

y=y0

[Fz(x, y, z0 + δz)− Fz(x, y, z0)] dx dy

The right-hand side of this equation is the surface integral over the closed surface of the cuboid. Forexample, for the ‘front’ side x = x0 + δx has outward normal parallel to i and surface area element dy dz iwhere as the ‘back’ side x = x0 has a normal pointing in the opposite direction and surface element−dy dz i– hence the minus sign in the integrand. Likewise the second and third lines give the contributions from the‘left’ and ‘right’ and ’top’ and ’bottom’ sides.

As with Stokes’ theorem, when the contributions from cuboids are summed, neighbouring cuboids sharesurfaces whose contributions cancel because their outward normals point in opposite directions. Thus theonly contribution that remains is from the boundary of the whole volume V .

Department of Materials, Imperial College London

Page 43: Vector Calculus Notes

MSE 201: Mathematics 43

Examples

• Verify the divergence theorem for the vector field F = x i + y j + z k for the unit cube 0 ≤ x ≤ 1,0 ≤ y ≤ 1, 0 ≤ z ≤ 1.

• Use the divergence theorem to evaluate the surface integral∫

SF · dS of F = (x + y2z) i + (xz2 −

2y) j + (z + x2 + y2)k over the open hemispherical surface x2 + y2 + z2 = a2, z ≥ 0.

13 Summary

From this section of the course, students should be able to:

• understand the concept of vector area and calculate it for simple surfaces

• understand the significance of the scale factors in orthogonal coordinate systems and recall them forCartesian, cylindrical polar and spherical polar coordinates

• find expressions for line, surface and volume elements in Cartesian, cylindrical polar and sphericalpolar coordinates

• perform partial differentiation including the use of the chain rule to change coordinate system

• calculate total differentials and establish whether a given differential is exact or inexact

• perform double and triple integrals

• calculate and use the Jacobian to change variables in multidimensional integrals

• calculate derivatives of vector quantities

• interpret the gradient, divergence and curl geometrically

• recall and apply the formulae for the gradient, divergence, curl and Laplacian in Cartesian coordinates

• apply given formulae for the gradient, divergence, curl and Laplacian in cylindrical polar and sphericalpolar coordinates

• derive vector operator identities using Cartesian coordinates

• calculate line, surface and volume integrals

• recall and apply Stokes’ theorem and the divergence theorem

• use vector calculus to solve problems in materials science and engineering

Department of Materials, Imperial College London