Autumn Winter Primer 2008
Autumn Winter Primer 2008
Finance
Introduction to Mathematical Methods
Riaz Ahmad
Calculus
Linear Algebra
Probability
Di¤erential Equations
[email protected]
1
1. INTRODUCTION TO CALCULUS
1 Introduction to Calculus
np o
Irrationals 2; 0:01001000100001:::; ; e
2
1. INTRODUCTION TO CALCULUS
3
1. INTRODUCTION TO CALCULUS
1.2 Functions
x 7! f (x) :
We can also write f : X !Y
30
20
10
0
-4 -3 -2 -1 0 1 2 3 4
-10
-20
-30
4
1. INTRODUCTION TO CALCULUS
domain range/image
-1 1
f
0 0
2 4
input output
p
f (x) = x is a one to many mapping. Note we do not
use the term function here.
5
1. INTRODUCTION TO CALCULUS
p
Thus x and x2 are inverse mappings (for x 0).
Further Notation:
q
therefore y 1 ( x) = x+1 :
2
Check:
0s 12
x + 1A
yy 1 (x) = 2 @ 1 = x = y 1 y ( x)
2
Domf = ( 1; 0) [ (0; 1) or R f 0g
y = 2 x2 1
clearly Domf = R (clearly)
and for
s
x+1
y 1 ( x)
=
2
to exist we require the term inside the square root sign to
be non-negative, i.e. x+12 0 =) x 1; therefore
Domf = f[ 1; 1)g :
7
1. INTRODUCTION TO CALCULUS
f ( x) = f ( x)
e.g. f (x) = x2:
f ( x) = f ( x) :
8
1. INTRODUCTION TO CALCULUS
1.2.1 Polynomials
ax2 + bx + c = 0
which can be solved for x using the formula
p
b b2 4ac
x=
2a
b
(2) b2 4ac = 0 ! x = x1 = x2 = 2 R : one
2a
two fold root
10
1. INTRODUCTION TO CALCULUS
y = 2 x2 + 4 x 16 = 0
A trivial example is
y x2 = 0 ;
which in its current form is implicit. Simple rearranging
gives y = x2 which is explicit:
4y 4 2 y 2 x2 yx2 + x2 + 3 = 0:
y 2 + x2 16 = 0:
12
1. INTRODUCTION TO CALCULUS
modulus function
3.5
2.5
1.5
0.5
-4 -3 -2 -1 0 1 2 3 4
13
1. INTRODUCTION TO CALCULUS
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).
e = 2:718281828 : : : :
which is the approximation to
1 n
1+
n
14
1. INTRODUCTION TO CALCULUS
Also
1 x:
= e
ex
Here we have used the property (xa)b = xab; which
allowed us to write e1x = (ex) 1 = e x:
15
1. INTRODUCTION TO CALCULUS
Exponential Functions
7
exp(x) and (exp(-x) 6
0
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
x
1.5
1
0.5
0
-0.5 0 1 2 3 4 5
-1
-1.5
-2
-2.5
x
16
1. INTRODUCTION TO CALCULUS
2
Later we will also see e x =2; which is particularly useful
in probability: This function decays particularly rapidly as
jxj increases. The term x2=2 is called the exponent,
i.e. the "bit" above the exponential. When there is a
large exponent (many terms) then it is common to write
exp (:::::::)
Note:
exey = ex+y ; e0 = 1
!
x
log = log x log y:
y
Dom (ex) = R
Im (ex) = (0; 1)
18
1. INTRODUCTION TO CALCULUS
1.5
0.5
0
-8 -6 -4 -2 0 2 4 6 8
-0.5
-1
-1.5
sin x = 0 () x = n 8n 2 Z
Dom =R and Im = [ 1; 1]
19
1. INTRODUCTION TO CALCULUS
cos x = 0 () x = (2n + 1) 2 8n 2 Z
Dom =R and Im = [ 1; 1]
Trigonometric Identities:
cos2 x + sin2 x = 1
sin (x y ) = sin x cos y cos x sin y
cos (x y ) = cos x cos y sin x sin y
sin x + = cos x
2
cos x = sin x
2
sin x
tan x =
cos x
20
1. INTRODUCTION TO CALCULUS
n o
Dom = fx : cos x 6= 0g = x : x 6= (2n + 1) 2 ; n 2 Z =
n o
R (2n + 1) 2 ; n 2 Z
21
1. INTRODUCTION TO CALCULUS
1 x
sinh x = e e x
2
Dom =R
Im = R
1 x
cosh x = e +e x
2
Dom =R
Im = [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
sinh x
tanh x =
cosh x
Dom =R
Im = ( 1; 1)
23
1. INTRODUCTION TO CALCULUS
2x = exp y exp ( y )
(ey )2 2x (ey ) 1 = 0:
p p
Now x2
+ 1 > x =) x x2 + 1 <p0 and we know
that ey > 0 therefore we have ey = x + x2 + 1: Hence
24
1. INTRODUCTION TO CALCULUS
Dom sinh 1 x =R
Im sinh 1 x = R
exp y+exp( y)
Similarly y = cosh 1 x ! x = cosh y = 2 ;
and
q
ey = x + x2 1
25
1. INTRODUCTION TO CALCULUS
Im cosh 1 x = [0; 1)
26
1. INTRODUCTION TO CALCULUS
x exp 2y + x = exp 2y 1
1+x
exp 2y (1 x) = 1 + x ! exp 2y =
1 x
hence
1+x
tanh 1 x = 12 ln
1 x
Dom tanh 1x = ( 1; 1)
Im tanh 1 x = R
27
1. INTRODUCTION TO CALCULUS
1.3 Limits
lim f (x) ! l;
x!x0
Whenever x is close to x0
28
1. INTRODUCTION TO CALCULUS
f (x) is close to l:
Example 1:
lim x2 + 2x + 3 ! 0 + 0 + 3 ! 3;
x!0
Example 2:
Example 3:
x2 + 2x 2
x2 + 2x + 2 x2 x2
+ x2
lim = lim =
x!1 3 x2 + 4 x!1 3x2 + 4
x2 x2
1 + x2 + x22 1
lim ! :
x!1 3 + x42 3
29
1. INTRODUCTION TO CALCULUS
Example 4:
x2 9 (x + 3) (x 3)
lim = lim = lim (x + 3) ! 6
x!3 x 3 x!3 (x 3) x!3
f ( x) ! l as x ! x0
f ( x) ! l as x ! x+
0
More Examples:
lim sin x ! 0
x!0
sin x
lim !1
x!0 x
lim jxj ! 0
x!0
30
1. INTRODUCTION TO CALCULUS
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
31
1. INTRODUCTION TO CALCULUS
1.4 Continuity
That is, ’we can draw its graph without taking the pen
o¤ the paper’.
32
1. INTRODUCTION TO CALCULUS
1.5 Di¤erentiation
df
f 0 ( x) or
dx
f (x + x) f ( x)
f 0 (x) = lim
x!0 x
33
1. INTRODUCTION TO CALCULUS
1
f 0 ( x) = (f (x) f (x h)) backward
lim
h!0 h
1
f 0 (x) = lim (f (x + h) f (x h)) centred
h!0 2h
Examples:
f ( x) = x2
f (x + h) = (x + h)2 = x2 + 2xh + h2
f ( x + h ) f ( x) 2hx + h2
=
h h
= 2x + h
! 2x as h ! 0;
34
1. INTRODUCTION TO CALCULUS
d n
x = nxn 1;
dx
d x d ax
e = ex; e = aeax;
dx dx
d 1
log x =
dx x
d
cos x = sin x
dx
d
sin x = cos x
dx
d
tan x = sec2 x
dx
35
1. INTRODUCTION TO CALCULUS
Examples:
f ( x ) = x 5 ! f 0 ( x ) = 5x 4
g (x) = e3x ! g 0 (x) = 3e3x = 3g (x)
Linearity
dy d
= ( f (x) + g (x)) = f 0 (x) + g 0 (x) :
dx dx
36
1. INTRODUCTION TO CALCULUS
dy
= f 0 ( x) g ( x) + f ( x) g 0 ( x) :
dx
38
1. INTRODUCTION TO CALCULUS
y = f (g (x)) then
dy
= f 0 (g (x)) g 0 (x) :
dx
4x 2
Thus if y = e then
4x 2 4x 2
dy=dx = e 4 :2 x = 8xe :
39
1. INTRODUCTION TO CALCULUS
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)) :
dy du dy
=
dx dx du
2
Thus for y = e4x ; write u = 4x2; y = eu: Then
40
1. INTRODUCTION TO CALCULUS
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 = u2 where u = tan x
y 0 = 2u: sec2 x ! y 0 = 2 tan x sec2 x
41
1. INTRODUCTION TO CALCULUS
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
f ( x)
Staring with y = and writing as y = f (x) (g (x)) 1
g ( x)
we apply the product rule
42
1. INTRODUCTION TO CALCULUS
dy df 1 d
= (g (x)) + f (x) (g (x)) 1
dx dx dx
d 1 du d
(g (x)) = 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)
43
1. INTRODUCTION TO CALCULUS
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
= xex + ex = ex (x + 1) ;
d 2 d u
e x = (e ) where u = x2 ) du = 2xdx
dx dx
2
= ( 2 x) e x :
44
1. INTRODUCTION TO CALCULUS
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
This is an example of implicit di¤erentiation.
45
1. INTRODUCTION TO CALCULUS
4y 4 2 y 2 x2 yx2 + x2 + 3 = 0:
The resulting derivative will also be an implicit function.
Di¤erentiating gives
46
1. INTRODUCTION TO CALCULUS
47
1. INTRODUCTION TO CALCULUS
d2f d df
f 00 (x)
= =
dx2 dx dx !
d 3f d d2f
000
f ( x) = =
dx3 dx dx2
f ( x) = 4x 3
0
f (x) = 12x2 ! f 00 (x) = 24x
f 000 (x) = 24 ! f (iv) (x) = 0:
so for any nth degree polynomial
48
1. INTRODUCTION TO CALCULUS
f (x) = ex
f 0 (x) = ex ! f 00 (x) = ex
...
f (n) (x) = ex = f (x)
f (x) = log x
f 0 (x) = 1=x
f 00 (x) = 1=x2
f 000 (x) = 2=x3:
Warning
49
1. INTRODUCTION TO CALCULUS
1
Easy way is to "look for a hole", e.g. f (x) =
x 2
does not exist at x = 2:
50
1. INTRODUCTION TO CALCULUS
f ( x) f (r+1) (x)
lim lim :
x!a g (x) x!a g (r+1) (x)
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’
x!0 1 cos 2x
ex e x
Hospital’s rule we have lim ; which has
x!0 2 sin 2x
indeterminate form 0=0 again for 2nd time, so 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 !
x!1 ln x 1 x!1 1=x
1
52
1. INTRODUCTION TO CALCULUS
e3x 1
4. lim ) lim 3xe3x ! 1
x!1 ln x 1 x!1
sin x
6. lim lim cos x 1
x!0 x x!0
53
1. INTRODUCTION TO CALCULUS
f ( x) t f ( x0 )
ex 1+x
55
1. INTRODUCTION TO CALCULUS
25
20
15
10
0
-4 -3 -2 -1 0 1 2 3 4
-5
56
1. INTRODUCTION TO CALCULUS
g (0) = f (0) =) c = 1
g 0 (0) = f 0 (0) =) b = 1
g 00 (0) = f 00 (0) =) 2a = 1
This gives
1
ex g ( x ) = x2 + x + 1
2
57
1. INTRODUCTION TO CALCULUS
25
20
15
10
0
-4 -3 -2 -1 0 1 2 3 4
58
1. INTRODUCTION TO CALCULUS
25
20
15
10
0
-4 -3 -2 -1 0 1 2 3 4
-5
59
1. INTRODUCTION TO CALCULUS
and so on.
f (x) t f (x0) + (x x0 ) f 0 ( x0 ) :
1
f (x) t f (x0)+(x 0
x0) f (x0)+ (x x0)2 f 00 (x0) :
2
60
1. INTRODUCTION TO CALCULUS
1 (n)
f ( x0 ) ( x x0 ) n ;
n!
Examples:
x2 x3 xn
ex =1+x+ + + ::: +
2! 3! n!
x2 x3 x4 n x
n+1
log (1 + x) = x + + ::: + ( 1)
2 3 4 (n + 1)!
61
1. INTRODUCTION TO CALCULUS
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 + : 2 x3 + x + :::::
1! 2! 3! 4!
x2 x3 x4
= x + + :::
2 3 4
62
1. INTRODUCTION TO CALCULUS
f (x) = f (x0) + 1! 1 f 0 (x ) ( x x0 ) +
0
1 f 00 (x ) (x 2
2! 0 x 0 ) + :::
+ (n 1 1)! f (n 1) (x0) (x x0 ) n 1 + R n ( x )
64
1. INTRODUCTION TO CALCULUS
n n (n 1) 2 n (n 1) (n 2) 3
(1 + x) = 1+nx+ x + x +::: :
2! 3!
65
1. INTRODUCTION TO CALCULUS
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 ...
66
1. INTRODUCTION TO CALCULUS
As an example consider:
(1 + x)3 n = 3 ) 1 3 3 1 ) (1 + x)3 =
1 + 3x + 3 x 2 + x 3
(1 + x) 1 = 1 x + x2 x3 + ::: :
and
1=2 1 1 1 x2
(1 + x) =1+ x+ ::: :
2 2 2 2!
67
1. INTRODUCTION TO CALCULUS
sin x
Example: We looked at lim ! 1 (by L’Hospital).
x!0 x
We can also do this 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:
68
1. INTRODUCTION TO CALCULUS
1.7 Integration
Z
f (x) dx;
Z
dF
F ( x) = f (x) dx then ( x) = f ( x ) :
dx
69
1. INTRODUCTION TO CALCULUS
dF
if = f (x) then
dx
d dF dC dF
( F ( x) + C ) = ( x) + = ( x) = f ( x) :
dx dx dx dx
Z
1
xndx = xn+1 + C (n 6= 1) ;
n+1
Z
dx
= log (x) + C;
Z x
ax 1 ax
e dx = e + C (a 6= 0) ;
Z a
1
cos axdx = sin ax + C
Z a
1
sin axdx = cos ax + C
a
70
1. INTRODUCTION TO CALCULUS
Linearity
Integration is linear:
Z Z Z
( f (x) + g (x)) dx = f (x) dx + g (x) dx
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.
71
1. INTRODUCTION TO CALCULUS
Z b
f (x) dx;
a
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
72
1. INTRODUCTION TO CALCULUS
Z b Z b Z b
(Af (x) + Bg (x)) dx = A f (x) dx+B g (x) dx:
a a a
Z b
f (x) dx
a
So
Z b Z b Z b
f (x) dx = f (y ) dy = f (z ) dz:
a a a
73
1. INTRODUCTION TO CALCULUS
Z x
f (x) dx
a
74
1. INTRODUCTION TO CALCULUS
Z x
2 s 2
erf (x) = p e ds;
0
Z 1
2 s 2
erf c (x) = p e ds;
x
Z x
1 2
N ( x) = p e s =2ds:
2 1
75
1. INTRODUCTION TO CALCULUS
Z c Z b Z c
f (x) dx = f (x) dx + f (x) dx:
a a b
Z a Z c
f (x) dx = f (x) dx:
c a
Z c Z b Z c
f (x) dx = f (x) dx + f (x) dx:
a a b
76
1. INTRODUCTION TO CALCULUS
Z
g (f (x)) f 0 (x) dx;
Z
g (z ) dz:
For example:
Z Z
x 1 dz
dx =
1 + x2 2 z
1 1
= log (z ) + C = log 1 + x2 + C
2 q 2
= log 1 + x2 + C
77
1. INTRODUCTION TO CALCULUS
if we put z = 1 + x2 so dz = 2xdx:
Similarly:
Z Z
x2 1
xe dx = ez dz
2
1 z 1 x2
= e +C = e +C
2 2
Z Z
1 1
log (x) dx = z dz = z 2 + C
x 2
1
= (log (x))2 + C
2
Z Z Z
ex+ex dx = ex
exe dx = ez dz
x
= ez +C = ee +C
78
1. INTRODUCTION TO CALCULUS
with z = ex so dz = exdx:
Z 2
x 2
e 2xdx:
1
Z x=2 Z z=4
x2
e 2xdx = ez dz
x=1 z=1
= [ez ]z=4
z=1 = e4 e1:
79
1. INTRODUCTION TO CALCULUS
Z x=2
2xdx
2
:
x=1 1 + x
Z x=2 z=5 dz Z
2x
dx =
x=1 1 + x2 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
80
1. INTRODUCTION TO CALCULUS
Or consider
Z x=e
log (x)
2 dx
x=1 x
81
1. INTRODUCTION TO CALCULUS
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.
82
1. INTRODUCTION TO CALCULUS
Z 1
2
x2dx =
1 3
Z x=1 Z
2 1 z=1 dz
x dx = p =0
x= 1 2 z=1 z
83
1. INTRODUCTION TO CALCULUS
84
1. INTRODUCTION TO CALCULUS
dy du dv
= v+u
dx dx dx
so that
du dy dv
v= u
dx dx dx
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
85
1. INTRODUCTION TO CALCULUS
i.e.
Z Z
u0vdx = uv uv 0dx + C
and
Z Z Z
vdu = uv udv = xex exdx
= ex (x 1) + C
Another example
Z Z
x 2 e2x dx = 1 x2 e2x xe 2x dx + C
|{z} |{z} | {z }
v(x) u0 |2 {z } uv 0
uv
Z Z
2x 1 2x 1 1
xe dx = xe e2xdx = (2x 1) e2x + D
2 2 4
so
Z
1
x2e2xdx = 2 x2 2x + 1 e2x + E:
4
87
1. INTRODUCTION TO CALCULUS
Important Example:
Z
ex cos xdx
R x
so set I = e cos xdx: Now put
v = ex u0 = cos x
v 0 = ex u = sin x
which gives
Z
I = ex sin x ex sin xdx
R x
need to obtain e sin xdx for a second time by parts so
put
v = ex u0 = sin x
v 0 = ex u = cos x
and we have
Z Z
ex sin xdx = ex cos x + ex cos xdx
| {z }
I
so putting together with the earlier integral
I = ex sin x ( ex cos x + I )
2I = ex (sin x + cos x)
hence
Z
ex
ex cos xdx = (sin x + cos x) + C
2
88
1. INTRODUCTION TO CALCULUS
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
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.
90
1. INTRODUCTION TO CALCULUS
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)
91
1. INTRODUCTION TO CALCULUS
A
Firstly, look at the term : The denominator van-
x 2
ishes for x = 2; so take the expression on the LHS and
"cover-up" (x 2) : Now evaluate the remaining ex-
x
pression, i.e. for x = 2; which gives 2=5: So
(x + 3)
A = 2 =5:
B
Now repeat this, by noting that does not exist at
x+3
x = 3: So cover up (x + 3) on the LHS and evaluate
x
for x = 3; which gives B = 3=5:
(x 2)
92
1. INTRODUCTION TO CALCULUS
f ( x)
Any rational expression (with degree of f (x) <
g ( x)
degree of g (x)) such as above can be written
f ( x)
F1 + F2 + :::::::: + Fk
g ( x)
where each Fi has form
A Cx + D
or n
(px + q )m ax2 + bx + c
A
where is written as
(px + q )m
A1 A2 A
+ + :::::: +
(px + q ) (px + q )2 (px + q )m
Cx + D
and n becomes
ax2 + bx + c
C1x + D1 Cnx + Dn
+ :::::: + n
ax2 + bx + c 2
ax + bx + c
93
1. INTRODUCTION TO CALCULUS
Examples:
3x 2 A B C
+ + +
(4x 3) (2x + 5)3 4x 3 2x + 5 (2x + 5)2
D
(2x + 5)3
4x2 + 13x 9 A B C
+ +
x (x + 3) (x 1) x x + 3 (x 1)
3 x3 18x2 + 29x 4 A B C
+ + +
(x + 1) (x 2)3 x + 1 x 2 (x 2) 2
D
(x 2)3
5 x2 x+2 Ax + B Cx + D
2 2
+ 2
+
x2 + 2x + 4 (x 1) x + 2 x + 4 x2 + 2 x + 4
E
x 1
x2 x 21 Ax + B Cx + D E
2
+ 2
+
x2 + 4 (2x 1) x2 + 4 x2 + 4 2x 1
94
1. INTRODUCTION TO CALCULUS
z = r (cos + i sin )
where r is always positive and counter-clockwise from
Ox: So x = r cos ; y = r sin
x z = x+iy
r
y
So
q
y
x = r cos ; y = r sin ; r = + x2 + y 2; = arctan
x
95
1. INTRODUCTION TO CALCULUS
We call the x axis the real line and the y axis the
imaginary line.
96
1. INTRODUCTION TO CALCULUS
1.8.1 Arithmetic
c id
here we have simply multiplied by and note that
c id
2
(c + id) (c id) = c + d 2
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
97
1. INTRODUCTION TO CALCULUS
z1 1 + 2i 3 + i 1 + 7i
= : =
z2 3 i 3+i 10
98
1. INTRODUCTION TO CALCULUS
(3, 5)
_
We de…ne 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
_
1. z = z
_
2. (z1 + z2) = z1 + z 2
_ _
3. (z1z2) = z1z2
99
1. INTRODUCTION TO CALCULUS
_
_ 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
z1 z1 z 2 z1 z 2
8. = : =
z2 z2 z 2 jz 2j2
Hence
ei = cos + i sin ;
which is a special relationship called Eulers Identity.
Knowing sin is an odd function gives e i = cos
i sin : Referring to the earlier …gure, we have:
jzj = r; arg z =
If
z1 = r1ei 1 and z2 = r2ei 2
then
x2 x3 xn
ex =1+x+ + + ::::::::::::: + (a)
2! 3! n!
x3 x5 x2n+1 n
sin x = x + ::::::::::::: +( 1) (b)
3! 5! (2n + 1)!
x2 x4 n x
2n
cos x = 1 + ::::::::::::: + ( 1) (c)
2! 4! (2n)!
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
102
1. INTRODUCTION TO CALCULUS
103
1. INTRODUCTION TO CALCULUS
104
1. INTRODUCTION TO CALCULUS
@f
@x
@f f (x + x; y ) f (x; y )
= lim :
@x x!0 x
105
1. INTRODUCTION TO CALCULUS
@f f (x; y + y ) f (x; y )
= lim :
@y y!0 y
@f @f
and
@x @y
Examples
If
2
f (x; t) = x + t2 + xe t
then
@f t2
= fx = 1 + 0 + 1 e
@x
106
1. INTRODUCTION TO CALCULUS
@f t2
= ft = 0 + 2t + x ( 2t) e :
@t
107
1. INTRODUCTION TO CALCULUS
@ 2f @ @f
= fxx = ;
@x2 @x @x
@ 2f @ @f
= fxy = ;
@x@y @y @x
!
@ 2f @ @f
= fyx = ;
@y@x @x @y
and
!
@ 2f @ @f
2
= fyy = :
@y @y @y
108
1. INTRODUCTION TO CALCULUS
fxy = fyx:
109
1. INTRODUCTION TO CALCULUS
Examples:
2
With f (x; t) = x + t2 + xe t as above,
t2
fx = 1+e
so
2
fxx = 0; fxt = 2te t
Also
t2
ft = 2 t 2xte
so
t2 t2 2 t2
ftx = 2te ; ftt = 2 2xe + 4xt e
dF dx @f dy @f
(s ) = (s ) (x (s) ; y (s))+ (s) (x (s) ; y (s))
ds ds @x ds @y
dF
= sin (s) 2 cos (s) + cos (s) 2 sin (s) = 0
ds
i.e. a constant.
111
1. INTRODUCTION TO CALCULUS
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
112
1. INTRODUCTION TO CALCULUS
@F @x @f @y @f @F @x @f @y @f
= + and = + :
@u @u @x @u @y @v @v @x @v @y
@ @x @ @y @ @ @x @ @y @
= + ; = + :
@u @u @x @u @y @v @v @x @v @y
113
1. INTRODUCTION TO CALCULUS
Example:
@T @T @x @T @y
= + = cos 3x2 y + sin 3y 2 x
@r @x @r @y @r
= cos 3r2 cos2 r sin +
sin 3r2 sin2 r cos
= 3r2 cos3 + sin3 2r cos sin
= 3r2 cos3 + sin3 r sin 2 :
@T @T @x @T @y
= +
@ @x @ @y @
= r sin 3x2 y + r cos 3y 2 x
= r sin 3r2 cos2 r sin +
r cos 3r2 sin2 r cos
= 3r3 cos sin (sin cos ) +
r2 sin2 cos2 :
= r2 (sin cos ) (3r cos sin + sin + cos )
114
1. INTRODUCTION TO CALCULUS
1.9.5 Extensions
@F @x @f @y @f
= +
@u @u @x @u @y
@F @x @f @y @f
= +
@v @v @x @v @y
@F @x @f @y @f
= +
@w @w @x @w @y
@F @x @f @y @f @z @f
= + +
@u @u @x @u @y @u @z
@F @x @f @y @f @z @f
= + +
@v @v @x @v @y @v @z
So we can generalise this to obtain a chain rule for
115
1. INTRODUCTION TO CALCULUS
116
1. INTRODUCTION TO CALCULUS
That is,
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 x3; y 3 :
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:
118
1. INTRODUCTION TO CALCULUS
Z 1
( x) = e ttx 1dt (x > 0)
0
Z 1
Note e tdt = 1
0
Z 1
Integration by parts gives us e ttxdt = (x + 1) =
0
Z 1 Z 1
x e ttx 1dt = x (x 1) e ttx 2dt (1)
0 0
= :::::::: = x!
Important results:
(n + 1) = n! (n 0)
(1) = 1
119
1. INTRODUCTION TO CALCULUS
(x + 1) = x (x) :
Z 1
If we make the substitution t = u2 in ( x) = e ttx 1dt
0
we obtain
Z 1
2
( x) = 2 e u u2x 1du
0
and put x = 1=2 so that
Z 1
1 2
2 =2 e u du
0
Z 1
2
and we know from the error function that e u du =
p 0
=2; hence
1 =p :
2
Examples:
(4) 3! 1
1. (4) = 3! = 6; = = ;
(5) 4! 4
120
1. INTRODUCTION TO CALCULUS
5
2. use (x + 1) = x (x) with x = 3=2
2
5 3 3 3 1 1 3 1 p
= = =
2 2 2 2 2 2 2 2
3p
=
4
3 (x + 1)
3. now use ( x) =
2 x
3
3 +1 2 1
= 2 =
2 3= 2 3 2
2 3
1
6 7 p
= 26 2 7= 2 2 = 4p
3 6 1=2 7
4 5 3 3
121
2. INTRODUCTION TO LINEAR ALGEBRA
122
2. INTRODUCTION TO LINEAR ALGEBRA
Examples:
p
u1 = (1; 0) ; u2 = 1; e; 3; 6 ; u3 = (3; 4) ; u4 =
( ; ln 3; 2; 1)
1. u1 ; u3 2 R2 and u2 ; u4 2 R4
123
2. INTRODUCTION TO LINEAR ALGEBRA
Examples:
1. u+v = (3 + 5; 1 5; 2 + 1; 0 + 2) = (8; 4; 1; 2)
mutative , i.e.
u:v = v:u
If a pair of vectors have a scalar product which is zero,
125
2. INTRODUCTION TO LINEAR ALGEBRA
y1
x1 x
y
= arctan 1 :
x1
Any vector u can be expressed as
b
u = juj u
126
2. INTRODUCTION TO LINEAR ALGEBRA
uv
127
2. INTRODUCTION TO LINEAR ALGEBRA
128
2. INTRODUCTION TO LINEAR ALGEBRA
If u; v 2 Rn we write
q p
2 2 2 2
kuk = (2) + ( 1) + (0) + ( 3) = 14
129
2. INTRODUCTION TO LINEAR ALGEBRA
130
2. INTRODUCTION TO LINEAR ALGEBRA
2.2 Matrices
Let A; B 2 mRn
A+B =
0 1 0 1
a11 a12 :::: a1n b11 b12 :: :: b1n
B C B C
B a21 a22 :::: a2n C B b21 b22 :: :: b2n C
B C B C
B : : : : C B C
B C+B : : : : : C
B : : : : C B C
B C B : : : : : C
B
@ : :: :::: : C B
A @ : :: :: :: : C
A
am1 am2 :::: amn bm1 bm2 :: :: bmn
and the corresponding elements are added to give
0 1
a11 + b11 a12 + b12 :::: a1n + b1n
B C
B a21 + b21 a22 + +b22 :::: a2n + b2n C
B C
B : : : : C
B C = B +A
B : : : : C
B C
B C
@ : :: :::: : A
am1 + bm1 am2 + bm2 :::: amn + bmn
132
2. INTRODUCTION TO LINEAR ALGEBRA
Examples:
! !
1 1 2 4 0 3
A = ; B= ;
0 3 4 1 2 3
0 1 0 1
2 3 1 1 0 0
B C B C
C = @ 5 1 2 A; D=@ 0 1 0 A
1 0 3 0 0 1
0 1
! 3 3 1
5 1 1 B C
A+B = ; C +D = @ 5 0 2 A
1 1 7
1 0 4
We cannot perform any other combination of addition as
A and B are (2 3) and C and D are (3 3) :
133
2. INTRODUCTION TO LINEAR ALGEBRA
N
X
Cij = Aik Bkj :
k=1
! ! !
a b e f ae + bg af + bh
= :
c d g h ce + dg cf + dh
134
2. INTRODUCTION TO LINEAR ALGEBRA
Example:
0 1
! 1 2
2 1 0 B C
@ 0 3 A
2 0 2
1 2
!
2 : 1 + 1: 0 + 0: 1 2 : 2 + 1: 3 + 0 : 2
=
2 : 1 + 0: 0 + 2: 1 2 : 2 + 0: 3 + 2 : 2
!
2 7
=
4 8
135
2. INTRODUCTION TO LINEAR ALGEBRA
2.2.3 Transpose
! ! !
1 2 1 3 1 2
A= ; B= ; C= ;
3 4 2 4 2 1
(i) (A + B )T = AT + B T
T T
(ii) A =A
(iv) (AB )T = B T AT
Example:
0 1
2 1 !
B C 2 1 2
A = @ 1 2 A ! AT =
1 2 2
2 2
137
2. INTRODUCTION TO LINEAR ALGEBRA
ax + by = p
cx + dy = q
Then …nd y :
Examples:
Here is a system with a unique solution:
x y = 0
x+y = 2
The solution is x = y = 1:
Now try
x y = 0
2x 2y = 2
Lastly try
x y = 1
2x 2y = 2:
140
2. INTRODUCTION TO LINEAR ALGEBRA
! ! !
a b x p
=
c d y q
or
Ax = p:
a b
= ad bc
c d
is not zero.
141
2. INTRODUCTION TO LINEAR ALGEBRA
0 1
1 0 0 ::: 0
B C
B0 1 0 ::: C
B C
I=B
B0 0 1 : : : ... C
C:
B ... ... 0C
@ A
0 ::: 0 1
0 1
0 0
B ... ... ... ... C
B C
B . . . ... C
B 0 ... ... ... C
A=B
B ... . . . ... ... ... 0
C
C
B C
B ... ... ... ... C
@ A
0 0
142
2. INTRODUCTION TO LINEAR ALGEBRA
AT = A
aij = aji
so the leading diagonal acts as a "mirror". Clearly a
symmetric matrix is square. For example
0 1
a b c
B a d e C
B C
B C
@ b d f A
c e f
is symmetric.
143
2. INTRODUCTION TO LINEAR ALGEBRA
To conclude:
System of Linear Equations
Inconsistent Consistent
No Solution
E=n E<n
free variable
144
2. INTRODUCTION TO LINEAR ALGEBRA
ax + by + cz = p ( )
dx + ey + f z = q
gx + hy + iz = r
0 1 0 1
x p
B C B C
@ y A; @ q A
z r
0 1
a b c
B C
A = @ d e f A:
g h i
146
2. INTRODUCTION TO LINEAR ALGEBRA
0 1
a11 a12 :: :: :: a1n b1
B C
B a21 a22 :: :: :: a2n b2 C
B C
B : : : C
B C:
B : : : C
B C
B C
@ : :: :: :: :: : : A
am1 am2 amn bm
148
2. INTRODUCTION TO LINEAR ALGEBRA
Examples:
1.
9
2x + y 2z = 10 >
=
3x + 2 y + 2 z = 1 Ax = b with
>
5x + 4 y + 3 z = 4 ;
0 1 0 1
2 1 2 10
B C B C
A=@ 3 2 2 A and b = @ 1 A
5 4 3 4
The
0 augmented matrix
1 for this system
0 is 1
2 1 2 10 2 1 2 10
B C R !2R 3R 1 B C
@ 3 2 2 1 A 2 2
@ 0 1 10 28 A
R3 !2R3 5R1
5 4 3 4 0 3 16 42
0 1
2 0 12 38
R3 !R3 3R2 B C
@ 0 1 10 28 A
R1 !R1 R2
0 0 14 42
14z = 42 ! z = 3
y + 10z = 28 ! y = 28 + 30 = 2
x 6z = 19 ! x = 19 18 = 1
149
2. INTRODUCTION TO LINEAR ALGEBRA
150
2. INTRODUCTION TO LINEAR ALGEBRA
2.
9
x + 2 y 3z = 6 >
=
2x y + 4 z = 2
>
4x + 3y 2z = 14 ;
0 1
1 2 3 6
B C R2!R2 2R1
@ 2 1 4 2 A
4 3 2 14 R3!R3 4R1
0 1
1 2 3 6
B C R !R3 R2
@ 0 5 10 10 A 3
R2 !0:5R2
0 5 10 10
0 1
1 2 3 6
B C
@ 0 1 2 2 A
0 0 0 0
Number of equations is less than number of un-
knowns.
y 2z = 2 so z = a is a free variable) y =
2 (1 + a)
x + 2 y 3z = 6 ! x = 6 2y + 3 z = 2 a
) x = 2 a; y = 2 (1 + a) ; z = a
151
2. INTRODUCTION TO LINEAR ALGEBRA
152
2. INTRODUCTION TO LINEAR ALGEBRA
3.
9
x + 2 y 3z = 1 >
=
3x y + 2 z = 7
>
5x + 3 y 4z = 2 ;
0 1
1 2 3 1
B C R2!R2 3R1
@ 3 1 2 7 A
R3 !R3 5R1
5 3 4 2
0 1
1 2 3 1
B C R3!R3 R2
@ 0 7 11 10 A
0 7 11 7
0 1
1 2 3 1
B C
@ 0 7 11 10 A
0 0 0 3
153
2. INTRODUCTION TO LINEAR ALGEBRA
AA 1 = A 1 A = I:
Ax = p
is
x=A 1 p:
154
2. INTRODUCTION TO LINEAR ALGEBRA
!
a b
c d
is
!
1 d b
ad bc c a
provided that ad bc 6= 0:
h iT
i+j
where adj A = ( 1) Mij is the adjoint, i.e. we
form the matrix of A’s cofactors and transpose it.
155
2. INTRODUCTION TO LINEAR ALGEBRA
2 1 1 1 1 2
= 1 1 +0
1 3 0 3 0 1
= (2 3 1 1) (1 3 1 0) + 0 = 5 3
= 2
2 1 1 1
( 1)1+1 M11 = + ( 1)1+2 M12 =
1 3 0 3
1 2
( 1)1+3 M13 = +
0 1
1 0 1 0
( 1)2+1 M21 = ( 1)2+2 M22 = +
1 3 0 3
1 1
( 1)2+3 M23 =
0 1
1 0 1 0
( 1)3+1 M31 = + ( 1)3+2 M32 =
2 1 1 1
1 1
( 1)3+3 M33 = +
1 2
0 1T
5 3 1
adj A = B
@ 3 3
C
1 A
1 1 1
157
2. INTRODUCTION TO LINEAR ALGEBRA
0 1
5 3 1
1 B C
A 1= @ 3 3 1 A
2 1 1 1
158
2. INTRODUCTION TO LINEAR ALGEBRA
A matrix P is orthogonal if
P 1 = PT:
! !
cos sin cos sin
or
sin cos sin cos
159
2. INTRODUCTION TO LINEAR ALGEBRA
!
cos sin
Finally, if P = then
sin cos
!
1 1 cos sin
P = = PT:
cos2 sin2 sin cos
| {z }
=1
160
2. INTRODUCTION TO LINEAR ALGEBRA
Av = v or (A I) v= 0:
det (A I) = 0:
A = P DP T or P TAP = D
where D is diagonal, that is only the entries on the
leading diagonal are nonzero, and these are equal to the
162
2. INTRODUCTION TO LINEAR ALGEBRA
eigenvalues of A:
0 1
0 0 0 0
B 1 ... ... ... C
B 0 0 C
B ... ... ... C
D=B
B 0 0 C
C
B 0 ... ... ... 0 C
@ A
0 0 0 0 n
Example:
0 1
3 3 3
B C
A= @ 3 1 1 A
3 1 1
then
3 3 3
det (A I) = 3 1 1
3 1 1
= 3 + 2 + 24 + 36 = 0
= ( + 3) ( + 2) ( 6)
163
2. INTRODUCTION TO LINEAR ALGEBRA
0 1 0 1
3 i 3 3 0
B C B C
@ 3 1 i 1 A v i = @ 0 A i = 1 ; 2; 3
3 1 1 i 0
0 10 1 0 1
6 3 3 x 0
B CB C B C
1 = 3: @ 3 2 1 A@ y A = @ 0 A
3 1 2 z 0
0 1
2 1 1 0
B C
Upon row reduction we have @ 0 1 1 0 A!y=
0 0 0 0
z;0so put
1 z = a and 2x = y z!x= ) v1 =
1
B C
@ 1A
1
Similarly
164
2. INTRODUCTION TO LINEAR ALGEBRA
0 1 0 1
0 2
B C B C
2 = 2 : v2 = @ 1 A; 3 = 6 : v3 = @1 A
1 1
0 1 0 1 0 1
1 0 2
v1 = B C
@ 1A ; v2 = B C
@ 1 A; v3 = B C
@1A
1 1 1
b = v= jvj for
Now normalise these, i.e. jvj = 1: Use v
normalised eigenvectors
0 1 0 1 0 1
1 0 2
1 B C 1 B C 1 B C
b 1 = p @ 1A ;
v b2 = p @ 1 A ;
v b 3 = p @1 A
v
3 1 2 1 6 1
Hence
0 1 2 1 0 1 1
p 0 p p p1 p1
B 3 6C B 3 3 3C
B 1 p C
P = B p3 p1
2
1
6A
C! PT = B
B 0 p1
2
p C
1
C
2A
@ @
p1 p1 p1 p2 p1 p1
3 2 6 6 6 6
165
2. INTRODUCTION TO LINEAR ALGEBRA
so that
0 1
3 0 0
PTAP = B
@ 0
C
2 0A
0 0 6
= D:
166
2. INTRODUCTION TO LINEAR ALGEBRA
167
2. INTRODUCTION TO LINEAR ALGEBRA
X
jAiij > Aij :
j6=i
Examples:
0 1
2 0 1
B C
@ 1 4 2 A is s.d.d. and so invertible;
1 3 6
0 1
1 0 2
B C
@ 2 5 1 A is not s.d.d. but still invertible;
3 2 13
168
2. INTRODUCTION TO LINEAR ALGEBRA
!
1 1
is neither s.d.d. nor invertible.
1 1
169
3. INTRODUCTION TO PROBABILITY
3 Introduction to Probability
3.1 Preliminaries
Example 1
= f1; 2; 3; 4; 5; 6g
So
1[ = f 2; 3; 4; 5; 6g
3 event that an even or
prime number occurs.
171
3. INTRODUCTION TO PROBABILITY
Example 2 Experiment:
1\ 2 = fHHg
172
3. INTRODUCTION TO PROBABILITY
X:!2 ! R;
If X is a RV then
P (X = a) = P (f! 2 : X (! ) = ag)
is the probability that a occurs (or X maps onto a).
P (f! 2 :a X (! ) bg)
X: ! R
Domain Range (…nite)
xi x1 x2 :::::::::::: xn
f ( xi ) f ( x1 ) f ( x2 ) :::::::::::: f ( xn )
n
P
(ii) f (xi) = 1; i.e. sum of all probabilities is one.
i=1
175
3. INTRODUCTION TO PROBABILITY
3.1.2 Mean/Expectation
Example:
xi 2 3 8
f ( xi ) 1 1 1
4 2 4
3
P 1 1 1
= E [X ] = xi f ( x i ) = 2 +3 +8
i=1 4 2 4
= 4
176
3. INTRODUCTION TO PROBABILITY
Variance V [X ] =
h i h i n
P
2
E (X ) =E X2 2 = x2i f (xi) 2 = 2
i=1
h i
2
E (X ) is also called the second moment about
the mean.
177
3. INTRODUCTION TO PROBABILITY
E [ X ] = E [X ]
E [X + Y ] = E [X ] + E [Y ] ; (linearity)
V[ X + ] = 2 V [X ]
E [XY ] = E [X ] E [Y ] ;
V [X + Y ] = V [X ] + V [Y ]
178
3. INTRODUCTION TO PROBABILITY
Z b
P (a X b) = p (x) dx
a
h i Z
Variance 2 = V [X ] = E (X )2 = x2p (x) dx
R
2
= E [ X n]
n Z
= xnp (x) dx:
R
180
3. INTRODUCTION TO PROBABILITY
181
3. INTRODUCTION TO PROBABILITY
183
3. INTRODUCTION TO PROBABILITY
Example:
0.8
0.7
0.6
0.5
p(x)
0.4
0.3
0.2
0.1
0
-1.5 -1 -0.5 0 0.5 1 1.5
x
184
3. INTRODUCTION TO PROBABILITY
i) Calculate k :
We know
Z 1 Z 1
p (x) dx = 1 ) k 1 x2 dx = 1
1 1
k x 1 x3 1 ! k = 34
3 1
Z Z 1
ii) E [X ] = xp (x) dx = 34 x x3 dx
R 1
If
Z f (x) is an odd function, i.e. f ( x) = f (x) then
a
f (x) dx = 0 ) = E [X ] = 0:
a
185
3. INTRODUCTION TO PROBABILITY
Z Z
iii) V [X ] = x2p (x) dx 2 = x2p (x) dx
R R
Z 1
= 43 x2 x4 dx:
1
If f Z(x) is an even function,
Z i.e. f ( x) = f (x)
a a
then f (x) dx = 2 f (x) dx )
a 0
Z 1
V [X ] = 3 x2 x4 dx = 3 1 x3 1 x5 1
2 0 2 3 5 0
= 1 2! standard deviation
5 = 0:45
186
3. INTRODUCTION TO PROBABILITY
187
3. INTRODUCTION TO PROBABILITY
X 1
E = E [X ] = 0;
X X
V =V
188
3. INTRODUCTION TO PROBABILITY
1 n
X E (X n )
MX ( ) =
n=0 n!
Z Z Z
2
= p (x) dx + xp (x) dx + 2! x2p (x) dx +
| R {z } | R {z } |R {z }
1 E(X) E(X 2)
Z
3 3 p (x) dx + ::::
3! R x
| {z }
E(X 3)
2 3
= 1 + E (X ) + 2! E X 2 + 3! E X 3 + ::::
1 n
X E (X n )
= :
n=0 n!
190
3. INTRODUCTION TO PROBABILITY
Calculating Moments
The MGF is
h i h i
M (X ) = E e x =E e ( + )
h i
= e E e
191
3. INTRODUCTION TO PROBABILITY
192
3. INTRODUCTION TO PROBABILITY
d2 1 2
m2 = 2
e2
d =0
1 2
= 2 +1 e2 =1
=0
d3 1 2
m3 = 3
e2
d =0
1 2
= 3 +3 e2 =0
=0
d4 1 2
m4 = 4
e2
d =0
= 4 +6 2 + 3 e 12 2 =3
=0
The latter two are particularly useful in calculating the
skew and kurtosis.
193
3. INTRODUCTION TO PROBABILITY
3.4 Correlation
X; Y are correlated if
h i
E (X x) Y y 6= 0:
i. (X; Y ) = (Y; X )
ii. (X; X) = 1
iii. 1 1
XY = 1 )perfect correlation
XY = 0 ) X; Y uncorrelated
XY = E [(X X ) (Y Y )]
If we put
h i
2 2
V [X ] = X = E (X X)
h i
2 2
V [Y ] = Y = E (Y Y) :
From Cauchy-Schwartz we have
h i h i
2 2 2
(E [(X X ) (Y Y )]) E (X X) E (Y Y)
or we can write
2 2 2
XY X Y
Divide through by 2 2
X Y
2
XY 1
2 2
X Y
and we know that the left hand side above is 2XY , hence
2
2 = XY 1
XY 2 2
X Y
196
3. INTRODUCTION TO PROBABILITY
1 XY +1:
197
4. DIFFERENTIAL EQUATIONS
4 Di¤erential Equations
4.1 Introduction
dy d 2y d ny
x; y; ; 2
; ::::::::; (some …xed n)
dx dx dxn
Note y 4 =
6 y (4)
dy d 2y d 4y
y= , y= 2
, ......, y =
dt dt dt4
199
4. DIFFERENTIAL EQUATIONS
e.g.
@u @ 2u @u
+ + u=0
@t @x@y @z
200
4. DIFFERENTIAL EQUATIONS
d ny
An ode is of degree r if n
(where n is the order of
dx
the derivative) appears with power r
Examples:
DE order degree
(1) y 0 = 3y 1 1
(2) y 0 3 + 4 sin y = x3 1 3
2 5
(3) y (4) +x y 2 (2) + y0 6 + y =0 4 2
p
(4) 00
y = y0 + y + x 2 2
(5) y 00 + x y 0 3 xy = 0 2 1
dny dn 1 y dy
an (x) dxn + a n 1 ( x ) dxn 1
+ :::: + a 1 ( x ) dx +a0 (x) y = g (x)
n
X
ai (x) y (i) (x) = g (x) (more pedantic)
i=0
202
4. DIFFERENTIAL EQUATIONS
Examples:
DE Nature of DE
(1) 2xy 00 + x2y 0 (sin x) y = x2 Linear
(2) yy 00 + xy 0 + y = 2 a2 = y ) Non-Linear
p 1
(3) y 00 + y0
+y = x2 Non-Linear * y0 2
d4y 4=0
(4) + y Non-Linear - y 4
dx4
203
4. DIFFERENTIAL EQUATIONS
Examples:
dy
) = 3x2 3ce 3x, so eliminate c by taking 3y +
dx
y 0 = 3 x3 + 3 x 2
i.e.
3x2 (x + 1) + 3y + y 0 = 0
204
4. DIFFERENTIAL EQUATIONS
Now
)
y + y 0 = 3c2e2x (a)
y 0 + y 00 = 6c2e2x (b)
and 2(a)=(b) ) 2 y + y 0 = y + y 00 !
y 00 2y 0 y = 0.
y; y 0; :::::::::::; y (n)
205
4. DIFFERENTIAL EQUATIONS
Example:
Exercise:
206
4. DIFFERENTIAL EQUATIONS
e.g. y 00 + 2y 0 = ex; y ( ) = 1, y 0 ( ) = 2 is an
IVP because both conditions are given at the same value
x= .
207
4. DIFFERENTIAL EQUATIONS
y 00 + 4y = 0; y (0) = 0; y 0 (0) = 1
208
4. DIFFERENTIAL EQUATIONS
F x; y; y 0 = 0
y 2x
xy 0 + 2xy y=0) y0 =
x
209
4. DIFFERENTIAL EQUATIONS
y missing:
Z
y 0 = f ( x) solution is y = f (x)dx
x missing:
Z
1
y 0 = f (y ) solution is x = dy
f (y )
Example:
y 0 = cos2 y , y = when x = 2
4
Z Z
1
)x= 2
dy = sec2 y dy ) x = tan y + c ,
cos y
210
4. DIFFERENTIAL EQUATIONS
c is a constant of integration.
so rearranging gives
y = arctan (x 1)
211
4. DIFFERENTIAL EQUATIONS
y 0 = g ( x) h ( y ) (3)
c arbitrary constant
Examples:
dy x2 + 2
1. =
dx y
Z Z
y2 x3
y dy = x2 +2 dx ! = + 2x + c
2 3
212
4. DIFFERENTIAL EQUATIONS
dy
2. = y ln x subject to y = 1 at x = e ( y (e) = 1)
dx
Z Z Z
dy
= ln x dx Recall: ln x dx = x (ln x 1)
y
ln y = x (ln x 1) + c ! y = A exp (x ln x x)
A arb. constant
213
4. DIFFERENTIAL EQUATIONS
y 0 + P ( x) y = Q ( x) (4)
d
R ( x ) y 0 + R ( x ) P ( x) y = ( R ( x) y ) (5)
dx
Ry 0 + RP y = Ry 0 + R0y
from (4).
214
4. DIFFERENTIAL EQUATIONS
dR
This gives RP y = R0y ) R(x)P (x) = , which is
dx
a DE for R which is separable, hence
Z Z Z
dR
= P dx + c ! ln R = P dx + c
R
215
4. DIFFERENTIAL EQUATIONS
R
So R(x) = K exp ( P dx), hence there exists a func-
tion R(x) with the required property.
Z
d
(Ry ) = R(x)Q(x) ! R(x)y = R(x)Q(x)dx+B
dx
B arb. constant.
Z Z Z
yK exp P dx = K exp P dx Q(x)dx + B
216
4. DIFFERENTIAL EQUATIONS
Z Z Z
y exp P dx = exp P dx Q(x)dx+ constant.
Examples:
1. Solve xy 0 y = x3
217
4. DIFFERENTIAL EQUATIONS
R 1 1
I.F R(x) = exp dx = exp ( ln x) = .
x x
1
Multiply DE by !
x
Z
1 0 1 d y
y y = x) =x! d x 1y
x x Z dx x
= xdx + c
y x2 x3
) = + c ) GS is y = + cx
x 2 2
218
4. DIFFERENTIAL EQUATIONS
dx
2. Obtain the general solution of (1 + yex) = ex
dy
dy
= (1 + yex) e x = e x + y )
dx
dy
y=e x
dx
Z
I.F R(y ) = exp dx = e x
so multiplying DE by I.F
2x d
e x y0 y = e ! ye x = e 2x )
Z Z dx
d ye x = e 2xdx
219
4. DIFFERENTIAL EQUATIONS
1 2x
ye x = e +c
2
1 x
) y = cex e is the GS
2
220
4. DIFFERENTIAL EQUATIONS
y 00 = f x; y; y 0
A y 0, y missing, so y 00 = f (x)
R R
Integrate wrt x (twice): y = ( f (x) dx) dx
Example: y 00 = 4x
Z Z Z h i 2 x3
GS y = 4x dx dx = 2 x2 + C dx = +Cx+D
3
221
4. DIFFERENTIAL EQUATIONS
B y missing, so y 00 = f y 0; x
dP
Put P = y 0 ! y 00
= = f (P; x), i.e. P 0 =
dx
f (P; x) - …rst order ode
d 2y dy
Example: Solve x 2 + 2 = x3
dx dx
C y 0 and x missing, so y 00 = f (y )
Put p = y 0, then
d 2y dp dp dy dp
= = = p
dx2 dx dy dx dy
= f (y )
222
4. DIFFERENTIAL EQUATIONS
dp
p = f (y )
dy
which is separable, so
Z Z
p dp = f ( y ) dy !
Z
1 2
p = f (y ) dy + const.
2
Example: Solve y 3y 00 = 4
4 d2y dp 4
) y 00 0
= 3 . Put p = y ! 2 = p = 3
y dx dy y
Z
R 4 4
) p dp = dy ) p2 = +D ) p =
q y3 y 2
Dy 2 4
, so from our de…nition of p,
y
223
4. DIFFERENTIAL EQUATIONS
q
Dy 2 4 Z Z
dy y
= ) dx = q dy
dx y Dy 2 4
) GS is Dy 2 D 2 (x E )2 = 4
D x missing: y 00 = f y 0; y
d2y dP st order
Put P = y 0, so = P = f ( P; y ) - 1
dx2 dy
ODE
224
4. DIFFERENTIAL EQUATIONS
d dr d ry
D ; Dr so Dr y
dx dx r dx r
dr
) ar D r a r ( x) r
so
dx
d ry
ar D r y = a r ( x)
dx r
Now introduce
225
4. DIFFERENTIAL EQUATIONS
Ly=g
GS of Ly = g is given by
y = yc + yp
)
yc is solution of Ly = 0
) GS y = yc + yp
yp is solution of Ly = g
1 y 1 ( x) + 2 y 2 ( x) + ::::::::::: + n y n ( x) =0
227
4. DIFFERENTIAL EQUATIONS
whenever
1 y 1 ( x) + 2 y 2 ( x) + ::::::::::: + n y n ( x) = 0 8x
then 1 = 2 = ::::::::: = n = 0:
FACT:
d2y dy
L y =a 2 +b + cy = 0 a; b; c 2 R
dx dx
L e x = aD2 + bD + c e x
So 1 6= 2 2 R, so GS is
y = c1 exp ( 1x) + c2 exp ( 2x)
c1 , c2 arb. const.
(2) b2 4ac = 0
b
So = 1= 2=
2a
L xe x = aD2 + bD + c xe x
= a 2+b +c xe x + (2a + b) e x
| {z } | {z }
=0 =0
= 0
230
4. DIFFERENTIAL EQUATIONS
r
b 1
p= , q= b2 4ac (6= 0)
2a 2a
Hence
y = c1 exp (p + iq ) x + c2 exp (p iq ) x
= c1epxeiqx + c2epxe iqx = epx c1eiqx + c2e iqx
231
4. DIFFERENTIAL EQUATIONS
Examples:
(1) y 00 3y 0 4y = 0
A.E: 2 3 4=0!( 4) ( + 1) = 0 )
=4& 1 - 2 distinct R roots
GS y (x) = Ae4x + Be x
232
4. DIFFERENTIAL EQUATIONS
(2) y 00 8y 0 + 16y = 0
A.E 2 8 + 16 = 0 ! ( 4)2 = 0 ) =4
, 4 (2 fold root)
(3) y 00 3y 0 + 4 y = 0
p
2 3 9 16
A.E 3 +4 = 0 ! = =
p 2
3 i 7
2
p p
3+i 7 3 i 7
1= , 2 = p iq
2 2
p !
3 7
p= , q=
2 2
233
4. DIFFERENTIAL EQUATIONS
p p !
3x 7 7
y= e2 a cos x + b sin x
2 2
234
4. DIFFERENTIAL EQUATIONS
Consider
then
L b n 1Dn 1 + a
Dn + a b n 2D n 2 + ::::::::::
b 1D + a
+a b0
b i 2 R (0
a i n 1)
ai
bi =
we have divided through by an, i.e. a so L y =
an
0
235
4. DIFFERENTIAL EQUATIONS
Case 1 (Basic)
y = 1e 1x + 2e 2x + :::::::: + ne nx
i arb.
Case 2
y=e x 1 + 2x + 3x2:::::::: + r xr 1
i arb.
236
4. DIFFERENTIAL EQUATIONS
Case 3
)
epx cos qx, xepx cos qx, ..........,xr 1epx cos qx
epx sin qx, xepx sin qx, ............,xr 1epx sin qx
! 2r Lin. Indep. solutions of L y = 0
237
4. DIFFERENTIAL EQUATIONS
(1) y (4) 5y 00 + 6y = 0
A.E: 4 5 2+6=0 ! 2 2 2 3 =0
p p
So = 2, = 3 - four distinct roots
p p p p
) GS y = Ae 2x +Be 2x +Ce 3x +De 3x (Case
1)
d 6y d 4y
(2) 5 4 =0
dx6 dx
6 4
p
A.E: 5 =0 roots: 0; 0; 0; 0; 5
p p
GS y = Ae 5x + Be 5x + C + Dx + Ex2 + F x3
(* exp(0) = 1)
d 4y d 2y
(3) 4
+2 2 +y =0
dx dx
238
4. DIFFERENTIAL EQUATIONS
2
A.E: 4 + 2 2 + 1 = 2 +1 =0 = i is a 2
fold root.
239
4. DIFFERENTIAL EQUATIONS
GS y = C.F + P.I
(b) Annihilator
240
4. DIFFERENTIAL EQUATIONS
The method will work when g (x) has the following forms
iii. Trigonometric terms, g (x) has the form sin ax, cos ax
(Provided ia is not a root of A.E).
241
4. DIFFERENTIAL EQUATIONS
Examples:
(1) y 00 + 3y 0 + 2y = x2
GS y = C.F + P.I = yc + yp
O x2 : 2p2 = 1 ) p2 = 12
242
4. DIFFERENTIAL EQUATIONS
O ( x) : 6p2 + 2p1 = 0 ) p1 = 3
2
7 3 1
) GS y = ae x + be 2x + x + x2
4 2 2
243
4. DIFFERENTIAL EQUATIONS
(2) y 00 + 3y 0 + 2y = 3e5x
1
C 52 + 15 + 2 e5x = 3e5x ! C =
14
1
) y = Ae x + Be 2x + e5x
14
244
4. DIFFERENTIAL EQUATIONS
(3) y 00 5y 0 6y = cos 3x
yp = A cos 3x + B sin 3x
1
y = e x + e6x (cos 3x + sin 3x)
30
245
4. DIFFERENTIAL EQUATIONS
Ae2x [4 10 + 6] = e2x
Statement
246
4. DIFFERENTIAL EQUATIONS
m
X
g1 (x) = gk xk , g2 (x) = Cekx,
k=0
g3 (x) = ( sin mx + cos mx) epx
Then try
where
248
4. DIFFERENTIAL EQUATIONS
2 d2y dy
Ly= ax + x + cy = g (x)
dx2 dx
y=x
249
4. DIFFERENTIAL EQUATIONS
So y 0 = x 1 ! y 00 = ( 1) x 2 , which upon
substitution yields the quadratic, A.E.
a 2+b +c=0
250
4. DIFFERENTIAL EQUATIONS
GS y = Ax 1 + Bx 2
GS y = x (A + B ln x)
251
4. DIFFERENTIAL EQUATIONS
Put y = x ) y 0 = x 1 ) y 00 = ( 1) x 2
and substitute in DE to obtain (upon simpli…cation) the
A.E. 2 3 4=0!( 4) ( + 1) = 0
y (x) = Ax4 + Bx 1
So assume y = x
252
4. DIFFERENTIAL EQUATIONS
1 = 2+3i, 2 = 2 3i i ( = 2, = 3)
253
4. DIFFERENTIAL EQUATIONS
Solve x2y 00 xy 0 + y = ln x
dy dy dt 1 dy
= =
dx dt dx x dt
d 2y d dy d 1 dy 1 d dy 1 dy
2
= = =
dx dx dx dx x dt x dx dt x2 dt
1 dt d dy 1 dy 1 d2y 1 dy
= =
x dx dt dt x2 dt x2 dt2 x2 dt
254
4. DIFFERENTIAL EQUATIONS
y 00 (t) 2y 0 (t) + y = t
y (t) = et (A + Bt) + 2 + t
y = x (A + B ln x) + 2 + ln x.
255
4. DIFFERENTIAL EQUATIONS
4.7.1 Introduction
@V 1 2 2 @ 2V @V
+ S 2
+ (r D) S rV = 0
@t 2 @S @S
Model equation is
@p 2 @ 2p
=c
@t @y 2
257
4. DIFFERENTIAL EQUATIONS
p (y; t) = t f ( )
therefore
@p @p @ 0 1
= = t f ( ): = t f0 ( )
@y @ @y t
!
@ 2p @ @p @
2
= = t f0 ( )
@y @y @y @y
@ @
= t f0 ( )
@y @
1 @ 0 2 f 00 (
= t f ( )=t )
t @
@p @ 1f
=t f( )+ t ( )
@t @t
258
4. DIFFERENTIAL EQUATIONS
so we have
@p 1f 1f 0 (
= t ( ) yt )
@t
t 1f ( ) yt 1f 0 ( ) = c2 t 2 f 00 :
y=t
t 1f ( ) t 1f 0 ( ) = c2 t 2 f 00 :
p = t f py
t
259
4. DIFFERENTIAL EQUATIONS
p p
change of variables u = y= t ! du = dy= t so the
integral becomes
Z 1
t +1=2 f (u) du = 1
1
d
We have an exact derivative on the lhs, i.e. ( f) =
d
f + f 0, hence
1d
( f ) = c2f 00
2d
260
4. DIFFERENTIAL EQUATIONS
f ( ) = A exp 1 2
4c2
and returning to
p (y; t) = t 1=2f ( )
becomes
!
A y2
p (y; t) = p exp :
t 4tc2
261
4. DIFFERENTIAL EQUATIONS
1 y2 1 (x )2
:
2 2tc2 2 2
262