Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Chapter 1

Introduction and Functions of Several Variables

1.1

Introduction

You should recall the following notation:


R = set of real numbers
R2 = { (a, b) | a, b R }
R3 = { (a, b, c) | a, b, c R }
Rn = { (a1 , a2 , . . . , an ) | ai R for i = 1, 2, . . . , n }
Any straight line in R2 can be represented by an equation of the form
ax + by + c = 0.
Any straight (that is, at) plane in R3 can be represented by an equation of the form
ax + by + cz + d = 0.
A straight line in R3 is a little harder but most can be represented by equations of the form
yb
zc
xa
=
=
.

You may also have met interval notation. Given the reals numbers a and b.
(a, b) = { x R | a < x < b }
(a, b] = { x R | a < x b }
[a, b) = { x R | a x < b }
[a, b] = { x R | a x b }
(, b) = { x R | x < b }
(, b] = { x R | x b }
(a, ) = { x R | a < x }
[a, ) = { x R | a x }
(, ) = R

1.2

Review of Hyperbolic Trigonometric Functions

Most people are familiar enough with the trigonometric function that no revision is really
necessary. Fewer people, however, recall the hyperbolic versions as well, which is a pity as
they are simpler in a way. Recall the basic denitions.
ex ex
2
ex + ex
cosh x =
2
sinh x =

MATH203: W. N. Franzsen (10/2/2015).

Advanced Calculus (2014)

It is easy to see that the derivative of sinh x is cosh x and the derivative of cosh x is sinh x.
The following are also well known, and can easily be checked if you dont recall them.
cosh2 x sinh2 x = 1
sinh 2x = 2 sinh x cosh x
cosh 2x = cosh2 x + sinh2 x
= 2 cosh2 x 1
= 1 + 2 sinh2 x
Exercise When rst introduced, these functions seem odd and out of place. In fact, we have
met them before. In an important sense these are just the ordinary trigonometric functions!
But to see that we need to use complex numbers! Verify each of the following.
sinh(ix) = sin x
cosh(ix) = cos x
sin(ix) = sinh x
cos(ix) = cosh x
This is just one of the reasons why calculus should really be done with complex numbers.
Sadly, we will not have time to see the benets, except for small points like this one.

1.3

Review of Integration

The most important fact to remember about integration is that it has two aspects that are
connected by the Fundamental Theorems of Calculus. Our rst brush with integration is via
anti-dierentiation: If F  (x) = f (x), then we call F (x) an anti-derivative of f (x). We should
also recall that F (x) is not the anti-derivative because we can add any constant to F (x) and
still obtain an anti-derivative of f (x). The second time we meet integration is in the guise
of the denite integral. Once we have those two aspects we can state the most important
results in calculus.
1.1 First Fundamental Theorem of Calculus Given the function f (x), if we dene
 x
f (t) dt
F (x) =
a

then F  (x) = f (x).


1.2 Second Fundamental Theorem of Calculus


If F  (x) = f (x), then

f (t) dt = F (b) F (a).

x
If we rewrite the second theorem in the form a f (t) dt = F (x) F (a) then we can see
the dierentiating rst and then integrating takes us back to where we started, except for the
addition of a constant, the F (a). The other tells us that integrating and then dierentiating
takes exactly back to where we started.
We all have enough experience now to know that although dierentiation is straightforward, but complicated at times, it is integration that causes the most headaches. Indeed
there are some integrals that we cannot evaluate. The most famous example being the one
coming from the normal distribution that you will meet in statistics

2
ex dx

Chapter 1

Advanced Calculus (2014)

You should be familiar with the following methods of integration, it will be assumed without
comment that you can evaluate integrals using these methods.
(1)
You should be able to nd direct anti-derivatives. For example,

3
3x3 sin x + sec2 x dx = x4 + cos x + tan x + c1
4
In particular, you should recall that integration is linear, that is



af (x) + bg(x) dx = a f (x) dx + b g(x) dx,

(2)

when both a and b are constants.


In some situations you should recognise and use the reverse of the chain rule.
For example, you should recognise that the derivative of x2 + 3x 5 is 2x + 3
and so

1 2
(x + 3x 5)11 + c2
(x2 + 3x 5)10 (2x + 3) dx =
11
Sometimes these rst two need to be used together.


2x + 3
4x + 6
dx
=
2
dx
x2 + 3x 5
x2 + 3x 5
= 2 log |x2 + 3x 5| + d2

(3)

More complicated versions of the


reverse chain rule are best dealt with via a
substitution. To evaluate x x + 1 dx we let u = x + 1 and so du = dx
and x = u 1.



x x + 1 dx = (u 1) u du

3
1
= u 2 u 2 du
2 3
2 52
u u 2 + c3
5
3
2
2
5
3
= (x + 1) 2 (x + 1) 2 + c3
5
3
2
=
x + 1(x + 1)(3(x + 1) 5) + c3
15
2
=
x + 1(x + 1)(3x 2) + c3
15

The next method requires a little more work. We recall the product rule for dierentiation, in the form
(uv) = u v + uv 
We may rearrange this to obtain

u v = (uv) uv 

On integration we obtain


(uv) uv  dx


= (uv) dx uv  dx



u v dx = uv uv  dx (+constant)
u v dx =

Advanced Calculus (2014)

The constant comes from the integral of (uv) , it is important to remember that it is there
but we usually leave it out to remember the usual method of integration by parts


u v dx = uv uv  dx
Although the following is just as good.



uv dx = uv u v dx
Example To evaluate

x sin x dx we let u = x and v  = sin x, then u = 1 and v = cos x.


x sin x dx = x( cos x) 1( cos x) dx

= x cos x + cos x dx
= x cos x + sin x + b

There are various tricks with integration by parts, you have met some and these will
be refreshed in the tutorial. The nal trick we will meet is the method of partial fractions.

1.4

Partial Fractions

As the name suggests this method applies to integrands that are in the form of fractions. In
fact we need to be a bit more specic than that. The method of partial fraction only applies
to fractions made up from polynomials, that is, we will be considering integrals of the form


2x3 5x2 + 6x 8
dx
x5 + 3x4 5x3 + x2 8x + 9

Needless to say, we wont be looking at integrals quite as complex as this one.


Rather than sneaking the steps in slowly, this time its best to describe them all at
once and then concentrate on the important part. So, suppose we are given an integral of
the form

n(x)
dx
d(x)
where n(x) and d(x) are both polynomials (being the numerator and denominator, respectively). There are several steps to follow, but we usually dont have to apply all the steps.
(1)
If the degree of n(x) is greater than or equal to the degree of d(x) we divide n(x)
by d(x) nding the quotient q(x) and remainder r(x). You should recall that
this means we have
r(x)
n(x)
= q(x) +
d(x)
d(x)

(2)

r(x)
,
We can integrate q(x) directly, so it only remains to nd the integral of d(x)
where the degree of the numerator is less than the degree of the denominator.
We now need to factorise the denominator. In reality this will be a very, very
dicult process, and is sometimes impossible to actually carry out, as youll see
in MATH216. For this unit we will organise things so that the denominator
factorises relatively easily. One fact that is important to keep in mind, but is

Chapter 1

Advanced Calculus (2014)

very hard to actually prove, is that all polynomials using real numbers can be
factorised as a product of degree one terms and degree two terms.
r(x)
, using the method of partial fractions that will be
We split the last term, d(x)
explained in a moment.
(4)
Finally we integrate each of the resulting terms.
As long as you can factorise the denominator it is possible to integrate any function of the
form n(x)
with polynomials top and bottom. Sadly, as youll see, the details can get a bit
d(x)
messy.

(3)

where the bottom


We now need to consider how to simplify expressions of the form n(x)
d(x)
line has been factorised. We work our way up from the bottom pun intended!
1
as the sum of two simpler fractions. In fact we will nd
Example 1 We write (x1)(x+2)
constants a and b such that
a
b
1
=
+
(x 1)(x 2)
x1 x+2
We know that the numerators on the right are constants as they must have degree less than
the denominator. We multiply both sides by (x 1)(x + 2)
1 = a(x + 2) + b(x 1)
There are now two ways to proceed. The easiest is to let x = 1 and then x = 2 to nd a
and b directly.* If we let x = 1 then we nd 1 = 3a and so a = 13 . Now letting x = 2 we
nd b = 13 and so
1
1
1
=

(x 1)(x + 2)
3(x 1) 3(x + 2)
The other alternative is to expand the polynomials and equate coecients.
1 = a(x + 2) + b(x 1)
1 = (a + b)x + (2a b)
Thus
a+b=0
2a b = 1
These can be solved to nd the same solution as above.
Exercise This will work with any number of factors. Repeat the above for the frac1
.
tion (x1)(x+2)(x+3)
The rst problem arises when we have degree one terms but some are repeated. There
is a quick trick we can use in this case: If a term appears to the power n in the denominator
then we may have a term with each power of that term up to degree n. It is possible to prove
this, but this is easier to remember than prove.
* Some object that the initial fractions forbid the use of x = 1 and x = 2, however
we can avoid this problem. The equation 1 = a(x + 2) + b(x 1) is an equality between
polynomials that is true for all points except possibly 1 and 2. However, if two polynomials
agree at an innite number of points then they agree everywhere. Thus these polynomials
agree at 1 and 2 and we can use the easy method.

Advanced Calculus (2014)

Example Write (x1)12 (x+2) as the sum of simpler fractions. Here the target will have terms
with all powers of (x 1) up to degree 2.
1
a
b
c
=
+
+
2
2
(x 1) (x + 2)
x 1 (x 1)
x+2
If we had a cube term, then there would be 3 powers to consider, and so on.
We multiply again to obtain
1 = a(x 1)(x + 2) + b(x + 2) + c(x 1)2
Letting x = 1 we nd b = 13 , letting x = 2 we nd c = 19 . At this point we seem to hit a
wall, we could revert to equating coecients but this time there is another trick. We know
that
1
1
1 = a(x 1)(x + 2) + (x + 2) + (x 1)2
3
9
so pick another value for x, say we try x = 0.
1 = 2a +

2 1
+
3 9

and we nd that a = 19 .
1
1
1
1
=
+
+
2
2
(x 1) (x + 2)
9(x 1) 3(x 1)
3(x + 2)
Again we might use the equating coecients method if we prefer.
Finally we might have a quadratic term on the bottom line. The dierence here will
be that the top line has degree less than the bottom and so our term will look like xax+b
2 + .
Example Write (x1)(x12 +x+1) as the sum of simpler fractions. As mentioned above the
simplication will look like the following.
a
bx + c
1
=
+
(x 1)(x2 + x + 1)
x 1 x2 + x + 1
We multiply to remove the denominators.
1 = a(x2 + x + 1) + (bx + c)(x 1)
We can only nd the value of a easily in this case. If we let x = 1 then we nd a = 13 . To
nd the others we can either equate coecients or chose two other values for x and solve the
resulting equations. This time we equate coecients.
1 2
(x + x + 1) + (bx + c)(x 1)
3
3 = x2 + x + 1 + (bx + c)(3x 3)
= (3b + 1)x2 + (1 3b + 3c)x + 1 3c
1=

Thus we have the equations


3b + 1 = 0
1 3b + 3c = 0
1 3c = 3
Solving these we nd b = 31 and c = 23 .
1
x 2
1
=
+
2
(x 1)(x + x + 1)
3(x 1) 3(x2 + x + 1)
Exercise Write

4
(x+2)(x2 +3)

as the sum of simpler fractions.

Chapter 2
Functions of Several Variables

2.1

Functions of Several Variables

In this unit we will be concentrating upon functions whose domain is a subset of Rn , usually
R2 , and whose codomain (and hence their range) is a subset of R. That is, our functions will
usually be functions of several variables but whose values are a single real number.
Examples The following are all functions of several variables.
The volume of a cylinder:
V = V (r, h) = r 2 h.
The area of a rectangle:
A = A(h, w) = hw.
Or anything similar to the following:

f (w, x, y, z) = 2w + sin(x + y) log
3

x cos y

x2 + z 2 + 1


.

We denote such functions in the following way.


f :DC
where f is the name of our function, D is the domain and in this unit we will usually have D
a subset of Rn , and C is the codomain (or target), in this unit we will usually have C R.
Example Let f : D R, where D R2 and
f (x, y) = log(x)

y + 1.

What is the largest domain we couldpossible have? We know that log(x) does not make
sense unless x > 0 while to evaluate y + 1 we need y 1. Thus the largest domain we
could have is
D = { (x, y) | x > 0, y 1 }
= (0, ) [1, )
This set is sometimes called the domain of denition of f . (Also note that the interval
notation is much shorter but much harder to decipher.)
As with functions f : R R the range of f is the set of values that f attains and is
often quite hard to nd. (In the last example the range is the whole of R.)
With functions of one variable we have seen that sketches of the graph of the function
help us to notice some properties of the function. These sketches can be drawn as we only
need one dimension for the domain and one for the range and our pages are two dimensional.
A function f : R2 R can only be successfully drawn on a two dimensional page if we use
our imagination. As we need two dimensions for the domain and one for the codomain we
have to invent a new dimension on the page. The convention is that the x-axis is drawn
coming out of the page toward the reader. This is shown by drawing the axis at an angle of
/6 to the vertical. For example suppose we plot the point (1, 3, 2).
MATH203: W. N. Franzsen (10/2/2015).

Advanced Calculus (2014)

z
3
2
(1, 3, 2)
1
y
1

1
2
3
x
So we can plot points with reasonable success, but how to sketch a function f : R2 R? As
with functions of one variable we sketch the surface
z = f (x, y)
where z is represented by the height above the point (x, y).
Exercise Try to sketch the surface z = x2 y 2 .
The sketches below show the surface z = x2 + y 2 and demonstrate the two easiest ways
of depicting a surface in three dimensions. In the rst method we draw the cross-sections we
get by slicing the surface vertically, while in the second we slice horizontally.

Chapter 2

Advanced Calculus (2014)

Putting the two together gives an even better idea of the shape.

Surface sketching is not part of this unit but the ideas behind both methods will be
used at various times. The rst method being the one we will see most. The second method
is also used on all maps. Take a surface
z = f (x, y),
for example z = x2 + y 2 + 2. We can cut this surface at any height. If we cut at the height
z = 6 we obtain a cross-section of the surface. In the case z = 6 we nd that 6 = x2 + y 2 + 2
and so we obtain the cross-section z = 6 and x2 + y 2 = 4. This cross-section is a circle with
radius 2. If we ignore the fact that the circle lies in the plane z = 6 we get a level curve.
Thus the cross-section is the curve z = 6, x2 + y 2 = 4.

10

Advanced Calculus (2014)

y
2

x
While the level curve is the circle x2 + y 2 = 4.
y

You will have seen level curves before as contour lines on a map. They are not crosssections as they are not raised above the surface of the map.
Note that even if you cant draw the surface the level curves often allow you to imagine
the shape.

2.2

Continuous Functions

As with functions of one variable we have the idea of a function being continuous. A function
f : R2 R is continuous at (a, b) if
lim

(x,y)(a,b)

f (x, y) = f (a, b).

Unfortunately your background to this point is not enough for us to be able to cover this
idea properly. For reference the following functions are continuous:
Any polynomial in x and y, for example, f (x, y) = x3 + 3x4 y xy 5 + y 6 18

Chapter 2

Advanced Calculus (2014)

Any function involving e? where the power is one of the functions on this list
Any function with sin, cos in the numerator
Any positive power of x or y

2.3

Partial Derivatives

If we imagine a surface in R3 what could we mean by the word gradient. Instead of a tangent
line we will get a tangent plane. This means that we do not have a nice equivalent of the
derivative. If we observe that a tangent line has one dimension while a tangent plane has two
we might expect to get two derivatives. As each derivative forms part of the whole we call
them partial derivatives. We will meet the tangent plane again later.
To nd the partial derivatives we cut the surface with a plane that is parallel to the
x or y-axis and that passes through the given point. If we cut parallel to the x-axis then
y = y0 is a constant. If our surface is z = f (x, y) then we get the curve z = f (x, y0 ). This
is a function of one variable and we can use all the techniques from one-variable calculus to
nd the slope in the x-direction. If we want to dierentiate with respect to x we could use
limits.
f
f (x + h, y) f (x, y)
= lim
fx (x, y) =
x h0
h
This is called the partial derivative with respect to x. Similary we can dene the partial
derivative with respect to y, and so nd the slope in the y-direction.
fy (x, y) =

f
f (x, y + h) f (x, y)
= lim
h0
y
h

Example 1 Find the partial derivative of f (x, y) = x2 + 2y with respect to x.


f (x + h, y) f (x, y)
h0
h
(x + h)2 + 2y x2 2y
= lim
h0
h
2
x + 2xh + h2 x2
= lim
h0
h
= lim 2x + h

fx (x, y) = lim

h0

= 2x
Example 2 Find the partial derivative of g(x, y) = 2xy y 3 with respect to y at the point
(2, 1).
g(2, 1 + h) g(2, 1)
h
4(1 + h) (1 + h)3 3
= lim
h0
h
4 + 4h 1 3h 3h2 h3 3
= lim
h0
h
h 3h2 h3
= lim
h0
h
= lim 1 3h h2

gy (2, 1) = lim

h0

h0

=1

11

12

Advanced Calculus (2014)

Exercise Given the function f : R2 R where f (x, y) = xy + 2y 2 nd fx and fy .


Of course we do not want to have to use limits to nd derivatives, luckily there is a
shortcut. If we look at the form of the limit for fx , say, we will notice that the value of y does
not change. That is, y is behaving like a constant. To nd fx we dierentiate f (x, y) all the
while pretending that y is a constant. Similarly, to nd fy we dierentiate f (x, y) treating x
like a constant.
kx
Example 3 If f (x, y) = x2 y + 2y + exy , and remembering that d(edx ) = kekx we nd that
fx (x, y) = 2xy + 0 + yexy
= 2xy + yexy
fy (x, y) = x2 + 2 + xexy
Exercise Find

z
z
and
for each of the following.
x
y
z = x2 y 2 + 3x3 + 2y + cos x
z = cos x tan y
z = x sin y
z = sin(xy)
z = xey

Exercise For those who like a challenge, nd

z
z
and
for each of the following.
x
y

z = x2 y 3 sin x cos y
y
x

z=
tan x log y

Chapter 3
Tangent Planes and Dierentials

3.1

Tangent Planes

We now know how to nd the partial derivatives of a function. These can be used to nd the
slope in the x- and y-directions. For example, if f (x, y) = x2 + 2y 2 then
fx (x, y) = 2x
fy (x, y) = 4y
Thus, at the point (3, 4, 41), on the surface z = f (x, y), the slope in the x-direction is
fx (3, 4) = 6, while the slope in the y-direction is fy (3, 4) = 16. This means that we could
nd the equations of the lines tangent to the surface in these directions. But we know that
there is a plane tangent to the surface at this point. To nd the equation of this tangent we
recall that the (general) equation of a plane can be written in the form
z = ax + by + c
(at least this is true in most cases, we will ignore the small problems that can arise for the
z
z
= a and
= b. Suppose that we are given the function f and want
moment). Then
x
y
to nd the equation of the tangent plane to f at the point (x0 , y0 , z0 ). As this is to be the
tangent plane the slopes in the x and y-directions should agree with the slopes of the function
in these directions. That is we should have
z
= fx (x0 , y0 )
x
z
= fy (x0 , y0 )
y
Thus a = fx (x0 , y0 ) and b = fy (x0 , y0 ) and we nd that
z = fx (x0 , y0 ) x + fy (x0 , y0 ) y + c.
Now at (x0 , y0 ) we should have z = f (x0 , y0 ) and so
f (x0 , y0 ) = fx (x0 , y0 ) x0 + fy (x0 , y0 ) y0 + c
c = f (x0 , y0 ) fx (x0 , y0 ) x0 fy (x0 , y0 ) y0
Hence the equation of the tangent plane to the function f (x, y) at the point (x0 , y0 ) is
z = fx (x0 , y0 ) x + fy (x0 , y0 ) y + f (x0 , y0 ) fx (x0 , y0 ) x0 fy (x0 , y0 ) y0
Or more simply:
z f (x0 , y0 ) = fx (x0 , y0 )(x x0 ) + fy (x0 , y0 )(y y0 )

MATH203: W. N. Franzsen (10/2/2015).

13

14

Advanced Calculus (2014)

Example Continuing from above. We have f (x, y) = x2 + 2y 2 , f (3, 4) = 41, fx (3, 4) = 6


and fy (3, 4) = 16. Thus the equation of the tangent plane at (3, 4, 41) is
z 41 = 6(x 3) + 16(y 4)
z = 6x + 16y 18 64 + 41
= 6x + 16y 41
Similar to what we have already seen the rst time we met calculus, not all surfaces are
dened explicitly, that is with a denition of the form z = f (x, y). Some surfaces are dened
implicitly using equations of the form x2 + y 2 = 1, which you will recall denes the unit circle.
Here we will dene a surface by setting a function of x, y and z equal to a constant.
Example Consider the function g(x, y, z) = x2 + 2y 2 z. If we set g(x, y, z) = 0 then we
have dened the surface used above.
g(x, y, z) = 0
x + 2y 2 z = 0
z = x2 + 2y 2
2

The advantage of this idea is that we may dene surfaces that cannot be written in
the form z = f (x, y) in any easy way, if at all. Nevertheless we will still be able to nd the
tangent plane to such surfaces. In fact, the formula we use will be easier to remember.
3.1 Tangent Planes Given a surface dened by g(x, y, z) = k, where k is a constant,
the equation of the tangent plane at a point (x0 , y0 , z0 ) on the surface is given by
fx (x0 , y0 , z0 )(x x0 ) + fy (x0 , y0 , z0 )(y y0 ) + fz (x0 , y0 , z0 )(z z0 ) = 0
In Leibnitzs notation this would be
f
f
f
(x x0 ) +
(y y0 ) +
(z z0 ) = 0
x
y
z
where all the partial derivatives are evaluated at (x0 , y0 , z0 ).
The advantage of this form is that x, y and z are treated the same. However, does this
give the same answer for functions we can write in the form z = g(x, y)? We have already
seen the trick we need to apply. The surface z = g(x, y) is exactly the same as the surface
dened by g(x, y) z = 0, so we let f (x, y, z) = g(x, y) z and consider the tangent planes
at (x0 , y0 , z0 ) for the surfaces z = g(x, y) and f (x, y, z) = 0.
From before, we know that the tangent plane to the surface z = g(x, y) is given by
z z0 = gx (x0 , y0 )(x x0 ) + gy (x0 , y0 )(y y0 )
Using the above we calculate the tangent plane to the surface f (x, y, z) = 0 at the given
point.
fx (x0 , y0 , z0 )(x x0 ) + fy (x0 , y0 , z0 )(y y0 ) + fz (x0 , y0 , z0 )(z z0 ) = 0
We now calculate the partial derivatives of f .
(g(x, y) z)
f
=
x
x
z
g(x, y)

=
x
x
= gx (x, y)

Chapter 3

Advanced Calculus (2014)

fx (x0 , y0 , z0 ) = gx (x0 , y0 )
(g(x, y) z)
f
=
y
y
g(x, y) z
=

y
y
= gy (x, y)
fy (x0 , y0 , z0 ) = gy (x0 , y0 )
(g(x, y) z)
f
=
z
z
g(x, y) z

=
z
z
= 1
fz (x0 , y0 , z0 ) = 1
Thus the tangent plane is
0 = fx (x0 , y0 , z0 )(x x0 ) + fy (x0 , y0 , z0 )(y y0 ) + fz (x0 , y0 , z0 )(z z0 )
0 = gx (x0 , y0 )(x x0 ) + gy (x0 , y0 )(y y0 ) + (1)(z z0 )
0 = gx (x0 , y0 )(x x0 ) + gy (x0 , y0 )(y y0 ) (z z0 )
z z0 = gx (x0 , y0 )(x x0 ) + gy (x0 , y0 )(y y0 )
and the two forms agree.

3.2

Dierentials

We can now use these ideas


to
approximate the values of functions. Suppose that we needed

the numerical value of 8 + 37 but did not have a calculator. We rst nd afunction that

has a function value equal to the given expression, for example if f (x, y) = x + y then

f (8, 37) = 8 + 37. We know that


f (9, 36) =

9+

36 = 3 + 6 = 9.

Look at the tangent plane to the surface z = f (x, y) at the point (9, 36). For points near
(9, 36, 9) the z-values on the tangent plane will be close to the values on the surface. We
therefore nd the equation of the tangent plane at that point.
The equation of the tangent plane to the surface z = f (x, y) at the point (a, b) is
z f (a, b) =

z
z
(x a) +
(y b).
x
y

So we evaluate the partial derivatives at (9, 36).


1
fx (x, y) =
2 x
1
fy (x, y) =
2 y
1
1
fx (9, 36) = =
6
2 9
1
1
fy (9, 36) = =
12
2 36

15

16

Advanced Calculus (2014) Given a function

z = f (x, y) we can find two first partial derivatives

Thus the equation of the tangent plane is


z9=

1
1
(x 9) + (y 36).
6
12

We now assume that f (8, 37) z at the point (8, 37).


1
1
(8 9) + (37 36)
6
12
1
1
f (8, 37) 9 +
6 12
107
=
12

For the record 107/12 = 8.916 while 8 + 37 = 8.911 . . ., a reasonably good approximation.
Example We nd an approximation to sin 1 + cos 1. To complete this we must remember
that = 3.1415 . . . and so 1 3 . If you recall your exact values you will realise that the value

of sin 3 is 23 , to nd the value of this we really need to nd an approximation to 3, but that

is similar to the previous question and so well just use the approximate value 23 = 0.8660 . . .
To start, we let f (x, y) = sin x + cos y, then

 

3 1
,
= sin + cos =
+ = 1.3660 . . .
z0 = f
3 3
3
3
2
2
f (8, 37) 9

It is easily seen that fx (x, y) = cos x and fy (x, y) = sin y and so


 

1
,
= cos =
fx
3 3
3
2


,
= sin = 0.8660 . . .
fy
3 3
3



We can now write down the equation of the tangent plane at the point 3 , 3 , writing our
numbers correct to 3 decimal places.
  
  


,
x
+ fy
,
y
z 1.366 fx
3 3
3
3 3
3
1
= (x 1.047) 0.866(y 1.047)
2
at (1, 1)
z 1.366 + 0.5(1 1.047) 0.866(1 1.047)
1.383
The actual value of sin 1 + cos 1, to 3 decimal places is 1.382 and we are not too far o the
mark.
If we now return to the approximation:
z f (a, b)
we can write this as
z

z
z
(x a) +
(y b)
x
y
z
z
x +
y.
x
y

As we move closer to the point (a, b) this approximation gets better, in the limit we have
dz =

z
z
dx +
dy.
x
y

The expressions dx, dy and dz are known as dierentials.

Chapter 3

3.3

Advanced Calculus (2014)

Second Partial Derivatives

z
= fx (x, y)
x
z
= fy (x, y)
y
As in the 1-dimensional case we can dierentiate again. This time there are more possibilites:
(a)
We can dierentiate with respect to x and then with respect to x.
(b)
We can dierentiate with respect to x and then with respect to y.
(c)
We can dierentiate with respect to y and then with respect to x.
(d)
We can dierentiate with respect to y and then with respect to y.
Thus we have 4 second partial derivatives.
 
z
2z

=
x x
x2
 
z
2z

=
y x
yx
 
z
2z

=
x y
xy
 
z
2z

=
y y
y 2

= fxx (x, y)
= fxy (x, y)
= fyx (x, y)
= fyy (x, y)

Example Find all four second partial derivatives of


z = 2x xy + log y.
We evaluate the rst partial derivatives.
z
=2y
x
1
z
= x +
y
y
We can now nd the second partial derivatives
2z
x2
2z
yx
2z
xy
2z
y 2
Notice that

2z
2z
=
.
yx
xy

=0
= 1
= 1
=

1
y2

17

18

Advanced Calculus (2014) Given a function

z = f (x, y) we can find two first partial derivatives

Exercises Evaluate the four second partial derivatives for each of the following functions.
z = x2 y 2 + cos y
z = y cos x
z = ex log y
2z
2z
=
, this is always true. (Well
yx
xy
nearly always, we will not meet any functions where this is not true in this unit.) Later you
will also see that this is true of more complicated functions and of higher partial derivatives.
For example,
In each of these cases you will nd that

fxyz (x, y, z) = fyzx (x, y, z) = fzyx (x, y, z)


fxxyx (x, y) = fyxxx (x, y)
and so on.

Chapter 4
The Chain Rules and Revision of Vector Arithmetic

4.1

The Chain Rules

Unlike functions of one variable there are two dierent chain rules:
(1)
The Total Derivative Rule, and
(2)
The chain rule for functions of several variables.
These two arise because we are looking at functions of functions. Suppose z = f (x, y) where
x and y are themselves functions. We have two cases.
(a)
Both x and y are functions of the same variable, or
(b)
they are functions of two or more variables.
Example 1 Suppose that z = x2 + y 2 and that x = 2t and y = t2 are functions of the same
variable. In this case we really have
z = x2 + y 2 = (2t)2 + (t2 )2 = 4t2 + t4 ,
a function of one variable. Dierentiating we nd that
dz
= 8t + 4t3 ,
dt
a normal (full) derivative.
In simple situations we can use the expressions for x and y to write z as a function of
the single variable, but things can become quite complicated. For example, there is no easy
way of eliminating x and y in the following situation.
 x+y


2
x y +
cosh(w2 + 1) dw
z = arc sec
0


t

x = tan
t2 1

y = e t+log t
However we may still be able to evaluate dz
dt .
You will recall that we showed that
z

z
z
x +
y.
x
y

If we divide both sides by t then we get


z x z y
z

+
.
t
x t
y t
Taking the limit as t 0 we get (theres a lot to prove here but we dont need the details)
z dx z dy
dz
=
+
.
dt
x dt
y dt
This is known as the Total Derivative Rule. Notice that the left-hand-side is a full derivative.
MATH203: W. N. Franzsen (10/2/2015).

19

20

Advanced Calculus (2014)

Example 2 If we look at z = x2 + y 2 , x = 2t and y = t2 again we nd that


z
z
= 2x and
= 2y
x
y
dx
dy
= 2 and
= 2t
dt
dt
Using the Total Derivative Rule we nd:
z dx z dy
dz
=
+
dt
x dt
y dt
= 2x 2 + 2y 2t
= 8t + 4t3
The same answer as we got before.
Suppose now that x and y are functions of two (or more) variables. For example we
might have z = x2 + y 2 , x = u + t and y = 2u t2 . Using similar arguments to that used for
the Total Derivative Rule we can show that there are two chain rules.
z x z y
z
=
+
t
x t
y t
z x z y
z
=
+
u
x u y u
z
z
and
given that z = x2 + y 2 , x = u + t and y = 2u t2 .
t
u
This time we have

Example 3 Evaluate

z
= 2x and
x
x
= 1 and
t
x
= 1 and
u

z
= 2y
y
y
= 2t
t
y
=2
u

Thus we nd that
z x z y
z
=
+
t
x t
y t
= 2x 1 + 2y (2t)
= 2(u + t) 4t(2u t2 )
= 2u + 2t 8ut + 4t3
z x z y
z
=
+
u
x u y u
= 2x 1 + 2y 2
= 2(u + t) + 4(2u t2 )
= 10u + 2t 4t2
Exercise In the above example we could have just written z as a function of u and v and
dierentiated normally. Show that if we do this we get the same answers.

Chapter 4

Advanced Calculus (2014)

Example 4 We may use the Total Derivative rule to perform implicit dierentiation. Given
a implicit equation
2x2 y + 3xy 4 = 7
we let z = 2x2 y + 3xy 4 7 = 0 and so

dz
dx

= 0 as z is constant.
dz
0=
dx
z dx z dy
+
=
x dx y dx
z dy
z
+
=
x y dx
z
dy
= x
z
dx
y
4xy + 3y 4
= 2
2x + 12xy 3
For the record, this is the only sensible way to evaluate implicit derivatives.

4.2

Revision of Vector Arithmetic

You should be familiar with the whole of this section, from MATH107 or equivalent. Dont
panic if you dont remember vectors, all the facts that you need will be covered in this
section. (Although we wont provide all of the proofs.) Firstly you should recall that there
are two standard ways to write down a vector, either as a small matrix or using the standard
vectors i, j and k . Thus the vectors

2
3
and
2i + 3j + k

1

represent the same vector. As most of our work in this unit will take place in three dimensions
the revision below will assume that we are working in three dimensions.
The rst fact to remember is that vectors are independent of their starting point. The
vector joining the points P (2, 0, 5) and Q(1, 3, 9) is
 1 

v = P Q = 3 = i + 3j + 4k

But this vector also joins the origin O(0, 0, 0) to the point (1, 3, 4).
4.1 Points and Vectors You should remember the following in whatever form is easiest
for you. What is written below is only one way of remembering these facts.
(a)
The vector joining P (a, b, c) to Q(r, s, t) is
 ra 

v = P Q = sb = (r a)i + (s b)j + (t c)k .

tc


(b)
Given the point P (a, b, c) and vector v = = i + j + k , the point Q

such that P Q = v is

Q(a + , b + , c + )

(c)
Given the point Q(r, s, t) and vector v = = i + j + k , the point P such

that P Q = v is

P (r , s , t )

21

22

Advanced Calculus (2014)

Exercise Convince yourself that you only really need to remember one of these. That is,
using any one of these show that you can easily deduce the other two.
2
 0 
We may also add vectors. Given the vectors 1 and 5 we can easily form the
sum

2
1
5


+

0
5
3


=

2+0
1+(5)
5+3


=

2
4
8

With similar ease if we had written these using i, j and k. It is also important to remember

that we can also think of vectors geometrically.


u

v+u

We may also subtract vectors. The above diagram, with one small change can also help us
visualise this.
u

We know that w = v + u and so v = w u.



We have seen that given a vector v and a point P we can nd a point Q so that v = P Q.

It is easy to see that the length of v can be calculated from the distance between P and Q.
the length directly.
In fact there is an easier way to nd
a
4.2 Length of a Vector Given the vector v = b = ai + bj + ck the length of v is

given by

|v | = v = a2 + b2 + c2

You will note the two common notations for the length of a vector are given above, namely ||
and , both are used at dierent times, but should never be used in the same book or unit.
As the notation | | is used in other areas of this unit we will stick with that notation.
If a vector has length 1 then we call it a unit vector.
The vector with length 0 is called the zero vector. It should be noted that the zero vector
has no direction.
Note The vector i is the unit vector that points in the direction of the positive x-axis.

Thus we can write i = (0, 0, 0)(1, 0, 0). Similarly, j is the unit vector in the direction of the

positive y-axis and k for the positive z-axis.

Exercise Check that the formula given above gives the right answer: First nd the distance
between the points P (2, 5, 5) and Q(3, 8, 2) using the distance formula from high school.

Then nd the vector P Q and calculate the length of that vector.


Given a vector v and a real number we may form the vector v . Using our notation

that gives the components


this is easy to dene.
a

b
c


=

a
b
c

(ai + bj + ck) = ai + bj + cj

Geometrically things are a bit more complicated as the sign of the number changes the
vector dramatically. There are therefore two cases.
Case 1 If 0 then v is the vector that is parallel to v and has length |v |.

Chapter 4

Advanced Calculus (2014)

Case 2 If < 0 then v is the vector that is parallel to v , has length |v | and points in
> 0 and so|v | can be the
the opposite direction to v . (Note that as < 0 we have

length of something as it is positive.)

2
Example Given u =

1
5

2v
2v

 1 
and v = 5
evaluate 7u 3v .


 14 
3
7u 3v = 7 15

9
35
 17 
= 8
v

44

4.3

Lemma Given the vector v and the scalar (that is, number) we have

|v | = |||v |

Proof The description above provides the proof.


then |v | = |v |. If we recall the denition of ||


,
if
|| =
, if

If 0 then |v | = |v | while if < 0

then the proof is nished.


0
<0

4.4 Unit Vectors Given a non-zero vector v the vector |v1 | v is a unit vector parallel to v .

Indeed this vector will also point in the same direction as v .

Proof As |v1 | v is a non-zero scalar multiple of v it is parallel to v . As the scalar is in fact

positive, thisvector will have the same sense as v . We calculate its length.


1 1
v = |v |
|v | |v |

1
|v |
as |v | 0
=
|v |

=1

4.3

Dot (Scalar) Product

We can add and subtract vectors so it is only natural to ask whether we can multiply them.
In this unit we will see that for vectors in three dimensions there are two ways of nding the
product of vectors. Only the Dot, or Scalar, Product can be applied to any sized vectors.
Before giving the denition we observe that given two non-zero vectors, u and v , there

are two angles formed if we start the vectors from the same point.
v

In all cases, we take the angle between vectors to be the smaller of the two angles. That is
the angle in the above diagram.

23

24

Advanced Calculus (2014)

Exercise Show that for any pair of non-zero vectors the angle, , between them satises 0 .
4.5 Definition Given two non-zero vectors u and v , the dot (or scalar) product of u

and v is dened to be

u v = |u| |v | cos


where is the (smaller) angle between the vectors.
If either, or both, of the vectors are zero vectors then
uv =0

(We have to have this last little bit as is not dened in this case. In calculations we usually
just use the earlier formula. As one of the lengths is 0 we can pretend that the doesnt
matter as the right hand side will be 0.)
You should recall that there is a quick way of nding the dot product.
   
a
c
d = ac + bd
b
a
d
b
e = ad + be + cf
c

and so on. Using both forms we may nd the angle between a pair of non-zero vectors.

4.4

Cross (or Vector) Product

As a rst encounter with the cross product we give the denition and then the more useful
way of calculating the vector.
The main problem with the dot product is that the answer is a scalar, hence the
alternative name of the scalar product. It would be nice if we could multiply two vectors and
get a vector as an answer. In three dimensions this is possible, and this only applies to three
dimensions. The big problem is deciding what the direction of the resultant vector should
be. The following denition is correct but not particularly helpful.
4.6 Definition Given two non-zero vectors, u and v , in R3 with angle between them.
The cross product is dened to be the vector u v that is perpendicular to the plane formed
handed system, and such that the length
by u and v , so that u, v and u v forms a right

of u v is

|u v | = |u| |v | sin


A cross product involving the zero vector is the zero vector.
All of this denition makes sense except for the right handed system bit. Dont worry
about that for the moment.
As with the dot product there is another way of calculating the cross product. For
once, the i, j , k notation is quicker.


a b c
a
b
c
d e f
= det d e f
(ai + bj + ck) (di + ej + f k) =

i
j
k
i j k


 a 
d
bf ce
b
e = cdaf
c

acbd

2 3 1


Example (2i + 3j k) (i j k ) = 1 1 1 = 4i + j 5k.
i j
k

Exercise Show that the cross product in the example is perpendicular to the two individual
vectors forming it.

Chapter 5
Directional Derivatives, Stationary Points

5.1

Directional Derivatives

Using the partial derivatives we may nd the slope of a function in the x or y directions.
What if we dont want to move in those directions? Given a function f (x, y) is it possible to
nd the slope of the surface z = f (x, y) in a given direction? As you may have guessed, the
trick we use will involve vectors.
Extended Example Consider the function f (x, y) = x2 +y 2 . Suppose we are standing at

 the
2
point (1, 1, 2) on the surface z = f (x, y) and we want to know the slope in the direction 1 .
To nd this slope we use the same trick that we did for functions of one variable.
That is, we nd the function value
  at (1, 1) and then at the point we reach by moving a
2

short distance in the direction 1 . Using traditional notation, suppose we move along the
   
2
2h
vector h 1 = h . As we started at the point (1, 1) we end up at (1 + 2h, 1 + h) and have


moved a distance (2h)2 + h2 = h 5 (just using the distance formula if you must, this is
just the length of the vector along which we moved).
f (1, 1) = 12 + 12 = 2
f (1 + 2h, 1 + h) = (1 + 2h)2 + (1 + h)2
= 1 + 4h + 4h2 + 1 + 2h + h2
= 2 + 6h + 5h2
Thus the slope of the chord joining (1, 1) and (1 + 2h, 1 + h) is
rise
run
f (1 + 2h, 1 + h) f (1, 1)

=
h 5
2 + 6h + 5h2 2

=
h 5
h(6 + 5h)

=
h 5
6 + 5h
=
5
 
2
Taking the limit we nd that the slope at (1, 1) in the direction 1 is
slope of chord =

6 .
5

At this stage it is worth evaluating a few other things at the point (1, 1).
fx (x, y) = 2x
fx (1, 1) = 2
fy (x, y) = 2y
fy (1, 1) = 2
  

2
1 = 22 + 12 = 5
MATH203: W. N. Franzsen (10/2/2015).

25

26

Advanced Calculus (2014)

Now consider the following.




fx (1,1)
fy (1,1)

  1      1  
6
1
2
2
2

= 2
= (2 2 + 2 1) =
1
1
5
5
5
5

5.1 Lemma
given by

The slope of the function f (x, y) at the point (a, b) in the direction v is



fx (a,b)
v
fy (a,b)

where v is the unit vector in the direction v .





f (a,b)
Notation The vector fxy (a,b) is such a useful quantity that we have a special notation for
it.


f (a,b)
f (a, b) = fxy (a,b)

and so the directional derivative can be written as


f (a, b) v

For once it is worth proving this lemma. Apart from anything else it will remind us of
some of the tricks we use with limits.
 
r
Proof To simplify matters while we are working let us suppose that v = s is a unit

vector. Well worry about other length vectors later.


At the point (a, b) the function value is f (a, b). The point that is hv from (a, b)
travelled
is (a + hr, b + hs) and the function value there is f (a + hr, b + hs). The distance
is |hv | = h|v | = h, as we are assuming that the length of v is 1. Calculating the slope of this
we nd

chord
f (a + hr, b + hs) f (a, b)
h
f (a + hr, b + hs) f (a, b + hs) + f (a, b + hs) f (a, b)
=
h
f (a + hr, b + hs) f (a, b + hs) f (a, b + hs) f (a, b)
+
=
h
h
f (a, b + hs) f (a, b)
f (a + hr, b + hs) f (a, b + hs)
+s
=r
hr
hs

slope of the chord =

(a,b)
, we rst let hs = k, say,
We now concentrate on each fraction. Start with f (a,b+hs)f
hs
and note that k 0 as h 0. Then we note that, by denition,

lim

k0

f (a, b + k) f (a, b)
= fy (a, b)
k

The other fraction is slightly harder to deal with, but we note that as h 0 then b + hs b
and we nd
lim (slope of the chord) = rfx (a, b) + sfy (a, b) = f (a, b) v

h0

 
We can now deal with the problem of the length of the vector. If v =

length then we look at the unit vector in that direction, namely


1 p
1
v=
=
v =
|v | |v | q

v|
q
|v |

p
q

is not unit

Chapter 5

Advanced Calculus (2014)

As this vector points in the same direction the above formula applies with r = |vp | and s = |vq | ,

thus
lim (slope of the chord) = rfx (a, b) + sfy (a, b)

h0

p
q
fx (a, b) +
fy (a, b)
|v |
|v |

1
(pfx (a, b) + qfy (a, b)
=
|v |

v
= f (a, b)
|v |


Example Find the slope at the point (2, 3, 9) in the direction v =

face z = f (x, y), where


f (x, y) = 3x2 2xy + y 2
The unit vector in the direction v is

1 v .
10

3
1


on the sur-

Looking at the partial derivatives we nd




f (x, y) =

=
f (2, 3) =

fx (x,y)

fy (x,y)
6x2y
2x+2y

 
6
2

Thus the slope is


1
slope = f (2, 3) v
10
1 6  3 
1
=
10 2
16
=
10
Notation The slope of the function f (x, y) at the the point (a, b) in the direction v is

denoted by
Dv f (a, b)

Thus we have
v
Dv f (a, b) = f (a, b)
|v |



fx (x,y)
The vector f (x, y) = fy (x,y) is called the gradient of f (x, y) and the symbol f is
pronounced grad-f .

5.2

Steepest Slopes

Most of the time we are not particularly interested in the slope in a given direction. Much
of the time we are more interested in either nding the direction of the steepest slope, or a
direction in which the slope is 0. By looking for these we will, in fact, nd a solution to the
general problem of nding a direction with a given slope.
We rst look closely at the value of the slope. Suppose we have a surface z = f (x, y)
and are interested in the slopes at the point (a, b). To save some fuss we again consider a

27

28

Advanced Calculus (2014)

unit vector u. Let be the angle between u and f (a, b). You should observe that we are
that f (a, b) is not the zerovector, well worry about that case later. From
assuming here
before we know that the value of the slope at this point is
Du f (a, b) = f (a, b) u

= |f (a, b)| |u| cos

= |f (a, b)| 1 cos


= |f (a, b)| cos
The good news is that this is all we need to know. The angle between vectors lies in the
range from 0 to , with a largest value of 1 at = 0 and a smallest value of 1 at = .
Not only have we found the steepest slope, we know the direction.
5.2 Lemma Given a function f (x, y), the steepest (upwards) slope at the point (a, b) occurs in the direction parallel to f (a, b) and has the value |f (a, b)|. The steepest downwards
slope occurs in the direction f (a, b) and has the value |f (a, b)|.
We can also gain information about the direction in which there is zero slope. If = 2
then cos = 0 and so the slope is 0. Therefore, if we move in a direction perpendicular
to f (a, b) then the slope is 0.
5.3 Lemma Given a function f (a, b), the slope in the directions perpendicular to f (a, b)
is 0.
This has important consequences for bushwalkers and road builders. The contour lines
on a map show places that have equal height. The above tells us that the directions of these
at any point are at right angles to the direction of the steepest slopes. Thus, if you move
perpendicular to contour lines on a map then you have chosen the steepest slope (either up
or down, depending which direction you go).
Example Find the direction of steepest descent on the surface z = 3x2 5x 5y 2 at the
point (2, 1, 2), and nd the value of that slope.
As we want the steepest downhill slope we know the direction will be f (2, 1)
where f (x, y) = 3x2 5x 5y 2 and the value will be |f (2, 1)|.
f (x, y) =
f (2, 1) =
f (2, 1) =





6x5
10y
10
10
10
10





Thus the steepest downwards slope occurs in the direction

1
1


(the constant factor of 10

is unimportant for the direction) and the magnitude of the slope in that direction is
|f (2, 1)| =

(10)2 + 102 = 10 2

The factor of 10 does matter for the size of the slope.


If asked for the directioninwhichthe slope is 0, we choose a vector perpendicular
1
1
to f (2, 1). For example, both 1 and 1 are directions with slope 0.

5.3

Stationary Points

We now need to deal with the one case we left out of the discussion of steepest slopes, namely
the case where f (a, b) is the zero vector.

Chapter 5

Advanced Calculus (2014)

5.4 Definition Given the function f (x, y), the point (a, b) is called a stationary point
if f (x, y) is the zero vector.
Example Find all the stationary points of the function f (x, y) = 3x2 5x 5y 2 .
To do this we solve the equations we get from
 
f (x, y) = 00
  

fx (x,y)
= 00
fy (x,y)
  

6x5
= 00
10y
6x 5 = 0
10y = 0


Thus the only stationary point is 56 , 0 .
The next step should be to classify the nature of our stationary points, and we will, but
the fact is that we have many more possibilities. For functions of one variable a stationary
point is a local maximum, local minimum or a horizontal point of inexion. For functions
of two variables we might still have a local maximum (think of the top of a hill) or a local
minimum, but there are many others. The most important is a saddle point. As the name
suggests we need to imagine the middle point of a horses saddle, in one direction (across
the horse) the surface has a maximum, but in another direction (along the horse) we have
a minimum. We can also get equivalents of horizontal points of inexion as well as even
more option. The only three we will worry about are local maxima, local minima and saddle
points. All the rest will be counted as other.

Local Minimum

Local Maximum

Saddle Point

One Example of Other

It would be nice if there was a simple test for the nature of a stationary point. As we
will see below, there is a test involving the second derivatives but it is not simple. We should
expect this, not least because for a function of 2 variables there are 4 second derivatives. We
rst start by forming the second derivatives into a matrix. Suppose the function f (x, y) a
stationary point at (a, b), so fx (a, b) = 0 and fy (a, b) = 0. We consider the following matrix


f (a, b)
Hf (a, b) = xx
fyx (a, b)

fxy (a, b)
fyy (a, b)

29

30

Advanced Calculus (2014)

In one sense there is a simple rule for the nature of the stationary point: If both eigenvalues
are positive we have a local minimum, if both are negative we have a local maximum, one of
each and we have a saddle and if either or both are zero we have no information. Sadly, this is
only simple if we know the eigenvalues (indeed if we know what eigenvalues are!). Thankfully
we can remember this another way. To save writing, we use a symbol for the determinant of
the above matrix.


fxx (a, b) fxy (a, b)
= fxx (a, b)fyy (a, b) fxy (a, b)2
= det
fyx (a, b) fyy (a, b)
Remembering that fxy (a, b) = fyx (a, b) for all nice functions.
(1)
If > 0 and fxx (a, b) > 0 then f has a local minimum at the point (a, b).
(2)
If > 0 and fxx (a, b) < 0 then f has a local maximum at the point (a, b).
(3)
If < 0 then f has a saddle point at (a, b).
As with the second derivative test in one dimension, if = 0 then we have no information.
We might have a maximum, a minimum, a saddle or one of the other possibilities.
Example Find the stationary point(s) of the function
f (x, y) = 2x2 + y 2 + 4x 4y + 5
and determine the nature of these points.
We rst nd any stationary points by solving f (x, y) = 0.

 
0
= f (x, y)
0


4x+4
= 2y4
It is easy to see that the only stationary point is at (1, 2). We now calculate the matrix of
second derivatives here all the second derivatives are constant.


4 0
0 2
Clearly, in this case, = 8 > 0 and 4 > 0. Therefore (1, 2) is a local minimum.

Chapter 6
Lagrange Multipliers

6.1

Constrained Extrema

We have just seen how to nd stationary points and extreme points of functions. In principle
this process is straight-forward. However, the process relies on being able to nd a suitable
way of writing the boundary of a region in terms of parameters. In many cases that just
isnt possible or convenient. We need a way of nding extreme points that works in a similar
way to implicit dierentiation. That is, we wont need to write the boundary in the form
of a function. The boundary (or boundaries) we will be looking at are called constraints,
that is, they are conditions that our points must satisfy. For example, we might look the
highest value of a function that lies on the unit circle. In that case the constraint would
be x2 + y 2 = 1.
We will rst state the method of Lagrange Multipliers, following that statement will
be an example that is adapted from a genuine problem. The exercise following that example
shows an actual application of Lagrange Multipliers, in particular showing the problems that
can arise in real situations. (That is, it isnt an easy exercise.)
6.1 Method of Lagrange Multipliers To nd the extreme points of the function f (x)

subject to the constraints g1 (x) = 0, g2 (x) = 0 and so on, we solve the system of simultaneous

equations
f (x) = 1 g1 (x)

f (x) = 2 g2 (x)

..
.
g1 (x) = 0

g2 (x) = 0

..
.
For most of our examples there will only be one constraint. In this case the method of
Lagrange multipliers reduces to the following.
f (x) = g(x)

g(x) = 0

Note The multiplier, , is to be treated as a genuine unknown. Most of the time we will
need to nd its value(s) to solve the problem. However, there are cases where we can nd the
extreme points without nding the value(s) of . You will nd that solving problems using
Lagrange multipliers requires some exibility.
Example This is a traditional problem that uses Lagrange multipliers, it also has an important application that we will see later. A surf lifesaver is standing on the waters edge and
notices a swimmer in diculty. The lifesaver can run at 5 metres per second across sand and
swim at 1 metre per second through the surf. The swimmer is 30 metres from a point on the
waters edge that is 100 metres from the lifesaver.
MATH203: W. N. Franzsen (10/2/2015).

31

32

Advanced Calculus (2014)

lifesaver

100 metres

30 metres
water

swimmer

The lifesaver realises that the quickest way to reach the swimmer is to run for a distance
along the beach and then dive in and swim directly to the person to be rescued.
In order to minimise the time taken, how far should the lifesaver run before swimming directly
to the person to be rescued?
Let r metres be the distance the lifesaver runs and s metres the swimming distance.
Then the time taken will be
s
r
r
+ =
+s
f (r, s) =
10 1
10
The right-angled triangle on the right has side lengths 30 and 100 r and hypotenuse s and
so (100 r)2 + 302 = s2 . Thus our constraint is
g(r, s) = (100 r)2 s2 + 302 = 0
Using Lagrange multipliers we have the constraint just noted, together with
f (r, s) = g(x, y)


 
1
2(100r)
10
=
2s
1

Taken together we have 3 equations for the 3 unknowns.


20(100 r) = 1
2s = 1
(100 r)2 s2 + 302 = 0
The second equation tells us that neither nor s are 0, thus we may divide by them. In fact
1
and so we may reduce our equations to
we obtain the equation = 2s
10
(100 r) = 1
s
(100 r)2 s2 + 302 = 0
The rst equation becomes (100 r) =

s
10

and so

 s 2
s2 + 302 = 0
10
s2
s2 + 302 = 0
100
99 2
s = 900
100
90000
s2 =
99
10000
=
11

10000
s=
11

Chapter 6

Advanced Calculus (2014)

As these are distances we may ignore the negative solution, thus


s = 30.1511 . . . metres
Solving for r we nd that
r = 96.984 . . . metres
As we might expect, the lifesaver will do as much work as possible on the sand. (In this case
the lifesaver only saves half a second! But who knows, that might be enough.)
Example/Exercise The last problem is related to a very important principle in physics.
Indeed I knew the answer to the above before we started: The size of the angle at the swimmer
1
, the ratio of the speeds! You should check
in the right-angle triangle is where sin = 10
that the numbers do come out this way. We, that is to say you, can use the method of
Lagrange multipliers to establish Snells Law. It is a principle of physics that light travels in
such a way as to minimise the time taken (as in the problem above). Although the speed of
light in a vacuum is a constant, the speed of light in other materials is dierent and slower
than that. Suppose a beam of light travels from the point A to the point B in the situation
depicted below, passing from one material to another. For example, A could be in the air
over a lake, while B is below the surface of the lake. The beam will travel in a path that
minimises the time taken. Suppose the speed of light above the line is v1 and the speed below
the line is v2 . Taking the normal at the point where the beam crosses the line, we let 1
and 2 be the angles to that normal.
speed of light = v1

A
1

2
speed of light = v2
B
Your task Using the method of Lagrange multipliers verify Snells Law
v1
sin 1
=
sin 2
v2
You should note that this is not a particularly easy task, but it is also not particularly hard.
So, dont try it as your rst Lagrange multipliers problem, but remember to have a go at it
sometime.
(Hint: Pick points A and B distance 1 from the line, and calculate the distances and times
in terms of the angles.)
Example Find the extrema of f (x, y) = x y subject to the constraint that x2 y 2 = 2.
We let g(x, y) = x2 y 2 and use Lagrange multipliers.
f (x, y) = g(x, y)

  
1
2x
=
2y
1
1 = 2x
1 = 2y

33

34

Advanced Calculus (2014)

It is easy to see that none of , x or y can be 0 and so we may divide.


x=

1
=y
2

However, we now nd that g(x, y) = g(x, x) = x2 x2 = 0 = 2 and so there are no such


points. Thus there are no extreme values. Most likely the values just increase or decrease
indenitely.
Example Find the extrema of f (x, y) = 3x+2y subject to the constraint that 2x2 +3y 2 = 3.
We let g(x, y) = 2x2 + 3y 2 .
f (x, y) = g(x, y)
  

4x
3
=
6y
2
3 = 4x
2 = 6y
1 = 3y
Again, none of , x or y is 0. (Otherwise, for example if y = 0, 2 = 6y = 0, which cannot
happen.)
1
3
9
3
x = = 3y = y
4
4
4
Now using this fact in the constraint.
3 = g(x, y)
 2
9
y + 3y 2
=2
4
81 2
y + 3y 2
=
8
105 2
y
=
8
8
y2 =
35
8
y=
35
4
=
70
Thus we have two candidate points


4
9
,
70
70


or

9
4
,
70
70

This time it is easy to see that the value of f at the rst point is positive and the value at
the second is negative. Thus the rst is a maximum and the second a minimum.
As you might expect, not all Lagrange multiplier questions are as nice as these. In
many cases there is a complicated interplay between the variables and the multiplier. In
these cases the number of possible points usually multiplies, sometimes alarmingly. When
this happens it is important to remain organised.

Chapter 6

Advanced Calculus (2014)

Example Find the extrema of f (x, y) = xy subject to the constraint g(x, y) = 4x2 +9y 2 = 36.
We rst observe that as 4x2 + 9y 2 = 36 we cant have both x and y being 0.
f (x, y) = g(x, y)
  

y
8x
=
x
18y
y = 8x
x = 18y
Now observe that if = 0 then both x and y are 0, but we have seen that this cant happen.
Thus = 0.
x = 18y = 18(8x) = 1442 x
1442 x x = 0
(1442 1)x = 0
And so we have 3 cases: x = 0, =
Case 1 Suppose x = 0, then

1
and = 12
.

1
12

4 02 + 9y 2 = 36
y2 = 4
y = 2
Thus there are two points that come from this case.
(0, 2)
Case 2 Suppose =

(0, 2)

and

1
12 .


2

4x + 9

4 2
x
9

y = 8x
2
= x
 3
= 36

8x2 = 36
x=
y=
Thus there are two more points.


9
, 2
4

9
2

2
x= 2
3

and


9
, 2
4

1
.
Case 3 Suppose = 12


2

4x + 9

4 2
x
9

y = 8x
2
= x
3

= 36

8x2 = 36
x=

9
2

2
y= x= 2
3

35

36

Advanced Calculus (2014)

Thus there are two more points.

9
, 2
4

and

9
, 2
4

We therefore have 6 possible extreme points. To decide which is which we nd the


value of f (x, y) at each point. As sometimes occurs, the function values for both points in
each case is the same. Case 1 gives the value 0, case 2 the value 3 and case 3 the value 3.
Thus the points from case 2 give the maximal values while those from case 3 give the minimal
value.
Warning Even more complicated situations can arise from very similar looking questions.
Example Find the points on the hyperbola y = x1 that are closest to the origin.
We can write this constraint as g(x, y) = xy = 1, but we dont have a function to
optimise. As we are considering the distance from the origin we could use the distance
formula x2 + y 2 , but that involves square roots. As x2 and y 2 are alwayspositive we can
nd the extreme values of x2 + y 2 and then deduce the extreme values of x2 + y 2 . So we
let f (x, y) = x2 + y 2 and we can now use the method of Lagrange multipliers.
f (x, y) = g(x, y)
   
2x
= y
2y
x

2x = y
2y = x
Note that if = 0 then both x and y are also 0, but xy = 1 and so this cannot happen,
indeed neither x nor y can be 0. Thus x, y and are all non-zero.
2
y

2
2
y= y

4
1= 2

= 2
x=

as y = 0

If = 2 then x = y and so x2 = 1, thus x = 1 and so y = 1 and we have two points to


consider (1, 1) and (1, 1).
If, however, = 2 then x = y and x2 = 1, which has no real solutions. Thus the
only points to consider are the two from above. Checking
their distance from the origin we

can see that they are both the minimum distance of 2 from the origin.

Exercise Prove that if x, y > 0 then x > y if and only if x > y.

Chapter 7
Extreme Points and Integration of Functions of Several Variables

7.1

Extrema in a Constrained Domain

We have seen how to nd the extreme points of a function associated with stationary points.
In the last section we saw how to nd the extreme values of a function given a constraint. We
will now consider the general situation of nding extreme points. The good news is that we
dont need to consider Lagrange multipliers here, that is only one method of nding extreme
points. Here are are only interested in describing where such points might be.
In one sense, the places where we might nd extreme points are reasonably obvious.
We know that an extreme point might be a stationary point, that is, a point where f (x) = 0.

However, we might remember from calculus of one variable, that we might also get extreme
points at places where we cant nd a derivative. We can even simplify things here by splitting
the points with no derivative into two types. There are points were there just is no derivative,
for example, the function |x| has no derivative at x = 0. There are also problems with nding
derivatives along the boundaries of the domain. Exactly what we mean by that last statement
will become obvious in our rst example.
7.1 Finding Extreme Points Given a function f dened on a domain D, the extreme
points of f will occur at
(1)
Points where f (x) = 0

(2)
Points where f is not dened
(3)
Points on the boundary of D.
Example Find the extreme points of the function f (x, y) = x2 + y 2 on the domain
D = [1, 2] [2, 1]
that is, D is the region between the lines x = 1, x = 2, y = 2 and y = 1. If we consider
a sketch of this function we can immediately see that by restricting the surface to the given
domain, the largest values are occurring on the edges.
8
6
2

4
1
2
1

0
0

0
1

1
2

We also have an extreme value that lies at a stationary point. To nd these extreme values
we consider each type of point in turn.
 
0
(a)
Stationary points occur when f (x, y) = 0 .


2x
2y

 
=

0
0

Thus, (0, 0) is the only stationary point. As we are nding all extreme points,
we dont need to determine the nature of this point yet. We merely nd the
MATH203: W. N. Franzsen (10/2/2015).

37

38

Advanced Calculus (2014)

function value at this point.


f (0, 0) = 02 + 02 = 0
(b)
(c)

There are no points were the derivative is not dened, apart from the boundary,
and so we dont need to consider this type in this example.
This is where things get messy, although not hard if you are organised. There
are four boundaries we need to consider.
(i)
x = 1 and 2 y 1
(ii) x = 2 and 2 y 1
(iii) 1 x 2 and y = 2
(iv) 1 x 2 and y = 1
(i)
If x = 1 then the function becomes f (1, y) = 1 + y 2 . We want the
extreme points of this function on the interval 2 y 1. We now
repeat the above. The stationary point is at y = 0 and has value
f (1, 0) = 1
There are no points where the derivative is not dened. The end-points
are y = 2 and y = 1 and
f (1, 2) = 5
f (1, 1) = 2
(ii)

If x = 2 then f (2, y) = 4 + y 2 . Repeating the above, the stationary point


is again at y = 0. The values at the stationary point at the end-points
are
f (2, 0) = 4
f (2, 2) = 8
f (2, 1) = 5

(iii)

It is worth noting at this stage that often the functions along the boundaries look quite dierent. We are lucky here that they are so simple.
If y = 2 then f (x, 2) = x2 + 4. Repeating again.
f (0, 2) = 4

(iv)

and we have the values of both end-points already.


Finally
f (0, 1) = 1

We have found 9 candidates for extreme values.


f (0, 0) = 0
f (1, 0) = 1
f (1, 2) = 5
f (1, 1) = 2
f (2, 0) = 4
f (2, 2) = 8
f (2, 1) = 5
f (0, 2) = 4
f (0, 1) = 1
Considering these values the maximum is 8 at the point (on the boundary) (2, 2) and the
minimum is 0 at (0, 0).

Chapter 7

Advanced Calculus (2014)

Example Find the extreme values of the function f (x, y) = 2x 3y + 5 on the domain D = { (x, y) | x2 + y 2 2 }. That is, D is the disk of radius 2 centred at the origin.
 
2
This time we have f (x, y) = 3 = 0 and so there are no stationary points. This

tells us that the extreme points, if any, must lie on the boundary.
To deal with the boundary we could use Lagrange Multipliers or proceed as follows.
The boundary is the circle of radius 2 centred at the origin, we remember polar coordinates.
All the points on the circle have polar coordinates (2 cos , 2 sin ) and so
f (x, y) = 4 cos 6 sin + 5
If we let () = 4 cos 6 sin + 5 then we may nd the extreme points on the boundary
normally, remembering to only consider one cycle, so < .
 () = 4 sin 6 cos
at a stationary point
0 =  () = 4 sin 6 cos
4 sin = 6 cos
3
tan =
2
3
or
4 = arc tan
2
3
2 = arc tan
2
These are angles in the 4th and 2nd quadrants respectively. We could just evaluate these
directly to nd the function values. Better is to use what we know about trigonometric
ratios. You should check that the following are true.
3
sin 2 =
13
2
cos 2 =
13
3
sin 4 =
13
2
cos 4 =
13
Thus, the extreme values occur at the points


4
6
,
and
13
13

6
4
,
13
13

The function values are




4
12
12
24
6
= + +5= +5
f ,
13
13
13
13
13


4
12
12
24
6
= + 5 = + 5
f ,
13
13
13
13
13


Clearly the maximum occurs at 613 , 413 and the minimum at the other point.
Exercise Should we really check the end points as well. That is, = and = ?

39

40

Advanced Calculus (2014)

7.2

Integrating Functions of Several Variables

Having completed our introduction to dierentiation, if we followed the script from a calculus
of one variable unit wed now consider anti-dierentiation. While we could consider antipartial-dierentiation nobody ever does. With functions of several variables virtually all
integrals will be denite integrals. Following the lead from calculus of one variable suppose
we have a function of 2 variables dened on some region R of the plane. As with functions of
one variable we consider a very small rectangle within that region of width dx and depth dy.
If the height of the function at that point is f (x, y) then the volume of the little shape will
be approximately
f (x, y) dx dy
z

f (x, y)
y
dx
dy
x

Obviously, this is just an approximation as the height will be dierent at dierent points
within the little rectangle. But, in the limit, this will be all be sorted out. Adding all these
little volumes will give use the total volume at least it would if we could rely on all the
function values being positive. Just as with areas, this calculation does not always give us
the volume as some terms might be negative. However, regardless of the value, adding these
will always give the integral. We denote the integral of f (x, y) over the region R as

f (x, y) dx dy
R

This leaves a few points to sort out.


(1)
Is there something special about the order in which we do things? That is, could
we have written the above as

f (x, y) dy dx?
R

(2)

How can we convert a region R, that might be quite complicated, into ordinary
limits of integration?
(3)
How do we actually calculate such integrals?
We tackle these points one at a time.
Notation If we have three variable then we get a triple integral

f (x, y, z) dx dy dz
R

and so on.

Chapter 7

7.3

Advanced Calculus (2014)

Fubinis Theorem

As you might guess, Fubinis theorem gives us the answer to our rst question. This theorem
is a surprisingly late addition to calculus being proved by Guido Fubini (18791943) in 1907.
For us, that is ignoring the ddly details, we have the following.
7.2 Fubinis Theorem If f (x, y) is a continuous function dened on the region R then


f (x, y) dx dy =
f (x, y) dy dx
R

In short, as long as we deal with the limits correctly, we may choose the order of
integration. It will turn out that this freedom is a very powerful tool. We will soon meet
integrals that we can only evaluate one way.

7.4

Regions to Limits of Integration

This is a good time to remember what the limits of integration really mean. If we consider
b
the denite integral a f (x) dx then what we really mean is
 x=b
f (x) dx
x=a

This gives us the clue in the cases where our region is nice and simple. For example, if R is
the rectangle [1, 2] [3, 4]
R

Then we can describe R as the region bounded by the lines x = 1, x = 2, y = 3 and y = 4.


This gives us out limits, all we need do is line then up correctly. The way to remember that
is to think of the integral signs and the dx things like brackets. Given the integral

f (x, y) dx dy
the rst integral sign is associated with the dy as they are on the outside, next layer in are
the xs.
 y=??  x=??

f (x, y) dx dy
f (x, y) dx dy =
y=?

So for our region above we have




f (x, y) dx dy =
R

x=?

f (x, y) dx dy
1

Never mix the two, that would be a mistake, just as writing [x + (2 + 3x]2 ) is a mistake.
It is obvious that more complicated regions will have more complicated limits. We will
see later that some regions even need to be cut into pieces for us to be able to determine the
limits. For the moment we will stay with rectangles in order to answer the third question.

41

42

Advanced Calculus (2014)

7.5

Iterated Integrals

The word iterated means to perform repeatedly. Iterated integrals are just that, we integrate
repeatedly, only changing variables as we go. As with partial derivatives, when integrating
with respect to x, say, we treat y and any other variables as if they where constants. (So this
really is partial-anti-dierentiation after all!)
Example Given the rectangle R = [1, 2] [3, 4] and the function f (x, y) = 2x + 3y + 4
evaluate

f (x, y) dx dy
R

As this is a nice rectangle, we may use the above discussion to write down the limits.


f (x, y) dx dy =
R

2x + 3y + 4 dx dy


1
4

=


x2 + 3xy + 4x

3y + 7 dy
3 2
y + 7y
2

4



3 2
3 21
2

x2 + xy dy dx.

xy 2
x y+
2

3

x + xy dy dx =
0

dy

3
= 42 + 28
2
35
=
2
23

(4 + 6y + 8) (1 + 3y + 4) dy

Example Evaluate

2

9
3x2 + x dx
2
0
2

9
= x3 + x2
4
0
=8+9
= 17

dx
0

Chapter 8
Fubinis Theorem and Changing the Order of Integration
Recall Fubinis theorem (7.2): If f (x, y) is continuous on the region R then



f (x, y) dx dy =
R

f (x, y) dy dx
R

As mentioned before, the main problem with demonstrating this is the diculty of converting
the region into limits of integration. We will take things in easy stages. One unlooked-for
benet will be that we will also learn about changing the order of integration as we go.

8.1

Rectangles

In fact the title should be Rectangles with sides parallel to the axes. As we will see, an
absolute requirement will be that parallel to at least one axis we should be able to bound our
region with lines parallel to the axis. But well cross that bridge when we come to it. This is
the simplest case: Given the rectangle R = [a, b] [c, d] we have


f (x, y) dx dy =

f (x, y) dx dy =
c

f (x, y) dy dx
a

This particular case is easily checked, and there will be many examples in the tutorials for
you to try.

8.2

Triangles

Again triangles with one side parallel to an axis. Suppose our region is bounded by the
lines x = 1, y = 2 and y = x.
y=x
2
R

1
Here, the region can be bounded by lines parallel to the x or the y-axes and so
 we may choose
either dx dy or dy dx. Suppose we wish to write this integral in the form . . . dx dy. The
outside limits must be numbers. As the outside integral is with respect to y we must have
lines of the form y = so we draw lines parallel to the x-axis that mark the extreme limits
of our region.
MATH203: W. N. Franzsen (10/2/2015).

43

44

Advanced Calculus (2014)

y=x
2
R
1
1

2
These two lines, namely y = 1 and y = 2 give use the outside limits: 1 . . . dy. Now pick
a y-value that lies in between and consider the x-values as we move along a line at that y-value.
y=x
2
R
1
1
Following the dotted line, it rst enters the region R when x = 1 and it always enters at that
value. So the lower limit of integration will be x = 1. However, the dotted line exits R when
it hits the line y = x, so from the point of view of x the upper limit will be x = y. Thus the x
integral will have limits x = 1 and x = y. Or, more conventionally, our integral becomes
 2 y

f (x, y) dx dy =
f (x, y) dx dy
1

Note If you have been given the region and must work out the limits, one rule is to make sure
that the limits on the outside only contain numbers. The limits inside can contain letters,
but not those on the outside.

Example Evaluate R f (x, y) dx dy where f (x, y) = 2x + 4y and R is the triangular region
above.
 2 y

f (x, y) dx dy =
2x + 4y dx dy
1

1
2

[x2 + 4xy]y1 dy

=
1

y 2 + 4y 2 (1 + 4y) dy

=
1

5y 2 4y 1 dy

=
1

2
5y 3
2
2y y
=
3
 1

5
40
82
21
=
3
3


Chapter 8

Example Evaluate
above.


R

Advanced Calculus (2014)

14
3

f (x, y) dy dx where f (x, y) = 2x + 4y and R is the triangular region

Here we are using the other possible order of integration. Following the steps we can see
2
that x is on the outside so we use the extreme boundaries for the limits. So we have 1 . . . dx
(again, sometimes that happens, usually not). For the limits for y we pick an x-value and
move upwards along that line.
y=x
2
R
1
1
Here the rst time we cross into the region is at y = x and we always leave R at x = 2. Thus
the integral becomes
 2 2
f (x, y) dy dx
1

You should complete the calculation and show that we get the same answer.
Notation If we dont know whether to put dx dy or dy dx then we usually write dA, think
of this as a little bit of area, just like dx is a little bit of x.
Example Considering the region S bounded by the lines y = 1, y = x and y = x 4,
evaluate the integral

2x + xy + 5 dA
S

(2, 2)
(1, 1)

(3, 1)

This time our decision is almost made for us. The only line parallel to an axis is y = 1 so we
put the dy on the outside.


2x + xy + 5 dA =
S

. . . dx dy
1

45

46

Advanced Calculus (2014)

We now move in the x direction


y = x 4
y=x
(2, 2)
S

We are looking for the x-value as the dotted line enters and leaves S, these are on the
lines y = x and y = x 4 respectively. Finding the x-value we nd x = y and x = y 4,
thus the integral is
 2  y4

2x + xy + 5 dA =
. . . dx dy
1

This time we have y in both limits. Completing the calculation




y4

2x + xy + 5 dA =

2x + xy + 5 dx dy
1

x2 y
+ 5x
x +
2

y4

=
1

dy
y

4 + 6y + 4y 2 dy

=


4
= 4y + 3y + y 3
3
43
=
3

2

It is worth the time to check what happens if we try to write this integral using dy dx.
The outside limits are ne



2x + xy + 5 dA =
S

. . . dy dx
1

But the problems start when we try to draw our dotted line if we place it to the left of
the top vertex then we hit the line y = x, otherwise we hit the line y = x 4, but we can
only have one nice expression as out limit of integration. What this is telling us is that this
is not the way to go. Either weve chosen the wrong order, as we know, or we need to split
the integral into two bits. At times we will have to split integrals, but it is something to be
avoided if we can.

8.3

Other Regions

Obviously not all regions will be nice rectangles or triangles. The good news is that the
process weve just seen will work, it might take a bit more eort, but it will work.

Chapter 8

Advanced Calculus (2014)

Example Let T be the region bounded by the line y = 1 and the parabola y = 3x2 + 9x 5
3

13
2, 4

T
(1, 1)

(2, 1)

Here we must use the form dy dx, the limits for x being from x = 1 to x = 2. The dotted
line will enter T at y = 1 and exit on the curve y = 3x2 + 9x 5, thus


3x2 +9x5

f (x, y) dA =

f (x, y) dy dx
1

Example Let C be the upper half of the circle of radius 2 centred at the origin.

The equation of the circle is x2 + y 2 = 4. We note that the limits for x are 2 and 2, while
the limits for y are then 0 and the point on the circle. Here we need the y-value.
x2 + y 2 = 4
y 2 = 4 x2

y = 4 x2
As we are considering the upper half we take y =


4 x2 . Thus the integral becomes

4x2

f (x, y) dA =
C

8.4

f (x, y) dy dx
2

Changing the Order of Integration


To change the order of integration, that is to convert and integral of the form R . . . dx dy
to R . . . dy dx or vice versa now only requires one more skill: Taking the limits of a given
integral and sketching the region.

47

48

Advanced Calculus (2014)

Example Sketch the region of integration R for the integral




3x+1

f (x, y) dy dx
1

We interpret the limits of integration as weve done before, so the limits become
x=1
x=3
y=4
y = 3x + 1
Thus the region is bounded by these four curves.
(3, 10)
y = 3x + 1

R
y=4

Here we can reverse the order of integration. If we have dx dy then the outer limits become y = 4 and y = 10. The right x limit will be 3 while the left limit will be on the
and so
line y = 3x + 1. In terms of x this is the line x = y1
3


3x+1

f (x, y) dy dx =
1

10

3
y1
3

f (x, y) dx dy

Chapter 9
Polar Coordinates, Arc Length and Line Integrals

9.1

Polar Coordinates

You may recall that when we introduce integration we took our small piece of area as a
rectangle, deducing that dA = dx dy in some order. There was nothing that forced us to use
that shape, we only chose a rectangle as they are convenient and easy. Other shapes can
be used but the only commonly used alternative is via polar coordinates. The dierence in
shape is immediately apparent.

dy

dA

dA

d
dx
dA = dx dy = dy dx

r
dr
dA =?

The problem comes when we try to calculate the size of dA using polar coordinates. However,
as we will be taking a limit anyway we use some approximations. Roughly speaking the
region dA is close to a rectangle with height dr and width equal to the arc length, that
is r d. Hence
dA = r dr d = r d dr
It is worth summarising what we know about polar coordinates so that we have one place to
refer to.
9.1 Polar Coordinates All points may be written in Cartesian coordinates, that is (x, y),
or in polar coordinates, that is (r, ).
x = r cos
y = r sin

r = x2 + y 2
y
tan =
x
dx dy = dy dx = r dr d = r d dr

for x = 0

Remembering to be very careful about quadrants when nding the value of .


At rst sight this seems to be a very complicated way of making integrals look even
more complicated. In fact, there are some integrals where converting to polar coordinates
is the only way to proceed. A second look will also suggest that if the region is circular
or involves circular arcs then polar coordinates might be helpful. The rst example will
demonstrate that sometimes polar coordinates are the only way to proceed.
MATH203: W. N. Franzsen (10/2/2015).

49

50

Advanced Calculus (2014)


2
2
Example Evaluate R ex ey dA where R is the upper half of the unit circle centred at the
origin.
 2
You should note that ex dx is one of the integrals that does not have a closed form,
2
that is there is no nice anti-derivative for ex .
The only sneaky trick we use is to convert to polar coordinates. First we consider
the limits. For the unit circle the values of r will run from 0 (at the origin) to 1 on the
circumference. As we only want the upper half the values of will lie between 0 and . We
now consider the integrand (the function we are integrating.
2

ex ey = ex +y
2
= er

We may now convert to polar coordinates and evaluate. Remembering to match the limits
with the correct dthing.
 1
 2 2
2
x y
e e dA =
er r d dr
R

0
1

rer d dr

=


2 
rer 0 dr

rer dr

=
0

1
2
er
=
2
0
e

=
2
2

= (e 1)
2
Remember, this integral could not be evaluated using dx dy.

Example Evaluate the integral R x dA where R is bounded by = 6 , = 4 , r = 1
and r = 3.
Here the form of the region cries out to be evaluated using polar coordinates. We recall
(from 9.1) that x = r cos and so
 4  3

x dA =
r cos r dr d



=

=


1
3

r 2 cos dr d
1

r3
cos
3

3
d
1

26
cos d
3

26 
sin 4
=
6
3

26
2 1

=
3
2
2

13( 2 1)
=
3

Chapter 9

9.2

Advanced Calculus (2014)

Arc Length

We now have some skills with iterated integrals (remember, that means repeated integrals).
It is time to use them to solve some problems that might be important. The problem we
will encounter is that the most useful applications tend to lead to integrals we cant actually
evaluate! For this reason, some of the examples will seem a little contrived. They are! We
only use them because they are the ones for which you can complete the calculation. First of
all we want to calculate the length of curves. Suppose we have a curve, l, we want to know
what the length along the curve from A to B is.

As with much of calculus we solve this problem by cutting the curve into tiny bits, approximating the length of those bits and then adding them up by integration. Here we cut the
arc into bits, that well call dl, and then integrate them, so the total (arc-)length L is
 B
L=
dl
A

To estimate the length of each bit we use Pythagoras


dl

dy

dx

B
It is clear that dl = dx2 + dy 2 , but this would lead to the formula L = A dx2 + dy 2
which doesnt seem to have a dthing! In fact it does, or at least it can have, if we use a bit
of algebra rst. It turns out that there are three related forms, each of which will be useful
in some circumstances.
dl2 = dx2 + dy 2

 2
dy
= 1+
dx2
dx

 2
dy
dl = 1 +
dx
dx
Or we may repeat this but instead taking out a factor of dy 2 .

 2
dx
+ 1 dy
dl =
dy
The third form seems strange at rst, but one example will show its usefulness. We take out
a factor of dt.
 
 2
2
dy
dx
+
dt
dl =
dt
dt
These lead us to three equivalent formulae that may be used to calculate arc-length.

51

52

Advanced Calculus (2014)

9.2
by

Arc-Length

Given an arc l from point A to point B the length of the arc is given


2
dy
L=
1+
dx
dx
A

 B  2
dx
+ 1 dy
=
dy
A

 B  2  2
dy
dx
+
=
dt
dt
A


dt

As an example of how we may set up these calculations we will consider the length
along the parabola y = x2 from (0, 0) to (2, 4). We will quickly see that setting up the
calculation is the least of our worries. Using the rst form of the arc-length we nd


L=


1+

0
2

dy
dx

2

1 + (2x)2

dx
dx

In two steps we have reduce the calculation to a single integral. Sadly, we cannot easily evalu
ate this integral. We could try repeating this using the second formula instead. Here x = y
1
= 2
and we nd
and so dx
dy
y
 4
1
+ 1 dy
L=
4y
0
again an awkward integral. When setting examples we must be very careful to ensure they
can actually be evaluated. For this reason, the curves whose lengths we nd will not be
standard ones.
Exercise Conrm, by evaluating eitherof the above integrals, that the length of arc along the
4
. (For the record, this is approximately
parabola y = x2 from (0, 0) to (2, 4) is 17 + arc sinh
4
equal to 4.65.)
Example Find the length of the curve y 3 = 94 x2 from (0, 0) to (1, 1). (Clearly this has been

3
chosen to ensure we can complete the calculation. We rst observe that x = 23 y 3 = 23 y 2
1
2
and so dx
dy = y .
 1
1 + y dy
L=
0

We let u = 1 + y so du = dy. At y = 0, u = 1 and at y = 1, u = 2.




L=


1+y

du

2
2 3
2
u
=
3
1
2
= ( 8 1)
3


dy

L, length 1.219

Chapter 9
2

Advanced Calculus (2014)

Example The Astroid is the curve with equation x 3 + y 3 = 1.

Rather than attempting to use the given equation we will instead use the parameterisation
x = cos3 t
y = sin3 t
and will nd the length of the astroid. First we observe that the length will be 4 times the
length in the rst quadrant. We do this so that both sin t and cos t are positive.


L=
0

=4


=4
=4

=4
=6

2  2
dy
dx
+
dt
dt
dt
 
 2
2
dy
dx
+
dt
dt
dt

(3 cos2 t sin t)2 + (3 sin2 t cos t)2


dt


9 cos2 t sin2 t(cos2 t + sin2 t) dt

3 cos t sin t 1 dt

as cos t > 0 and sin t > 0

2 cos t sin t dt

sin 2t dt

=6
0



= 3 cos 2t 02
=6

9.3

Line Integrals

A reasonable comment on the last section is that it didnt involve iterated integrals. While
true, the last example was an example of a line integral. The classic example used to introduce
line integrals is to imagine a piece of wire that has dierent densities along its length. Can
we calculate its mass? In mathematical terms, if we have an arc L and a function f , can we
add up the values of the function along the arc? The trick, as always, is to cut the arc into
little bits, dl, multiply those little bits by the function values and then add them up. Thus
we have the basic form of a line integral.

53

54

Advanced Calculus (2014)

9.3

Line Integrals Given a curve L and a function f (x), the line integral is given by


f (x) dl

Most of the time we will be working


 with curves that are dened using parameters.
Thus, the points on L will have the form x(t), y(t), z(t) for some parameter t, thus the line
integral will become



f x(t), y(t), z(t) (x (t))2 + (y  (t))2 + (z  (t))2 dt
L

Obviously, if you only have 2 dimensions then you can ignore the z terms.

Example Evaluate L 2x y 2 dl along the straight line joining the origin to the point (1, 2).
To evaluate this we need to nd parameters for the straight line. One way is to nd
the equation of the line, y = 2x, as it happens, and just let x = t. Then y = 2t and we have
our parameters. For simple curves this is good enough. The curve L runs from t = 0 to t = 1
and so
 1


2x y dl =
(2t (2t)2 ) x (t)2 + y  (t)2 dt
L

0
1

=
0

(2t 4t2 ) 1 + 2 dt


1
4 3
= 3 t t
3 0



4
= 3 1
3

3
=
3
Notation You should note that although Im using dl for a little bit of length, this is not
the only notation around. Many, indeed most, books use ds.
The above describes line integrals with respect to arc-length. It is possible to dene
line integrals with respect to x and y and so on. So, for example, the line integral of f along
the curve L with respect to x is




f (x, y, x) dx =
f x(t), y(t), z(t) x (t) dt

and similarly for the integrals with respect to other coordinates. This leads to one piece of
notation that sometimes worries people. Suppose we wish to evaluate the sum of integrals



M dx +
N dy =
M dx + N dy
L
L
L
   
M
dx
if we observe that N dy = M dx + N dy we write this as
  


M
M dx + N dy =
(M i + N j ) dl

dl
=
N

L
L
L

Final Note Sometimes the curve we are interested in actually forms a closed loop. For

example, consider the astroid we met earlier. In those cases we sometimes use the symbol
to indicate that the curve is closed. You should be aware that this is not really necessary, but
it does remind us of something that is occasionally very important. Namely, that the curve
starts and ends at the same point. Thus, the line integral in this case would be written as

f (x, y, z) dl
L

The most important thing is not to be intimidated by this notation. Nothing mysterious, the
curve just returns to the starting point.

Chapter 10
Vector Fields, Greens Theorem and Surface Integrals

10.1 Vector Fields


These sound much more impressive than they really are. In one sense they are just the next
obvious step in our journey in calculus. We started our study of calculus by considering
functions of a single variable that have real number values. In notation, these are functions
of the form
f :RR
So far in this unit we have considered functions of several variables, usually 2, that have real
number values. That is, we have considered functions of the form
f : Rm R
usually with m = 2. The next step is now reasonably obvious, now that our functions start
with several coordinates why shouldnt they return several coordinates. This is exactly what
vector elds are:
10.1 Vector Field A vector eld is a function
f : Rm Rn
We will not consider such things in their full glory, but will usually restrict m and n
to be 2 or 3. A simple example will show where the vector eld name comes from.
Example Consider the vector eld f : R2 R2 where
 
x
f (x, y) = y
Notice that Im deliberately using vector notation here. I dont need to, but it helps if we keep
the domain and codomain separate. What this function does is associate a vector, f (x, y),
with every point, (x, y), in the plane. We can illustrate this by drawing the vectors starting
from a few relevant points.

MATH203: W. N. Franzsen (10/2/2015).

55

56

Advanced Calculus (2014)

Of course this is a fairly simple vector eld, below is a slightly more complicated example.

You should also remember the alternative way of writing these function values. In many
situations it will be convenient to write, for example,
f (x, y) = (2x + 3)i + (cos x 8)j + 3k

In fact we have already


met
such
a
function.
Given
the
function f : R2 R,

f (x,y)
then f (x, y) = fxy (x,y) is a function from R2 to R2 . This leads to an equivalent to
the ordinary Fundamental Theorems of Calculus.
10.2 Theorem Given a function f : R2 R and a path C from the point a to the point b,

we have

f dl = f (b) f (a)

C
In actual fact there are some conditions on the function and path in the above theorem,
but those are unimportant for us in this unit. One special case to consider, however, is what
happens when the curve C is closed, that is, when a = b. It is clear that the right hand side
theorem

is equal to 0. Thus, if our function satises the above


then we have

f dl = 0

C
This fact turns out to be extremely important in many physical applications. If we have
a vector eld that can be written in the form f for some function f then we know that
integrals of the above form around closed paths are always equal to 0. This can be used to
show that for such functions, the actual path you follow is unimportant, all that matters is
where you started from and where you ended your journey. You may meet such things in
later applied mathematics units you undertake.
Of course, in many cases the integral around a closed curve will not be 0. Some would
even say that those are the interesting cases. However, calculating such integrals can be a
nuisance. Consider the path formed by the perimeter of the square [0, 1] [0, 1]. There are
four parts to this path so if we are to calculate the integral along this path we need four
separate sets of parameters. The following is one possible set.
(1)
y = 0, x = t for 0 t 1
(2)
x = 1, y = t for 0 t 1
(3)
y = 1, x = 1 t for 0 t 1
(4)
x = 0, y = 1 t for 0 t 1
We would then need to calculate four separate integrals. This can get messy, very quickly.
Thankfully, Greens theorem gives us a way to convert a path integral, around a closed path,
into an iterated integral.

Chapter 10

Advanced Calculus (2014)

10.3 Greens Theorem Given a closed path L and functions M and N (with some
conditions on all of these). If we let R be the region enclosed by the path L then we have

  N
M

dA
M dx + N dy =
x
y
L

This gives us a much quicker way of evaluating the integral around the square above.
Instead of calculating four separate integrals, we can simply calculate one iterated inte11
gral: 0 0 . . . dA. (Saving two integrations!) However, there are situations when evaluating
the contour integral is quicker. For example, if the curve was a circle, there is likely to be
a single integral to evaluate, rather than the two that the equivalent iterated integral would
require.
Example Using the square L from above, evaluate the integral

(x + 3y) dx + (x2 5y) dy
L

directly as well as via Greens Theorem.


We rst evaluate the path integral along each section. Call the sections L1 , L2 and so on.
(1)
Along y = 0, x = t for 0 t 1 we have y  = 0 and x = 1


(x + 3y) dx + (x 5y) dy =

(t + 0)1 dt + (t2 0)0 dt

L1

t2
2

1
0

1
=
2
(2)

Along x = 1, y = t for 0 t 1 we have x = 0 and y  = 1




(x + 3y) dx + (x2 5y) dy =


L2

(1 + 3t)0 dt + (1 5t)1 dt


5t2
= t
2
5
=1
2
3
=
2
(3)

1
0

Along y = 1, x = 1 t for 0 t 1 we have y  = 0 and x = 1





(x + 3y) dx + (x 5y) dy =
L3

(1 t + 3)(1) dt + 0 dt

t2
4t
=
2
1
= 4
2
7
=
2

1
0

57

58

Advanced Calculus (2014)

(4)

Finally, along x = 0, y = 1 t for 0 t 1 we have x = 0 and y  = 1


 1



2
(x + 3y) dx + (x 5y) dy =
0 dt + 0 5(1 t) (1) dt
L4

5t2
= 5t
2
5
=5
2
5
=
2

1
0


(x + 3y) dx + (x 5y) dy =
2

(x + 3y) dx + (x2 5y) dy


L1

(x + 3y) dx + (x2 5y) dy
+
L
 2
(x + 3y) dx + (x2 5y) dy
+
L3

(x + 3y) dx + (x2 5y) dy
+
L4

1 3 7 5
= +
2 2 2 2
= 2
We now conrm this using Greens Theorem. In the integral

(x + 3y) dx + (x2 5y) dy
L

we have M = x + 3y and so
Theorem we have

N
M
= 3, and N = x2 5y giving
= 2x, thus using Greens
y
x


(x + 3y) dx + (x2 5y) dy =
L


R

2x 3 dA


2x 3 dx dy

=


0
1

=


x2 3x

1
0

dy

2 dy

=
0

= [2y]10
= 2
And the two agree, as expected.

10.2 Surface Integrals


In the same that way we can integrate a function along a line, it is possible to integrate a
function over a surface. An example of a surface might be the top half of a sphere, or other
more complicated things. Also as with line integrals, the basic idea of a surface integral relies
on how we might calculate surface area. By a process very similar to the one we used for
nding arc-length we can nd the area of a surface.

Chapter 10

Advanced Calculus (2014)

10.4 Surface Area Given a surface z = h(x, y), the area of that part of the surface that
lies above the region R is given by


 2  2
 2  2


h
h
z
z
1+
+
dA =
1+
+
dA
A=
x
y
x
y
R

10.5 Surface Integral Suppose we have a surface S dened by z = h(x, y) over a region R.
The integral of the function f (x, y, z) over this surface, S, is given by

 2  2

 

h
h
f (x, y, z) dS =
f x, y, h(x, y) 1 +
+
dA
x
y
S

Example Find the surface area of the plane x + y + z = 1 that lies above the triangle formed
by the origin (1, 0) and (0, 1). (Another way of phrasing this would be to ask for the area of
that part of this plane the lies in the rst octant.)
Here we have h(x, y) = 1 x y and so hx (x, y) = 1 = hy (x, y). You can also check
that the limits for the region we are interested in are 0 x 1 and 0 y 1 x. Thus the
surface area is
 1  1x 
1 + (1)2 + (1)2 dy dx
A=
0


= 3

0
1

1x

dy dx
0

 1 1
[x]0 x dx
= 3

= 3

0
1

1 x dx
0

1
x2
= 3 x
2 0

3
=
2
Exercise Sketch this surface and use geometry/trigonometry to conrm that this is the area
of this triangle.
Notation We have met expressions of the form M dx + N dy before, specically in the
lead-up to Greens Theorem. If we dene the function F (x, y) = M (x, y)i + N (x, y)j and we

write dr = dx i + dy j then we can see that

F dr = M dx + N dy

Although these look a bit mysterious, it is just another piece of notation.


Another bit of notation is to use the fact that

f
x

f (x, y) =
f
y

x
and use it as a vector. So
to let =

y
f
x
=f
f (x, y) =
f
y

59

60

Advanced Calculus (2014)

Finally, it is possible (at least in the cases we might meet) to consistently dene a
normal to the surface at any point. We usually denote that normal by n. Remember, that
this normal is a function of position, the normal to a surface will point indierent directions
from dierent points on the surface.
We now have enough notation to state Stokes Theorem. Sadly, as will many theorems,
this is known as Stokes theorem because Sir George Stokes publicised the result. It was rst
proved by Lord Kelvin (William Thomson).
10.6 Stokes Theorem If F is a function dened on a surface S whose edge is the path C
then


F dr =
F n dS

C
S
Just for completeness we will state one last theorem. We have some experience with
line integrals, and have just met surface integrals. As you might now expect we can dene
volume integrals. And, you now wont be surprised to learn there is an equivalent to Greens
and Stokes theorems.
10.7 Gausss Divergence Theorem If the region (volume) D is enclosed by the surface S
then


F n dS =
F dV

S
D

You might also like