رياضيات 4 - 123537-1
رياضيات 4 - 123537-1
رياضيات 4 - 123537-1
Waleed Raslan
Ibrahim El-Kalla and Waleed Raslan
2014-2015
ii
Contents
Preface vii
1 Special functions 3
iii
iv CONTENTS
2 Fourier Analysis 69
2.1 Fourier series . . . . . . . . . . . . . . . . . . . . . . . 73
2.1.1 Convergence of Fourier series . . . . . . . . . . 74
2.1.2 The phase angle form of a Fourier series . . . . 86
2.1.3 Fourier series for even and odd functions . . . . 89
2.1.4 Half-range expansions . . . . . . . . . . . . . . 93
2.2 Fourier Integral . . . . . . . . . . . . . . . . . . . . . . 100
2.2.1 Fourier cosine integral . . . . . . . . . . . . . . 108
2.2.2 Fourier sine integral . . . . . . . . . . . . . . . . 109
2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 113
CONTENTS v
vii
viii PREFACE
1
2 PREFACE
Chapter 1
Special functions
Gamma function
Beta function
Legendre polynomials
Hermite plynomials
Laguerre plynomials
Chebyshev plynomials
Bessel function
3
4 CHAPTER 1. SPECIAL FUNCTIONS
Proof. Z 1
(n) = e x xn 1 dx
0
Put n = 1;
Z 1 x 1
e
(1) = e x dx = =1
0 1 0
where
xn
lim e x xn = lim =0
x!1 x!1 ex
Solution
(n + 1) = n!
Proof.
(n + 1) = n (n) = n(n 1) (n 1)
= n(n 1):::2:1: (1)
= n!
i.e. For n = 4
(4) = 3! = 6
6 CHAPTER 1. SPECIAL FUNCTIONS
x (x)
x is negative integer or zero 1
x < 1 and fraction (x) = (x+1)
x
x > 0 and x << 1 (x) = x1 0:577215
1<x<2 from table
x>2 (x + 1) = x (x)
10
-5 -4 -3 -2 -1 1 2 3 4 5
x
-5
-10
Putting x = y 2 ) dx = 2ydy
Z 1 Z 1
1 y2 1 y2
( )= e y :2ydy = 2 e dy
2 0 0
Replacing the dummy variable x by y, we get
Z 1 Z 1
1 y2 2
( )=2 e dy = 2 e x dx
2 0 0
Then, we have
Z 1 Z 1
1 (x2 +y 2 )
[ ( )]2 = 4 e dxdy
2 0 0
we get
Z =2 Z r=1 Z =2 Z r=1
1 r2 r2
[ ( )]2 = 4 e rdrd = ( 2) e ( 2r)drd
2 =0 r=0 =0 r=0
h i1 Z =2
r2
= ( 2) e : 1d
0 =0
= 2: =
2
8 CHAPTER 1. SPECIAL FUNCTIONS
)
1 p
( )=
2
Note: Z
0
ef (x) f (x)dx = ef (x)
Corollary:
Z p
1
x2 ( 12 )
e dx = =
0 2 2
Example 6 Compute
5 3
( ); ( ); (0:01)
2 2
Solution
5 3 1 1 3p
( ) = : : ( )=
2 2 2 2 4
1
3 ( 2
) ( 12 ) 4p
( ) = 3 = 3 =
2 2 2
: 21 3
1
(0:01) = :577215 = 0:99433
0:01
Example 7 Evaluate Z 1 p p
4 x
xe dx (1.5)
0
R1p p
x
Solution Let I = 0
4
xe dx
1.1. THE GAMMA FUNCTION 9
p
Putting x = t or x = t2 ) dx = 2tdt in (1.5), we get
Z 1
1
I = t 2 e t 2tdt
0
Z 1
3
= 2 t 2 e t dt
0
5
= 2 ( )
2
3 1 1 3p
= 2: : ( ) =
2 2 2 2
Example 8 Evaluate
Z 1
xa
dx; a > 1
0 ax
R1 xa
Solution Let I = 0 ax
dx
Putting
t dt
ax = et ) t = x ln a ) x = ; dx =
ln a ln a
at t = 0 ) x = 0; at t ! 1 ) x ! 1
Z 1 Z 1
t a t dt 1
I = ( ) e = ta e t dt
0 ln a ln a (ln a)a+1 0
1
= (a + 1)
(ln a)a+1
Example 9 Evaluate
Z 1
1
I= xn 1 (ln( ))m 1 dx
0 x
10 CHAPTER 1. SPECIAL FUNCTIONS
Solution Putting
1
ln( ) = t ) x = e t ) dx = e t dt
x
at x = 0 ! t = 1; at x = 1 ! t = 0
Therefore
Z 0
I = (e t )n 1 (t)m 1 ( e t )dt
Z11
= tm 1 e nt
dt
0
Put
du
nt = u ) dt =
n
)
Z 1 Z 1
u u du 1
I = ( )m 1
e = m um 1 e u
du
0 n n n 0
1
=(m)
nm
Example 10 Evaluate
Z 1
x2
I= e2ax dx
a
Solution First, we complete the square for
Z 1
e [x 2ax] dx
2
I =
Za 1
e [x 2ax+a a ] dx
2 2 2
=
Za 1
e [(x a) a ] dx
2 2
=
a
Z 1
a2 2
= e e (x a) dx
a
1.1. THE GAMMA FUNCTION 11
Let
p 1 1
(x a)2 = t ) x a= t ) dx = t 2 dt
2
)
Z
1 a2 1 t 1
I = e e t 2 dt
2 a
1 a2 1 1 2p
= e ( ) = ea
2 2 2
Example 11 Evaluate
Z 1
(1 + x)2 e x dx
0
Solution
Z 1 Z 1
2 x
(1 + x) e dx = (1 + 2x + x2 )e x dx
0
Z0 1 Z 1 Z 1
x x
= e dx + 2 xe dx + x2 e x dx
0 0 0
= (1) + 2 (2) + (3)
= 5
1 (2n)! p
(n + ) = 2n
2 2 n!
12 CHAPTER 1. SPECIAL FUNCTIONS
Proof.
1 1 3 3 1 1
(n + ) = (n )(n ):::( )( ) ( )
2 2 2 2 2 2
2n 1 2n 3 3 1 p
= ( )( ):::( )( )
2 2 2 2
(2n 1)(2n 3)(2n 5):::5:3:2:1 p
=
2n
1 2n (2n 1) (2n 2) (2n 3) 4 3:2:1 p
= n: : : : ::: :
2 2n 1 2n 2 1 4 1
2n(2n 1)(2n 2):::3:2:1 p
=
(22n )n(n 1)(n 2):::3:2:1
(2n)! p
= 2n
2 n!
1.2. THE BETA FUNCTION 13
Important relations
(m; n) = (n; m)
Proof Put y = 1 x ) dy = dx; x = 0 ) y = 1; x =
1 ) y = 0 into (1.6), we get
Z 0
(m; n) = (1 y)m 1 y n 1 dy
Z 11
= y n 1 (1 y)m 1 dy
0
= (n; m)
Z
2
(m; n) = 2 sin2m 1
cos2n 1
d ; (1.7)
0
Z
2 1 p+1 q+1
) sinp cosq d = ( ; ) (1.8)
0 2 2 2
Proof In (1.6), let
Z 1
tm 1
(m; n) = dt (1.9)
0 (1 + t)m+n
Proof In (1.6), let
1 dt
x = ; dx = ;
1+t (1 + t)2
x = 0 ) t = 1; x = 1 ) t = 0
Therefore
(m) (n)
(m; n) =
(m + n)
Example 13 Evaluate
Z 1 p p
3
I= x 1 x2 dx (1.10)
0
Solution Put
1 p
x2 = t; x = t; dx = p dt
2 t
x = 0 ) t = 0; x = 1 ) t = 1
Solution: Let
x = 4t ) dx = 4dt; x = 0 ) t = 0; x = 4 ) t = 1
16 CHAPTER 1. SPECIAL FUNCTIONS
Therefore
Z 1
(4t)2
I = p 4dt
0(4 4t)
Z 1
1
= 32 t2 (1 t) 2 dt
0
1
= 32 (3; )
2 p
(3) ( 21 ) 2:
= 32 = 32 5 3 1 p
(3:5) : :
2 2 2
9
2
=
15
Z 1
xm 1 + xn 1
(m; n) = dx
0 (1 + x)m+n
Z 1
xm 1
(m; n) = dx
0 (1 + x)m+n
Z 1 Z 1
xm 1 xm 1
= m+n
dx + dx
0 (1 + x) 1 (1 + x)m+n
= I1 + I2
1.2. THE BETA FUNCTION 17
1
Putting x = t
in I2 , we get
Z 0
( 1t )m 1 1
I2 = 1 m+n ( )dt
1 (1 + t ) t2
Z 1
( 1t )m 1 1
= 1 m+n ( 2 )dt
0 (1 + t ) t
Z 1
( 1t )m 1 ( t12 )
= dt
0 (1 + t)m+n ( 1t )m+n
Z 1
tn 1
= dt
0 (1 + t)m+n
Z 1
xn 1
= dx
0 (1 + x)m+n
Therefore
(m; n) = I1 + I2
Z 1 Z 1
xm 1 xn 1
= m+n
dx + m+n
dx
0 (1 + x) 0 (1 + x)
Z 1 m 1
x + xn 1
= dx
0 (1 + x)m+n
Example 16 Evaluate
Z p
2
I= cot d
0
18 CHAPTER 1. SPECIAL FUNCTIONS
Solution.
Z r
2 cos
I = ( )d
0 sin
Z
2 1 1
= cos 2 sin 2 d
0
1 21 + 1 1
+1
= ( ; 2 )
2 2 2
1 3 1
= ( ; )
2 4 4
1 ( 34 ) ( 14 ) 1 3 1
= = ( ) ( )
2 (1) 2 4 4
Example 17 Evaluate
Z b
I= (x a)n 1 (b x)m 1 dx
a
Solution. Set
x x
a x!b,0 t!1
Let
x a t 0
= ) x a = (b a)t
b a 1 0
dx = (b a)dt; (b x) = (b a)(1 t)
x = a ) t = 0; x = b ) t = 1
Therefore
Z 1
I = ((b a)t)n 1 ((b a)(1 t))m 1 (b a)dt
0
Z 1
m+n 1
= (b a) tn 1 (1 t)m 1 dt
0
m+n 1
= (b a) (m; n)
1.2. THE BETA FUNCTION 19
Let 2 = t; we have
Z
( p+1 ) ( p+1 ) 1
2 2
= p (sin t)p dt
2 (p + 1) 2 :2 0
Z
1 2
= p 2 (sin t)p dt
2 :2 0
1 p+1 1
= p ( ; )
2 :2 2 2
1 ( p+1 2
) ( 12 )
= p
2 :2 2 ( p+2 2
)
20 CHAPTER 1. SPECIAL FUNCTIONS
Therefore
( p+1
2
) ( 12 )
= p p+2
(p + 1) 2 ( 2 )
Take
p+1
= m ) p = 2m 1
2
) p
(m)
= 2m (1.11)
(2m) 2 1 ( 2m+1
2
)
) p
1
(m) (m + ) = 2m 1
(2m)
2 2
Multiplying both sides of (1.11) by (m), we have
Solution Put
x t at
= )x=
a+x a+1 a+1 t
a(a + 1)
dx = dt
(a + 1 t)2
1.2. THE BETA FUNCTION 21
Therefore
Z at at
1 ( a+1 t
)m 1 (1 a+1 t
)n 1
a(a + 1)
I = at dt
0 (a + a+1 t
)m+n (a + 1 t)2
Z 1
(at)m 1 (a + 1 t at)n 1
= a(a + 1)dt
0 (a2 + a at + at)m+n
Z 1 m 1
a (a + 1)n 1 tm 1 (1 t)n 1
= a(a + 1)dt
0 am+n (a + 1)m+n
Z 1
1
= tm 1 (1 t)n 1 dt
an (a + 1)m 0
1
= (m; n)
a (a + 1)m
n
22 CHAPTER 1. SPECIAL FUNCTIONS
1.2.1 Exercise
(1) Evaluate the following integral
Z 1
2 2
I1 = e a x dx
Z0 1
1
I2 = (ln )n 1 dy
y
Z0 1
I3 = (x ln x)3 dx
Z0 1
1
I4 = p dx
0
Z 1 x ln x
I5 = xa a x dx
Z0 1
1
I6 = (1 x4 ) 2 dx
Z0 1
x
I7 = ex e dx
Z0 1 p
3
I8 = x3 x4 dx
Z0 1
a
I9 = p 2 dx
0 x(a + x2 )
Z
10 = sin5 dx
Z0 1
2
I11 = x2 e (x 3) dx
3
1.2. THE BETA FUNCTION 23
Z 7 p
4
I12 = (x 3)(7 x)dx
3
Z 4
1
I13 = p dx
4x x 2
0
Z 1
1
I14 = dx
0 1 + x6
Z r
2
4 1 sin x
I15 = ( ) cos xdx
0 sin3 x
Z 1
2
I16 = 7 3x dx
0
( ( 41 ))2
x4 + y 4 = 1 is p
2
d 0
[(1 x2 )y ] + n(n + 1)y = 0 (1.13)
dx
This equation can be solved using Taylor power series method
which leads to the general solution
where
XN
( 1)r (2n 2r)!xn 2r
Pn (x) = (1.15)
r=0
2n r!(n r)!(n 2r)!
where
n
2
if if n even
N= (n 1) (1.16)
2
if if n odd
26 CHAPTER 1. SPECIAL FUNCTIONS
P0 (x) = 1
P1 (x) = x
1
P2 (x) = (3x2 1)
2
1
P3 (x) = (5x3 3x)
2
1
P4 (x) = (35x4 30x2 + 3)
8
1
P5 (x) = (63x5 70x3 + 15x)
8
1
P6 (x) = (231x6 315x4 + 105x2 5)
16
Remark: It is very important to note that (for example)
1
y = P4 (x) = (35x4 30x2 + 3);
8
1.3. LEGENDRE POLYNOMIALS 27
Remark
Theorem For all jxj < 1 and jtj < 1, the following relation
holds
1 X1
p = tn Pn (x) (1.20)
1 2xt + t2 n=0
= P0 (x) + P1 (x)t + P2 (x)t2 + :::
Proof. Recall the binomial expansion is given by
1 1 3 5
(1 z) 2 = 1 + z + z 2 + z 3 + ::: (1.21)
2 8 16
we have
1 1
p = (1 (2xt t2 )) 2
1 2xt + t2
1 3
= 1 + (2xt t2 ) + (2xt t2 )2
2 8
5
+ (2xt t2 )3 + :::
16
1 2 3
= 1 + xt t + (4x2 t2 4xt3 + t4 )
2 8
5
+ (8x3 t3 + 6xt5 12x2 t4 + t4 )
16
+:::
Rearranging the terms, we get
1 1
p = 1 + [x]t + [ (3x2 1)]t2
1 2xt + t2 2
1
+[ (5x3 3x)]t3 + :::
2
We observe that
1
p = P0 (x) + P1 (x)t + P2 (x)t2 + :::
1 2xt + t2
So, the coe¢ cients of tn are the Legendre polynomial Pn (x)
1.3. LEGENDRE POLYNOMIALS 29
1 X1
p = tn Pn (x) (1.22)
1 2xt + t2
n=0
1 X 1
p = tn Pn (1) (1.23)
1 2t + t2
n=0
Since
1 1
p = p
1 2t + t2 (1 t2 )2
= (1 t) 1
= 1 + t + t2 + ::: + tn + ::: (1.24)
X
1
1 + t + t2 + ::: + tn + ::: = tn Pn (1)
n=0
Pn (1) = 1
1.
nPn = (2n 1)xPn 1 (n 1)Pn 2
2.
0 0
(2n + 1)Pn = Pn+1 Pn 1
3.
0 0
nPn = xPn Pn 1
4.
0
(x2 1)Pn = (n + 1)(Pn+1 xPn )
Put n = 2, we get
Example 23 Evaluate
Z 1
Pn (x)dx when n is even
0
Solution
Since n is even, then n 1 and n + 1 are odd. Accordingly
Therefore
Z 1
1
Pn (x)dx = [1 1 0 + 0] = 0
0 2n + 1
and
00 0
(1 x2 )Pn 2xPn + n(n + 1)Pn = 0 (1.27)
Multiplying (1.26) by Pn and (1.27) by Pm and subtracting the
resulting equations, we have
00 00 0 0
(1 x2 )(Pn Pm Pm Pn ) 2x(Pn Pm Pm Pn )
+[m(m + 1) n(n + 1)]Pn Pm = 0
32 CHAPTER 1. SPECIAL FUNCTIONS
or
d 0 0 0 0
(1 x2 ) (Pn Pm Pm Pn ) 2x(Pn Pm Pm Pn )
dx
+[m2 n2 + m n]Pn Pm = 0
d n 0 0
o
(1 x2 )(Pn Pm Pm Pn ) = (m n)(m + n + 1)Pn Pm
dx
Z 1
) Pn (x)Pm (x)dx = 0
1
)
n n+1
xPn = Pn 1 + Pn+1 (1.29)
2n + 1 2n + 1
1.3. LEGENDRE POLYNOMIALS 33
)
Z 1 h i Z 1
2 0 0
(1 x )Pn Pm dx = 0 + n(n + 1) Pn Pm dx
1 1
= 0 (since m 6= n)
34 CHAPTER 1. SPECIAL FUNCTIONS
where Z 1
2n + 1
Cn = f (x)Pn dx (1.33)
2 1
Replacing m by n
Z 1
2n + 1
Cn = f (x)Pn dx
2 1
36 CHAPTER 1. SPECIAL FUNCTIONS
Then
Z
2n + 1 1
Cn = f (x)Pn dx
2 1
Z 0 Z 1
2n + 1
= ( ) 0:Pn dx + x:Pn dx
2 1 0
Z 1
2n + 1
= ( ) x:Pn dx
2 0
)
Z Z
1 1 1 1 1
C0 = x:P0 dx = x:1dx =
2 0 2 0 4
Z Z 1
3 1 1 1
C1 = x:P1 dx = x:xdx =
2 0 2 0 6
Z Z 1
5 1 5 3x 2
1 5
C2 = x:P2 dx = x dx =
2 0 2 0 2 16
Z Z 1
7 1 7 5x 3
3x
C3 = x:P3 dx = x dx = 0
2 0 2 0 2
Z Z
9 1 9 1 35x4 30x2 + 3 3
C4 = x:P4 dx = x dx =
2 0 2 0 8 32
Hence
1 1 5 3
f (x) = P0 + P1 + P2 P4 + :::
4 6 16 32
1.4. HERMITE POLYNOMIALS 37
r=0
r! (n 2r)!
where hni n
2
if n is even
= n 1
2 2
if n is odd
2.
0 0
Hn (x) = 2nHn 1 (x); H0 (x) = 0 (1.39)
) Z 1
1 x2
Cm = p m e f (x)Hm dx
2 m! 1
Replacing m by n
Z 1
1 x2
Cn = p n e f (x)Hn dx
2 n! 1
Example Evaluate
Z 1
x2
xe Hn Hn+1 dx
1
L0 (x) = 1
L1 (x) = x+1
1 2
L2 (x) = x 4x + 2
2!
1
L3 (x) = x3 + 9x2 18x + 6
3!
1 4
L4 (x) = x 16x3 + 72x2 96x + 24
4!
1.5. LAGUERRE POLYNOMIALS 41
1.
2.
0
xLn (x) = nLn (x) nLn 1 (x); (1.47)
where Z 1
Cn = e x f (x)Ln dx
0
Proof. Multiplying both sides of (1.49) by e x Lm and integrate from
0 to 1, we obtain
Z 1 X1 Z 1
x
e f (x)Lm dx = Cn e x Ln Lm dx
0 n=0 0
42 CHAPTER 1. SPECIAL FUNCTIONS
) Z 1
Cm = e x f (x)Lm dx
0
Replacing m by n
Z 1
Cn = e x f (x)Ln dx
0
Example 24 Evaluate
Z 1
xe x Ln Ln+1 dx
0
so that
Z 1 Z 1
x
xe Ln Ln+1 dx = e x Ln+1 [(2n + 1) Ln (n + 1) Ln+1 nLn 1 ] dx
0 0
Z 1 Z 1
x
= (2n + 1) e Ln+1 Ln dx (n + 1) e x L2n+1 dx
Z 1 0 0
n e x Ln+1 Ln 1 dx
0
= (2n + 1) (0) (n + 1) n(0)
= (n + 1)
1.6. CHEBYSHEV POLYNOMIALS 43
[ n2 ]
X n!
Tn (x) = ( 1)r (x)n 2r
(1 x2 )r (1.51)
r=0
2r! (n 2r)!
1 t2 X1
2
= T0 (x) + 2 tn Tn (x) (1.52)
1 2tx + t n=1
T0 (x) = 1
T1 (x) = x
T2 (x) = 2x2 1
T3 (x) = 4x3 3x
T4 (x) = 8x4 8x2 + 1
44 CHAPTER 1. SPECIAL FUNCTIONS
1.
Tn+1 (x) = 2xTn (x) Tn 1 (x); (1.54)
2.
0
1 x2 Tn (x) = nxTn (x) + nTn 1 (x); (1.55)
where
Z 1
2 Tn (x)
Cn = f (x) p dx; n = 1; 2; :::
1 1 x2
Z
1 1 f (x)
C0 = p dx
1 1 x2
1.6. CHEBYSHEV POLYNOMIALS 45
Example 25 Evaluate
Z 1
Tn+1 (x)Tn (x)
x p dx
1 1 x2
Solution We have from (1.54)
1
xTn (x) = [Tn+1 (x) + Tn 1 (x)]
2
46 CHAPTER 1. SPECIAL FUNCTIONS
so that
Z 1 Z
Tn+1 (x)Tn (x) 1 1 Tn+1
x p dx = p [Tn+1 + Tn 1 ] dx
1 1 x2 2 1 1 x2
Z Z
1 1 Tn+12
1 1 Tn+1 Tn 1
= p dx + p dx
2 1 1 x2 2 1 1 x2
1
= : =
2 2
1.6. CHEBYSHEV POLYNOMIALS 47
1.6.6 Exercises
1. Express f (x) = 4x3 +6x2 +7x+2 in terms of Legendre polynomial
2. Prove that
Pn (1) = 1
3. Prove that
Pn ( 1) = ( 1)n
4. Prove that
P2n+1 (0) = 0
5. Prove that Z 1
Pn (x) = 0
1
6. Show that Z 1
Pn (x) 2hn
p dx =
1 1 2xt + t2 2n + 1
7. Prove that
1 1
1 + P1 (cos ) + P2 (cos ) + :::
2 3
1 + sin =2
= ln
sin =2
9. Expand
f (x) = x2
48 CHAPTER 1. SPECIAL FUNCTIONS
13. Evaluate Z 1
x3 P4 (x)dx
1
14. Evaluate Z 1
xPn2 (x)dx
1
n is a fraction
y = c1 Jn (x) + c2 J n (x)
n is an integer or zero
y = c1 Jn (x) + c2 Yn (x)
where
1.0
0.8
0.6
0.4
0.2
0.0
1 2 3 4 5 6 7 8 9 10
-0.2 x
-0.4
y 1
0.5
x
2.5 5 7.5 10
0
-0.5
-1
-1.5
-2
-2.5
Yn (x), n = 0; 1; 2; 3; 4
1.7. THE BESSEL FUNCTION 51
Example 26 Notation 27
1.
d n
[x Jn (x)] = xn Jn 1 (x)
Z dx
xn Jn 1 (x)dx = xn Jn (x) + c
2.
d
[x n Jn (x)] = x n
Jn+1 (x)
Z dx
x n Jn+1 (x)dx = x n
Jn (x) + c
52 CHAPTER 1. SPECIAL FUNCTIONS
Example 28
d 3
[x J3 (x)] = x3 J2 (x)
dx
d
[x 3 J3 (x)] = x 3 J4 (x)
dx
Z
3 3
x 2 J 1 (x)dx = x 2 J 3 (x) + c
2 2
Z
3 3
x 2 J 5 (x)dx = x 2 J 3 (x) + c
2 2
Solution Z
x2 :x1 J0 (x)dx
1.7. THE BESSEL FUNCTION 53
Integrating by part
Z Z
x2 :x1 J0 (x)dx = x1 J1 (x):x2 x1 J1 (x)(2x)dx
Z
3
= x J1 (x) 2 x2 J1 (x)dx
= x3 J1 (x) 2x2 J2 + c
Example 31 Evaluate the following integral
Z
x2 J0 (x)J1 (x)dx
Solution
Z Z
I = x J0 (x)J1 (x)dx = x1 J0 (x)x1 J1 (x)dx
2
Z
1 1
= x J1 (x)x J1 (x) x1 J1 (x)x1 J0 (x)dx
Z
2 2
= x J1 (x) x2 J1 (x)J0 (x)dx
= x2 J12 (x) I
) 2I = x2 J12 (x)
1
) I = x2 J12 (x) + c
2
Example 32 Show that
d
[xJ5 (x)J6 (x)] = x[J52 (x) J62 (x)]
dx
Solution
d d
[xJ5 (x)J6 (x)] = [x 5 J5 (x)x6 J6 (x)
dx dx
= (x 5 J5 (x))(x6 J5 (x)) + (x6 J6 (x))( x 5 J6 (x))
= (xJ52 (x) xJ62 (x))
= x[J52 (x) J62 (x)]
54 CHAPTER 1. SPECIAL FUNCTIONS
x 1
X
n=1
e 2 (t t
)
= J0 (x) + Jn (x)[tn + ( 1)n t n
] (1.71)
n=1
56 CHAPTER 1. SPECIAL FUNCTIONS
t = ei
x i
(e 1
)
X
n=1
e 2 ei = Jn (x)ei n
n= 1
(ei e i ) X
n=1
eix 2i = Jn (x)ei n
n= 1
Since
(ei e i
)
sin =
2i
)
X
n=1
ix sin
e = Jn (x)ei n
(1.72)
n= 1
and
sin(x sin ) = 2J1 sin + 2J3 sin 3 + 2J5 sin 5 + ::: (1.74)
n= 1
= J0 + J1 ei + J 1 e i
+ J2 e2i + J 2 e 2i
+ :::
1.7. THE BESSEL FUNCTION 57
Since
J n (x) = ( 1)n Jn (x)
)
and
sin(x sin ) = 2(J1 sin + J3 sin 3 + :::) (1.76)
Remark: On putting = 2
in (1.75) and (1.76), we obtain
and
sin(x cos ) = 2J1 cos 2J3 cos 3 + 2J5 cos 5 :::) (1.78)
Solution. Putting = 2
in (1.75) and (1.76)
Now, putting = 2
in (1.79), we obtain
y = xn Jn (x) (1.81)
0 1 2n
L:H:S = [xn Jn 1 + nxn 1 Jn 1 + x n Jn 1 + x n Jn ] (1.84)
x
Dividing (1.84) by xn 1
0
L:H:S = xn 1 [xJn 1 + nJn 1 + Jn 1 2nJn 1 + xJn ]
n 1 0
= x [xJn 1 nJn 1 + Jn 1 + xJn ] (1.85)
X
1
f (x) = Ci Jn ( i x) (1.89)
i=1
a2 2
= Cj J ( j a)
2 n+1
Since j is a dummy variable, we can write
Z a
2 1
Ci = 2 2 xf (x)Jn ( i x)dx
a Jn+1 ( i a) 0
1.7. THE BESSEL FUNCTION 61
Example 38 Expand
f (x) = x
P
in series of the form 1 r=1 Cr J1 ( r x), where r are the roots of the
equation J1 ( ) = 0; valid for the interval 0 < x < 1
Solution Given
X
1
f (x) = x = Cr J1 ( r x) (1.92)
r=1
x J1 ( r x)dx = 2
t2 J1 (t)dt
0 r 0
1
= 3
[t2 J2 (t)]0 r
r
1 2
= 3
[ r J2 ( r ) 0]
r
J2 ( r)
=
r
2 J2 ( r r )
Cr =
J22 ( i )
2
= (1.94)
r J2 ( r )
62 CHAPTER 1. SPECIAL FUNCTIONS
X1
J1 ( r x)
x=2
J ( r)
r=1 r 2
1.7. THE BESSEL FUNCTION 63
1.7.6 Exercises
1. Show that
r
2 sin x x cos x
(a) J3=2 (x) = ( )
x x
r
2 sin x + x cos x
(b) J 3=2 (x) = ( )
x x
2. Evaluate
J5=2 and J 5=2
(a) Z
x3 J3 (x)dx
(b) Z
x3 J2 (x)dx
(c) Z
p
J1 ( 3 x)dx
(d) Z
J2 (x)
dx
x2
(e) Z
J0 (x) sin xdx
64 CHAPTER 1. SPECIAL FUNCTIONS
(f) Z
J3 dx
(g) Z
xJn2 (x)dx
(h) Z
3=2
x J5=2 dx
4. Show that
(a)
1
sin x = J1 J3 + J5 J7 + :::
2
(b)
x
J1 = J2 2J4 + 3J6 :::
4
(c)
Z x X
1
J0 (t)dt = 2 J2k+1 (x)
0 k=0
(d) Z 1
J0 (t)dt = 1
0
(e) Z 1
ax 1
e J0 (bx)dx = p
0 a2 + b 2
(f) Z 1
2 cos xt
J0 = p dt
0 1 t2
1.7. THE BESSEL FUNCTION 65
(g) Z 1
4 2
(x x3 )J0 ( x)dx = 3
J1 ( ) 2
J0 ( )
0
5. Prove that
cos(x sin ) = J0 + 2J2 cos 2 + 2J4 cos 4 + :::
sin(x sin ) = 2J1 sin + 2J3 sin 3 + 2J5 sin 5 + :::
Hence, prove that
Z
1
Jn (x) = cos(n x sin )d ; n = 0; 1; 2; :::
0
6. Prove that
Jn ( x) = ( 1)n Jn (x)
7. Z 1 2
4 2
x3 J0 ( x)dx = 3
J1 ( ) + 2
J0 ( )
0
9. Prove that
d 2 0
(x Jn 1 Jn+1 ) = 2x2 Jn Jn
dx
and
d
(xJn Jn+1 ) = x(Jn2 2
Jn+1 )
dx
10. Expand
f (x) = 1 x2
P
in series of the form 1
r=1 Cr J1 ( r x) valid for the interval 0 < x <
1, where r are the roots of the equation J1 ( ) = 0
66 CHAPTER 1. SPECIAL FUNCTIONS
1.8 Summary
Equation Solution
2 00 0
(1 x )y 2xy + n(n + 1)y = 0 Pn (x) Legendre polynomial
2 00 0
x y + xy + (x2 n2 )y = 0 Jn (x) Bessel function
00 0
y 2xy + 2ny = 0 Hn (x) Hermite polynomial
00 0
xy + (1 x)y + ny = 0 Ln (x) Laguerre polynomial
00 0
(1 x2 )y xy + n2 y = 0 Tn (x) Chebyshev polynomial
Fourier Analysis
69
70 CHAPTER 2. FOURIER ANALYSIS
gfgfvgfgfgfg
71
f (x + T ) = f (x); T > 0
For example:
sin(x + 2 ) = sin x
1.0
y
0.5
-20 -10 10 20
x
-0.5
-1.0
y = sin x; T = 2
Note that
i. The period of sin nx or cos nx, where n is a positive
integer is 2n
ii. The period of jsin nx jor jcos nxj, where n is a positive
integer is n
(b) Other examples are shown in the following …gure
72 CHAPTER 2. FOURIER ANALYSIS
6
f(x)
5
0
0 1 2 3
x
3. Useful relations
cos nx = ( 1)n ; n 2 I sin nx = 0
n
0 if n even ( 1) 2 if n even
sin n2 = n 1 cos n2 =
( 1) 2 if n odd 0 if n odd
1
cos x cos y = [cos(x y) + cos(x + y)]
2
1
sin x sin y = [cos(x y) cos(x + y)]
2
1
sin x cos y = [sin(x y) + sin(x + y)]
2
2.1. FOURIER SERIES 73
a0 X
1
n x n x
f (x) = + (an cos + bn sin ) (2.1)
2 n=1
L L
Remarks
2 If L = ; then
a0 X
1
f (x) = + (an cos nx + bn sin nx) (2.8)
2 n=1
Then the Fourier series (2.1) with coe¢ cients (2.2)-(2.3) converges
to
f (x+ )+f (x )
2
if x is a point of discontinuity
The conditions (i), (ii) and (iii) imposed on f (x) are su¢ cient but
not necessary, i.e. if the conditions are satis…ed the convergence is
guaranteed. However, if they are not satis…ed the series may or may
not convergence.
Example 39 Expand
0 if x<0
f (x) =
x if 0 x
2
1 1 1
= 2
+ 2 + 2 + ::::
8 1 3 5
Solution
The period 2L = 2 ) L = ; so
Z
1
a0 = f (x)dx
Z 0 Z
1
= 0dx + ( x )dx
0
1 x2
= x
2 0
=
2
76 CHAPTER 2. FOURIER ANALYSIS
Z
1
an = f (x) cos nxdx
Z 0 Z
1
= 0: cos nxdx + ( x ) cos nxdx
0
Z
1 sin nx 1
= ( x)j0 + sin nxdx
n n 0
1h cos nx i 1
= 0 2
= [cos 0 cos n ]
n 0 n2
1 ( 1)n
=
n2
Z
1
bn = f (x) sin nxdx
Z 0 Z
1
= 0: sin nxdx + ( x ) sin nxdx
0
Z
1 cos nx 1
= ( x) j0 cos nxdx
n n 0
1h i
= 0
n 0
1
=
n
Therefore
X
1
1 ( 1)n 1
f (x) = + 2
cos nx + sin nx (2.12)
4 n=1
n n
X
1
1 ( 1)n 1
f (0) = + 2
cos 0 + sin 0
4 n=1
n n
)
X
1
1 ( 1)n
= +
2 4 n=1
n2
)
2
2 2 2
= 2
+ 2 + 2 + :::
4 1 3 5
therefore we have
2
1 1 1
+ = + + :::
8 12 32 52
Referring to (2.12), we sketch the partial sum
a0 X
r
n x n x
Sr (x) = + (an cos + bn sin )
2 n=1
L L
f(x)
3
-10 -5 0 5 10
x
y y
3 3
2 2
1 1
-2 2 4 -2 2 4
x x
S5 (x) on ( ; ) S8 (x) on ( ; )
y y
3 3
2 2
1 1
-2 2 4 -2 2 4
x x
S15 (x) on ( ; ) S30 (x) on ( ; )
2.1. FOURIER SERIES 79
Gibbs phenomenon
Previeous …gures shows the partial sums of (2.12). We can see
there are pronounced spikes near the discontinuities (at x = 0). This
overshooting of Sr does not smooth out but remains fairly constant
even when r is large. This is so-called Gibbs phenomenon
2. …nd f (0); f ( )
3. Prove that
X1
( 1)r
=
r=0
2r + 1 4
Z 2
1
a0 = f (x)dx
0
Z 2
1
= xdx
0
2
1 x2
=
2 0
= 2
80 CHAPTER 2. FOURIER ANALYSIS
Z 2
1
an = f (x) cos nxdx
0
Z 2
1
= x cos nxdx
0
Z 2
1 sin nx 2 1
= x j0 sin nxdx
n n 0
1h cos nx i2
2
1 1 1
= 0+ =
n2 0 n2 n2 0
= 0
Z 2
1
bn = f (x) sin nxdx
0
Z 2
1
= x sin nxdx
0
Z 2
1 cos nx 2 1
= x j0 + cos nxdx
n n 0
1 2
= +0
n
2
=
n
Therefore
X
1
sin nx
f (x) = 2 (2.13)
n=1
n
At x = 0
f (0+ ) + f (0 ) 0+2
f (0) = f (0) = = =
2 2
f( ) =
2.1. FOURIER SERIES 81
Putting x = 2
in (2.13), we get
X1
sin(n 2 )
f( ) = 2
2 n=1
n
Let
n = 2r + 1
X
1
sin(2r + 1) 2
= 2
2 n=0
2r + 1
X1
( 1)r
= 2
n=0
2r + 1
therefore we have
X1
( 1)r
=
4 n=0
2r + 1
f(x) 6
5
-20 -10 0 10 20
x
y y
6 6
4 4
2 2
-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
x x
S5 (x) S8 (x)
y y
6 6
4 4
2 2
-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
x x
S15 (x) S30 (x)
2.1. FOURIER SERIES 83
Example 41 Expand
2 if 2 x 0
f (x) =
x if 0<x<2
Z
1 2 n x
an = f (x) cos dx
2 2 2
Z 0 Z 2
1 n x n x
= 2: cos dx + x: cos dx
2 2 2 0 2
" #
2
1 4 n x 0 2 n x 4 n x
= sin + x sin + 2 2
cos
2 n 2 2 n 2 n 2 0
1 4 4
= 2 2
cos n 2 2
2 n n
2
= [( 1)n 1]
n 2
2
84 CHAPTER 2. FOURIER ANALYSIS
Z
1 2 n x
bn = f (x) sin dx
2 2 2
Z 0 Z 2
1 n x n x
= 2: sin dx + x: sin dx
2 2 2 0 2
" #
2
1 4 n x 0 2 n x 4 n x
= cos + x cos + 2 2
sin
2 n 2 2 n 2 n 2 0
1 4 4 4 4
= + cos n + cos n + 2 2
sin n
2 n n n n
2
=
n
Therefore
3 X 2(( 1)n 1)
1
n x 2 n x
f (x) = + 2 2
cos sin (2.14)
2 n=1 n 2 n 2
3 X 2
1
1= + [( 1)n 1]
2 n=1 n2 2
Let
n = 2r + 1
)
4 X
1
1 1
= 2
2 r=0
(2r + 1)2
2.1. FOURIER SERIES 85
therefore we have
2 X
1
1
=
8 r=0
(2r + 1)2
The following …gure shows the function and its Fourier series
f(x)
3
-4 -3 -2 -1 0 1 2 3 4
x
y3 y
3
2 2
1 1
-4 -2 2 4 -6 -4 -2 2 4 6
x x
S5 (x) S8 (x)
86 CHAPTER 2. FOURIER ANALYSIS
3 3
y y
2 2
1 1
-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
x x
S15 (x) S30 (x)
a0 X
1
f (x) = + cn cos(n! 0 x + n) (2.19)
2 n=1
and
p
cn = a2n + b2n
bn
n = tan 1 ( )
an
Where
Example 42 Find the phase angle form of the Fourier series for the
following function
f (x) = x2 ; 0 x < 3
and
f (x + 3) = f (x)
Solution Here
!0 = =
L 3=2
2
=
3
88 CHAPTER 2. FOURIER ANALYSIS
Z 3
1
an = f (x) cos (n! 0 x) dx
3=2 0
Z
2 3 2 2n x
= x cos dx
3 0 3
9
=
n 2
2
and
Z 3
1
bn = f (x) sin (n! 0 x) dx
3=2 0
Z
2 3 2 2n x
= x sin dx
3 0 3
9
=
n
Calculate
p
cn = a2 + b2n
r n
81 81
= 4 4
+ 2 2
n n
9 p
= 1 + n2 2
n2 2
2.1. FOURIER SERIES 89
and
bn
n = tan 1 ( )
an
9=n
= tan 1 ( )
9=n2 2
= tan 1 (n )
Therefore the harmonic or phase angle form of the Fourier series
of f (x) is
X1
9 p 2n x
f (x) = 3 + 2 2
1 + n2 2 cos + tan 1 (n )
n=1
n 3
3
f(x)
-2 -1 0 1 2
x
90 CHAPTER 2. FOURIER ANALYSIS
f ( x) = f (x)
For example
3
f(x)
2
-2 -1 1 2
-1
x
-2
-3
Z
2 L n x
an = f (x) cos dx
L 0 L
Z
2
= x2 cos nxdx
0
2 sin nx cos nx sin nx
= x2 + 2x 2
n n2 n3 0
4( 1)n
=
n2
92 CHAPTER 2. FOURIER ANALYSIS
Therefore
X1
4( 1)n
2
f (x) = + cos nx (2.26)
3 n=1
n2
Putting x = 0 in (2.26), we get
2
1 1 1 1
0= 4 + 2 + :::
3 12 22 3 42
)
2
1 1 1 1
+ + ::: =
12 22 32 42 12
Example 44 Find the Fourier series expansion of
f (x) = x2 ; x
Hence, …nd the sum of
1 1 1 1
2 2
+ 2 + :::
1 2 3 42
Solution Since f (x) = x3 is an even function ) a0 = an = 0;
and
Z
2 L n x
bn = f (x) sin dx
L 0 L
Z
2
= x3 sin nxdx
0
2cos nx sin nx cos nx sin nx
= x3
+ 3x2 2 + 6x 6
n n n3 n4 0
2
6
= 2( 1)n 3
n n
Therefore
X
1
6 2
f (x) = 2( 1)n sin nx (2.27)
n=1
n3 n
2.1. FOURIER SERIES 93
1. Re‡ect the graph about the y-axis onto L < x < 0; the func-
tion is now even
3
f(x)
-2 -1 0 1 2
x
2. Re‡ect the graph through the origin onto L < x < 0; the func-
94 CHAPTER 2. FOURIER ANALYSIS
3
f(x)
2
-2 -1 1 2
-1
x
-2
-3
3
y
-2 -1 0 1 2
x
Example 45 Expand
f (x) = x2 ; 0<x<
2.1. FOURIER SERIES 95
1. in cosine series,
2. in sine series
3. in Fourier series
12
f(x)
10
-4 -2 0 2 4
x
f (x) = x2 , 0 < x <
96 CHAPTER 2. FOURIER ANALYSIS
12
f(x)
10
-4 -2 0 2 4
x
Z Z
2 L 2
a0 = f (x)dx = x2 dx
L 0 0
2 x3
=
3 0
2 2
=
3
Z
2
an = x2 cos nxdx
0
2sin nx cos nx sin nx
= x2 + 2x 2
n n2 n3 0
4( 1)n
=
n2
bn = 0
Therefore
X1
4( 1)n
2
f (x) = + cos nx
3 n=1
n2
2.1. FOURIER SERIES 97
f(x) 10
-4 -2 2 4
x
-5
-10
a0 = 0
an = 0
Z
2 L n x
bn = f (x) sin dx
L 0 L
Z
2
= x2 sin nxdx
0
2 cos nx sin nx cos nx
= x2 + 2x 2 + 2
n n n3 0
2
2 ( 1)n 2( 1)n 2
= + 3
n n n3
4 4 2
= 3
+ ( 1)n 3
n n n
98 CHAPTER 2. FOURIER ANALYSIS
Therefore
X
1
4 4 2
f (x) = + ( 1)n sin nx
n=1
n3 n3 n
f(x) 10
-4 -2 2 4
x
-5
-10
Z
1
a0 = f (x)dx
2 0
Z
2
= x2 dx
0
2 x3
=
3 0
2 2
=
3
2.1. FOURIER SERIES 99
Z
1 n x
an = f (x) cos dx
2 0 2
Z
2 2
= x cos 2nxdx
0
2 sin 2nx cos 2nx sin 2nx
= x2 + 2x 2
+2
2n 4n 8n3 0
1
=
n2
Z
1 n x
bn = f (x) sin dx
2 0 2
Z
2
= x2 sin 2nxdx
0
2 cos 2nx sin 2nx cos 2nx
= x2 + 2x 2
+2
2n 4n 8n3 0
=
n
Therefore
2 X1
1
f (x) = + 2
cos 2nx sin 2nx (2.28)
3 n=1
n n
Given that as
X Z
L ! 1: T hen 4 ! ! 0; (:) 4 ! ! (:)d!
and
2 R1 3
Z 1 f (x) cos (!x) dx cos (!x)
1 4 1
5 d!(2.32)
f (x) = R1
0 + 1
f (x) sin (!x) dx sin (!x)
Z 1
1
= [A(!) cos (!x) + B(!) sin (!x)] (2.33)
0
102 CHAPTER 2. FOURIER ANALYSIS
Remark
and
B(!) = 0:
Therefore
Z 1
1
f (x) = [A(!) cos (!x) + B(!) sin (!x)] d!
Z0 1
1 2
= 2 + !2
cos (!x) d!
0
Putting x = 5 )
Z 1
5 1 2
e = 2 + !2
cos (5!) d!
0
) Z 1
cos (5!) 5
2 + !2
d! = e
1 2
Note that
Z 1
x
e cos (!x) dx = 2 + !2
Z0 1
x !
e sin (!x) dx = 2 + !2
0
In the next …gures, we Sketch the function and its Fourier integral
1.0
f(x)
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f4
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f10
2.2. FOURIER INTEGRAL 105
Solution
Since f (x) is even function ) B(!) = 0; and
Z 1
A(!) = 2 f (x) cos (!x) dx
0
Z 1 Z 1
= 2 1: cos (!x) dx + 0: cos (!x) dx
0 1
2 sin !
=
!
Therefore
Z 1
1
f (x) = [A(!) cos (!x) + B(!) sin (!x)] d!
0
Z 1
1 2 sin !
= cos (!x) d!
0 !
The following sketch is Fourier integral
1.2
f(x)
1.0
0.8
0.6
0.4
0.2
-3 -2 -1 0 1 2 3
x
106 CHAPTER 2. FOURIER ANALYSIS
1.2
y
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f5 integrate from x = 0 to x = 5
1.2
y
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f20 integrate from x = 0 to x = 20
2.2. FOURIER INTEGRAL 107
1.2
y
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f50 integrate from x = 0 to x = 50
108 CHAPTER 2. FOURIER ANALYSIS
1.2
y
1.0
0.8
0.6
0.4
0.2
-4 -2 0 2 4
x
f100 integrate from x = 0 to
x = 100
Z 1
1
f (x) = A(!) cos (!x) d!
0
Z 1
A(!) = 2 f (x) cos (!x) dx
0
2.2. FOURIER INTEGRAL 109
Find
x
Even function
110 CHAPTER 2. FOURIER ANALYSIS
Z 1
A(!) = 2 f (x) cos (!x) dx
Z0 1
x
= 2 e cos (!x) dx
0
2
= 2 + !2
and
Z 1
1
f (x) = A(!) cos (!x) d!
0
Z 1
2 1
= 2
cos (!x) d!
0 + !2
Odd function
2.2. FOURIER INTEGRAL 111
Z 1
B(!) = 2 f (x) sin (!x) dx
0
Z 1
x
= 2 e sin (!x) dx
0
2!
= 2 + !2
and
Z 1
1
f (x) = B(!) sin (!x) d!
0
Z 1
2 !
= 2
sin (!x) d!
0 + !2
Z 1
cos( 2 !) cos !x 2
cos x jxj < 2
d! =
0 1 !2 0 jxj > 2
Solution Let
2.3 Exercises
1. If the functionsf (x); g(x) have the period P , show that the func-
tion h(x) = af (x)+bg(x) where a, b are constants has the period
P:
1 if <x<0
f (x) =
x if 0<x<
2
Obtain series representation for
sin x if 0<x<
f (x) =
0 if <x<2
2
+ x if <x<0
f (x) =
2
x if 0<x<
114 CHAPTER 2. FOURIER ANALYSIS
Find
Fourier series
10 Prove that
Z L X
1
1 2
f (x) dx = 2a20 + (a2n + b2n )
L L n=1
1.5
f(x)
1.0
0.5
-4 -2 2 4
-0.5
x
-1.0
-1.5
116 CHAPTER 2. FOURIER ANALYSIS
Partial Di¤erential
Equations (PDEs)
117
118CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
will depend both on time and which part of the string you’re looking
at. The solution of an ODEs is called a trajectory. It may be rep-
resented graphically by one or more curves. The solution of a PDEs,
however, could be a surface, a volume, or something else; depending
on how many variables are involved and how they’re interpreted. In
general, PDEs are complicated to solve. Concepts such as separation
of variables or integral transformations tend to work very di¤erently.
One signi…cant di¢ culty is that the solution of a PDEs depends very
strongly on the initial/boundary conditions (ICs/BCs). An ODEs typ-
ically yields a general solution, which involves one or more constants
which may be determined from one or more ICs/BCs. PDEs, how-
ever, do not easily yield such general solutions. A solution method
that works for one initial boundary value problem (IBVP) may be
useless for a di¤erent IBVP.
uxx + uyy = 0
L [u] = f
where
L [:] = (:)xx 5 (:)y + (:) (3.1)
is the second order partial di¤erential operators, and
f (x; y) = xy 2 (x 5)
120CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
L [ v + w] = L [v] + L [w]
for any functions v and w in the domain of L and for any con-
stants and ; otherwise it is nonlinear, for example the op-
erator L given by (3.1) is linear because
@2 @
L [ v + w] = 2
( v + w) 5 ( v + w) + ( v + w)
@x @y
= (vxx 5vy + v) + (wxx 5wy + w)
= L [v] + L [w]
L [u] = ux + uuy
is nonlinear since
The equation is called linear if the unknown function and the par-
tial derivatives are of the …rst degree and at most one of these appears
in any given terms, otherwise the equation is nonlinear.
3.1. BASIC CONCEPTS 121
Boundary conditions
Initial conditions
Principle of superposition
Parabolic if B 2 4AC = 0
Hyperbolic if B 2 4AC > 0
Elliptic if B 2 4AC < 0
utt = c2 uxx
ut = c2 uxx
uxx + uyy = 0
1.
2uxx + 3uxy uyy + 3u = 0
2.
utt + 5uxx = 0
3.
yuxx + uyy = 0
4.
yuxx = xuyy
Solution
3.1. BASIC CONCEPTS 123
1. A = 2; B = 3; C = 1
B2 4AC = 32 4(2)( 1)
= 17 > 0
) Hyperbolic
2. A = 1; B = 0; C = 5
B2 4AC = 02 4(1)(5)
= 20 < 0
) Elliptic
3. A = y; B = 0; C = 1
B2 4AC = 02 4(y)(1)
= 4y
Hyperbolic if y < 0
) Elliptic if y > 0
Parabolic if y = 0
4. A = y; B = 0; C = x
B2 4AC = 02 4(y)( x)
= 4xy
Hyperbolic if x:y > 0
) Elliptic if x:y < 0
Parabolic if x:y = 0
124CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
Physical assumptions
1. The mass of the string per unit length is constant (string is
homogeneous)
2. The string is perfectly elastic
3. Every particle of the string moves vertically
4. The string o¤er no resistance to bending
Steps
1. Let T1 and T2 be the tension at endpoints P and Q of the portion
of the string, then
T1 cos = T2 cos = T = constant (3.4)
3.1. BASIC CONCEPTS 125
@2u
T2 sin T1 sin = 4x (3.5)
@t2
4 Now, tan and tan are the slopes of the string at x and x+4x
@u @u
tan = ; tan =
@x x @x x+4x
)
@u @u @2u
= 4x (3.6)
@x x+4x @x x @t2
6 If 4x ! 0; we get
@2u 2
2@ u T
= c ; c2 =
@t2 @x2
126CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
If X(0) 6= 0 or X(L) 6= 0;then T (t) must be zero for all t; and so,
by (3.10) u is identically zero (trivial solution). To avoid this trivial
solution, we set
and
X(L) = 0 ) 0 = C2 sinh L ) C2 = 0
Therefore we get only the trivial solution from this case
X(0) = 0 ) C1 = 0 ) X(x) = C2 x
and
X(L) = 0 ) 0 = C2 L ) C2 = 0
Therefore we get only the trivial solution from this case
2
Case 3 If k < 0: Let k = ; then from (3.13), we get
00 2
X + X = 0; X(0) = 0 and X(L) = 0 (3.18)
and
X(L) = 0 ) 0 = C2 sin L
To avoid the trivial solution, we take C2 6= 0; which forces
sin L = 0
and so
n
X = Xn = sin x; n = 1; 2; :::
L
note that for the negative values of n we obtain the same solutions
except for a change of sign.
2 n 2
Now, we go back to (3.12) and substitute k = = L
and
get
00 n 2
T + c T = 0; n = 1; 2; :::
L
The general solution of this equation is
Tn = C3 cos nt + C4 sin nt
where
n
n =c
; n = 1; 2; :::
L
Combining the solutions for X and T as described in (3.10), we
obtain an in…nite set of product solutions of (3.7)
n
un (x; t) = sin x (C3 cos nt + C4 sin n t) ; n = 1; 2; :::
L
Then by superposition principle, we get
X
1
n
u(x; t) = sin x (C3 cos nt + C4 sin n t)
n=1
L
u(x; 0) = f (x) )
X1
n
f (x) = C3 sin x; 0 < x < L
n=1
L
3.2. SOLUTION OF THE WAVE EQUATION 131
@u X
1
n
= sin x ( C3 n sin nt + n C4 cos n t)
@t n=1
L
@u
(x; 0) = g(x) )
@t
X1
n
g(x) = n C4 sin x
n=1
L
Is
X
1
n
u(x; t) = sin x ( bn cos nt + bn sin n t)
n=1
L
where
n
n =c ;
L
Z L
2 n
bn = f (x) sin x dx; n = 1; 2; :::
L 0 L
and Z L
2 n
bn = g(x) sin x dx; n = 1; 2; :::
cn 0 L
1
Determine the subsequent motion of the string, given that c =
Solution
3.2. SOLUTION OF THE WAVE EQUATION 133
Z
2 L n
bn = f (x) sin x dx
L 0 L
Z
2 1
= f (x) sin n x dx
1 0
Z 1 Z 1
3 3 3
= x sin n x dx + (1 x) sin n x dx
5 0 10 13
9 sin n3
=
10 2 n2
n
n =c =n
L
9 X
1
sin n 3
u(x; t) = 2
sin n x cos nt
10 n=1
n2
1.2
u
1.0
0.8
0.6
0.4
0.2
0.0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
t=0
1.2
u
1.0
0.8
0.6
0.4
0.2
0.0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
t = 0:5
3.2. SOLUTION OF THE WAVE EQUATION 135
1.2
u
1.0
0.8
0.6
0.4
0.2
0.0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
t=1
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t = 1:5
136CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t=2
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t = 2:5
3.2. SOLUTION OF THE WAVE EQUATION 137
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t=3
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t = 3:5
138CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
1.0
u
0.5
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
x
-0.5
-1.0
t=4
Solution
Since f (x) = 0 ) bn = 0; n = c nL = 2n and
Z L
2 n
bn = g(x) sin x dx
cn 0 L
Z
2 2
= xcosx sin 2nx dx
n 0
8( 1)n+1
= ; n = 1; 2; :::
(4n2 1)2
We …nd the solution
8 X ( 1)n+1
1
u(x; t) = 2 2
sin 2nx sin 2nt
n=1
(4n 1)
3.2. SOLUTION OF THE WAVE EQUATION 139
0.4
u
0.2
0.0
0.2 0.4 0.6 0.8 1.0 1.2 1.4
x
-0.2
-0.4
140CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
3.3.1 Case 1
Solve the heat equation
ut = c2 uxx ; 0 < x < L; t > 0 (3.21)
with the boundary conditions
u(0; t) = 0 and u(L; t) = 0; t>0 (3.22)
and initial condition
u(x; 0) = f (x); 0 < x < L (3.23)
3.3. THE ONE DIMENSIONAL HEAT EQUATION 141
If X(0) 6= 0 or X(L) 6= 0;then T (t) must be zero for all t; and so,
by (3.10) u is identically zero (trivial solution). To avoid this trivial
solution, we set
where
n
n =c ; n = 1; 2; :::
L
3.3. THE ONE DIMENSIONAL HEAT EQUATION 143
u(x; 0) = f (x) )
X1
n
f (x) = bn sin x; 0 < x < L
n=1
L
Is
X
1
2t n
u(x; t) = bn e n sin x
n=1
L
where
Z L
2 n n
bn = f (x) sin x dx; n =c ; n = 1; 2; :::
L 0 L L
Example 52 Temperature in a bar with ends held at 0 C
and
X
1
n2 t
u(x; t) = bn e sin nx
n=1
where
Z
2
bn = 100 sin nx dx
0
200
= (1 ( 1)n )
n
)
200 X 1
1
n2 t
u(x; t) = (1 ( 1)n )e sin nx
n=1
n
400 X e
1 (2k+1)2 t
= sin (2k + 1) x
k=0
2k + 1
u 100
80
60
40
20
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x
t = 0; n = 30
146CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
u 100
80
60
40
20
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x
t = 0:5
u
100
80
60
40
20
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x
t=1
3.3. THE ONE DIMENSIONAL HEAT EQUATION 147
u 100
80
60
40
20
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x
t = 2:5
Note that the previous graph shows that the temperature of the
bar tends to zero as t increases. This is clear since the ends of the bar
are kept at 0 C and there is no source of internal heat.
and
lim u(x; t) = v(x)
t!1
where the function v(x) called the Steady state temperature dis-
tribution.
148CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
d2 v
=0
dx2
with
v(0) = T1 and v(L) = T2
Because v, the steady state solution, is a function of x only. The
general solution is
v(x) = Ax + B
since
v(0) = T1 ) B = T1
and
v(L) = T2 ) AL + T1 = T2
T2 T1
) A=
L
Therefore, the steady state solution is
T2 T1
v(x) = x + T1 (3.29)
L
where
Z
2 L n
bn = [f (x) v(x)] sin x dx; (3.38)
L 0 L
Z
2 L T2 T1 n
= f (x) x + T1 sin x dx; (3.39)
L 0 L L
150CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
Solution
We have T1 = 0 and T2 = 100; f (x) = 100; L = . Thus
T2 T1 100
v(x) = x + T1 = x
L
and
T2 T1 100
f (x) x + T1 = 100 x
L
so
Z
2 L T2 T1 n
bn = f (x) x + T1 sin x dx;
L 0 L L
Z
2 100 n
= 100 x sin x dx
0 L
200
=
n
u
100
80
60
40
20
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x
In equation (3.44) the variables are separated in the sense that the
left side is a function of t alone and right side is a function of x alone.
Since the x and t variables are independent of each other, so we equate
the two sides with a constant k , thus
0 00
T X
=k and =k
c2 T X
3.3. THE ONE DIMENSIONAL HEAT EQUATION 153
X(0) = 0
X(0) = 0 ) A = 0
Leaving
X(x) = B sin x
and the solution of (3.45) yields
2 2
c t
T =e
154CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
2
So, for any values of ; the function
2 2
c t
u(x; t; ) = X(x)T (t) = B sin x e
u(x; 0) = f (x) )
Z 1
f (x) = B( ) sin x d
0
@u @u
(0; t) = 0; and (L; t) = 0; t > 0
@x @x
3.3. THE ONE DIMENSIONAL HEAT EQUATION 155
3.4 Exercises
1. In excersises a-f decide whether the given PDE and boundary or
initial conditions are linear or nonlinear, and, if linear, whether
they are homogeneous or nonhomogeneous. Determine the order
of the equation, and classify for elliptic, parabolic, or hyperbolic.
(a)
uxx + uxy = 2u; ux (0; y) = 0
(b)
uxx + xuxy = 2; u(x; 0) = 0; u(x; 1) = 0
(c)
uxx ut = f (x; t); ut (x; 0) = 2
(d)
uxx = ut ; u(x; 0) = 1; u(x; 1) = 0
(e)
ut ux + uxt = 2u; u(0; t) + ux (0; t) = 0
(f)
uxx + et utt = u cos x; u(x; 0) + u(x; 1) = 0
(a)
1
f (x) = 0:05 sin x; g(x) = 0; c =
(b) g(x) = 0; c = 4;
1
2x if 0 x 2
f (x) =
2(1 x) if 12 < x 1
(c) g(x) = 1; c = 4;
8 1
< 4x if 0 x 4
f (x) = 1 if 14 < x 3
4
:
4(1 x) if 34 < x 1
(a)
L = 1; c = 1; f (x) = x
(b)
x
L = 1; c = 1; f (x) = e
(c)
100 if 0 x 2
L = ; c = 1; f (x) =
0 if 2 < x
(d)
33x if 0 x 2
L = ; c = 1; f (x) =
33( x) if 2 < x
is
u(x; t) = w(x; t) + v(x)
where
T2 T1
v(x) = x + T1
L
and
X
1
2t n n
w(x; t) = bn e n sin x; n =c
n=1
L L
Z L
2 n T1+ ( 1)n+1 T2
bn = f (x) sin x 2
L 0 L n
7. Solve the previous problem for the following condition
and
f (x) = 50x(1 x)
160CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
Bibliography
[5] Bell, W.W. Special Functions for Scientists and Engineers. Lon-
don, Van Nostrand, 1968.
161
Part (2)
Numerical Analysis
EQUATIONS 23
Chapter -3 Interpolation 57
-1-
Curve fitting
-2-
1-1 Curve fitting
In practice a relationship is found to exist between two or more variables,
and one wish to express this relationship in mathematical form by determining
an equation connecting these variables.
Suppose that we have the following raw data that was obtained from a
certain experiment:
xi x1 x2 x3 … xn
yi y1 y2 y3 … yn
The next step is to scatter these points on the xy-plane, the resulting diagram is
called scatter diagram.
From the scatter diagram it is often possible to visualize a smooth curve
approximating the data. Such a curve is called an approximating curve the
approximating curve may be one of the following:
(a) Linear relationship (fig.1-a)
(b) Non-linear relationship (fig.1-b)
(c) no relationship between the variable (fig.1-c)
y=f(x)
o x
-3-
Fig. (1-a)
y=f(x)
o x
Fig. (1-b)
y=f(x)
o x
Fig. (1-c)
The general problem of finding equation of approximating curve that fit a
given raw data is called curve fitting. In practice the type of equation is often
suggested from the scatter diagram. Thus for figure (1-a) we could fit a straight
line:
-4-
y Ax B
While for figure (1-b) we could fit an exponential curve or a parabola
like:
y e Ax B
for arbitrary constant A and B, in which we obtain later under suitable criteria.
Notice:
In this chapter we always interested in the straight line equation. Even
the fitted curve is not a straight line we can transform to linear case like the
following examples:
Example 1
y e Ax B
Solution:
We can take ln(.) to both sides then,
ln y Ax B
Introduce a variable Y ln y then we obtain a linear case:
Y Ax B
Example 2
y ln Ax B
Solution:
We can take e . to both sides then,
e y Ax B
Introduce a new variable Y e y then we obtain a linear case:
-5-
Y Ax B
Example 3
1
y
Ax B
Solution:
Let ,
1
Ax B
y
1
Introduce a new variable Y then we obtain a linear case:
y
Y Ax B
Example 4
y Ax2 B
Solution:
Introduce a new variable X x 2 then we obtain a linear case:
y AX B
Example 5
y Ax2 B
Solution:
This case can be transformed by:
y 2 Ax2 B
-6-
Introduce new variables X x 2 and Y y 2 then we obtain a linear case:
Y AX B
As we see the transformation is so easy and the student can do without any
troubles.
1-2 Regression
One of the main purposes of the curve fitting is to estimate one of the
variables (say, the dependent variable) from the other variable (say, the
independent variable). The process of estimation is often referred to as
regression. If y is to be obtained from x by means of some equation we call the
equation a regression equation of y on x and the corresponding curve a
regression curve of y on x.
1-3 The method of least square
The least square method based on, as in figure (2), that the sum of the
square differences between the actual y ordinate (y form table) and the
n
di
2
theoretical t ordinate (y on the curve) must be minimized. I.e. the value
i 1
must be minimums.
y=f(x)
dn
d3
d1
d2
o Fig. (2) x
-7-
1-4 The least square line
As we see before, many of the required curves can be transformed to a
straight line problem. So, we are interested in the equation of the straight line.
Now we are going to drive the least square line based on minimizing the
n
sum d i .
2
i 1
di yi yi curve
2 2
Such that yi curve is the value of the ordinate y on the curve at this point that is
equal.
yi curve Axi B
So,
di yi Axi B
2 2
And,
n n
di yi Axi B
2 2
i 1 i 1
This sum is a function of A and B only (since the readings xi , yi is fixed
values), denoting this sum by:
n
E A, B yi Axi B
2
i 1
A i 1
This is yields,
n n n
A xi B xi xi yi
2
(1)
i 1 i 1 i 1
-8-
And,
E A, B n
2 yi Axi B 1 0
1
B i 1
This is yields,
n n
A xi nB yi (2)
i 1 i 1
The equations (1) and (2) called the normal equations and used to
evaluate the coefficients A and B.
Example:
Fit the least square line to the data:
x 1 3 4 6 8 9 11 14
y 1 2 4 4 5 7 8 9
Estimate y (10)?
Solution:
Using the normal equations:
n n
A xi nB yi
i 1 i 1
n n n
A xi B xi xi yi
2
i 1 i 1 i 1
-9-
x y x2 xy y2
1 1 1 1 1
3 2 9 6 4
4 4 16 16 16
6 4 36 24 16
8 5 64 40 25
9 7 81 63 49
11 8 121 88 64
14 9 196 126 81
We obtain:
8 A 56B 40
56 A 524B 364
Solving we get,
6 7
B and A
11 11
And the regression line is:
7 6
y x
11 11
y10 10 6 76
7
11 11 11
(The column y 2 if we want to find x as a function of y)
- 10 -
Example:
Fit y Ke
Ax
to the data:
x 0 1 2 3 4
y 1.5 2.5 3.5 5 7.5
Estimate y (7)?
Solution:
y Ke Ax
ln y ln K Ax
Introduce a new variable Y ln y and replace ln (K) by B
Y Ax B
Using the normal equations:
n n
A xi nB Yi
i 1 i 1
n n n
A xi B xi xiYi
2
i 1 i 1 i 1
- 11 -
We obtain:
30 A 10B 16.30974
10 A 5B 6.19886
Solving we get,
B 0.457367 and A 0.391202
B ln K K e B e 0.457367 1.5799
And the regression curve is:
y 1.5799e0.391202 x
y7 1.5799e 0.391202 7
1-5 The standard error of estimate
If we let yest denote the estimated value of y for a given value of x then,
the measure of the scatter about the regression curve is supplied by the
quantity:
y yest
2
S yx
n
2
y 2 B y A xy
S yx n
- 12 -
The standard error of estimates has properties analogous to those of the
standard deviation. For example, if we construct pair of lines parallel to the
from it, we should find, if n is large enough that there would be included
between these pairs of lines about 68%, 95% and 99.7% of the sample points
respectively.
Example:
Find S y x for the data:
x 65 63 67 64 68 62 70 66 68 67 69 71
y 68 66 68 65 69 66 68 65 71 67 68 70
Solution:
First calculate the regression line of y on x (as before) it will be found:
y 0.476 x 35.82
x 65 63 67 64 68 62 70 66 68 67 69 71
y 68 66 68 65 69 66 68 65 71 67 68 70
yest
y- yest
The student tries to complete the table and find the final result:
y yest
2
S yx 1.28
n
Also, the student can use the formula:
2
y 2 B y A xy
S yx n
And obtain the same results..
- 13 -
Sheet 1
i. fit a least square line to the data:
X 3 5 6 8 9 11
Y 2 3 4 6 5 8
- 14 -
ii.
(a) find the curve fit y C Ax
X -1 0 1 2 3
Y 6.62 3.94 2.17 1.35 0.89
- 15 -
1
(b) find the curve fit y
Ax B
X -1 0 1 2 3
Y 6.62 3.94 2.17 1.35 0.89
- 16 -
NUMERICAL SOLUTIONS OF
NONLINEAR EQUATIONS
- 17 -
1. Introduction
A problem of great importance in applied mathematics and engineering
is that of determining the roots of equation in the form:
f x 0 (1)
Where, f(x) may be given explicitly as , a polynomial of degree n in x:
f x Pn x x n a1 x n1 an1 x an
or, f(x) may be known only implicitly as a transcendental function, for example,
]
f x x exp( x ) .
- 18 -
Methods of solutions:
There are generally two types of methods used to find the roots of the
equation (1).
(a) Direct methods.
These give the exact values of the roots in a finite number of steps.
Further, the methods give all the roots at the same time. For example, a direct
method gives the root of a first degree equation:
a0 x a1 0 , a0 0 (2)
a1
as x
a0
Similarly, the roots of the quadratic equation
a0 x 2 a1 x a2 0 , a0 0 (3)
are given by
a1 a12 4 a0 a2
x
2a0
- 19 -
For the above reasons, we study iterative numerical techniques, for
solving equation of one variable. These techniques are usually applied
for polynomial equation of degree higher than 2, as well as
transcendental equations.
Definition (convergence)
where xk and xk+1 are two consecutive iterates and is the prescribed error
tolerance.
- 20 -
graph of the equation y = f(x) intersects the x-axis, gives the root of f(x) = 0,
then any value in the neighborhood of this point may be taken as an initial
approximation to the root (see fig 2.1a, b)
y y
x
-1 1
x
0.2
y
y =x
y =e-x
cos x x
0.5 /2
Theorem 2.1
If f(x) is a continuous function on some interval [a, b] and f(a)f(b) < 0,
then the equation f(x) = 0 has at least one root or an odd number of roots in the
interval (a, b).
- 21 -
Therefore, we can set up a table of values of f(x) for various values of x
and obtain a suitable initial approximation to the root.
Example 1
Obtain an initial approximation to a root of the equation:
f x cosx xe x 0 .
Solution
We prepare a table of the values of the function f(x) for various values of
x. We get
x 0 0.5 1 1.5 2
f(x) 1 0.0532 -2.1780 -6.6518 -15.19
From the table, we find that the equation f(x) = 0 has at least one root in
the interval (0.5, 1). The exact root correct to ten decimal places is
0.5177573637.
- 22 -
2. The Bisection Method
Basic idea of this method based on the repeated application of the intermediate
value theorem.
If we know that a root of f(x) lies in the interval I0 = (a0, b0), we find the
root as follows:
i. Bisect I0 at m1 = 0.5 (a0 + b0). a0 m1
x
b0
ii. Denote by I1 :
the interval (a0,m1) if f(a0)f(m1) < 0 or
the interval (m1,b0), if f(b0)f(m1) < 0.
Therefore, the interval I1 also contains the root.
iii. Bisect the interval I1 and get a subinterval I2 at whose end points, the
values of f(x) take opposite signs and therefore contains the root.
iv. Continuing this procedure, we obtain a sequence of nested sets of sub-
intervals I0 I1 I2 … such that each sub-interval contains the root.
After repeating the bisection process q times, we either find the root or
find the interval Iq of length (b0-a0) / 2q which contains the root.
v. We take the midpoint of the last sub-interval as the desired
approximations to the root.
Remarks:
a. This root has error not greater than one half of the length of the
interval of which it is the midpoint.
b. Generally, in the bisection method
ak bk
mk 1 , k = 0,1,2,
2
and
- 23 -
ak , mk 1 if f(ak ) f ( mk 1 ) 0
I k 1 ak 1 ,bk 1
m ,b if f(mk+1 ) f ( bk ) 0
k 1 k
c. The method uses only the end points of the interval [ak, bk] for which
f(ak)f(bk) < 0 and not the values of f(x) at these end points, to obtain
the next approximation to the root.
d. The method is simple to use and the sequence of approximations
always converges to the root for any f(x) which is continuous in the
interval that contains the root.
The bisection method requires a large number of iterations to achieve a
reasonable degree of accuracy for the root. It requires one function
evaluation for each iteration
e. Stopping criteria:
f mk 0 , stop mk exact root
equivalent to ak bk 2 Tol .
f. Advantages:
Simple to apply
Convergence of the method is guarantied.
If the permissible error is then the approximate number of
iterations required may be determined from the relation
a0 b0 a0 b0
, 2 n
or
2n
b a0
ln 0
n
ln 2
- 24 -
so, the number of required iteration steps can be determined, before
applying the method by the above formula.
g. Disadvantages:
The need of change of sign. Therefore the method is inconvenient
in the following:
x x
nearly equal roots double roots
Relatively slow convergence.
Example 2
Perform five iterations of the bisection method to obtain the smallest
positive root of the equation: f x x 3 5 x 1 0
Solution
Since f(0) > 0 and f(1) < 0,
then, the smallest positive root lies in the interval (0,1).
Taking a0 = 0, b0 = 1, we get
b0 a0
m1 0.5 ,
2
f(m1) = -1.375 and f(a0) f(m1) < 0.
Thus the root lies in the interval (0, 0.5).
The sequence of intervals is given in Table 2.3.
- 25 -
Table 2.3: Sequence of Intervals for the Bisection Method
f ( ak 1 ) f ( bk 1 ) Mid-point
ak 1 bk 1
k ak-1 bk-1 mk f ( mk ) ?
2
1 0 1 0.5 -
2 0 0.5 0.25 -
3 0 0.25 0.125 +
4 0.125 0.25 0.1875 +
5 0.1875 0.25 0.21875 -
6 0.1875 0.21875 0.203125
3. Secant Method
In this method, given two initial guess for the roots of the equation f(x),
we replace the curve f(x) by a straight line (a chord) passing through the points
(xk, fk) and (xk-1, fk-1) and take the point of intersection of the straight line with x-
axis as the next approximation to the root.
The method is shown graphically in Fig. 2.2. Since (xk-1, fk-1), (xk, fk) are
known before the start of the iteration.
y
xk 1 , yk 1
xk+2 xk+1 xk x
0 xk-1
(xk+1, fk+1)
(xk,fk)
- 26 -
The equation of the line (chord) which passes through the two points
xk 1 , yk 1 and xk , yk is:
y f xk f xk 1 f xk
x xk xk 1 xk
Putting y = 0 to get the intersection with the x-axis, we get xk+1 i.e. the
approximation value of the root
0 f xk f xk 1 f xk
xk 1 xk xk 1 xk
x k 1 x k f x k
xk 1 xk
f xk 1 f xk
Finally,
x k 1 x k f x k
xk 1 xk , k 0 ,1,2,....
f xk 1 f xk
This is called the secant method.
The use of this method can be tabulated as follow:
k xk 1 f xk 1 xk f xk xk 1 f xk 1
1 x0 f x0 x1 f x1 x2 f x2
2 x1 f x1 x2 f x2 x3 f x3
3 x2 f x2 x3 f x3 x4 f x4
- 27 -
Disadvantages:
Convergence is not guaranteed, depending on the choice of the starting
guess and the nature of f(x).
Example 3
Use the secant method to determine the root of the equation: cos (x) -
xex = 0. Take x0 = 0, x1 = 1.
Solution
x k 1 x k f x k
xk 1 xk , k 0 ,1,2,3,...
f xk 1 f xk
k xk 1 f xk 1 xk f xk xk 1 f xk 1
1 0 1 1 -2.1780 0.3147 0.5199
2 1 -2.1780 0.3147 0.5199 0.4468 0.2035
3 0.3147 0.5199 0.4468 0.2035 0.5318 -0.0431
4 0.4468 0.2035 0.5318 -0.0431 0.5169 0.0025
5 0.5318 -0.0431 0.5169 0.0025 0.5177 0.0001
6 0.5169 0.0025 0.5177 0.0001 0.5177
- 28 -
3, Newton -Raphson Method
Basic idea: in this case the problem of finding the root of the equation
f(x)=0 is equivalent to finding the point of intersection of the tangent to the
curve y = f(x) at the point (xk, f(xk) with the x-axis.
( xk , f ( xk ))
root
x
( xk 1 ,0 )
Putting y = 0 to get the intersection with the x-axis, we get xk+1 i.e. the
approximation value of the root:
0 f xk f ( xk )
f ( xk ) xk 1 xk
x k 1 x k f ( xk )
Finally,
f ( xk )
xk 1 xk , k 0 ,1,2 ,...
f ( xk )
This is called the Newton-Raphson method.
- 29 -
Advantages of the method:
i. Convergence is very fast (if it is converges)
ii. No need to change of sign
iii. We need only one suitable starting value x0 .
Disadvantages:
i. Convergence is not guarantied (depending up on the choice of x0 and the
nature of f(x).
ii. The function f(x) must be differentiable in certain interval containing the
required root [f '(xk) ≠0].
iii. If f(x) and f '(x) are closed to zero, near the root, then, the convergence
may be very slow.
Example 4
Apply Newton-Raphson’s method to determine a root of the equation:
20 lnx x 0
such that:
f xk 1 10 8
Where, xk+1 is the approximate value of the root.
Solution
20 lnx x 0
f ( x ) 20 lnx x
f ( x ) 20 / x 1
- 30 -
f ( xk )
x K 1 x K , k 0 ,1,2 ,...
f ( xk )
20 ln( xk ) xk
x K 1 x K , k 0 ,1,2 ,...
20 / xk 1
To find x0 :
f ( 1 ) 1, and f ( 2 ) 11 .9 ,
then the root lies in the interval [1,2], take x0 any value in [1,2], for
example x0 = 1.
Starting with x0 =1, the results obtained are given in the following table.
k xk f(xk)
0 1.0 -1.00
1 1.052631579 -0.2610-3
2 1.054118562 -0.1.99 10-5
3 1.054119671 -0.5610-11
4 1.054119671 -0.5610-11
- 31 -
4. The Method of Iteration
One of the most important methods, in the numerical solution of
equation, is the method of iteration (often also called the method of successive
approximations).
Essentially, this method consists in the following:
Suppose we have an equation
f x 0 (15)
where f(x) is a continuous function and is
required to determine its real root.
Put (15) in an equivalent equation
x x . (16)
In some way choose a roughly approximate
value of the root, x0, and substitute it into the right number of (16) to get
a number
x1 x0 . (17)
Now, inserting x1 in the right member of (17) in place of x0, we get a new
number x2 = (x1).
Repeating this process, we get a sequence of numbers
xn xn1 ., n = 1,2, (18)
If this sequence is convergent, that is, if there exists a limit = xn as n tends
to infinity, then the limit is a root of (16) and can be computed by formula
(18) to any desired degree of accuracy.
- 32 -
Plot on an xy-plane the functions y = x and y = (x). Each real root of
equation (16) is an abscissa (the x-coordinate) of the point of intersection of the
curve y = (x) with the straight line y = x. (see the following figure)
yx
y ( x1 ) y ( x )
( x0 )
root
x0 x1 x2
x
Theorem
If
a. (x) is a continuous function in the interval [a,b] that contains the
root,
b. the absolute value of ( x ) 1 in this interval,
Then,
for any choice of x0 [a,b], the sequence {xk}
determined from:
xk+1 =( xk) , k = 0,1,2,..
Converges to the root of x = ( x).
- 33 -
Example 5
Find the real roots of the following equation to three significant digits:
x - sinx - 0.25 = 0 .
Solution
f(1) = - 0.091471,
f(1.4) = 0.1645503,
then the there exist one possible root in [1, 1.4].
Take x0 =1.2
we write : y y=x
x = sin x + 0.25
sin x +0.25
where
1.2 x
(x) = sin x + 0.25
(x) = cos x ,
x2 1.175380828 ,
x3 1.172836598 ,
x4 1.171853595,
x5 1.171472199.
x6 1.171323981 (the approximate solution)
- 34 -
Example 6
Use the method of iteration to solve the equation x tan x 0 , in the
interval [4.4,4.6].
Solution
We can put the given function in two forms
Case 1 Case 2
x tan x x tan1 x
( x ) tan x ( x ) tan 1 x
( x ) sec 2 x ( x )
1
1 x2
1 / cos x 2
1 1
( x ) 1, x ( x ) 1, x
cos 2 x 1 x2
Then, this case diverges Then, this case converges
- 35 -
Example 7
Find the largest positive root of the equation:
x 3 x 1000 to within 10-4.
Solution
We put x= 1/y ,
and we find the smallest positive root to the equation:
1000 y 3 y 2 1 0
f(0.1) = - 0.01,
f(0.2) = 6.96,
then, the smallest positive root of last equation lies on (0.1, 0.2)
The largest positive root of the original equation lies on (5, 10).
The equation can be put in the form:
x 3 1000 x i.e x 3 1000 x ,
d 1 d
- 1 0 for x =10
dx 31000 x 2 / 3 dx
Example 8
Find the root of the equation: x3 x 1 0
Solution
f(1) = - 1 f(2) = 5
then the equation has a root in (1, 2).
If we put the equation in the form:
- 36 -
x x3 1 x 3 x 2
1 1 for 1< x <2
the equation does not satisfy the condition of convergence.
x 3 1 x i.e x 3 1 x ,
d 1
1 for 1 < x < 2,
dx 31 x 2 / 3
hence the process of iteration will converge rapidly, take x0 = 1,
x k 1 3 1 x k
x1 1.25992105 ,
x2 1.312293837 ,
x3 1.322353819 ,
x4 1.324268745 ,
x5 1.324632625 ,
x6 1.324701748
x7 1.324714878 ,
x8 1.324717372 .
- 37 -
Sheet 2
1) Find the interval in which the smallest positive root of the following
equations lies:
a) tanx tanhx 0 b) x 3 x 4 0
Determine the roots correct to two decimals using the bisection method.
a) tanx tanhx 0 b) x 3 x 4 0
- 38 -
2) Given the following equations:
a) x 4 x 10 0 b) x e x 0
Determine the initial approximations. Use these to find the roots correct to three
places with the following methods:
a) the Secant method,
- 39 -
c) the Simple Iteration method.
Apply the Newton-Raphson method with x0 = 0.8, the Secant method with x0 =
0.8 and x1 = 1.2 and the simple iteration method to the equation:
x x x 1 0
3 2
- 40 -
INTERPOLATION
- 41 -
1. Introduction
We consider the problem of approximating a real-valued function f(x) on
the assumption that the function values are only known at discrete pints,
xi , f ( xi ), i 0,1,...,n. . We may then approximately evaluate between the
discrete points. Interpolation polynomials are the most simple and common
means of approximation. Although the interpolation polynomials is unequally
determined by the given interpolation points there exist different
representations with specific advantages, depending on the actual application.
We shall see that The interpolation by polynomials is not always adequate.
Therefore we shall also consider the interpolation problem for rational
functions.
Then our objective in this chapter, is to find a polynomial of a specific
degree that is close to f(x) at given points xi , f ( xi ), i 0 ,1,...,n.
Definition.
When x [xo, xn], the approximation P(x) is called an interpolated value.
If x [xo, xn], then P(x) is called an extrapolated value.
The following theorems on existence and uniqueness serves as the basic
for all subsequent consideration abut polynomial interpolation.
Theorem 1.
If xi , yi are (n+1) support points, (i=0,1,...,n), with pair wise different
abscissas, xi x j , then there exists a unique interpolation polynomial Pn x
Pn xi yi ( i 0 ,1,..,n ),
- 42 -
Theorem 2.
(Weiersrtrass Approximation Theorem)
If f(x) is defined and continuous on [a, b] and > 0 is given, then there exists a
polynomial P(x), defined on [a,b], with the property that:
2. Taylor Polynomials
In this section we consider the problem of finding a polynomial of a
specific degree that is “close “ to a given function at a point. A polynomial P(x)
agree with a function f(x) at the number x0 precisely when P(x0) = f(x0). The
polynomial also has the same derivatives as the function f(x) at x0. Taylor
polynomial for the function f(x) at x0.
f x0
Pn ( x ) f x0 x x0 f x0 x x0 2
2!
n x ,
.... x x0 n f 0
n!
f x0
n k
Pn ( x ) x x0 k k!
,
k 0
- 43 -
Example-1
a) Calculate the third Taylor polynomial about x = 0 for
f(x) = (1+x)1/2
b) Use the polynomial in (a) to approximate (1.1)0.5 and
find the error.
1
c) Use the polynomial in (a) to compute 1 x dx and
0
Solution
f 0
3 0
P3 ( x ) f 0 xf 0 x
f
x
2 3
a) ,
2! 3!
f( x) 1 x , f ( 0 ) 1,
1 x 1 / 2 ,
1 1
f ( x ) f ( 0 ) ,
2 2
1 x 3 / 2 ,
1 1
f ( x ) f ( 0 ) ,
4 4
f
3 ( x ) 3 1 x 5 / 2 , f
3 ( 0 ) 3 ,
8 8
then,
x x2 x3
P3 ( x ) 1
2 8 16
- 44 -
x x
2
x
3
1.1 1 1.0488125 .
2 8 16
x 0.1
1 1
c) 1 x dx P3 x dx
0 0
1
x
1 2 3
x x
2
1 x dx 1
8
16
dx
0 0
1
1 x
2
x
3
x
4
1 x dx x
4
24 64
1.223958333
0 0
1
2 3
the exact value 1 x 2 1.218951416 .
3 0
Example-2
Expand function f(x) =1/x about x0 = 1 and then find f(3).
Solution
n k 1 n
Pn x x 1 k x 1k
f
k
k 0 k! k 0
where
f(x) = 1/x, x0 = 1, f(k)(x0)= (-1)k k!
- 45 -
The following table gives the value of Pn(x) at x = 3
n 0 1 2 3 4 5 6 7
Pn(3) 1 -1 3 -5 11 -21 43 -85
The reason this approximating technique fails is that the error term:
1n1 x 1n1
Rn x where 1 x
n 2
grows in absolute value as n increases. The growth in error results because x =
3 is not “ near enough “ to x0 =1.
3- Lagrange Interpolation.
The previous section discussed approximating polynomials that agree
with a given function and its derivatives at a single point. These polynomials
are useful only over small intervals for functions whose derivatives exist and
easily evaluated. Consequently, the Taylor polynomial is often of little use, and
alternative methods of approximation are needed. In this section we find
approximating polynomials that can be determined simply by specifying certain
points on the plane through which they must pass.
P1 x
x x1 y x x0 y . (3-1)
x0 x1 0 x1 x0 1
which it be written in the form
- 46 -
P1 x L0 x y0 L1 x y1 . (3-2)
where Li(x), i = 0, 1 are the Lagrange coefficients polynomials.
When x = x0 P1(x0) = y0 = f(x0), and
when x = x1 so P1(x1) = y1 = f(x1),
P1(x) has the required properties.
Example-3
Consider the curve f(x) = sin(x) over the interval [0.4, 1.0]. Find the
linear approximation using
(a) the nodes 0.4, 1, (b) the nodes 0.5, 0.9.
Solution
(a) x0 = 0.4, y0 = sin(0.4) = 0.389418342
x1 = 1.0, y1= sin(1.0) = 0.841470984
P1 x L0 x y0 L1 x y1
x 1 x 0.4
P1 x 0.389418342 0.841470984
0.6 0.6
P1 x 0.75342107 x 0.08804991
(b) x0 = 0.5, y0 = sin(0.5) = 0.479425538
x1 = 0.9, y1= sin(0.9) = 0.783326909
x 0.9 x 0.5
P1 x 0.479425538 0.783326909
0.4 0.4
P1 x 0.75975343 x 0.09954882
The quadratic curve y = P2(x) that passes through the three points (x0,
y0), (x1, y1) and (x2, y2) where x0, x1, x2 are distinct has the form:
P2 x L0 x y0 L1 x y1 L2 x y2 (3-3)
where
- 47 -
L0 x
x x1 x x2 ,
x0 x1 x0 x2
L1 x
x x0 x x2 , (3-4)
x1 x0 x1 x2
L2 x
x x0 x x1 .
x2 x1 x2 x1
Example 4
Use P2(x) with the nodes 0, 0.5, 1, to find the value of the integral :
1
1 x dx
0
Solution
If we take:
x0 = 0, x1 = 0.5, x2 = 1, and
f(x0) = 1, f(x1) = (1.5)1/2 , f(x2)= (1.5)1/2
then,
P2 x L0 x f ( x0 ) L1 x f ( x1 ) L2 x f ( x2 )
x 0.5x 1 xx 1 xx 0.5
P2 x 1.5 2,
0.5 0.25 0.5
P2 x 1 3 4 1.5 2 x 2 4 1.5 2 2 x . 2
1 x dx P2 x dx ,
0 0
1 4
1
P2 x dx
0.5
3
1.5 2 1.218865508 ,
0
- 48 -
3.2 General Case of Lagrange Interpolation.
The Lagrange polynomial PN(x) of degree N that passes through
the N+1 points (x0, y0) ,(x1,y1), ….(xN, yN)
has the form:
N
PN x Lk x yk
k 0
Lk x
x x0 .......x xk 1 x xk 1 ...x xN (3-6)
xk x0 ...xk xk 1 xk xk 1 ...xk xN
It is understood that the terms (x-xk) and (xk-xk) do not appear on the right side
of definition (3-6). It is often convenient to introduce the product notation to
express (3-6) and we write
x x j
N
Lk x
j 0 , j k
(3-7)
xk x j
N
j 0 , j k
Here the notation indicates that products of the linear factors (x-xj) are to be
formed, but the factor (x-xk) is to be left out (skipped). Then the nonzero
product of terms (xk -xj) is to be formed, where again the term (xk-xk) is to be
skipped. Finally, the quotient of these two products yields Lk(x).
- 49 -
Example 5
Use approximate Lagrange interpolating polynomials of degree four to
approximate f(1.5) given that
xi 0 1 2 5
F(xi) 2 3 2 147
Solution
P3 x L0 x yx0 L1 x yx1 L2 x yx2 L3 x yx3
P3 x
x x1 x x2 x x3 yx
x0 x1 x0 x2 x0 x3 0
x x0 x x2 x x3 yx
x1 x0 x1 x2 x1 x3 1
x x0 x x1 x x3 yx
x2 x0 x2 x1 x2 x3 2
x x0 x x1 x x2 yx
x3 x0 x3 x1 x3 x2 3
x 1x 2x 5 x 0 x 2x 5
P3 x ( 2 ) (3)
0 10 20 5 1 0 1 21 5
x 0 x 1x 5 x 0 x 1x 2
(2) ( 147 )
2 0 2 12 5 5 0 5 15 2
3 13 23 5 3 0 3 23 5
( 2 ) (3)
f ( 3 ) P3 ( 3 )
0 10 2 0 5 1 0 1 2 1 5
- 50 -
4- Newton Polynomials
The Lagrange polynomials, there is no constructive relationship between
PN-1(x) and PN(x). Each polynomial has to be constructed individually, and the
work required to compute the higher- degree polynomials involves many
computations.
In this section, we take a new approach and construct Newton
polynomials that have the recursive pattern:
P1 x a0 a1 x x0 , (4-1)
P2 x P1 x a2 x x0 x x1 , (4-2)
Here the polynomial PN(x) is obtained from PN-1(x) using the recursive
relationship
PN x PN 1 x a N x x0 x x1 x x2 ,x x N 1 (4-4)
The last polynomial is said to be a Newton polynomial with the N nodes
x0, x1, …., xN.
It involves sums of products of linear factors up to
aN (x-x0)(x-x1)….(x-xN-1), so that PN(x) will simplify to be an ordinary
polynomial of degree N.
If we want to find the coefficients ak for all the polynomials Pk(x), k = 1,
2,…, N that approximate a given function f(x), we will based on
Pk (x j ) f x j , j 0 ,1,...,k .
- 51 -
Substitute by these values in P1(x), then, we find that:
a0 = f(x0) (4-5)
f x1 f x0
a1 f1 (4-6)
x1 x0
The coefficients a0 and a1 are the same for both P1(x) and P2(x). Evaluating (4-
2) at the nodes x2, we find that
f x2 P2 x2 a0 a1 x2 x0 a2 x2 x0 x2 x1 .
The values of a0 and a1 can be used to obtain
a2
1
f 2 f1 f 2 f1 2 f 2 (4-7)
x2 x0 x2 x0
a1 x x0
a2 x x0 x x1
...
a N x x0 x x1 x x2 x x N 1
ak f k .
k
- 52 -
4-2. Divided-Differences Table.
The recursive rule for constructing divided differences is
i 1 i 1
fj f j 1
fj
i
, i=1,2,...,N, j=0,1,...,N
x j x j i
where
0 f j f j f x j , j 0 ,1,...,N .
Then the divided differences table for a function y =f(x) are defined as
follows (for N=3):
xj 0 f j f j fj
2
fj
3
x0 f0
f1 f0
x1 f1 f1
x1 x0
f 2 f1 f 2 f1
x2 f2 f 2 2 f 2
x2 x1 x2 x0
f3 f2 f 3 f 2 2 f 3 2 f 2
x3 f3 f 3 2 f 3 3 f 3
x3 x2 x3 x1 x3 x0
a0 0 f0 f0 , a1 1 f1 ,
a2 f 2 , and a3 f 3
2 3
- 53 -
Example 7
Construct the divided-difference table based on the points (1,-3), (2,0), (3,15),
(4,48), (5,105), and find the Newton polynomial P3(x).
Solution.
First we construct the divided difference table.
xj 0 f j f j fj
2
fj
3
fj
4
x0= 1 -3 a0
x1= 2 0 3 a1
x2= 3 15 15 6 a2
x3= 4 48 33 9 1 a3
x4= 5 105 57 12 1 0
a1 x x0
a2 x x0 x x1
a3 x x0 x x1 x x2
P3 x 3
3x 1
6 x 1x 2
x 1x 2 x 3
x 4 x.
3
- 54 -
Example 8
Construct a divided-differences table for: f(x) = cos(x) based on the points (k,
cos(k)), k = 0, 1, 2, 3, 4. Use it to find the coefficients ak and all interpolating
polynomials up to P4(x). Then compute the approximation P4(2.1).
Solution.
For simplicity we round off the values to seven decimal places.
xj 0 f j f j fj
2
fj
3
fj
4
x0= 0 1.000
- 55 -
4-3 The Error
The interpolating polynomial PN(x) of degree N that agree with the
function y = f(x) at the N+1 points
(xk, yk), k = 0, 1,.. ,N is:
PN x a0 a1 x x0 .... a N x x0 x x1 .....x x N 1 ,
where
ak f k
k
and if we define
f x PN x E N x ,
EN(x) is the error term. The formula of the error is given by:
c
( N 1 )
E N x x x0 x x1 x x2 ,x x N
f
,
N 1!
for some c in the interval [x0, xN].
The error term is the same as the one for Lagrange interpolation.
Remark.
The polynomial construction only requires N+ 1 poinst with distinct abscissas.
- 56 -
Sheet 3
1) Find Lagrange polynomials that approximate f(x) = x3.
a) Find the quadratic interpolation polynomial P2(x)
using the nodes: x0 = -1, x1 = 0, and x2 = 1.
- 57 -
2) Let f(x) = x +2/x.
a) Use quadratic Lagrange interpolation based on the
nodes: x0 =1, x1 = 2, and x2 = 2.5 to approximate
f(1.5) and f(1.2).
- 58 -
4) Let, L0(x), L1(x),…., LN(x), be the Lagrange coefficients
polynomials based on the N+1 nodes x0, x1,…, xN. Show
that Lk(xk) =1 for k = 0,1,…,N. and that Lk(xj) = 0
whenever j k.
- 59 -
6) Consider the function f(x) = sin (x) on the interval [0,1].
Determine the linear Lagrange interpolation
- 60 -
7) Use Taylor Series for sin(x) and establish the result
sin(h) = h + 0(h3).
- 61 -
a) Compute the divided-difference table for the tabulated function.
b) Write the Newton polynomials P1(x), P2(x), P3(x), and P4(x).
c) Evaluate the Newton polynomials in (b) at the given values.
d) Compare the values in part (c) with the function f(x).
1) f(x) = 3(2) x , x = 1.5, 2.5
k xk f(xk)
0 -1.0 1.5
1 0.0 3.0
2 1.0 6.0
3 2.0 12.0
4 3.0 24.0
- 62 -
2) f(x) = 3(2) x , x = 1.5, 2.5
k xk f(xk)
0 1.0 6.00
1 2.0 12.0
2 0.0 3.00
3 3.0 24.0
4 -1.0 1.50
k xk f(xk)
0 1.0 3.60
1 2.0 1.8
2 3.0 1.20
3 4.0 0.90
4 5.0 0.72
- 63 -
4) f(x) = 3.6/x , x = 2.5, 3.5
k xk f(xk)
0 3.0 1.20
1 2.0 1.80
2 4.0 0.90
3 1.0 3.60
4 5.0 0.72
k xk f(xk)
0 0.0 0.00
1 1.0 0.75
2 2.0 2.25
3 3.0 3.00
4 4.0 2.25
- 64 -
6) f(x) = 3x(2)-x , x = 1.5, 3.5
k xk f(xk)
0 0.0 0.000
1 1.0 1.500
2 2.0 1.500
3 3.0 1.125
4 4.0 0.750
- 65 -
NUMERICAL SOLUTIONS OF
ORDINARY DIFFERENTIAL EQUATIONS
- 66 -
1. Introduction to Differential Equations.
Numerical methods of differential equations are of great importance to
engineer and physicist because practical problems often lead to differential
equations that can not be solved exactly by the analytical methods. Also we can
solve initial value problem (IVP) exactly, but finding the value of the solution at
certain value of t may be a problem in itself, for example, the exact solution of
2
ln 4 y 2 2 tan 1 . Solving this equation requires using numerical
y
techniques.
This chapter includes basic methods for the numerical solution of IVP
of the form
y f t , y , yt0 y0 , (1)
assuming f to be such that the problem has a unique solution on some interval
containing t0 .
These methods are step –by-step methods, that is, we start from the given
yt0 y0 , and proceed stepwise, computing approximate values of the
solution yt at the mesh points
t1 t0 h, t 2 t0 2h, t3 t0 3h,...,
where the step size h is a fixed number whose choice we discuss later. The
computation in each step is done by the same formula.
- 67 -
2. Existence and Uniqueness.
Definition
The function f(t,y) is said to satisfy the Lipschitz condition in the variable y on
the rectangle R {a t b, c y d}, provided that a constant L > 0 exists so
that:
f t , y1 f t , y2 L y1 y2 for a t b and c y d.
Theorem
The initial value problem
3. Euler’s Method
The first method is called Euler’s method and serves to illustrate the
concepts involved in the advanced methods. It has limited usage because of the
large error that is accumulated as the process proceeds.
Assume that y(t), y' (t) and y"(t) are continuous and use Taylor series
h 2 yt h 3 yt
yt h yt h yt + ... (2)
2 6
If the step size h is chosen small enough, then we may neglect the higher
order terms and get
yt h yt h yt yt h f ( t , y ) (3)
- 68 -
(with the right side obtained from the given IVP) and the following iteration
process.
where t k 1 t k
This is called the Euler method.
Example
Use Euler’s Method to solve I.V.P.,
dy t y
on 0,3 with y0 1. h = 0.25.
dt 2
The exact solution: yt 3 exp t / 2 2 t .
Solution
y2 0.875 0.25
0.25 0.875 0.796875, etc.
2
This iteration continues until we arrive at the last step:
- 69 -
Example.
Use Euler’s method to approximate the initial value problem
y2 y1 1 hR y0 1 hR 2 and
yM yM 1 1 hR y0 1 hR M
For most problems there is no explicit formula for determining the
solution points and each new point must computed successively from the
previous point. However, the initial value problem (4) we are fortunate; Euler’s
method has the explicit solution:
yk y0 1 hR k , tk hk , k = 0,1,M . (5)
Formula (5) can be viewed as the “compound interest formula”, and the
Euler’s approximation gives the future value of a deposit.
- 70 -
3-1 Step Size Versus Error.
Taylor's formula with reminder has the form
h 2 y
yt h yt h yt + , t t h.
2
It shows that in Euler's method the truncation error in each step or local
truncation error is proportional to h 2, written O(h2), where O suggest the
order. Now over a fixed t-interval in which we want to solve an equation, the
number of steps is proportional to 1/h. Hence the total error or global error is
proportional to h2(1/h)=h1. For this reason Euler's method is called a first-
order methods,which may affect the accuracy of the values y 1 , y2 ,… more and
more as n increases.
4. Taylor Methods.
The Taylor method can be constructed to have a high degree of
accuracy.
Recall that if y(t) is analytical and has continuous derivatives of all
orders it can be represented in a Taylor series:
h2 h3 3
yt h yt hyt yt y t (1)
2 6
For numerical purpose, we must fix the number N and use a finite series
to approximate y(t+h). Then (1) becomes
h2 h N N
yt h yt hyt yt y t (2)
2 N!
The local truncation error (L.T.E.) of (2) is given by:
h N 1 N 1
L.T .E y , t t + h (3)
N 1!
- 71 -
The solution of y'(t) = f(t,y) over [t0, tM] is found by adapting formula (2)
to each subinterval [tk, tk+1]. The derivatives y(j)(t) are obtained by
differentiating f(t,y). The general form for Taylor’s method of order N is:
h 2 d 2 h3 d 3 hN dN
yk 1 yk hd1 y , (4)
2 6 N!
d j y j tk , for j = 1,2,, N, k = 0,1,, M - 1
The Taylor method of order N has the desirable feature that the L.T.E. is
of order O(hN+1), and N can be chosen large so that this error is small. If the
order N is fixed, it is possible to determine a priori the step size h so that the
G.T.E will be small as desired.
Example
Use Taylor’s method of order N = 4 to solve I.V.P.,
dy t y
on 0,3 with y0 1. Take h = 0.25.
dt 2
Solution
The exact solution: yt 3 exp t / 2 2 t .
dy t y
,
dt 2
d t y 1 - y 1 - t - y / 2 2 - t + y
y 2 t = = = ,
dt 2 2 2 4
y 3 t
d 2 - t + y - 2+t - y
= ,
dt 4 8
y 4 t
d - 2+t - y 2 - t + y
= .
dt 8 16
To find y1, the derivatives given above must be evaluated at the point
(x0,y0) = (0,1). Calculation reveals that
d1 y0 0.5,
- 72 -
d2 y 2 0 = 0.75,
d3 y 3 0 0.375,
d4 y 4 0 0.1875 ,
h 2 d 2 h3 d 3 h4 d4
y1 y0 hd1 y ,
2 6 4!
y1 0.8974915.
5. Heun’s Method
From Taylor method, we notice that, by taking more terms in the series
into account we obtain methods of higher order and precision, but there is a
practical problem. Since y in f depends on t,
f ft f y y ft f y f
and the further derivatives f'', f''' becomes even much more complicate.
The general strategy now is to avoid their computation and replace it by
computing f for one or several suitable chosen auxiliary values of (t,y(t)).
Suitably means that they are chosen to make the order of the method as high as
possible (to have high accuracy). Let us discuss two such methods that are of
practical importance.
The first method is the so-called Heun's method (some times also called
improved Euler method).
In this method, to obtain the solution point (t 1,y1) we can use the fundamental
theorem of calculus, and integrate
y' (t) f t, y (1)
over [t0 , t1] and get
- 73 -
t1 t1
yt1 yt0
h
f t0 , y0 f t1 , y1 (4)
2
Notice that the formula on the right-hand side of (4) involves the yet to
be determined value y(t1). To proceed, we use an estimate for y(t 1). Euler’s
solution will suffice for this purpose. After it is substituted into (4), the resulting
formula for finding (t1, y1) is called Heun’s method:
yt1 yt0
h
f t0 , y0 f t1 , y0 hf t0 , y0 (5)
2
The process is repeated and generates a sequence of points that
approximates the solution curve y = y(t).
The general step for Heun’s method is
pk 1 yk hf tk , yk , tk +1 tk h, (6a)
yk 1 yk
h
f tk , yk f tk 1 ء, pk 1 . (6b)
2
Remark:
The Heun’s method is a predictor-corrector method, because in each
step we first predict a value by (6a) and then correct it by (6b).
- 74 -
5-1 Step Size Versus Error.
The error term for Trapezoidal rule used to approximate the integral in
(3) is
h 3 2
e y (7)
12
If the only error at each step is that given in (7), then after M steps the
accumulated error for Heun’s method would be
M
b a h 2
E( y , h ) 12
y 2 O h 2
k 1
Example
Use Heun’s Method to solve I.V.P., h = 0.25.
dy t y
on 0,3 with y0 1.
dt 2
The exact solution: yt 3 exp t / 2 2 t .
Solution
p1 yt0 hf t0 , yt0 ,
0 1
f t0 , yt0 0.5 ,
2
p1 1 0.25( 0.5 ) 0.875,
y1 yt0
h
f t0 , y0 f t1 , p1 ,
2
0.25 0.875
f t1 , p1 0.3125 ,
2
- 75 -
The following table shows the values of y(3) at different h.
h y(3) Exact value
1.000 1.732422 1.669390
0.500 1.682121
0.250 1.672269
0.125 1.670076
- 76 -
As before, the interval [a,b] is divided into M subintervals of equal
width h. Starting with (x0,y0), four functions evaluations per step are required to
generate the discrete approximations (xk, yk) as follows:
y k 1 y k
h
f1 2 f 2 f 3 f 4 (1)
6
f 1 f t k , yk
h h
f 2 f t k , yk f 1 ,
2 2
h h
f 3 f t k , yk f 2 ,
2 2
f 4 f tk h, yk hf 3 .
Example.
Use RK4 method to solve I.V.P., with h = 0.25
ty
on 0,1 with y 0 1.
dy
dt 2
Solution
Divided the interval [0,1] by h=0.25
y
0.25 h 0.5 0.75 h 1
h h
t
t0 t1 t2 t3 t4
y0 y1 y2 y3 y4
y1 = ?:
y
0.125 0.25
h/ 2 h/ 2
x
t t0 t0 h / 2 t1
y y0
y0
h
f1 y0
h
f2 y0 h f3
2 2
f f1 f2 f 3- 77 - f4
y1 y0
h
f 1 2 f 2 f 3 f 4
6
0.0 1.0
f1 f t0 , y0 , f1 0.5 ,
2
h h
f 2 f t0 , y0 f1 ,
2 2
0.125 1 0.250.5 0.5
f2 0.40625 ,
2
h h
f 3 f t0 , y0 f 2 ,
2 2
0.125 1 0.250.5 0.40625
f3 0.4121094 ,
2
f 4 f t0 h, y0 hf 3 ,
0.125 1 0.250.5 0.4121094
f4 0.3234863,
2
y1 1
0.25
0.5 2 0.40625 0.4121094 0.3234863
6
y1 0.8974915.
y2 = ?:
- 78 -
7. System of Differential Equations
Consider the initial value problem:
f t , x , y
dx
xt0 x0
dt
with (1)
dy
g t , x , y y t0 y0
dt
A solution of (1) is a pair of differential functions x(t) and y(t) with the property
that when t, x(t), and y(t) are substituted in f(t,x,y) and g(t,x,y), the result is
equal to the derivative x’(t) and y’(t), respectively.
- 79 -
D 2 D 1x 6 x 0 or
D 2
3D 4 x 0
x c1e4t c2 e t
y 1.5c1e4t c2 e t .
4 1.5c1 c2 .
y 6 e4t 2e t .
- 80 -
7.2 Numerical Method
Runge-Kutta method of order four can be used to find the approximate
solutions of the system of differential equations as follows:
If M is positive integer, then,
ba
h ,
M
tk a kh, k = 0,1,...,M
x k 1 x k
h
f 1 2 f 2 f 3 f 4 ,
6
y k 1 y k
h
g1 2g 2 g 3 g 4 ,
6
where
f 1 f t k , xk , yk , g1 g t k , xk , yk ,
h h h
f 2 f t k , xk f 1 , y k g 1 ,
2 2 2
h h h
g 2 g t k , xk f 1 , y k g 1 ,
2 2 2
h h h
f 3 f t k , xk f 2 , y k g 2 ,
2 2 2
h h h
g 3 g t k , xk f 2 , y k g 2 ,
2 2 2
f 4 f t k h, xk hf 3 , yk hg 3 ,
g 4 g t k h, xk hf 3 , yk hg 3 .
Example
Use Range-Kutta method to compute the numerical solution of:
dx
x 2y x0 6 ,
dt with
dy
3x 2 y y 0 4.
dt
over the interval [0.0, 0.2] , h = 0.02
- 81 -
Solution
t0 6 , x0 6 , y0 4 ,
f ( t , x, y ) x 2 y , g( t , x , y ) 3 x 2 y ,
f1 f t k , xk , yk 14 , g1 g t k , xk , yk 26
h h
x0 f 1 6.14 , y0 g 1 4.26 ,
2 2
h h h
f 2 f t k , xk f 1 , yk g1 14.66
2 2 2
h h h
g 2 g t k , xk f 1 , yk g1 26.94
2 2 2
h h
x0 f 2 6.1466 , y0 g 2 4.2694 ,
2 2
h h h
f 3 f t k , xk f 2 , yk g 2 14.6854 ,
2 2 2
h h h
g 3 g t k , xk f 2 , yk g 2 26.9786 ,
2 2 2
x0 hf 3 6.293708 , y0 hg 3 4.539572,
f 4 f t k h, xk hf 3 , yk hg 3 15.372852,
g 4 g t k h, xk hf 3 , yk hg 3 27.960268.
x1 x0
h
f1 2 f 2 f 3 f 4 6.29354551,
6
y1 y0
h
g1 2g 2 g 3 g 4 4.53932490.
6
The calculation are summarized in the following table
- 82 -
k tk xk yk
0 0.00 6.00000000 4.00000000
1 0.02 6.29354551 4.53932490
2 0.04 6.61562213 5.11948599
3 0.06 6.96852528 5.74396525
4 0.08 7.35474319 6.41653305
5 0.10 7.77697287 7.14127221
6 0.12 8.23813750 7.92260406
7 0.14 8.74140523 8.76531667
8 0.16 9.29020955 9.67459538
9 0.18 9.88827138 10.6560560
10 0.20 10.5396230 11.7157807
- 83 -
dx
y xt0 x0
dt with (3)
dy
F t , x , y yt0 y0
dt
A Numerical procedure such as the Runge-Kutta method can be used to
solve (3) and will generate sequences, {x k}, {yk}. The first sequence is the
numerical solution to (1).
Example
Consider the second- order initial value problem
Solution
The differential equation has the form:
d 2 xt dxt
2
4 5 xt .
dt dt
using the substitution
dxt d 2 xt dy t
y t , and 2
dt dt dt
we get the reformulated problem:
dx
y xt0 3
dt with
dy
5x 4 y yt0 5
dt
Samples of the numerical computations are given in the following table. The values of
{yk} are not included. Instead, the true solution values x(tk) are included for comparison.
- 84 -
K tk xk x(tk)
0 0.00 3.00000000 3.00000000
1 0.1 2.52564583 2.52565822
2 0.2 2.10402783 2.10404686
3 0.3 1.73506269 1.73508427
4 0.4 1.41653369 1.41655509
5 0.5 1.14488509 1.14490455
- 85 -
Sheet 4
1) Use Euler’s method to find the approximate solution of :
dy y 2 y
a) , 1 t 1.2, y1 1, with h = 0.1
dt t 2 t
dy
b) sin t e t , 0 t 1, y0 0 , with h = 0.5
dt
c)
dy 1 2
y y,
dt t
1 t 3, y1 2 , with h = 0.5
- 86 -
0 t 1, y0 1, with h = 0.25
dy 4t
d) ty ,
dt y
2) Use Taylor method with N = 4 to approximate the solution for each of the
following initial-value problems and compare the approximation to the exact
solution.
dy 2
a) t , 0 t 2, y0 0.
dt
- 87 -
dy
b) ty , 0 t 2, y0 1.
dt
dy
c) 2t , 0 t 2, y0 1.
dt
dy
d) ty , 0 t 4, y0 4.
dt
- 88 -
In the following Exercises use Heun’s Method to approximate the I.V.P. a)
Compute yi for h = 0.2, M =1 and h = 0.05, M = 4. b) Compare with the exact
solution y(0.2).
dy 2
3) t y, 0 t 0.2 , y0 1.
dt
dy
4) 3 y 3t , 0 t 0.2 , y0 1.
dt
0 t 0.2 , y0 1.
dy
5) ty ,
dt
- 89 -
dy
6) 2ty 2 , 0 t 0.2 , y0 1.
dt
with, v0 v0 .
dv k
32 v ,
dt M
where v0 is the initial velocity, M the mass, and K the coefficient of air
resistance. Suppose that v0 = 160 ft/sec and K/M = 0.1. Use Heun’s method
with h = 0.5 to solve the problem.
- 90 -
8) Use Taylor’s method of order two to approximate the solution for each of
the following I.V.P.
2
dy y y
a) , 1 t 1.2, y1 1, with h = 0.1
dt t t
dy
b) sin t e t , 0 t 1, y0 0 , with h = 0.5
dt
c)
dy 1 2
y y,
dt t
1 t 3, y1 2 , with h = 0.5
- 91 -
0 t 1, y0 1, with h = 0.25
dy 4t
d) ty ,
dt y
11) For the following problems, find the analytical and the numerical solutions
x(0.2) and y(0.2) with h = 0.1
dx
2x 3 y x0 2
a) dt with
dy
2x y y 0 3
dt
Ans. xt 3e4t e t , yt e4t e t
- 92 -
dx
3x y x0 2
b) dt with
dy
4x y y 0 3
dt
Ans. xt 2et tet , yt 3et 2tet
dx
x 4y x0 2
c) dt with
dy
x y y 0 3
dt
xt et 2 cos 2t 6 sin 2t , yt et 3 cos 2t sin 2t
- 93 -
12) Find x(1):
a) 2xt 5 xt 3 xt 45e 2t with x0 2, x0 1
- 94 -