Calculus of Two Variables Lecture Notes 2009 Part I p1to62

62
Calculus of Two or More Variables Lecturer: Dr Eamonn Gaffney Notes extensively based on material written by Dr Richard Earl Michaelmas Term 2009

Transcript of Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Page 1: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Calculus of Two or More Variables

Lecturer: Dr Eamonn Gaffney

Notes extensively based on material written by Dr Richard Earl

Michaelmas Term 2009

Page 2: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

0.0 Syllabus

1. Introduction to Partial Derivatives. Standard Co-ordinate Systems.

2. Chain rule. Change of Variable.

3. Jacobians of Two Variable Systems.

4. Calculation of Areas. Standard Curves and Surfaces.

5. Gradient Vector. Directional Derivatives.

6. Normal to a Surface. Identities.

7. Critical points and classification using directional derivatives (non-degenerate case only).

8. The Laplacian and its Form in Other Co-ordinate Systems.

9. Elementary PDEs with motivation for where they arise in applications. Brief introduction to Laplace’s equation, Poisson’s equation andthe wave equation.

0.1 Recommended Texts and Website

• D. W. Jordan & P. Smith, Mathematical Techniques, 3rd Edition, Oxford (2002), Chapters 27-29, 31.

• Erwin Kreyszig, Advanced Engineering Mathematics, 8th Edition, Wiley (1999) Appendix 3.2, Sections 8.8, 8.9, 9.3, 9.5, 9.6.

• http://www.maths.ox.ac.uk/∼earl/

• http://www.maths.ox.ac.uk/∼gaffney/

2

Page 3: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

1. PARTIAL DIFFERENTIATION

We began our study of ordinary differential equations (ODEs) by modelling the flight of a projectile. Let’s consider here, before discussingpartial derivatives and partial differential equations (PDEs), a slightly more complex example of a mug of tea cooling down on a tabletop.

In what sense is this new physical scenario more complicated to model? The quantity we are naturally interested in here is the temperature Tof the liquid. In our earlier motivating example of the projectile, its height depended only on time t. Let’s take the mug’s dimensions as radiusR and height H. Here the temperature of the tea will again depend on time t, but almost certainly not in a uniform way throughout the mug.So rather than just depending on time t the temperature will also depend on the spatial co-ordinates x, y and z. Also heat will be lost to theair, down the sides of the mug, to the air beyond and may heat up the table and surrounding air.

The differential equation governing the behaviour of T (x, y, z, t) is a partial differential equation. The heat equation, which we will meetagain later in more detail, states that

∂T

∂t= κ

(

∂2T

∂x2+∂2T

∂y2+∂2T

∂z2

)

where κ is known as thermal diffusivity. These “fancy” derivatives with the curly ∂s just reflect that T depends on several variables.

• The partial derivative ∂T/∂t is the derivative of T with respect to time t when we keep all the other variables x, y, z constant.

• Again ∂T/∂t is a function of the four variables x, y, z, t.

• It is a measure of what we’d see if we focus separately on each point (x, y, z) and watch how the temperature changes over time.

Because the tea is cooling we would expect that ∂T/∂t < 0 throughout the mug and at all times.

PARTIAL DIFFERENTIATION 3

Page 4: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

What other information would we need to describe the tea’s cooling? Well, we would again need an initial condition saying how hot the teawas to begin with. So we might assume it to begin uniformly hot and have

T (x, y, z, 0) = T0

for some initial temperature T0 and for x2 + y2 < R2, 0 < z < H.

We would also need to make some assumptions about how the heat dissipated out of the mug. If we assume that air remains constantly atsome ambient room temperature TA then one boundary condition would be

T (x, y,H, t) = TA

for x2 + y2 < R2, t > 0; this describes the temperature’s behaviour at the top of the mug (though it isn’t a particularly realistic assumptionphysically!). If say the mug were insulated to allow no heat loss then another boundary condition would be

∂T

∂z(x, y, 0, t) = 0

for x2 + y2 < R2, t > 0 at the base of the mug. Likewise down the sides of the mug we would have

∂T

∂r(x, y, z, t) = 0

for x2 + y2 = R2, 0 < z < H, t > 0 and where r denotes the distance of a point from the central axis of the mug.

Indeed, having noticed this symmetry in the cooling we might decide to change variables and consider this as a problem in just three variablesr, t, z reducing the problem somewhat.

In this course, these are the sort of PDEs we shall consider, initial and boundary conditions, and how changes of variable can simplify them.

4 PARTIAL DIFFERENTIATION

Page 5: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

1.1 Partial Derivatives

Definition 1 Let f : Rn → R be a function of n variables x1, x2, . . . , xn. Then the partial derivative

∂f

∂xi(p1, . . . , pn)

is the rate of change of f, at (p1, . . . , pn) , when we vary only the variable xi about pi and keep all of the other variables constant. Precisely then

∂f

∂xi(p1, . . . , pn) = lim

h→0

f (p1, . . . , pi−1, pi + h, pi+1, . . . pn) − f (p1, . . . , pn)

h.

By contrast, derivatives such as df/dx are sometimes referred to as full derivatives

Remark 2 If f (x) is a function of a single variable note that

df

dx=∂f

∂x.

Notation 3 ∂f/∂x is still pronounced ”d f by d x” or sometimes ”partial d f by d x”.

We shall also, occasionally, write fx for ∂f/∂x. This is common notation, but as the ∂f/∂x is more visible, we shall mainly stick with thatnotation through the course.

In some texts ∂f/∂xi is denoted as fi. It is also sometimes written f,i.

PARTIAL DERIVATIVES 5

Page 6: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

∂f

∂x(a, b) = lim

h→0

f (a+ h, b) − f (a, b)

h,

∂f

∂y(a, b) = lim

k→0

f (a, b+ k) − f (a, b)

k.

Notation 4 To stress which variables are being kept constant some texts use the notation

∂f

∂x

y

to denote that this is the partial derivative of f with respect to x whilst keeping y constant. This is a measure of how quickly f (x, y) is changingas we move from the point (a, b) along the line y = b.

Unless such a notation is used, we will always make clear which co-ordinate system we are using and then a partial derivative will alwaysdenote differentiation with respect to some co-ordinate with all other co-ordinates in the system being kept constant.

6 PARTIAL DIFFERENTIATION

Page 7: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 5 Let

f (x, y, z) = x2 + yex +z

y.

Then

∂f

∂x= ,

∂f

∂y= ,

∂f

∂z= .

Example 6 Let

f (x1, x2, x3, x4) = sin (x1x2) + cos x4.

Then

∂f

∂x1= x2 cos (x1x2) ,

∂f

∂x2= x1 cos (x1x2) ,

∂f

∂x3= 0,

∂f

∂x4= − sinx4.

Note that ∂f/∂x3 = 0 as the definition of f is independent of x3.

Example 7 Let f : R2 → R be defined by

f (x, y) =

{

x+ y if x = 0 or y = 0,1 otherwise

Note that the partial derivatives ∂f/∂x and ∂f/∂y exist at (0, 0) with

∂f

∂x(0, 0) = 1 and

∂f

∂y(0, 0) = 1

yet f is not continuous at (0, 0) . This contrasts with full derivatives where differentiability implies continuity (see Hilary term analysis course).

PARTIAL DERIVATIVES 7

Page 8: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Definition 8 We may define second and higher partial derivatives in a similar manner to how we define them for full derivatives. So, in thecase of second partial derivatives of a function f (x, y)

∂2f

∂x2=

∂x

(

∂f

∂x

)

, also written fxx = (fx)x ,

∂2f

∂x∂y=

∂x

(

∂f

∂y

)

, also written fyx = (fy)x ,

∂2f

∂y∂x=

∂y

(

∂f

∂x

)

, also written fxy = (fx)y ,

∂2f

∂y2=

∂y

(

∂f

∂y

)

, also written fyy = (fy)y .

Example 9 Let us return to the function

f (x, y, z) = x2 + yex +z

y

from Example 5. Then

∂f

∂x= 2x+ yex,

∂f

∂y= ex − z

y2,

∂f

∂z=

1

y.

So

∂2f

∂x2= 2 + yex,

∂2f

∂y∂x= ex,

∂2f

∂z∂x= 0,

∂2f

∂x∂y= ex,

∂2f

∂y2=

2z

y3,

∂2f

∂z∂y=

−1

y2,

∂2f

∂x∂z= 0,

∂2f

∂y∂z=

−1

y2,

∂2f

∂z2= 0.

8 PARTIAL DIFFERENTIATION

Page 9: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Note in the previous example∂2f

∂y∂x=

∂2f

∂x∂y,

∂2f

∂z∂x=

∂2f

∂x∂z,

∂2f

∂z∂y=

∂2f

∂y∂z.

This will typically be the case in the examples we’ll see, as the following theorem shows:

Theorem 10 Let f : R2 → R be such that ∂2f∂y∂x and ∂2f

∂x∂y exist and are continuous. Then

∂2f

∂y∂x=

∂2f

∂x∂y.

Proof. (For reference only — requires Hilary term analysis). For x, y, h, k ∈ R define

φ (x, y) = f (x, y + k) − f (x, y) , and ψ (x, y) = f (x+ h, y) − f (x, y)

so that

D (x, y) = f (x+ h, y + k) − f (x+ h, y) − f (x+ h, y) + f (x, y)

= φ (x+ h, y) − φ (x, y)

= ψ (x, y + k) − ψ (x, y) .

By the Mean-Value Theorem, applied twice, there exist θ1, θ2 ∈ (0, 1) such that

D (x, y) = φ (x+ h, y) − φ (x, y) = hφx (x+ θ1h, y)

= h [fx (x+ θ1h, y + k) − fx (x+ θ1h, y)]

= hkfxy (x+ θ1h, y + θ2k) .

Arguing similarly with the D (x, y) = ψ (x, y + k) − ψ (x, y) expression we know there exist θ3, θ4 ∈ (0, 1) such that

D (x, y) = hkfyx (x+ θ3h, y + θ4k) .

So

fxy (x+ θ1h, y + θ2k) = fyx (x+ θ3h, y + θ4k)

Letting h and k tend to 0, and using the continuity of fxy and fyx we see that fxy = fyx as required.

PARTIAL DERIVATIVES 9

Page 10: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 11 Define f : R2 → R by

f (x, y) =

{

xy(x2−y2)x2+y2 if (x, y) 6= (0, 0) ,

0 if (x, y) = (0, 0) .

Show that

∂2f

∂y∂xand

∂2f

∂x∂y

are unequal at (0, 0) .

Solution. We have for x 6= 0 and y 6= 0,

∂f

∂x(0, y) =

and similarly

∂f

∂y(x, 0) =

Hence

∂2f

∂y∂x(0, 0) = −1 6= 1 =

∂2f

∂x∂y(0, 0) .

10 PARTIAL DIFFERENTIATION

Page 11: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 12 Find all solutions of the form f (x, y) to the partial differential equations

(i)∂2f

∂y∂x= 0, (ii)

∂2f

∂x2= 0.

Solution. The first PDE is

∂y

(

∂f

∂x

)

= 0.

Those functions g (x, y) which satisfy ∂g/∂y = 0 are functions p (x) which solely depend on x. So we have

∂f

∂x= p (x) .

This looks like an equation we would normally just integrate up, not forgetting a constant. But again ∂/∂x sends to zero any function Q (y) ofy. So instead of a constant we have an arbitrary function of y. The solution then is

f (x, y) = P (x) +Q (y)

where P (x) is an anti-derivative of p (x) , i.e. P ′ (x) = p (x) .

For the second equation ∂2f/∂x2 = 0 we can integrate in similar fashion to get

Remark 13 Note how the solutions to these second order PDEs include two arbitrary functions rather than two arbitrary constants as isoften the case of an ODE. This makes sense though when we note that partially differentiating wrt x annihilates functions solely in the variabley and not just constant functions.

PARTIAL DERIVATIVES 11

Page 12: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

1.2 Co-ordinate Systems

In the examples we have seen so far we have considered functions f (x, y) or g (x, y, z) where we have been thinking of x, y, z as Cartesianco-ordinates. f and g are then functions defined on a 2-dimensional plane or in 3-dimensional space. There are other natural ways to placeco-ordinates on a plane or space. Indeed, depending on the nature of a problem and its inherent symmetry, it may be very natural to use otherco-ordinates.

In the next lecture we will derive the chain rule which describes the relationship between derivatives in one system and another. For now, wesimply introduce some important examples of co-ordinate systems.

Example 14 (Planar Polar Co-ordinates) Instead of considering a point in a plane as given distances along each of two perpendicularaxes, we can equally describe a point P as being at a certain distance r from an origin O and such that OP makes an anti-clockwise angle θwith a fixed axis, usually the positive x-axis. This is shown in the diagram below.

We can see that the equations relating Cartesian co-ordinates and planar polar co-ordinates are

x = r cos θ, y = r sin θ

r =√

x2 + y2, tan θ = y/x.

12 PARTIAL DIFFERENTIATION

Page 13: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

So in the above diagram where x = 3 and y = 4 then

r =√

32 + 42 = 5 and θ = tan−1 4

3≈ 1.249 radians.

Note that r takes values in the range r ∈ [0,∞) and θ ∈ [0, 2π),for example, or equally (−π, π]. Note also that θ is undefined at the origin.

Remark 15 Note the definition of partial derivative ∂f/∂x very much depends on the co-ordinate system that x is part of. It is important toknow which other co-ordinates are being kept fixed.

For example, we could have two different co-ordinate systems, one the standard Cartesian co-ordinates and the other being x and the polarco-ordinate θ. Consider now what ∂r/∂x means in each system.

In Cartesian co-ordinates, we have

r =√

x2 + y2 and so ∂r/∂x =

However when we write r in terms of x and θ we have

r = x/ cos θ and so∂r

∂x=

which is certainly a different answer! The reason is that the two derivatives we have calculated are

∂r

∂x

y

and∂r

∂x

θ

and so are measuring the change in x along curves y = const. or along θ = const. which are very different directions.

Indeed note that the two are equal only when cos2 θ = 1 in which case lines of constant θ and constant y are in the same direction.

CO-ORDINATE SYSTEMS 13

Page 14: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 16 (Changing from polar to Cartesian co-ordinates and vice versa)

Given a curve with equation f (x, y) = 0 then it can be rephrased as an equation in polar co-ordinates as

g (r, θ) = f (r cos θ, r sin θ) = 0.

The unit circle x2 + y2 = 1 clearly becomes r = 1 and the line x = k becomes r = k sec θ.

More generally, the line ax+ by + c = 0 becomes r (a cos θ + b sin θ) = −c which can be rewritten as

r =

where A = −c/√a2 + b2 and tanα = b/a.

In reverse, given a curve in polar co-ordinates F (r, θ) = 0, then this can be rewritten as

G (x, y) = F(

x2 + y2, tan−1(y

x

))

= 0.

For example, r = cos θ becomes r2 = r cos θ which gives x2 + y2 = x. This we see is the circle

(

x− 1

2

)2

+ y2 =

(

1

2

)2

which is a circle of radius 1/2 around the point (1/2, 0) .

14 PARTIAL DIFFERENTIATION

Page 15: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 17 (Planar Parabolic Co-ordinates)

Planar Parabolic co-ordinates u, v are given in terms of x and y by the relations

x =1

2

(

u2 − v2)

, y = uv.

Note that the curve u = c, in Cartesian co-ordinates, is2xc2 = c4 − y2

and the curve v = k, in Cartesian co-ordinates is2xk2 = y2 − k4

both of which are parabolas. As u and v vary over the positive numbers then (x, y) varies over the upper half-plane.

CO-ORDINATE SYSTEMS 15

Page 16: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 18 (Cylindrical Polar Co-ordinates)

We can naturally extend planar polar co-ordinates into three dimensions using a further z co-ordinate. In this case they are called cylindricalpolar co-ordinates. The relationships between r, φ, z and x, y, z are given by

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

andr =

x2 + y2, tanφ =y

x, z = z.

Note that r = const. defines a cylinder, φ = const. defines a vertical plane through the origin and z = const. defines a horizontal plane.

16 PARTIAL DIFFERENTIATION

Page 17: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 19 (Spherical Polar Co-ordinates)

In the same way that latitude and longitude are used to determine a position on the planet, we can similarly use two angles θ and φ to determineposition on concentric spheres distance r from the origin. These are called spherical polar co-ordinates.

Here r is simply the distance of a point P from the origin O. The angle θ is the angle OP makes with the vertical z-axis and takes values in therange −π/2 6 θ 6 π/2. Finally, if Q is the projection of P vertically into the xy-plane then φ is the angle OQ makes with the positive x-axis.The relationships between x, y, z and r, φ, θ are given by

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

and

r =√

x2 + y2 + z2, tan φ =y

x, tan θ =

x2 + y2

z.

CO-ORDINATE SYSTEMS 17

Page 18: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

18 PARTIAL DIFFERENTIATION

Page 19: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

2. CHANGE OF VARIABLE. CHAIN RULE

2.1 Functions of Two Variables

Functions of more than one variable are common throughout mathematics. The motivating example for partial derivatives at the start of thelast chapter involved a temperature T which depended on three spatial co-ordinates x, y, z and one temporal co-ordinate t.

Such functions are often associated with maps as well. For example, we might have a physical map denoting the height z above a point (x, y) .The map might also include contours which are the curves z = c of constant height. Here z is a scalar function of two variables.

Or the map might be a meteorological map denoting the wind speed and direction (at a fixed height) above a point (x, y) . Below is a wind-direction field associated with a hurricane — with each point (x, y) is associated a vector u (x, y). That is, u is a vector-valued function of twovariables.

CHANGE OF VARIABLE. CHAIN RULE 19

Page 20: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 20 The height z of a column above the point (x, y) is given by the function

f (x, y) = 10 − (x− 1)2 + y2.

Write this as a function g (r, θ) of planar polar co-ordinates.

Solution. As x = r cos θ and y = r sin θ then we can write

f (x, y) = 10 − (r cos θ − 1)2 + (r sin θ)2

= 10 − r2 cos2 θ + 2r cos θ − 1 + r2 sin2 θ

= 9 − r2 cos 2θ + 2r cos θ

= g (r, θ) .

Remark 21 Note that f and g are different functions, even though they have the same numerical value z = f (x, y) = g (r, θ) . It is not thecase that z = f (r, θ) , rather z is given by a different rule in terms of r and θ. The rule

z = f (r, θ) = 10 − (r − 1)2 + θ2

is clearly not the right one!

20 CHANGE OF VARIABLE. CHAIN RULE

Page 21: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

2.2 The Chain Rule

The chain rule for two or more variables serves the same purpose as the chain rule for one variable which states that

df

dx=

df

du

du

dx.

The rule arises when we wish to calculate the derivative of the composition of two functions f (u (x)) with respect to x.

Likewise we might have a function f (u, v) of two variables u and v, each of which are functions of variables x and y. We can then make thecomposition F

F (x, y) = f (u (x, y) , v (x, y)) ,

which is itself a function of x and y. We might then wish to calculate its partial derivatives

∂F

∂xand

∂F

∂y.

The chain rule states that

∂F

∂x=

∂f

∂u

∂u

∂x+∂f

∂v

∂v

∂x,

∂F

∂y=

∂f

∂u

∂u

∂y+∂f

∂v

∂v

∂y.

Before going on to prove the chain rule, here is an example approached two different ways.

THE CHAIN RULE 21

Page 22: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 22 Let

f (u, v) = (u− v) sinu+ ev, u (x, y) = x2 + y, v (x) = y − 2x,

and let F (x, y) = f (u (x, y) , v (x, y)) . Calculate ∂F/∂x and ∂F/∂y by (i) direct calculation, (ii) the chain rule.

Solution. (i) We have that

F (x, y) =(

x2 + 2x)

sin(

x2 + y)

+ exp (y − 2x) .

Hence

∂F

∂x= (2x+ 2) sin

(

x2 + y)

+ 2x(

x2 + 2x)

cos(

x2 + y)

− 2 exp (y − 2x) ;

∂F

∂y=

(

x2 + 2x)

cos(

x2 + y)

+ exp (y − 2x) .

(ii) Using the chain rule we have

∂F

∂x=

∂f

∂u

∂u

∂x+∂f

∂v

∂v

∂x= (sinu+ (u− v) cos u) 2x+ (− sinu+ ev) (−2)

= (2x+ 2) sin(

x2 + y)

+ 2x(

x2 + 2x)

cos(

x2 + y)

− 2 exp (y − 2x) ,

and

∂F

∂y=

22 CHANGE OF VARIABLE. CHAIN RULE

Page 23: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Theorem 23 (Chain Rule) Let F (t) = f (u (t) , v (t)) with u and v differentiable and f being continuously differentiable in each variable.Then

dF

dt=∂f

∂u

du

dt+∂f

∂v

dv

dt

Proof. If we change t to t+ δt, then let δu and δv be the corresponding changes in u and v. Then

δu =

(

du

dt+ ε1

)

δt, and δv =

(

dv

dt+ ε2

)

δt,

where ε1, ε2 → 0 as δt → 0. Now

δF = f (u+ δu, v + δv) − f (u, v)

= [f (u+ δu, v + δv) − f (u, v + δv)] + [f (u, v + δv) − f (u, v)]

By the Mean-value Theorem (Hilary term Analysis) we have

f (u+ δu, v + δv) − f (u, v + δv) = δu∂f

∂u(u+ θ1δu, v + δv) ,

f (u, v + δv) − f (u, v) = δv∂f

∂v(u, v + θ2δv) ,

for some θ1, θ2 ∈ (0, 1). By the continuity of fu and fv then we have

δu∂f

∂u(u+ θ1δu, v + δv) = δu

(

∂f

∂u(u, v) + η1

)

δv∂f

∂v(u, v + θ2δv) = δv

(

∂f

∂v(u, v) + η2

)

where η1, η2 → 0 as δu, δv → 0.

So, putting this all together

δF

δt=

δu

δt

(

∂f

∂u(u, v) + η1

)

+δv

δt

(

∂f

∂v(u, v) + η2

)

=

(

du

dt+ ε1

)(

∂f

∂u(u, v) + η1

)

+

(

dv

dt+ ε2

)(

∂f

∂v(u, v) + η2

)

.

Letting δt → 0 we get the required result.

THE CHAIN RULE 23

Page 24: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Corollary 24 Let F (x, y) = f (u (x, y) , v (x, y)) with u, v differentiable in each variable and f being continuously differentiable in each. Then

∂F

∂x=

∂f

∂u

∂u

∂x+∂f

∂v

∂v

∂x∂F

∂y=

∂f

∂u

∂u

∂y+∂f

∂v

∂v

∂y

Example 25 A particle P (x, y, z) moves in three dimensional space on a helix so that at time t

x (t) = cos t, y (t) = sin t, z (t) = t.

The temperature T at (x, y, z) equals xy + yz + zx. Use (i) direct calculation, (ii) the chain rule, to calculate dT/dt.

Solution. (i)

T (t) = x (t) y (t) + y (t) z (t) + z (t) x (t)

= cos t sin t+ t sin t+ t cos t

SodT

dt= − sin2 t+ cos2 t+ sin t+ cos t+ t cos t− t sin t.

(ii) Alternatively the chain rule says that

dT

dt=

24 CHANGE OF VARIABLE. CHAIN RULE

Page 25: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 26 Let z = f (xy) . Show that

x∂z

∂x− y

∂z

∂y= 0. (2.1)

Example 27 Conversely show that any solution of (2.1) is of the form z = f (xy).

Solution. We first make a change of co-ordinatesu = y/x, v = xy.

We are aiming to show that z is a function solely in v, or equivalently that ∂z/∂u = 0. By the chain rule

∂z

∂u=∂z

∂x

∂x

∂u+∂z

∂y

∂y

∂u.

Solving for x and y in terms of u and v we have that

x =

v

uand y =

√uv.

Then

∂z

∂u=

−1

2

v

u3

∂z

∂x+

1

2

v

u

∂z

∂y

=−1

2

x2

y

∂z

∂x+

1

2x∂z

∂y

=−1

2

x

y

(

x∂z

∂x− y

∂z

∂y

)

= 0

and z = f (v) = f (xy) as required, where f is an arbitrary differentiable function.

THE CHAIN RULE 25

Page 26: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Theorem 28 (The Second Order Chain Rule)

Let F (x, y) = f (u (x, y) , v (x, y)) . Then

Fxx = fuuxx + fvvxx + fuu (ux)2 + 2fuvvxux + fvv (vx)2 ,

Fxy = fuuxy + fvvxy + fuuuxuy + fuv(vyux + vxuy) + fvvvxvy,

Fyy = fuuyy + fvvyy + fuu (uy)2 + 2fuvvyuy + fvv (vy)

2 .

Proof.

Fxx = (fuux + fvvx)x= (fu)x ux + (fv)x vx + fuuxx + fvvxx

= (fuuux + fuvvx)ux + (fvuux + fvvvx) vx + fuuxx + fvvxx

= fuuxx + fvvxx + fuu (ux)2 + 2fuvvxux + fvv (vx)2

and the other results follow similarly.

Example 29 Recall the definition of parabolic planar co-ordinates

x =u2 − v2

2, y = uv.

Show that Laplace’s equation∂2F

∂x2+∂2F

∂y2= 0

transforms into the same equation in parabolic co-ordinates.

Solution. From the second order chain rule we have

26 CHANGE OF VARIABLE. CHAIN RULE

Page 27: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 30 Find all circularly symmetric solutions to Laplace’s equation in the plane.

Solution. When we write Laplace’s equation in terms of planar polar co-ordinates it becomes

∂2f

∂r2+

1

r

∂f

∂r+

1

r2∂2f

∂θ2= 0.

To say that a solution is circularly symmetric means that f is solely a function of r. Hence we have

d2f

dr2+

1

r

df

dr= 0.

This equation has integrating factor r and so we have

d

dr

(

rdf

dr

)

= rd2f

dr2+

df

dr= 0

givingdf

dr=A

r

and so the general solution isf (r) = A ln r +B

THE CHAIN RULE 27

Page 28: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

28 CHANGE OF VARIABLE. CHAIN RULE

Page 29: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

3. JACOBIANS AND AREA

3.1 A Brief Introduction to Double Integrals

In a moment we will meet the definition of a Jacobian. The definition is simple enough, but, in order to motivate the idea behind it, we willneed to calculate some areas. As we change from one co-ordinate system to another the equations of curves change, the co-ordinates of points,the rules for functions. Likewise the Jacobian is a rule for how measuring areas, or volumes, changes with a co-ordinate change. Our first twoexamples of calculating areas involves two examples of double integrals.

Example 31 Calculate the area of the triangle with vertices (0, 0) , (B, 0) and (X,H).

Solution.

JACOBIANS AND AREA 29

Page 30: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

We have known, since early school days that the answer is 12BH, but we shall demonstrate this here by means of a double integral. The three

bounding lines of the triangles are

y = 0, y =H

Xx, y =

H

X −B(x−B) .

We’ll assume here that 0 < X < B. In order to ”pick up” all of the triangle’s area we need to let x range from 0 to B and y range appropriatelyfrom 0 up to the bounding line above (x, 0) . As our x and y vary over the triangle we need to pick up an infinitesimal piece of area dx dy ateach point. We can then calculate the triangle’s area as

A =

∫ x=X

x=0

∫ y=Hx/X

y=0dy dx+

∫ x=B

x=X

∫ y=H(x−B)/(X−B)

y=0dy dx

=

∫ x=X

x=0

Hx

Xdx+

∫ x=B

x=X

H (x−B)

X −Bdx

=H

X

[

x2

2

]X

0

+H

X −B

[

(x−B)2

2

]B

X

=H

X

X2

2− H

X −B

(X −B)

2

2

=HX

2− H (X −B)

2

=HB

2.

30 JACOBIANS AND AREA

Page 31: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Integrating this way, y first then x, we would need to treat X < 0 and X > B as two further cases. Alternatively, one could also pick up thearea by first letting y range from 0 to H and letting x range over the interior points of the triangle at height y.

Solution.

This method is somewhat better as we don’t have to treat the three cases of X < 0, 0 < X < B and B < X separately.

A =

∫ y=H

y=0

∫ x=y(X−B)/H+B

x=Xy/Hdxdy

=

∫ y=H

y=0

(

(X −B) y

H+B − yX

H

)

dy

=

∫ y=H

y=0

(

B − By

H

)

dy

= B

[

y − y2

2H

]y=H

y=0

= B

(

H − H2

2H

)

=BH

2

A BRIEF INTRODUCTION TO DOUBLE INTEGRALS 31

Page 32: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 32 Calculate the area of the disc x2 + y2 6 a2.

Solution. Again we know the answer, namely πa2.

In the first example of the triangle using y as the outside variable and x the inside avoided considering a number of separate cases. For thisexample of the disc though it would have seemed much more natural to use polar co-ordinates — if we knew how to calculate areas with such!

3.2 Jacobians

You may be aware that the modulus of a determinant of a 2 × 2 matrix A is a measure of how much the map x 7−→ Ax stretches area. Notethat the extent to which the mapping x 7−→ Ax stretches area does not vary from point to point.

The Jacobian, or rather its modulus, is a measure of how a general mapping stretches space locally, near a particular point, even when thisstretching effect varies from point to point.

The Jacobian takes its name from the German mathematician Carl Jacobi (1804-1851).

32 JACOBIANS AND AREA

Page 33: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Definition 33 Given two co-ordinates u (x, y) and v (x, y) which depend on variables x and y, we define the Jacobian

∂ (u, v)

∂ (x, y)

to be the determinant

det

(

∂u∂x

∂u∂y

∂v∂x

∂v∂y

)

.

Example 34 Let u and v be related to x and y by the matrix map(

uv

)

=

(

a bc d

)(

xy

)

=

(

ax+ bycx+ dy

)

. (3.1)

Then∂ (u, v)

∂ (x, y)= det

(

a bc d

)

= ad− bc.

Consider the parallelogram that is the image under the above map of the square with vertices (0, 0) , (1, 0) , (1, 1) , (0, 1) .

Figure 3-1 Image of the unit square under the map given by relation (3.1)

The area of a parallelogram with sides a and b is |a ∧ b|. Hence the above parallelogram’s area is

|(ai + cj) ∧ (bi + dj)| =

JACOBIANS 33

Page 34: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

This example illustrates the general result that the modulus of Jacobian does indeed give the relative change in area under a 2D mapping.

Example 35 Let x = r cos θ and y = r sin θ where r and θ are polar co-ordinates. Then

∂ (x, y)

∂ (r, θ)=

Example 36 In reverse, r =√

x2 + y2 and θ = tan−1 (y/x) and

∂ (r, θ)

∂ (x, y)= det

(

∂r∂x

∂r∂y

∂θ∂x

∂θ∂y

)

= det

(

x√x2+y2

y√x2+y2

−yx2+y2

xx2+y2

)

=x2 + y2

(x2 + y2)3/2

=1

x2 + y2=

1

r

34 JACOBIANS AND AREA

Page 35: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

The Jacobian satisfies its own sort of chain rule as one might expect:

Proposition 37 Let r and s be functions of variables u and v which in turn are functions of x and y. Then

∂ (r, s)

∂ (x, y)=∂ (r, s)

∂ (u, v)

∂ (u, v)

∂ (x, y)

Proof.

∂ (r, s)

∂ (x, y)= det

(

∂r∂x

∂r∂y

∂s∂x

∂s∂y

)

= det

(

∂r∂u

∂u∂x + ∂r

∂v∂v∂x

∂r∂u

∂u∂y + ∂r

∂v∂v∂y

∂s∂u

∂u∂x + ∂s

∂v∂v∂x

∂s∂u

∂u∂y + ∂s

∂v∂v∂y

)

= det

{

(

∂r∂u

∂r∂v

∂s∂u

∂s∂v

)

(

∂u∂x

∂u∂y

∂v∂x

∂v∂y

)}

=∂ (r, s)

∂ (u, v)

∂ (u, v)

∂ (x, y).

Corollary 38

∂ (x, y)

∂ (u, v)

∂ (u, v)

∂ (x, y)= 1

Solution. Take r = x and s = y in the previous proposition. Indeed the stronger result holds true that

( ∂x∂u

∂x∂v

∂y∂u

∂y∂v

)

(

∂u∂x

∂u∂y

∂v∂x

∂v∂y

)

= I2.

JACOBIANS 35

Page 36: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 39 Recall the definition of parabolic planar co-ordinates

x =1

2

(

u2 − v2)

, y = uv.

In this case the Jacobian ∂(x,y)∂(u,v) is given by

∂ (x, y)

∂ (u, v)= det

(

∂x∂u

∂x∂v

∂y∂u

∂y∂v

)

= det

(

u −vv u

)

= u2 + v2.

Though it is somewhat messy to calculate u and v in terms of x and y we can easily calculate that

(

u2 + v2)2

= u4 + 2u2v2 + v4

=(

u2 − v2)2

+ 4u2v2

= 4x2 + 4y2

Thus∂ (u, v)

∂ (x, y)=

For reference, here are the Jacobians of spherical and cylindrical polar co-ordinates.

36 JACOBIANS AND AREA

Page 37: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 40 (Cylindrical Polar Co-ordinates)x = r cos θ, y = r sin θ, z = z.

Then

∂ (x, y, z)

∂ (r, θ, z)=

∂x∂r

∂x∂θ

∂x∂z

∂y∂r

∂y∂θ

∂y∂z

∂z∂r

∂z∂θ

∂z∂r

=

Example 41 (Spherical Polar Co-ordinates)

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

Then

∂ (x, y, z)

∂ (r, θ, φ)=

∂x∂r

∂x∂θ

∂x∂φ

∂y∂r

∂y∂θ

∂y∂φ

∂z∂r

∂z∂θ

∂z∂φ

=

sin θ cosφ r cos θ cosφ −r sin θ sinφsin θ sinφ r cos θ sinφ r sin θ cosφ

cos θ −r sin θ 0

= cos θ

r cos θ cosφ −r sin θ sinφr cos θ sinφ r sin θ cosφ

+ r sin θ

sin θ cosφ −r sin θ sinφsin θ sinφ r sin θ cosφ

= cos θ[

r2 sin θ cos θ(

sin2 φ+ cos2 φ)]

+ r2 sin3 θ(

cos2 φ+ sin2 φ)

= r2 sin θ(

cos2 θ + sin2 θ)

= r2 sin θ.

JACOBIANS 37

Page 38: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Definition 42 Let R ⊆ R2 and let (x, y) be Cartesian coordinates. Then we define the area of R to be

A (R) =

∫∫

(x,y)∈R

dx dy.

Theorem 43 Let f : R→ S be a bijection between two regions of R2 with (u, v) = f(x, y). Suppose that

∂ (u, v)

∂ (x, y),

∂ (x, y)

∂ (u, v),

are defined and non-zero everywhere. Then∫∫

(u,v)∈S

du dv =

∫∫

(x,y)∈R

∂ (u, v)

∂ (x, y)

dx dy,

∫∫

(x,y)∈R

dx dy =

∫∫

(u,v)∈S

∂ (x, y)

∂ (u, v)

du dv.

Example 44 If we return to the case of calculating the area of the disc x2 + y2 6 a2, now using polar co-ordinates we have a much simplerdouble integral. The interior of the disc, in polar co-ordinates, is given by

0 6 r 6 a, 0 6 θ < 2π.

So

A =

∫∫

x2+y26a2

dx dy =

∫ r=a

r=0

∫ θ=2π

θ=0

∂ (x, y)

∂ (r, θ)

dθ dr

=

∫ r=a

r=0

∫ θ=2π

θ=0r dθ dr

=

∫ r=a

r=0[θr]θ=2π

θ=0 dr

= 2π

∫ r=a

r=0r dr

= 2π

[

r2

2

]r=a

r=0

= πa2.

38 JACOBIANS AND AREA

Page 39: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Proof. (Sketch proof of preceding theorem) Partition the area S into rectangular elements, indexed by i, of width δu and height δv, neglectingelements that intersect the boundary. Consider the vertices of the ith element Ei ∈ S

(u∗, v∗), (u∗ + δu, v∗), (u∗, v∗ + δv), (u∗ + δu, v∗ + δv).

This is mapped to the region Qi in the domain R with (u0, v0) mapped to the point

r(u0, v0) = (x(u0, v0), y(u0, v0))

and similarly for the other vertices. Neglecting boundary discrepancies, the regions Qi partition R because the elements Ei partition S; hencewe can generate the area of R by summation of the areas of the regions Qi. Thus we need to determine the area of the region Qi

The vertices of Qi ∈ R arer(u0, v0), r(u0, v0 + δv), r(u0+, v0), r(u0, v0 + δv), r(u0 + δu, v0 + δv).

For δu, δv sufficiently small the boundaries of Qi are, approximately, straight segments which approximate the parallelogram generated by

r(u0 + δu, v0) − r(u0, v0) ≈ δu∂r

∂u(u0, v0)

JACOBIANS 39

Page 40: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

and

r(u0, v0 + δv) − r(u0, v0) ≈ δv∂r

∂v(u0, v0).

The area of this parallelogram is∣

δu∂r

∂u∧ δv ∂r

∂v

= δuδv

(

∂x

∂u

∂y

∂v− ∂y

∂u

∂x

∂v

)

k

= δuδv

∂ (x, y)

∂ (u, v)

evaluated at (u0, v0). To sufficient accuracy for our needs, we have that as δv, δu tend to zero the area of this parallelogram is also the area ofQi, denoted A(Qi) below. Thus, summing over all the elements Ei in the limit that δv, δu tend to zero (plus δu/δv fixed, finite and non-zero)we have the area of the region R is

lim∑

i

A(Qi) = lim∑

i

δuδu

∂ (x, y)

∂ (u, v)

=

Sdudv

∂ (x, y)

∂ (u, v)

.

Noting this area is also∫

R dxdy we have the desired result.

Exercise 45 By considering an appropriate stretch find the area of the ellipse

x2

a2+y2

b2= 1.

40 JACOBIANS AND AREA

Page 41: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 46 Calculate the area bounded by the curves

2x = 1 − y2, 2x = y2 − 1, 8x = 16 − y2, 8x = y2 − 16.

as shown in the diagram below.

Solution. We see, if we change to planar polar co-ordinates

x =1

2

(

u2 − v2)

, y = uv,

that the region in question is 1 6 u 6 2, 1 6 v 6 2. Hence the area is given by

A =

∫ u=2

u=1

∫ v=2

v=1

∂ (x, y)

∂ (u, v)

dv du

=

∫ u=2

u=1

∫ v=2

v=1

(

u2 + v2)

dv du

=

∫ u=2

u=1

[

u2v +v3

3

]v=2

v=1

du

=

∫ u=2

u=1

(

u2 +7

3

)

du

=

[

u3

3+

7u

3

]2

1

=7

3+

7

3=

14

3.

JACOBIANS 41

Page 42: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 47 The area of the sector bounded by the half-lines θ = α and θ = β and the polar curve r = R (θ) equals

A =

∫ θ=β

θ=α

∫ r=R(θ)

r=0r dr dθ

=

∫ θ=β

θ=α

[

r2

2

]R(θ)

0

=1

2

∫ θ=β

θ=αR (θ)2 dθ

Example 48 Find the area bounded by the Folium of Descartes (see diagram) which has equation x3 + y3 = 3xy.

42 JACOBIANS AND AREA

Page 43: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 49 To calculate the volume of the sphere x2 + y2 + z2 6 a2, it seems most natural to use spherical polar co-ordinates. The interiorof the sphere, in spherical polar co-ordinates, is given by

0 6 r 6 a, 0 6 φ < 2π, 0 6 θ < π.

So

A =

∫∫∫

x2+y2+z26a2

dx dy dz =

Exercise 50 Find the volume of the ellipsoid

x2

a2+y2

b2+z2

c2= 1.

Example 51 Extra Material Equal Area Projections

Recall the definition of spherical polar co-ordinates

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

whose Jacobian has magnitude∣

∂ (x, y, z)

∂ (r, θ, φ)

= r2 sin θ

JACOBIANS 43

Page 44: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

where π2 − θ is latitude and φ is longitude. If then we are considering the element of area on the planet’s surface r = a, represented by θ and φ,

then the local area distortion is a2 sin θ.

The Albers Equal-area Conic Projection is an equal-area projection. In terms of θ and φ the projection is

x =1

n

√C − 2n cos θ sinnφ, y = ρ0 −

1

n

√C − 2n cos θ cosnφ,

where n,C, ρ0 are constants. Then the Jacobian of the projection is

∂ (x, y)

∂ (φ, θ)

=

det

( √C − 2n cos θ cosnφ sin θ√

C−2n cos θsinnφ√

C − 2n cos θ sinnφ − 2n sin θ√C−2n cos θ

cosnφ

)∣

= cos2 nφ sin θ + sin2 nφ sin θ

= sin θ.

44 JACOBIANS AND AREA

Page 45: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

4. THE GRADIENT VECTOR

4.1 Standard Curves and Surfaces

In the next section we will meet the gradient vector ∇f of a scalar function f . The gradient vector is a way of calculating the normal of acurve, or surface, f = c defined by a function.

Problem 52 How would one use a normal vector of a surface to determine the closest point on the surface to: another point? a plane?

Here we introduce a few standard examples of some curves and surfaces

THE GRADIENT VECTOR 45

Page 46: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 53 (Conic Sections) Conic sections, also referred to as conics, are non-degenerate curves formed by the intersection of a plane witha cone. Equivalently, they correspond to curves in a 2D plane which are solutions of algebraic equations of degree 2. The standard form ofequation of the conics (circle, ellipse, parabola, hyperbola) are

• circle: x2 + y2 = a2; parameterisation (a cos θ, a sin θ); area πa2.

• ellipse: x2/a2 + y2/b2 = 1 (b < a); parameterisation (a cos θ, b sin θ); eccentricity e2 = 1− b2/a2; foci (±ae, 0); directrices x = ±a/e; areaπab.

• parabola: y2 = 4ax; parameterisation(

at2, 2at)

; eccentricity e = 1; focus (a, 0); directrix x = −a.• hyperbola: x2/a2−y2/b2 = 1; parameterisation (a sec t, b tan t) or (±a cosh t, b sinh t); eccentricity e2 = 1+b2/a2; foci (±ae, 0); directricesx = ±a/e; asymptotes y = ±bx/a

Example 54 (Examples of Quadratic Surfaces (Quadrics)) Quadrics are surfaces which are solutions of algebraic equations of degree 2 in 3D.The standard form of equation of the quadrics are

• Sphere: x2 + y2 + z2 = a2 ;

• Ellipsoid: x2/a2 + y2/b2 + z2/c2 = 1;

• Hyperboloid of One Sheet: x2/a2 + y2/b2 − z2/c2 = 1;

• Hyperboloid of Two Sheets: x2/a2 − y2/b2 − z2/c2 = 1;

• Paraboloid: z = x2 + y2;

• Hyperbolic Paraboloid: z = x2 − y2;

• Cone: x2 + y2 = z2.

46 THE GRADIENT VECTOR

Page 47: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

4.2 Formal definition of a surface

We probably all feel we know a smooth surface in R3 when we see one, and this instinct for what a surface is will be satisfactory for the purposesof this course. In the main we will be happy to work with surfaces without a formal definition, but for those seeking a more rigorous treatmentof the topic, the following might provide a suitable working definition.

Definition 55 A smooth parameterised surface is a map r, known as the parameterisation

r : U → R3 : (u, v) 7→ (x (u, v) , y (u, v) , z (u, v))

from an open subset U ⊆ R2 to R3 such that

• x, y, z have continuous partial derivatives with respect to u and v of all orders

• at each point the vectors∂r

∂uand

∂r

∂v

are linearly independent (i.e. are not scalar multiples of one another).

Definition 56 Let r : U → R3 be a smooth parameterised surface and let p be a point on the surface. The plane containing p and which isparallel to the vectors

∂r

∂u(p) and

∂r

∂v(p)

is called the tangent plane to r (U) at p. Because these vectors are independent the tangent plane is well-defined.

FORMAL DEFINITION OF A SURFACE 47

Page 48: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Definition 57 Any vector in the direction∂r

∂u(p) ∧ ∂r

∂v(p)

is said to be normal to the surface at p. There are two unit normals of length one.

Example 58 We have already met a parameterisation for the sphere x2 + y2 + z2 = a2 with spherical polar co-ordinates. This given by

r (φ, θ) = (a sin θ cosφ, a sin θ sinφ, a cos θ) .

We already know the outward-pointing unit normal at r (θ, φ) is r (θ, φ) /a but let’s verify this with the previous definitions and find the tangentplane. We have

∂r

∂φ=

∂r

∂θ=

Hence

∂r

∂φ∧ ∂r

∂θ=

and so the two unit normals are ± (sin θ cosφ, sin θ sinφ, cos θ) . The tangent plane at r (φ, θ) is then

r• (sin θ cosφ, sin θ sinφ, cos θ) = a.

48 THE GRADIENT VECTOR

Page 49: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 59 Find the normal and tangent plane to the point (X,Y,Z) on the hyperbolic paraboloid z = x2 − y2.

Solution. This surface has a simple choice of parameterisation as there is exactly one point lying above, or below, the point (x, y, 0) . So wecan take a parameterisation

r (x, y) =(

x, y, x2 − y2)

.

We then have∂r

∂x= (1, 0, 2x) ,

∂r

∂y= (0, 1,−2y) .

So

∂r

∂x∧ ∂r

∂y=

i j k

1 0 2x0 1 −2y

=

−2x2y1

.

A normal vector to the surface at (X,Y,Z) is then (−2X, 2Y, 1) and we see that the equation of the tangent plane is

r• (−2X, 2Y, 1) =(

X,Y,X2 − Y 2)

• (−2X, 2Y, 1)

= −2X2 + 2Y 2 +X2 − Y 2

= Y 2 −X2 = −Z

or equivalently2Xx− 2Y y − z = Z.

FORMAL DEFINITION OF A SURFACE 49

Page 50: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

4.3 The Gradient Vector

Definition 60 Given a scalar function f : Rn → R, whose partial derivatives all exist, the gradient vector, denoted ∇f or grad f , is definedas

∇f =

(

∂f

∂x1,∂f

∂x2, . . . ,

∂f

∂xn

)

.

The symbol ∇ is pronounced “grad” usually, but also “del” or “nabla”.

Example 61 Let

f (x, y, z) = 2xy2 + zex + yz.

Then

∇f =(

2y2 + zex, 4xy + z, ex + y)

.

Example 62 Let

g (x, y, z) = x2 + y2 + z2.

Then

∇g = (2x, 2y, 2z) .

Note that ∇g is normal to the spheres g = const.

Example 63 Consider the vector field

v (x, y, z) =(

2xy + z cos (zx) , x2 + ey−z, x cos (zx) − ey−z)

.

Find all the scalar functions f (x, y, z) such that v = ∇f.

50 THE GRADIENT VECTOR

Page 51: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Solution.

Exercise 64 Show that there is no function f (x, y, z) such that ∇f (x, y, z) = (y, z, x) .

THE GRADIENT VECTOR 51

Page 52: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Proposition 65 (Planar Polar Co-ordinates) Let

er = (cos θ, sin θ) , eθ = (− sin θ, cos θ) .

These are perpendicular unit vectors, pointing in the directions of increasing r and θ respectively. Then

∇ψ =∂ψ

∂rer +

1

r

∂ψ

∂θeθ.

Proof. It is easy to check that

er • er = cos2 θ + sin2 θ = 1,

eθ • eθ = sin2 θ + cos2 θ = 1,

er • eθ = − sin θ cos θ + sin θ cos θ = 0.

Recall that the relationship between r, θ and x, y are given by

r =√

x2 + y2,∂r

∂x=

x√

x2 + y2= cos θ,

∂r

∂y=

y√

x2 + y2= sin θ,

θ = tan−1 y

x,

∂θ

∂x=

−yx2 + y2

=− sin θ

r,

∂θ

∂y=

x

x2 + y2=

cos θ

r,

and so

∇ψ =∂ψ

∂xi +

∂ψ

∂yj

=

52 THE GRADIENT VECTOR

Page 53: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

THE GRADIENT VECTOR 53

Page 54: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Exercise 66 (Spherical Polar Co-ordinates)

(i) Show that

er = (sin θ cosφ, sin θ sinφ, cos θ) .

eφ = (− sinφ, cosφ)

eθ = (cos θ cosφ, cos θ sinφ,− sin θ)

are mutually perpendicular unit vectors pointing in the directions of increasing r, θ, φ..

(ii) Show further that

∇f =∂f

∂rer +

1

r sin θ

∂f

∂φeφ +

1

r

∂f

∂θeθ.

Example 67 The gravitational potential at a distance r from a point mass M is given by

V = −GMr.

54 THE GRADIENT VECTOR

Page 55: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Using spherical co-ordinates we can write down straight away that

∇V =GM

r2er.

Alternatively using Cartesian co-ordinates we would have V = GM(

x2 + y2 + z2)−1/2

and find

∇V =GM

(x2 + y2 + z2)3/2(x, y, z) =

GMr

r3=GM

r2er.

By definition the gravitational field is the quantity −∇V.

Definition 68 Let f : Rn → R be a differentiable scalar function and let u be a unit vector. Then the directional derivative of f at a inthe direction u equals

limt→0

(

f (a+tu) − f (a)

t

)

.

This is the rate of change of the function f at a in the direction u.

Example 69 Let f (x, y, z) = x2y− z2 and let a = (1, 1, 1) . Then calculate the directional derivative of f at a in the direction u = (u1, u2, u3).In what direction does f increase most rapidly?

Solution. Now

f (a+tu) − f (a)

t=

[

(1 + tu1)2 (1 + tu2) − (1 + tu3)

2]

−(

121 − 12)

t= (2u1 + u2 − 2u3) +

(

u21 + 2u1u2

)

t+ u21u2t

2

→ 2u1 + u2 − 2u3 as t→ 0.

THE GRADIENT VECTOR 55

Page 56: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

This is the directional derivative asked for. What is the largest this can be as we vary u over all possible unit vectors? Well in the direction(

23 ,

13 ,

−23

)

the directional derivative is

4

3+

1

3+

4

3= 3.

On the other hand

2u1 + u2 − 2u3 = (2, 1,−2) • u = 3 |u| cos θ = 3cos θ

takes a maximum of 3 when θ = 0 and u = (2/3, 1/3,−2/3) .

Proposition 70 The directional derivative of a function f at the point a in the direction u equals ∇f (a) • u

Proof. Let

F (t) = f (a+tu) = f (a1 + tu1, . . . , an + tun) .

Then

limt→0

(

f (a+tu) − f (a)

t

)

= limt→0

(

F (t) − F (0)

t

)

= F ′ (0) .

Now

F ′ (0) =dF

dt

t=0

=∂f

∂x1(a)

dx1

dt+ · · · + ∂f

∂xn(a)

dxn

dt

=∂f

∂x1(a) u1 + · · · + ∂f

∂xn(a) un

= ∇f (a) • u.

Corollary 71 The rate of change of f is greatest in the direction ∇f , that is when u = ∇f/ |∇f | .

56 THE GRADIENT VECTOR

Page 57: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Definition 72 A level set of a function f : R3 → R is a set of points

{

(x, y, z) ∈ R3 : f (x, y, z) = c}

where c is a constant. For suitably ”nice” functions f and constants c the level set is a surface in R3. Note that all the surfaces in Example 54are level sets; for example the surface of a sphere is given by

x2 + y2 + z2 = a2.

Proposition 73 Given a surface S ⊆ R3 with equation f (x, y, z) = c and a point p ∈ S then ∇f (p) is normal to S at p.

Proof. Let u and v be co-ordinates near p and r : (u, v) → r (u, v) be a parameterisation of part of S. Recall that the normal to S at p is inthe direction

∂r

∂u∧ ∂r

∂v.

If we write r (u, v) = (x (u, v) , y (u, v) , z (u, v)) then we see that

∇f • ∂r∂u

=

(

∂f

∂x,∂f

∂y,∂f

∂z

)

•(

∂x

∂u,∂y

∂u,∂z

∂u

)

=∂f

∂x

∂x

∂u+∂f

∂y

∂y

∂u+∂f

∂z

∂z

∂u

=∂f

∂u[by the chain rule]

= 0

as f is constant as a function of u and v. Similarly ∇f • ∂r/∂v = 0 and hence ∇f is in the direction of ∂r/∂u ∧ ∂r/∂v and so normal to thesurface.

THE GRADIENT VECTOR 57

Page 58: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 74 In Example 59 we determined the normal at (X,Y,Z) to the hyperbolic paraboloid z = x2 − y2. If we introduce the function

f (x.y, z) = x2 − y2 − z

then we can know the normal is

∇f (X,Y,Z) = (2X,−2Y,−1)

which is the normal vector we found previously.

Example 75 Find the point on the ellipsoid

x2

4+y2

9+ z2 = 1

which is closest to the plane x+ 2y + z = 10.

Solution. The normal to the plane is parallel to (1, 2, 1) everywhere. The point on the ellipsoid which is closest will also have normal (1, 2, 1).If we set

f (x.y, z) =x2

4+y2

9+ z2 − 1,

then the gradient equals

∇f =

(

x

2,2y

9, 2z

)

.

58 THE GRADIENT VECTOR

Page 59: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 76 The temperature T in R3 is given by

T (x, y, z) = x+ y2 − z2.

Given that heat flows in the direction of −∇T , describe the curve along which heat moves from the point (1, 1, 1).

Solution. We have

∇T = (1, 2y,−2z) ,

which is the direction in which heat flows. If we parameterise the flow of the heat (say by arc-length s) as r (s) = (x (s) , y (s) , z (s)) then wehave

y′ (s)

y (s)= 2x′ (s) ,

z′ (s)

z (s)= −2x′ (s) ,

and integrating the last two equations we get

ln y (s) = 2x (s) − 2

ln z (s) = −2x (s) + 2.

THE GRADIENT VECTOR 59

Page 60: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Hence the equation of the heat’s path is

2x = ln y + 2 = 2 − ln z,

moving along the direction of (1, 2,−2) from (1, 1, 1) .

Proposition 77 Let f and g be functions of x, y, z. Then

(i) ∇ (fg) = f∇g + g∇f(ii) ∇ (fn) = nfn−1∇f

(iii) ∇(

fg

)

=g∇f − f∇g

g2

(iv) ∇ (f ◦ g) (x) = f ′ (g (x))∇g (x)

Proof. See Exercise Sheets for (i), (ii), (iii). The proof of (iv) follows from the chain rule ...

∇ (f ◦ g) (x) =

(

∂xf (g (x)) ,

∂yf (g (x)) ,

∂zf (g (x))

)

=

(

f ′ (g (x))∂g

∂x(x) , f ′ (g (x))

∂g

∂y(x) , f ′ (g (x))

∂g

∂z(x)

)

= f ′ (g (x))∇g (x)

60 THE GRADIENT VECTOR

Page 61: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 78 There are two important operations related to grad ∇. For a vector function v = (v1, v2, v3) we define

∇∧ v =

i j k∂∂x

∂∂y

∂∂z

v1 v2 v3

.

This is also called curl v.

Secondly

∇ • v =∂v1∂x

+∂v2∂y

+∂v3∂z

which is also called div v.

Example 79 These operations satisfy the identities

∇ • (∇∧ v) = 0

∇∧∇f = 0

for any vector function v and scalar function f . To prove the latter we see

∇∧∇f =

i j k∂∂x

∂∂y

∂∂z

∂f∂x

∂f∂y

∂f∂z

= (fzy − fyz) i+ (fxz − fzx) j+ (fyx − fxy)k = 0.

The Laplacian ∇2 given by

∇2f =∂2f

∂x2+∂2f

∂y2+∂2f

∂z2

can also be rewritten as ∇2f = div (grad f).

THE GRADIENT VECTOR 61

Page 62: Calculus of Two Variables Lecture Notes 2009 Part I p1to62

Example 80 Recall in Example 63 we introduced

v (x, y, z) =(

2xy + z cos (zx) , x2 + ey−z, x cos (zx) − ey−z)

and noted that v = ∇f where

f (x, y, z) = x2y + sin (zx) + ey−z.

From the previous example it follows that ∇∧ v = 0.

Another previous exercise was to show that

w = (y, z, x)

is not the gradient of any function (i.e. ∄ψ for which ∇ψ = w). Note that

∇∧ w =

i j k∂∂x

∂∂y

∂∂z

y z x

= (−1,−1,−1) 6= 0.

In fact, the converse of ∇ ∧∇f = 0 does hold. That is, if F is a vector-valued function on R3 such that ∇ ∧ F = 0 then there exists a scalarfunction φ, which is unique up to a constant, and known as a potential such that F = ∇φ.

The proof of this statement requires Stokes’ Theorem — see later courses.

62 THE GRADIENT VECTOR