0% found this document useful (0 votes)
17 views126 pages

Calculus Blank

Uploaded by

Lennon Turner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views126 pages

Calculus Blank

Uploaded by

Lennon Turner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 126

CERTIFICATE IN

FINANCE

CQF

Certificate in Quantitative Finance


June 2012
Subtext to go here

GLOBAL STANDARD IN FINANCIAL ENGINEERING


A4 PowerPoint cover landscape2.indd 1 21/10/2011 10:53
Maths Primer
This is a revision course designed to act as a mathematics refresher. The
volume of work covered is signi…cantly large so the emphasis is on working
through the notes and problem sheets. The four topics covered are

Calculus

Linear Algebra

Di¤erential Equations

Probability & Statistics

Page 1
1 Introduction to Calculus

1.1 Basic Terminology

We begin by de…ning some mathematical shorthand and number systems

9 there exists ! which gives equivalent


8 for all s.t such that similar
) therefore : such that 2 an element of
* because i¤ if and only if !x a unique x

Page 2
Natural Numbers N = f0; 1; 2; 3; :::::g
Integers ( N) Z = f0; 1; 2; 3; :::::g
n o
p 1;
Rationals q: p; q 2 Z; Q = 0:76; 2:25; 0:3333333::::
2
np o
Irrationals Q = 2; 0:01001000100001:::; ; e
Reals R all the above
n p o
Complex C = x + iy : i = 1

Page 3
(a; b) = a < x < b open interval

[a; b] = a x b closed interval

(a; b] = a < x b semi-open/closed interval

[a; b) = a x<b semi-open/closed interval

So typically we would write x 2 (a; b) :

Examples

1 < x<1 ( 1; 1)
1 < x b ( 1; b]
a x<1 [a; 1)

Page 4
1.2 Functions

This is a term we use very loosely, but what is a function? Clearly it is a type of
black box with some input and a corresponding output. As long as the correct
result comes out we usually are not too concerned with what happens ’inside’.

A function denoted f (x) of a single variable x is a rule that assigns each ele-
ment of a set X (written x 2 X ) to exactly one element y of a set Y (y 2 Y ) :

A function is denoted by the form y = f (x) or x 7! f (x) :

We can also write f : X ! Y; which is saying that f is a mapping such that


all members of the input set X are mapped to elements of the output set Y:
So clearly there are a number of ways to describe the workings of a function.

For example, if f (x) = x3; then f ( 2) = 23 = 8:

Page 5
30

20

10

0
-4 -3 -2 -1 0 1 2 3 4

-10

-20

-30

We often write y = f (x) where y is the dependent variable and x is the


independent variable.

Page 6
The set X is called the domain of f and the set Y is called the image (or
range), written Domf and Im f; in turn. For a given value of x there should
be at most one value of y . So the role of a function is to operate on the
domain and map it across uniquely to the range.

So we have seen two notations for the same operation.

The …rst y = f (x) suggests a graphical representation whilst the second


f : X ! Y establishes the idea of a mapping.

Page 7
There are three types of mapping:

1. For each x 2 X; 9 one y 2 Y: This is a one to one mapping (or 1 1


function) e.g. y = 3x + 1:

2. More than one x 2 X; gets mapped onto one y 2 Y: This is a many to


one mapping (or many 1 function) e.g. y = 2x2 + 1; because x = 2
yields one y:

p
3. For each x 2 X; 9 more than one y 2 Y; e.g. y = x: This is a many
to one mapping. Clearly it is multivalued, and has two branches. We will
assume that only the positive value is being considered for consistency with
the de…nition of a function. A one to many mapping is not a function.

Page 8
The function maps the domain across to the range. What about a process
which does the reverse? Such an operation is due to the inverse function which
maps the image of the original function to the domain. The function y = f (x)
has inverse x = f 1 (y ) : Interchange of x and y leads to consideration of
y = f 1 (x) :

The inverse function f 1 (x) is de…ned so that

f f 1 (x) = x and f 1 (f (x)) = x:

p
Thus x2 and x are inverse functions and we say they are mutually inverse.
p
Note the inverse x is multivalued unless we de…ne it such that only non-
negative values are considered.

Example 1: What is the inverse of y = 2x2 1:

Page 9
i.e. we want y 1: One way this can be done is to write the function above as

x = 2y 2 1
and now rearrange to have y = :::: so
s
x+1
y= :
2
s
1 (x) x+1
Hence y = : Check:
2
0s 12
x + 1A
yy 1 (x) = 2 @ 1 = x = y 1y (x)
2

Example 2: Consider f (x) = 1=x; therefore f 1 (x) = 1=x

Domf = ( 1; 0) [ (0; 1) or R f0g

Page 10
Returning to the earlier example
y = 2 x2 1
clearly Domf = R (clearly) and for
s
1 (x) x+1
y =
2
to exist we require the term inside the square root sign to be non-negative, i.e.
x+1 0 =) x > 1; therefore Domf = f[ 1; 1)g :
2

An even function is one which has the property


f ( x) = f (x)
e.g. f (x) = x2:

f (x) = x3 is an example of an odd function because


f ( x) = f (x) :
Most functions are neither even nor odd but every function can be expressed
as the sum of an even and odd function.

Page 11
1.2.1 Explicit/Implicit Representation

When we express a function as y = f (x) ; then we can obtain y corresponding


to a (known) value of x: We say y is an explicit function. All known terms
are on the right hand side (rhs) and unknown on the left hand side (lhs). For
example
y = 2 x2 + 4 x 16 = 0

Occasionally we may write a function in an implicit form f (x; y ) = 0; al-


though in general there is no guarantee that for each x there is a unique y .
A trivial example is y x2 = 0;which in its current form is implicit. Simple
rearranging gives y = x2 which is explicit:

A more complex example is 4y 4 2y 2x2 yx2 + x2 + 3 = 0:

This can neither be expressed as y = f (x) or x = g (y ) :

Page 12
So we see all known and unknown variables are bundled together. An implicit
form which does not give rise to a function is

y 2 + x2 16 = 0:

This can be written as


q
y= 16 x2 :
and e.g. for x = 0 we can have either y = 4 or y = 4; i.e. one to many.

Page 13
1.2.2 Types of function f (x)

Polynomials are functions which involve powers of x;

y = f (x) = a0 + a1x + a2x2 + :::::


:: + an 1xn 1 + anxn:
The highest power is called the degree of the polynomial - so f (x) is an nth
degree polynomial. We can express this more compactly as
n
X
f (x) = a k xk
k=0
where the coe¢ cients of x are constants.

Polynomial equations are written f (x) = 0; so an nth degree polynomial


equation is

anxn + an 1xn 1 + :::::: + a2x2 + a1x + a0 = 0:

Page 14
k = 1; 2 gives a linear and quadratic in turn. The most general form of
quadratic equation is
ax2 + bx + c = 0:
To solve we can complete the square which gives
b 2 b2 c
x+ 2a 4a2
+ = 0
a
b 2 b2 c b2 4ac
x + 2a = 4a2 = 4a2
p a
b = b2 4ac
x + 2a 2a
and …nally we get the well known formula for x
p
b b2 4ac
x= :
2a

There are three cases to consider:

(1) b2 4ac > 0 ! x1 6= x2 2 R : 2 distinct real roots

Page 15
b
(2) b2 4ac = 0 ! x = x1 = x2 = 2 R : one two fold root
2a

(3) b2 4ac < 0 ! x1 6= x2 2 C Complex conjugate pair

Page 16
1.2.3 The Modulus Function

Sometimes we wish to obtain the absolute value of a number, i.e. positive part.
For example the absolute value of 3:9 is 3:9: In maths there is a function
which gives us the absolute value of a variable x called the modulus function,
written jxj and de…ned as
(
x x>0
y = jxj = ;
x x<0
although most de…nitions included equality in the positive quadrant.

modulus function

3.5

2.5

1.5

0.5

-4 -3 -2 -1 0 1 2 3 4

Page 17
This is an example of a piecewise function.

The name is given because they are functions that comprise of ’pieces’, each
piece of the function de…nition depends on the value of x.

So, for the modulus, the …rst de…nition is used when x is non-negative and the
second if x is negative.

Page 18
1.3 Limits

Choose a point x0 and function f (x) : Suppose we are interested in this


function near the point x = x0: The function need not be de…ned at x = x0:
We write f (x) ! l as x ! x0; "if f (x) gets closer and closer to l as x
gets close to x0". Mathematically we write this as

lim f (x) ! l;
x!x0

if 9 a number l such that

Whenever x is close to x0

f (x) is close to l:

Page 19
The limit only exists if

f (x) ! l as x ! x0
f (x) ! l as x ! x+
0

Let us have a look at a few basic examples and corresponding "tricks" to


evaluate them

Example 1:

lim x2 + 2x + 3 ! 0 + 0 + 3 ! 3;
x!0

Page 20
Example 2:
x2 + 2x 2
x2 + 2x + 2 x2 x 2 + x2
lim = lim =
x!1 3x2 + 4 x!1 3x2 + 4
x2 x2
1 + x2 + x22 1
lim ! :
x!1 3 + x42 3

Example 3:
x2 9 (x + 3) (x 3)
lim = lim = lim (x + 3) ! 6
x!3 x 3 x!3 (x 3) x!3

Page 21
A function f (x) is continuous at x0 if

lim f (x) = f (x0) :


x!x0

That is, ’we can draw its graph without taking the pen o¤ the paper’.

Page 22
1.3.1 The exponential and log functions

The logarithm (or simply log) was introduced to solve equations of the form

ap = N
and we say p is log of N to base a: That is we take logs of both sides (loga)

loga ap = loga N
which gives
p = loga N:
By de…nition loga a = 1 (important).

We will often need the exponential function ex and the (natural) logarithm
loge x or (ln x) :

Page 23
Here
e = 2:718281828 : : : :
which is the approximation to
1 n
lim 1 +
n!1 n
when n is very large. Similarly the exponential function can be approximated
from
x n
lim 1 +
n!1 n

ln x and ex are mutual inverses:

log (ex) = elog x = x:

Page 24
Also

1 x:
= e
ex
Here we have used the property (xa)b = xab; which allowed us to write
1 = (ex ) 1 = e x :
ex

Their graphs look like this:

Exponential Functions logx and lnx

8 2

7 1.5

6 1
exp(x) and (exp(-x)

5 0.5

4 0

3 -0.5 0 1 2 3 4 5

2 -1

1 -1.5

0
-2
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 -2.5
x x

Page 25
Note that ex is always strictly positive. It tends to zero as x becomes very
large and negative, and to in…nity as x becomes large and positive. To get
an idea of how quickly ex grows, note the approximation e5 t 150:

2
Later we will also see e x =2; which is particularly useful in probability: This
function decays particularly rapidly as jxj increases.

Note:

exey = ex+y ; e0 = 1

(recall xa:xb = xa+b) and

log (xy ) = log x + log y; log (1=x) = log x; log 1 = 0:

Page 26
!
x
log = log x log y:
y

Dom (ex) = R; Im (ex) = (0; 1)


Dom (ln x) = (0; 1) ; Im (ln x) = R

Example:

lim e x ! 0; lim ex ! 1; lim ex ! e0 = 1:


x!1 x!1 x!0

Page 27
1.3.2 Trigonometric/Circular Functions

sinx and cosx

1.5

0.5

0
-8 -6 -4 -2 0 2 4 6 8

-0.5

-1

-1.5

sin x is an odd function, i.e. sin ( x) = sin x:

It is periodic with period 2 : sin (x + 2 ) = sin x. This means that after


every 360 it repeats itself.

sin x = 0 () x = n 8n 2 Z

Page 28
Dom (sin x) =R and Im (sin x) = [ 1; 1]

cos x is an even function, i.e. cos ( x) = cos x:

It is periodic with period 2 : cos (x + 2 ) = cos x.

cos x = 0 () x = (2n + 1) 2 8n 2 Z

Dom (cos x) =R and Im (cos x) = [ 1; 1]

sin x
tan x =
cos x

This is an odd function: tan ( x) = tan x

Periodic: tan (x + ) = tan x

Page 29
n o n o
Dom = fx : cos x 6= 0g = x : x 6= (2n + 1) 2 ; n 2 Z = R (2n + 1) 2 ; n 2 Z

Trigonometric Identities:
cos2 x + sin2 x = 1; sin (x y ) = sin x cos y cos x sin y
tan x + tan y
cos (x y ) = cos x cos y sin x sin y ; tan (x + y ) =
1 tan x tan y
Exercise: Verify the following sin x + 2 = cos x; cos 2 x = sin x:

The reciprocal trigonometric functions are de…ned by


1 1 1
sec x = ; csc x = ; cot x =
cos x sin x tan x

Page 30
More examples on limiting:

sin x
lim sin x ! 0; lim ! 1; lim jxj ! 0
x!0 x!0 x x!0
jxj
What about lim ?
x!0 x

jxj
lim = 1
x!0 x
+
jxj
lim = 1
x!0 x
jxj
therefore does not tend to a limit as x ! 0:
x

Page 31
Hyperbolic Functions
1 x
sinh x = e e x
2
Odd function: sinh ( x) = sinh x

Dom (sinh x) =R; Im (sinh x) = R

Page 32
1 x
cosh x = e +e x
2

Even function: cosh ( x) = cosh x

Dom (cosh x) =R; Im (cosh x) = [1; 1)

Page 33
sinh x
tanh x =
cosh x
Dom (tanh x) =R; Im (tanh x) = ( 1; 1)

Identities:
cosh2 x sinh2 x = 1
sinh (x + y ) = sinh x cosh y + cosh x sinh y
cosh (x + y ) = cosh x cosh y + sinh x sinh y

Page 34
Inverse Hyperbolic Functions
exp y exp( y)
y = sinh 1 x ! x = sinh y = 2 ;

2x = exp y exp ( y )

multiply both sides by exp y to obtain 2xey = e2y 1 which can be written
as
(ey )2 2x (ey ) 1 = 0:

This gives us a quadratic in ey therefore


p q
2x 4x2 + 4
ey = =x x2 + 1
2
p p
Now x2
+ 1 > xp
=) x x2 + 1 < 0 and we know that ey > 0 therefore
we have ey = x + x2 + 1: Hence taking logs of both sides gives us
q
sinh 1 x = ln x + x2 + 1

Page 35
Dom sinh 1 x =R; Im sinh 1x =R

exp y+exp( y)
Similarly y = cosh 1 x ! x = cosh y = 2 ;

2x = exp y + exp ( y ) and again multiply both sides by exp y to obtain

(ey )2 2x (ey ) + 1 = 0:
and
q
ey = x + x2 1

Page 36
We take the positive root (not both) to ensure this is a function.
q
cosh 1 x = ln x + x2 1

Dom cosh 1x =[1; 1); Im cosh 1x = [0; 1)

We …nish o¤ by obtaining an expression for tanh 1 x: Put y = tanh 1 x !


exp y exp ( y )
x = tanh y = ;
exp y + exp ( y )

x exp y + x exp ( y ) = exp y exp ( y )

Page 37
and as before multiply through by ey

x exp 2y + x = exp 2y 1
1+x
exp 2y (1 x) = 1 + x ! exp 2y =
1 x
taking logs gives
1+x 1+x
2y = ln =) tanh 1 x = 12 ln
1 x 1 x
Dom tanh 1x = ( 1; 1) ; Im tanh 1x =R

Page 38
1.4 Di¤erentiation

A basic question asked is how fast does a function f (x) change with x? The
derivative of f (x) ; written

df
: Leibniz notation
dx
or
f 0 (x) : Lagrange notation,
is de…ned for each x as

f (x + x) f (x)
f 0 (x) = lim
x!0 x
assuming the limit exists (it may not) and is unique.

Page 39
f (x+ x) f (x)
The term on the right hand side x is called Newton quotient.

Di¤erentiability implies continuity but converse does not always hold.

There is another notation for a derivative due to Newton, if a function varies


with time, i.e. y = y (t) then a dot is used

y
We can also de…ne operator notation due to Euler. Write
d
D :
dx
df
Then D operates on a function to produce its derivative, i.e. Df dx :

Page 40
The earlier form of the derivative given is also called a forward derivative.
Other possible de…nitions of the derivative are
1
f 0 (x) = lim (f (x) f (x x)) backward
x!0 x
1
f 0 (x) = lim (f (x + x) f (x x)) centred
x!0 2 x

Example: Di¤erentiating x3 from …rst principles:

f (x) = x3
f (x + x) = (x + x)3 = x3 + x3 + 3x x (x + x)
f (x + x) f (x) x3 + 3x x (x + x)
= = x2 + 3x2 + 3x x
x x
! 3x2 as x ! 0;

Page 41
d n d x d ax
x = nxn 1; e = ex; e = aeax;
dx dx dx
d 1 d d d
log x = ; cos x = sin x; sin x = cos x; tan x = sec2 x
dx x dx dx dx
and so on. Take these as de…ned (standard results).

Examples:

f (x) = x5 ! f 0 (x) = 5x4


g (x) = e3x ! g 0 (x) = 3e3x = 3g (x)

Page 42
Linearity: If and are constants and y = f (x) + g (x) then

dy d
= ( f (x) + g (x)) = f 0 (x) + g 0 (x) :
dx dx

Thus if y = 3x2 6e 2x then

dy=dx = 6x + 12e 2x:

Page 43
1.4.1 Product Rule

If y = f (x) g (x) then

dy
= f 0 (x) g (x) + f (x) g 0 (x) :
dx
Thus if y = x3e3x then

dy=dx = 3x2e3x + x3 3e3x = 3x2 (1 + x) e3x:

Page 44
1.4.2 Function of a Function Rule

Di¤erentiation is often a matter of breaking a complicated problem up into


simpler components. The function of a function rule is one of the main ways
of doing this.

If y = f (g (x)) then

dy
= f 0 (g (x)) g 0 (x) :
dx

2
Thus if y = e4x then

2 2
dy=dx = e4x 4:2x = 8xe4x :

Page 45
So di¤erentiate the whole function, then multiply by the derivative of the
"inside" (g (x)) :

Another way to think of this is in terms of the chain rule.

Write y = f (g (x)) as

y = f (u) ; u = g (x) :
Then

dy d du d
= f (u) = f (u) = g 0 (x) f 0 (u)
dx dx dx du
0 0
= g (x) f (g (x)) :
Symbolically, we write this as

Page 46
dy du dy
=
dx dx du
provided u is a function of x alone.
2
Thus for y = e4x ; write u = 4x2; y = eu: Then
dy du dy 4x 2
= = 8xe :
dx dx du
Further examples:

y = sin x3
y = sin u; where u = x3
y 0 = cos u:3x2 ! y 0 = 3x2 cos x3
y = tan2 x : this is how we write (tan x)2 so put
y = u2 where u = tan x
y 0 = 2u: sec2 x ! y 0 = 2 tan x sec2 x

Page 47
y = ln sin x: Put u = sin x ! y = ln u
dy 1 du
= ; = cos x
du u dx
hence y 0 = cot x:

dy
Exercise: Di¤erentiate y = log tan2 x to show = 2 sec x csc x
dx

Page 48
1.4.3 Quotient Rule

f (x)
If y = then
g (x)

dy g (x) f 0 (x) f (x) g 0 (x)


= 2
:
dx (g (x))

Thus if y = e3x=x2;

dy x23e3x 2xe3x 3x 2 3x
= = e :
dx x4 x3

This is a combination of the product rule and the function of a function (or
chain) rule. It is very simple to derive:

Page 49
f (x)
Starting with y = and writing as y = f (x) (g (x)) 1 we apply the
g (x)
product rule
dy df 1 d
= (g (x)) + f (x) (g (x)) 1
dx dx dx
Now use the chain rule on (g (x)) 1 ; i.e. write u = g (x) so

d du d
(g (x)) 1 = u 1 = g 0 (x) u 2
dx dx du
g 0 (x)
= 2
:
g (x)
Then

dy 1 df g 0 (x) f 0 (x) f (x) g 0 (x)


= f (x) 2
= 2
:
dx g (x) dx g (x) g (x) g (x)

Page 50
To simplify we note that the common denominator is g (x)2 hence
dy g (x) f 0 (x) f (x) g 0 (x)
= 2
:
dx g (x)
Examples:
d x d x x d
(xe ) = x (e ) + e (x)
dx dx dx
x x x
= xe + e = e (x + 1) ;

d x x (ex)0 ex (x)0 xex ex


(e =x) = 2
=
dx (x) x2
ex
= 2 (x 1) ;
x
d 2 d u
e x = (e ) where u = x2 ) du = 2xdx
dx dx
x 2
= ( 2x) e :

Page 51
1.4.4 Implicit Di¤erentiation

Consider the function


y = ax
where a is a constant. If we take natural log of both sides

ln y = x ln a
and now di¤erentiate both sides by applying the chain rule to the left hand
side
1 dy
= ln a
y dx
dy
= y ln a
dx
and replace y by ax to give
dy
= ax ln a:
dx

Page 52
This is an example of implicit di¤erentiation.

We could have obtained the same solution by initially writing ax as a combi-


nation of a log and exp
y = exp (ln ax) = exp (x ln a)
0 d x ln a x ln a d
y = e =e (x ln a)
dx dx
x
= a ln a:
Consider the earlier implicit function given by
4y 4 2y 2x2 yx2 + x2 + 3 = 0:
The resulting derivative will also be an implicit function. Di¤erentiating gives
16y 3y 0 2 2yy 0x2 + 2y 2x y 0x2 + 2xy = 2x
16y 3 2yx2 x2 y 0 = 2x + 4y 2x + 2xy
2x + 4y 2x + 2xy
y0 =
16y 3 2yx2 x2

Page 53
1.4.5 Higher Derivatives

These are de…ned recursively;


d2f d df
f 00 (x)
= 2
=
dx dx dx !
000 d 3f d d2f
f (x) = =
dx3 dx dx2
and so on. For example:
0
f (x) = 4x3 ! f (x) = 12x2 ! f 00 (x) = 24x
f 000 (x) = 24 ! f (iv) (x) = 0:
so for any nth degree polynomial

f (x) = anxn + an 1xn 1 + ::::::: + a1x + a0


we have f (n+1) (x) = 0:

Page 54
Consider another two examples
f (x) = ex
f 0 (x) = ex ! f 00 (x) = ex
...
f (n) (x) = ex = f (x) :

g (x) = log x ! g 0 (x) = 1=x


g 00 (x) = 1=x2 ! g 000 (x) = 2=x3:
Warning

Not all functions are di¤erentiable everywhere. For example, 1=x has the
derivative 1=x2 but only for x 6= 0:

1
Easy way is to "look for a hole", e.g. f (x) = does not exist at x = 2:
x 2

x = 2 is called a singularity for this function. We say f (x) is singular at the


point x = 2:

Page 55
1.4.6 Leibniz Rule

This is the …rst of two rules due to Leibniz. Here it is used to obtain the nth
derivative of a product y = uv , by starting with the product rule.
dy dv du
=u +v uDv + vDu
dx dx dx
then

y 00 = uD2v + 2DuDv + vD2u


y 000 = uD3v + 3DuD2v + 3D2uDv + vD3u
and so on. This suggests (can be proved by induction)

Dn (uv ) = uDnv + n1 DuDn 1v + n2 D2uDn 2v +:::+ nr Dr uDn r v +:::+vD nu

where nr = r!(nn! r)! :

Page 56
Example: Find the nth derivative of y = x3eax:

Put u = x3 and v = eax and Dn (uv ) (uv )n ; so

(uv )n = uvn + n1 u1vn 1 + n2 u2vn 2 + n3 u3vn 3 + :::::::

u = x3; u1 = 3x2; u2 = 6x; u3 = 6; u4 = 0


v = eax; v1 = aeax; v2 = a2eax; ::::::::; vn = aneax
therefore Dn x3eax =

x3aneax + n1 3x2an 1eax + n2 6xan 2eax + n3 6an 3eax


= eax x3an + n3x2an 1 + n (n 1) an 23x + n (n 1) (n 2) an 3

Page 57
1.4.7 Further Limits

This will be an application of di¤erentiation. Consider the limiting case


f (x) 0 1
lim or
x!a g (x) 0 1
This is called an indeterminate form. Then L’Hospitals rule states

f (x) f 0 (x) f (r) (x)


lim = lim 0 = ::::::: = lim (r)
x!a g (x) x!a g (x) x!a g (x)
for r such that we have the indeterminate form 0=0: If for r + 1 we have

f (r+1) (x)
lim !A
x!a g (r+1) (x)

where A is not of the form 0=0 then

f (x) f (r+1) (x)


lim lim :
x!a g (x) x!a g (r+1) (x)

Page 58
Note: Very important to verify quotient has this indeterminate form before
using L’Hospitals rule. Else we end up with an incorrect solution.

Examples:

1.
cos x + 2x 1 0
lim
x!0 3x 0
So di¤erentiate both numerator and denominator !
d (cos x + 2x 1) sin x + 2 0 2
lim dx d (3x)
= lim 6= !
x!0 x!0 3 0 3
dx

ex + e x 2
2. lim ; quotient has form 0=0: By L’Hospital’s rule we have
x!0 1 cos 2x
ex e x
lim ; which has indeterminate form 0=0 again for 2nd time, so
x!0 2 sin 2x

Page 59
we apply L’Hospital’s rule again
ex + e x 1
lim = :
x!0 4 cos 2x 2

x2 1 2x
3. lim ) use L’Hospital , so lim !1
x!1 ln x 1 x!1 1=x

e3x 1
4. lim ) lim 3xe3x ! 1
x!1 ln x 1 x!1

x 2
5. lim x2e 3x 0:1; so we convert to form 1=1 by writing lim 3x ;
x!1 x!1 e
2
and now use L’Hospital (di¤erentiate twice), which gives lim !0
x!1 9e3x

Page 60
sin x
6. lim lim cos x 1
x!0 x x!0

What is example 6: saying?

When x is very close to 0 then sin x x: That is sin x can be approximated


with the function x for small values.

Page 61
1.5 Taylor Series

Many functions are so complicated that it is not easy to see what they look
like. If we only want to know what a function looks like locally , we can
approximate it by simpler functions: polynomials. The crudest approximation
is by a constant: if f (x) is continuous at x0;

f (x) t f (x0)

for x near x0:

Before we consider this in a more formal manner we start by looking at a simple


motivating example:

Consider f (x) = ex:

Page 62
Suppose we wish to approximate this function for very small values of x (i.e.
df
x ! 0). We know at x = 0; dx = 1: So this is the gradient at x = 0: We
can …nd the equation of the line that passes through a point (x0; y0) using

y y0 = m (x x0 ) :
df
Here m = dx = 1; x0 = 0; y0 = 1; so y = 1 + x; is a polynomial. What
information have we ascertained from this?

If x ! 0 then the point (x; 1 + x) on the tangent is close to the point


(x; ex) on the graph f (x) and hence

Page 63
ex 1+x
25

20

15

10

0
-4 -3 -2 -1 0 1 2 3 4

-5

Page 64
Suppose now that we are not that close to 0: We look for a second degree
polynomial (i.e. quadratic)

g (x) = ax2 + bx + c ! g 0 = 2ax + b ! g 00 = 2a


If we want this parabola g (x) to have

(i) same y intercept as f :

g (0) = f (0) =) c = 1

(ii) same tangent as f


g 0 (0) = f 0 (0) =) b = 1

(iii) same curvature as f

g 00 (0) = f 00 (0) =) 2a = 1

Page 65
This gives
1 2
ex g (x) = x + x + 1
2

25

20

15

10

0
-4 -3 -2 -1 0 1 2 3 4

Page 66
Moving further away we would look at a third order polynomial h (x) which
gives
x 1 3 1 2
e h (x) = x + x + x + 1
3! 2!
25

20

15

10

0
-4 -3 -2 -1 0 1 2 3 4

-5
and so on.

Page 67
Better is to approximate by the tangent at x0: This makes the approximation
and its derivative agree with the function:

f (x) t f (x0) + (x x0) f 0 (x0) :


Better still is by the best …t parabola (quadratic), which makes the …rst two
derivatives agree:
1
f (x) t f (x0) + (x x0) f 0 (x0) + (x x0)2 f 00 (x0) :
2
This process can be continued inde…nitely as long as f can be di¤erentiated
often enough.

The nth term is

1 (n)
f (x0) (x x0 ) n ;
n!

Page 68
where f (n) means the nth derivative of f and n! = n: (n 1) : : : 2:1 is
the factorial.

x0 = 0 is the special case, called Maclaurin Series.

Examples:

Expanding about the origin x0 = 0;

x2 x 3 xn
ex =1+x+ + + ::: +
2! 3! n!
Near 0; the logarithm looks like

x2 x 3 x4 n x
n+1
log (1 + x) = x + + ::: + ( 1)
2 3 4 (n + 1)!

Page 69
How can we obtain this? Put f (x) = log (1 + x) ; then f (0) = 0

1
f 0 (x) = 1+x f 0 (0) = 1
f 00 (x) = 1 f 00 (0) = 1
(1+x)2
f 000 (x) = 2 f 000 (0) = 2
(1+x)3
f (4) (x) = 6 f (4) (0) = 6
(1+x)4

Thus
1 (n)
X f (0) n
f (x) = x
n=0 n!
1 ( 1) 2 1 ( 6) 4
= 0+ x+ x + :2x3 + x + :::::
1! 2! 3! 4!
x 2 x3 x 4
= x + + :::
2 3 4

Page 70
Taylor’s theorem, in general, is this : If f (x) and its …rst n derivatives exist
(and are continuous) on some interval containing the point x0 then
1 f 0 (x ) (x
f (x) = f (x0) + 1! x0 ) +
0
1 f 00 (x ) (x 2
2! 0 x 0 ) + :::
+ (n 11)! f (n 1) (x0) (x x0)n 1 + Rn (x)

where Rn (x) = (1=n!) f (n) ( ) (x x0)n ; is some (usually unknown)


number between x0 and x and f (n) is the nth derivative of f .

We can expand about any point x = a; and shift this point to the origin, i.e.
x x0 0 and we express in powers of (x x0)n :

Page 71
So for f (x) = sin x about x = =4 we will have
1 f (n)
X 4
f (x) = (x =4)n
n=0 n!

where f (n) 4 is the nth derivative of sin x at x0 = =4:

As another example suppose we wish to expand log (1 + x) about x0 = 2; i.e.


x 2 = 0 then
1
X 1
f (x) = f (n) (2) (x 2)n
n=0 n!

where f (n) (2) is the nth derivative of log (1 + x) evaluated at the point
x = 2:

Note that log (1 + x) does not exist for x = 1:

Page 72
1.5.1 The Binomial Expansion

The Binomial Theorem is the Taylor expansion of (1 + x)n where n is a


positive integer. It reads:

n (n 1) 2 n (n 1) (n 2) 3
(1 + x)n = 1 + nx + x + x + ::: :
2! 3!
We can extend this to expressions of the form

n(n 1) 2 n(n 1)(n 2) 3


(1 + ax)n = 1 + n (ax) + 2! ( ax ) + 3! ( ax ) + ::: :

" !#n " ! #


a a
(p + ax)n = p 1 + x = pn 1 + n x + ::::::::
p p

Page 73
The binomial coe¢ cients are found in Pascal’s triangle:

1 (n=0) (1 + x)0

1 1 (n=1) (1 + x)1

1 2 1 (n=2) (1 + x)2

1 3 3 1 (n=3) (1 + x)3

1 4 6 4 1 (n=4) (1 + x)4

1 5 10 10 5 1 (n=5) (1 + x)5

and so on ...

Page 74
As an example consider:

(1 + x)3 n=3)1 3 3 1 ) (1 + x)3 = 1 + 3x + 3x2 + x3

(1 + x)5 n = 5 ! (1 + x)5 = 1 + 5x + 10x2 + 10x3 + 5x4 + x5:

If n is not an integer the theorem still holds but the coe¢ cients are no longer
integers. For example,

(1 + x) 1 = 1 x + x2 x3 + ::: :

and

1=2 1 1 1 x2
(1 + x) =1+ x+ ::: :
2 2 2 2!

Page 75
h i
k
(a + b) = ak 1+ b k =
a

k(k 1) k(k 1)(k 2) 3


ak 1 + kba 1 + 2! b2a 2 + 3! b a 3 + ::

k(k 1) k(k 1)(k 2) 3 k 3


= ak + kbak 1 + 2 b2ak 2 + 3! b a + ::

sin x
Example: We looked at lim ! 1 (by L’Hospital). We can also do this
x!0 x
using Taylor series:
sin x x3=3! + x5=5! + ::::
x
lim lim
x!0 x x!0 x
lim 1 x2=3! + x4=5! + ::::
x!0
! 1:

Page 76
1.6 Integration

1.6.1 The Inde…nite Integral

The inde…nite integral of f (x) ;


Z
f (x) dx;

is any function F (x) whose derivative equals f (x). Thus if


Z
dF
F (x) = f (x) dx then (x) = f (x) :
dx
Since the derivative of a constant, C; is zero (dC=dx = 0) ; the inde…nite
integral of f (x) is only determined up to an arbitrary constant.

Page 77
dF
If = f (x) then
dx

d dF dC dF
(F (x) + C ) = (x) + = (x) = f (x) :
dx dx dx dx

Thus we must always include an arbitrary constant of integration in an inde…nite


integral.

Simple examples are

Z
1
xndx = xn+1 + C (n 6= 1) ;
n+1
Z Z
dx ax 1 ax
= log (x) + C; e dx = e + C (a 6= 0) ;
Z x Z a
1 1
cos axdx = sin ax + C; sin axdx = cos ax + C
a a

Page 78
Linearity

Integration is linear:
Z Z Z
( f (x) + g (x)) dx = f (x) dx + g (x) dx

for constants A and B: Thus, for example

Z Z Z
Ax2 + Bx3 dx = A x2dx + B x3dx
A 3 B 4
= x + x + C;
3 4
Z Z Z
dx
(3ex + 2=x) dx = 3 exdx + 2 = 3ex + 2 log (x) + C;
x
and so forth.

Page 79
1.6.2 The De…nite Integral

The de…nite integral,


Z b
f (x) dx;
a
is the area under the graph of f (x) ; between x = a and x = b; with
positive values of f (x) giving positive area and negative values of f (x)
contributing negative area. It can be computed if the inde…nite integral is
known. For example
Z 3
1 4 3 1 4
x3dx = x = 3 14 = 20;
1 4 1 4
Z 1
exdx = [ex]1 1 = e 1=e:
1
Note that the de…nite integral is also linear in the sense that
Z b Z b Z b
(Af (x) + Bg (x)) dx = A f (x) dx + B g (x) dx:
a a a

Page 80
Note also that a de…nite integral
Z b
f (x) dx
a
does not depend on the variable of integration, x in the above, it only depends
on the function f and the limits of integration (a and b in this case); the
area under a curve does not depend on what we choose to call the horizontal
axis.

So
Z b Z b Z b
f (x) dx = f (y ) dy = f (z ) dz:
a a a

We should never confuse the variable of integration with the limits of integra-
tion; a de…nite integral of the form
Z x
f (x) dx;
a

use dummy variable.

Page 81
If a < b < c then

Z c Z b Z c
f (x) dx = f (x) dx + f (x) dx:
a a b
Also

Z a Z c
f (x) dx = f (x) dx:
c a

Page 82
1.6.3 Integration by Substitution

This involves the change of variable and used to evaluate integrals of the form
Z
g (f (x)) f 0 (x) dx;

and can be evaluated by writing z = f (x) so that dz=dx = f 0 (x) or


dz = f 0 (x) dx: Then the integral becomes
Z
g (z ) dz:

Examples:
Z
x
2
dx : z = 1 + x2 ! dz = 2xdx
Z
1+x
x 1 1 2 +C
dx = log (z ) + C = log 1 + x
1 + x2 2 q
2
= log 1 + x2 + C

Page 83
R 2
xe x dx : z = x2 ! dz = 2xdx
Z Z
x 2 1
xe dx = ez dz
2
1 z 1 x2
= e +C = e +C
2 2
Z Z
1 1 2
log (x) dx = z dz = z + C
x 2
1
(log (x))2 + C
=
2
with z = log (x) so dz = dx=x and

Z Z Z
e x+ex dx = ex
exe dx = ez dz
x
= ez + C = ee + C
with z = ex so dz = exdx:

Page 84
The method can be used for de…nite integrals too. In this case it is usually more
convenient to change the limits of integration at the same time as changing
the variable; this is not strictly necessary, but it can save a lot of time.

For example, consider

Z 2
x 2
e 2xdx:
1

Write z = x2; so dz = 2xdx: Now consider the limits of integration; when


x = 2; z = x2 = 4 and when x = 1; z = x2 = 1: Thus

Z x=2 Z z=4
x2
e 2xdx = ez dz
x=1 z=1
= [ez ]z=4
z=1 = e4 e1:

Page 85
Further examples: consider

Z x=2
2xdx
2
:
x=1 1 + x

In this case we could write z = 1 + x2; so dz = 2xdx and x = 1


corresponds to z = 2, x = 2 corresponds to z = 5; and

Z x=2 z=5 dzZ


2x
2
dx =
x=1 1 + x z=2 z
= [ln (z )]z=5
z=2 = log (5) ln (2)
= ln (5=2)
We can solve the same problem without change of limit, i.e.
n ox=2
ln 1 + x2 ! ln 5 ln 2 = ln 5=2:
x=1

Page 86
Or consider

Z x=e
log (x)
2 dx
x=1 x

in which case we should choose z = log (x) so dz = dx=x and x = 1


gives z = 0; x = e gives z = 1 and so

Z x=e Z z=1 h iz=1


log (x) 2
2 dx = 2zdz = z = 1:
x=1 x z=0 z=0

Page 87
When we make a substitution like z = f (x) we are implicitly assuming that
dz=dx = f 0 (x) is neither in…nite nor zero. It is important to remember this
implicit assumption.

Consider the integral


Z 1
1 h 3ix=1 1 2
x2dx = x = (1 ( 1)) = :
1 3 x= 1 3 3
p
Now put z = x2
so dz = 2xdx or dz = 2 z dx and when x = 1;
z = x2 = 1 and when x = 1; z = x2 = 1; so
Z x=1 Z
2 1 z=1 dz
x dx = p =0
x= 1 2 z=1 z
p
as the area under the curve 1= z between z = 1 and z = 1 is obviously
zero.

Page 88
It is clear that x2 > 0 except at x = 0 and therefore that
Z 1
2
x2dx =
1 3
must be the correct answer. The substitution z = x2 gave
Z x=1 Z
2 1 z=1 dz
x dx = p =0
x= 1 2 z=1 z
which is obviously wrong. So why did the substitution fail?

It failed because f 0 (x) = dz=dx = 2x changed signs between x = 1


and x = 1: In particular, dz=dx = 0 at x = 0; the function z = x2 is
not invertible for 1 x 1:

Moral: when making a substitution make sure that dz=dx 6= 0:

Page 89
1.6.4 Integration by Parts

This is based on the product rule. In usual notation, if y = u (x) v (x) then
dy du dv
= v+u
dx dx dx
so that
du dy dv
v= u
dx dx dx
and hence integrating
Z Z Z Z
du dy dv dv
vdx = dx u dx = y (x) u dx + C
dx dx dx dx
or
Z Z
du dv
vdx = u (x) v (x) u (x) dx + C
dx dx
i.e.
Z Z
u0vdx = uv uv 0dx + C

Page 90
This is useful, for instance, if v (x) is a polynomial and u (x) is an exponential.

How can we use this formula? Consider the example


Z
xexdx

Put
v = x u0 = ex
v 0 = 1 u = ex
hence
Z Z
dv
xexdx = uv u dx
Z dx
= xex ex:1dx = ex (x 1) + C

The formula we are using is the same as


Z Z
vdu = uv udv + C

Page 91
R
Now using the same example xexdx
v = x du = exdx
dv = dx u = ex
and
Z Z Z
vdu = uv udv = xex exdx
= ex (x 1) + C
Another example
Z Z
2 e2x dx = 1 x2 e2x 2x
x
|{z} |{z} | {z }dx + C
xe
v(x) u0 |2 {z } uv 0
uv
and using integration by parts again
Z Z
2x 1 2x 1 1
xe dx = xe e2xdx = (2x 1) e2x + D
2 2 4
so Z
1
x2e2xdx = 2x2 2x + 1 e2x + E:
4

Page 92
1.6.5 Reduction Formula

Consider the de…nite integral problem


Z 1
e ttndt = In
0
put v = tn and u0 = e t ! v 0 = ntn 1 and u = e t
h i1 Z 1
e ttn +n e ttn 1dt
0 0
h i1
= e ttn + nIn 1
0
In = nIn 1
= n (n 1) In 2 = ::::::: = n!I0
Z 1
where I0 = e tdt = 1
0

) In = n!; n 2 Z+
In is called the Gamma Function.

Page 93
1.6.6 Other Results

Z
f 0 (x)
dx = ln jf (x)j + C
f (x)
e.g.
Z
3
dx = ln j1 + 3xj + C
1 + 3x
Z Z
1 1 7 1
dx = dx = ln j2 + 7xj + C
2 + 7x 7 2 + 7x 7
This allows us to state a standard result
Z
1 1
dx = ln ja + bxj + C
a + bx b
How can we re-do the earlier example
Z
x
2
dx;
1+x
which was initially treated by substitution?

Page 94
Partial Fractions Consider a fraction where both numerator and denomina-
tor are polynomial functions, i.e.
P
N
a n xn
f (x) n=0
h (x) =
g (x) P
M
bnxn
n=0

where deg f (x) < deg g (x) , i.e. N < M: Then h (x) is called a partial
fraction. Suppose
c A B
+
(x + a) (x + b) (x + a) (x + b)
then writing
c = A (x + b) + B (x + a)
and solving for A and B allows us to obtain partial fractions.

Page 95
The simplest way to achieve this is by setting x = b to obtain the value of
B; then putting x = a yields A:

1
Example: : Now write
(x 2) (x + 3)
1 A B
+
(x 2) (x + 3) x 2 x+3
which becomes
1 = A (x + 3) + B (x 2)

Setting x = 3!B= 1=5; x = 2 ! A = 1=5: So


1 1 1
:
(x 2) (x + 3) 5 (x 2) 5 (x + 3)

Page 96
There is another quicker and simpler method to obtain partial fractions, called
the "cover-up" rule. As an example consider
x A B
+ :
(x 2) (x + 3) x 2 x+3

A
Firstly, look at the term : The denominator vanishes for x = 2; so
x 2
take the expression on the LHS and "cover-up" (x 2) : Now evaluate the
x
remaining expression, i.e. for x = 2; which gives 2=5: So A = 2=5:
(x + 3)

B
Now repeat this, by noting that does not exist at x = 3: So cover
x+3
x
up (x + 3) on the LHS and evaluate for x = 3; which gives
(x 2)
B = 3=5:

Page 97
f (x)
Any rational expression (with degree of f (x) < degree of g (x)) such
g (x)
as above can be written
f (x)
F1 + F2 + :::::::: + Fk
g (x)
where each Fi has form
A Cx + D
m or n
(px + q ) ax2 + bx + c
A
where m is written as
(px + q )
A1 A2 A
+ + :::::: +
(px + q ) (px + q )2 (px + q )m

Page 98
Cx + D
and n becomes
ax2 + bx + c

C1x + D1 Cnx + Dn
+ :::::: + n
ax2 + bx + c ax2 + bx + c

Page 99
Examples:

3x 2 A B C D
+ + +
(4x 3) (2x + 5)3 4x 3 2x + 5 (2x + 5)2 (2x + 5)3

4x2 + 13x 9 A B C
+ +
x (x + 3) (x 1) x x + 3 (x 1)

3x3 18x2 + 29x 4 A B C D


+ + +
(x + 1) (x 2)3 x + 1 x 2 (x 2)2 (x 2)3

5x2 x+2 Ax + B Cx + D E
2
+ 2
+
x2 + 2 x + 4 (x 1) x2 + 2 x + 4 x2 + 2 x + 4 x 1

x2 x 21 Ax + B Cx + D E
2
+ 2
+
x2 + 4 (2x 1) x2 + 4 x2 + 4 2x 1

Page 100
1.7 Complex Numbers

A complex number z is de…ned by z = x + iy where x; y 2 R and


p
i= 1: It follows that i2 = 1:

We call the x axis the real line and the y axis the imaginary line.

z may also be expressed in polar co-ordinate form as

z = r (cos + i sin )
where r is always positive and counter-clockwise from Ox:

So x = r cos ; y = r sin

Page 101
x z = x+iy

r
y

q modulus of z denoted jzj is de…ned jzj = r =


+ x2 + y 2; argument = arctan xy

The set of all complex numbers is denoted C; and for any complex number z
we write z 2 C: We can think of R C:

_
We de…ne the complex conjugate of z by z where
_
z =x iy:
z is the re‡ection of z in the real line. So for example if z = 1 2i; then
z = 1 + 2i:

Page 102
1.7.1 Arithmetic

Given any two complex numbers z1 = a + ib; z2 = c + id the following


de…nitions hold:

Addition & Subtraction z1 z2 = ( a c) + i (b d)

Multiplication z1 z2 = (ac bd) + i (ad + bc)

z1 a + ib (ac + bd) + i (bc ad) (ac + bd) (bc ad)


Division = = = +i 2
z2 c + id c2 + d 2 2
c +d 2 c + d2

c id
here we have simply multiplied by and note that (c + id) (c id) =
c id
c2 + d2

Page 103
Examples

z1 = 1 + 2i; z2 = 3 i

z1 + z2 = (1 + 3) + i (2 1) = 4 + i ; z1 z2 = (1 3) i (2 ( 1)) =
2 + 3i

z1 z2 = (1:3 2: 1) + i (1: 1 + 2:3) = 5 + 5i

z1 1 + 2i 3 + i 1 7
= : = +i
z2 3 i 3+i 10 10

Page 104
1.7.2 Complex Conjugate Identities
_
1. z = z

_
2. (z1 + z2) = z1 + z 2

_ _
3. (z1z2) = z1z2

_
_ z+z
4. z + z = 2x = 2 Re z ) Re z =
2

_
_ z z
5. z z = 2iy = 2i Im z ) Im z =
2i

_
6. z: z = (x + iy ) (x iy ) = jzj2

Page 105
7. jzj2 = z (z ) = zz = jzj2 ) jzj = jzj

z1 z z z z
8. = 1 : 2 = 1 22
z2 z2 z 2 jz 2j

9. jz1z2j2 = jz1j2 jz2j2

Page 106
1.7.3 Polar Form

We return to the polar form representation of complex numbers. We now


introduce a new notation. If z 2 C; then

z = r (cos + i sin ) = rei :


Hence
ei = cos + i sin ;
which is a special relationship called Euler’s Identity. Knowing sin is an odd
function gives e i = cos i sin : Referring to the earlier polar coordinate
…gure, we have:
jzj = r; arg z =
If
z1 = r1ei 1 and z2 = r2ei 2

Page 107
then

z1z2 = r1r2ei( 1+ 2) ) jz1z2j = r1r2 = jz1j jz2j


arg (z1z2) = 1 + 2 = arg (z1) + arg (z2) :
If z2 6= 0 then
z1 r1ei 1 r
= = 1 ei( 1 2)
z2 r2ei 2 r2
and hence
z1 jz1j r
= = 1
z2 jz2j r2
!
z
arg 1 = 1 2 = arg (z1 ) arg (z2)
z2

Page 108
Euler’s Formula Let be any a1ngle, then

exp (i ) = cos + i sin :


We can prove this by considering the Taylor series for exp (x) ; sin x; cos x

x 2 x 3 x n
ex = 1 + x + + + ::::::::::::: + (a)
2! 3! n!

x3 x5 n x2n+1
sin x = x + ::::::::::::: + ( 1) (b)
3! 5! (2n + 1)!

x2 x4 n x
2n
cos x = 1 + ::::::::::::: + ( 1) (c)
2! 4! (2n)!

Page 109
Replacing x by the purely imaginary quantity i in (a), we obtain

(i )2 (i )3 (i )n
ei = 1+i + + + ::::::::::::: +
2! 3! ! n!
2 4 6
= 1 + + :::::::::::: +
2! 4! 6!
!
3 5
i + :::::::::
3! 5!
= cos + i sin

Note: When = then exp i = 1 and = =2 gives exp (i =2) = i:

Page 110
We can apply Euler’s formula to integral problems. Consider the problem
Z
ex sin xdx

which was simpli…ed using the integration by parts method. We know Re ei =


cos ; so the above becomes
Z Z
ex Im eixdx = Im e(i+1)xdx = Im 1+i
1 e(i+1)x

= ex Im 1+i1 1 i
eix = ex Im (1+i)(1 eix
i)
= 21 ex Im (1 i) eix = 12 ex Im eix ieix
= 21 ex Im (cos x + i sin x i cos x + sin x)
= 21 ex (sin x cos x)

Z
Exercise: Apply this method to solving ex cos xdx.

Page 111
1.8 Functions of Several Variables: Multivariate Calculus

A function can depend on more than one variable. For example, the value of
an option depends on the underlying asset price S (for ’spot’or ’share’) and
time t: We can write its value as V (S; t) :

The value also depends on other parameters such as the exercise price E;
interest rate r and so on. Although we could write V (S; t; E; r; :::) ; it is
usually clearer to leave these other variables out.

Depending on the application, the independent variables may be x and t for


space and time, or two space variables x and y; or S and t for price and
time, and so on.

Page 112
Consider a function z = f (x; y ) ; which can be thought of as a surface in
x; y; z space. We can think of x and y as positions on a two dimensional
grid (or as spacial variables) and z as the height of a surface above the (x; y )
grid.

How do we di¤erentiate a function f (x; y ) of two variables? What if there


are more independent variables?

The partial derivative of f (x; y ) with respect to x is written

@f
@x
(note @ and not d ). It is the x derivative of f with y held …xed:
@f f (x + x; y ) f (x; y )
= lim :
@x x!0 x

Page 113
The other partial derivative, @f =@y; is de…ned similarly but now x is held
…xed:
@f f (x; y + y ) f (x; y )
= lim :
@y y!0 y

@f @f
and
@x @y
are sometimes written as fx and fy :

Examples

If
2
f (x; y ) = x + y2 + xe y

then
@f y 2
= fx = 1 + 0 + 1 e
@x

Page 114
@f 2
= fy = 0 + 2y + x ( 2y ) e y :
@y
The convention is, treat the other variable like a constant.

Page 115
Higher Derivatives

Like ordinary derivatives, these are de…ned recursively:


@ 2f @ @f
= fxx = ;
@x2 @x @x!
@ 2f @ @f
= fyy = :
@y 2 @y @y
and
@ 2f @ @f
= fxy = ;
@x@y @y @x
!
2
@ f @ @f
= fyx = :
@y@x @x @y

Page 116
If f is well-behaved, the ’mixed’partial derivatives are equal:

fxy = fyx:
i.e. the second order derivatives exist and are continuous.

Example:

2
With f (x; y ) = x + y 2 + xe y as above,

2
fx = 1 + e y
so

2
fxx = 0; fxy = 2ye y

Page 117
Also

y 2
fy = 2 y 2xye
so
y 2 y 2 2 y 2
fyx = 2ye ; fyy = 2 2xe + 4xy e
Note that fxy = fyx:

Page 118
1.8.1 The Chain Rule I

Suppose that x = x (s) and y = y (s) and F (s) = f (x (s) ; y (s)) :


Then
dF @f dx @f dy
(s) = (x (s) ; y (s)) (s) + (x (s) ; y (s)) (s)
ds @x ds @y ds
Thus if f (x:y ) = x2 + y 2 and x (s) = cos (s) ; y (s) = sin (s) we …nd
that F (s) = f (x (s) ; y (s)) has derivative
dF
= sin (s) 2 cos (s) + cos (s) 2 sin (s) = 0
ds
which is what it should be, since F (s) = cos2 (s) + sin2 (s) = 1;

i.e. a constant.

Page 119
dz
Example: Calculate at t = =2 where
dt
z = exp xy 2 x = t cos t; y = t sin t:
Chain rule gives
dz @z dx @z dy
= +
dt @x dt @y dt
= y 2 exp xy 2 ( t sin t + cos t) +
2xy exp xy 2 (sin t + t cos t) :

dz 3
At t = =2 x = 0; y = =2 ) = :
dt t= =2 8

Page 120
1.8.2 The Chain Rule II

Suppose that x = x (u; v ) ; y = y (u; v ) and that F (u; v ) = f (x (u; v ) ; y (u; v )) :


Then

@F @x @f @y @f @F @x @f @y @f
= + and = + :
@u @u @x @u @y @v @v @x @v @y

This is sometimes written as

@ @x @ @y @ @ @x @ @y @
= + ; = + :
@u @u @x @u @y @v @v @x @v @y

so is essentially a di¤erential operator.

Page 121
Example:

T = x3 xy + y 3 where x = r cos ; y = r sin

@T @T @x @T @y
= + = cos 3x2 y + sin 3y 2 x
@r @x @r @y @r
= cos 3r 2 cos2 r sin +
sin 3r 2 sin2 r cos
= 3r 2 cos3 + sin3 2r cos sin
= 3r 2 cos3 + sin3 r sin 2 :

Page 122
@T @T @x @T @y
= +
@ @x @ @y @
= r sin 3x2 y + r cos 3y 2 x
= r sin 3r 2 cos2 r sin +
r cos 3r 2 sin2 r cos
= 3r 3 cos sin (sin cos ) +
r2 sin2 cos2 :
= r2 (sin cos ) (3r cos sin + sin + cos )

Page 123
1.8.3 Taylor for two Variables

Assuming that a function f (x; t) is di¤erentiable enough, near x = x0;


t = t0;

f (x; t) = f (x0; t0) + (x x0) fx (x0; t0) +


(t t0) ft (x0; t0)
2 2 3
(x x0) fxx (x0; t0)
16 7
+ 4 +2 (x x0) (t t0) fxt (x0; t0) 5 + ::::
2
+ (t t0)2 ftt (x0; t0)
That is,

f (x; t) = constant + linear + quadratic


+::::
The error in truncating this series after the second order terms tends to zero
faster than the included terms. This result is particularly important for Itô’s
lemma in Stochastic Calculus.

Page 124
Suppose a function f = f (x; y ) and both x; y change by a small amount, so
x ! x + x and y ! y + y; then we can examine the change in f using
a two dimensional form of Taylor

f (x + x; y + y ) = f (x; y ) + fx x + fy y +
1 1
fxx x2 + fyy y 2 +
2 2
fxy x y + O x2; y 2 :
By taking f (x; y ) to the lhs, writing

df = f (x + x; y + y ) f (x; y )
and considering only linear terms, i.e.
@f @f
df = x+ y
@x @y
we obtain a formula for the di¤erential or total change in f:

Page 125

You might also like