You are on page 1of 263

Math 4

Advanced Engineering Mathematics


Part 1

Waleed Raslan
Ibrahim El-Kalla and Waleed Raslan

2014-2015
ii
Contents

Preface vii

1 Special functions 3

1.1 The Gamma function . . . . . . . . . . . . . . . . . . . 4


1.1.1 Graph of Gamma function . . . . . . . . . . . . 6
1.2 The Beta function . . . . . . . . . . . . . . . . . . . . . 13
1.2.1 Exercise . . . . . . . . . . . . . . . . . . . . . 22
1.3 Legendre polynomials . . . . . . . . . . . . . . . . . . . 25
1.3.1 Generating function for Legendre polynomial . . 27
1.3.2 Recurrence relation . . . . . . . . . . . . . . . . 30
1.3.3 Orthogonality of Legendre polynomials . . . . . 31
1.3.4 Legendre series . . . . . . . . . . . . . . . . . . 35
1.4 Hermite polynomials . . . . . . . . . . . . . . . . . . . 37
1.4.1 Generating function . . . . . . . . . . . . . . . . 37
1.4.2 Other expression of Hermit plynomials . . . . . 37
1.4.3 Recurrence relation . . . . . . . . . . . . . . . . 38
1.4.4 Orthogonality of Hermite polynomials . . . . . 38
1.4.5 Hermite series . . . . . . . . . . . . . . . . . . . 38
1.5 Laguerre polynomials . . . . . . . . . . . . . . . . . . . 40
1.5.1 Generating function . . . . . . . . . . . . . . . . 40
1.5.2 Other expression of Laguerre plynomials . . . . 40

iii
iv CONTENTS

1.5.3 Recurrence relation . . . . . . . . . . . . . . . . 41


1.5.4 Orthogonality of Laguerre polynomials . . . . . 41
1.5.5 Laguerre series . . . . . . . . . . . . . . . . . . 41
1.6 Chebyshev polynomials . . . . . . . . . . . . . . . . . . 43
1.6.1 Generating function . . . . . . . . . . . . . . . . 43
1.6.2 Other expression of Chebyshev plynomials . . . 43
1.6.3 Recurrence relation . . . . . . . . . . . . . . . . 44
1.6.4 Orthogonality of Chebyshev polynomials . . . . 44
1.6.5 Chebyshev series . . . . . . . . . . . . . . . . . 44
1.6.6 Exercises . . . . . . . . . . . . . . . . . . . . . 47
1.7 The Bessel function . . . . . . . . . . . . . . . . . . . . 49
1.7.1 Di¤erentiations and integral identities . . . . . . 51
1.7.2 Recurrence relations . . . . . . . . . . . . . . . 54
1.7.3 Generating function of Bessel function . . . . . 55
1.7.4 Orthogonality of Bessel functions . . . . . 59
1.7.5 Bessel series . . . . . . . . . . . . . . . . . . . . 60
1.7.6 Exercises . . . . . . . . . . . . . . . . . . . . . 63
1.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . 66

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

3 Partial Di¤erential Equations (PDEs) 117


3.1 Basic concepts . . . . . . . . . . . . . . . . . . . . . . . 118
3.1.1 Modeling of vibrating string (wave equation) . . 124
3.2 Solution of the wave equation . . . . . . . . . . . . . . 126
3.3 The one dimensional heat equation . . . . . . . . . . . 140
3.3.1 Case 1 . . . . . . . . . . . . . . . . . . . . . . . 140
3.3.2 Case 2 Nonzero boundary conditions . . . . . . 148
3.3.3 Case 3 Semi-in…nite bar . . . . . . . . . . . . . 151
3.3.4 Case 4 Varying the boundary conditions . . . . 154
3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . 156
vi CONTENTS
Preface

This book is primary intended for the use in undergraduate courses


by engineering students in universities and technical colleges. In each
chapter, a number of problems serve as complete review of its ma-
terial which are carefully chosen. In chapter one, we introduce the
method of series solution for solving second order di¤erential equa-
tions with variable coe¢ cients. We introduce two approach, Taylor
and Forbenius methods. Chapter two deal with some special func-
tions naming, Gamma function, Beta function, Legendre polynomials,
Hermite polynomials, Laguerre polynomials, Chebyshev polynomials,
and Bessel function. In chapter three we introduce the Fourier analy-
sis. In chapter four the concepts of orthogonal functions and Sturm-
Liouville boundary value problem are introduced. In chapter …ve the
concepts of partial di¤erential equation (PDEs) is introduced. We
concentrate on the most important PDEs of applied mathematics, the
wave equations governing the vibrating string, the heat equation, and
the Laplace equation.

vii
viii PREFACE
1
2 PREFACE
Chapter 1

Special functions

Special functions are particular mathematical functions which have


more or less established names and notations due to their importance
in mathematical analysis, functional analysis, physics, or other ap-
plications. Many special functions appear as solutions of di¤erential
equations or integrals of elementary functions. In the following sec-
tions, we will discussd the following special functions

Gamma function

Beta function

Legendre polynomials

Hermite plynomials

Laguerre plynomials

Chebyshev plynomials

Bessel function

3
4 CHAPTER 1. SPECIAL FUNCTIONS

1.1 The Gamma function


It is denoted by (n) and is de…ned by
Z 1
(n) = e x xn 1 dx; (n > 0) (1.1)
0

Putting x = y 2 ) dx = 2ydy in (1.1), we get


Z 1
2
(n) = 2 e y y 2n 1 dy; (n > 0) (1.2)
0

Example 1 Prove that


(1) = 1 (1.3)

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

Example 2 Prove that

(n + 1) = n (n); n>0 (1.4)

Proof. From (1.1),


Z 1
(n + 1) = e x xn dx
0
1.1. THE GAMMA FUNCTION 5

Using integration by part


Z 1
x n 1
(n + 1) = [ e x ]0 ( e x )nxn 1 dx;
0
Z 1
= 0+n e x xn 1 dx
0
= n (n):

where
xn
lim e x xn = lim =0
x!1 x!1 ex

Example 3 Compute (5:5)

Solution

(5:5) = 4:5 (4:5)


= 4:5 3:5 2:5 1:5 0:5 (0:5)

Example 4 Prove that

(n + 1) = n!

For n is positive integer

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

How to compute (x)

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)

Table of Gamma function


x 1 1.1 1.2 . . . 1.8 1.9 2
(x) 1 0.951 0.918 . . . 0.932 0.962 1

1.1.1 Graph of Gamma function

10

-5 -4 -3 -2 -1 1 2 3 4 5
x
-5

-10

Graph of Gamma function


1.1. THE GAMMA FUNCTION 7

Example 5 Prove that


1 p
( )=
2
1
Proof. Putting n = 2
into (1.1), we get
Z 1
1 1
( )= e xx 2 dx;
2 0

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

Using polar coordinates

x = r cos ; y = r sin ) dxdy = rdrd

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

Example 12 Prove that for any positive integer n

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

1.2 The Beta function

It is denoted by (m; n) and is de…ned as


Z 1
(m; n) = xm 1 (1 x)n 1 dx; m; n > 0 (1.6)
0

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

x = sin2 ; dx = 2 sin cos ;


x = 0) = 0; x = 1 ) =
2
14 CHAPTER 1. SPECIAL FUNCTIONS

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

Relation between Gamma and Beta function


(m) (n)
(m; n) =
(m + n)
Proof From (1.2)
Z 1
y 2 2n 1
(n) = 2 e y dy;
0
Z 1
x2 2m 1
(m) = 2 e x dx
0
) Z 1 Z 1
(x2 +y 2 ) 2m 1 2n 1
(n) (m) = 4 e x y dy
0 0
Using polar coordinates
x = r cos ; y = r sin
we get
Z =2 Z 1
r2 2m 1
(n) (m) = 4 e r cos2m 1
r2n 1
sin2n 1
rdrd
=0 r=0
Z =2 Z 1
2m 1 2n 1 r 2 2(m+n) 1
= 2 cos sin d :2 e r dr
=0 r=0
= (m; n) (m + n)
1.2. THE BETA FUNCTION 15

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

Substituating in equation (1.10)


Z 1
1 1 1
I = t 4 (1 t) 3 p dt
0 2 t
Z 1
1 1 1
= t 4 (1 t) 3 dt
2 0
1 3 4 1 ( 34 ) ( 43 )
= ( ; )=
2 4 3 2 ( 25
12
)
1 ( 43 ) 13 ( 31 )
=
2 13 1
12 12
1
( 12 )
Example 14 Evaluate
Z 4
x2
I= p dx
0 (4 x)

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

Example 15 Prove that

Z 1
xm 1 + xn 1
(m; n) = dx
0 (1 + x)m+n

Proof. We know that

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

Example 18 Prove that


p
1
(m) (m + ) = 2m 1
(2m)
2 2
Hence, show that
1
(m; m) = 21 2m
(m; )
2
Solution We know that
Z
2 1 p+1 q+1
sinp cosq d = ( ; )
0 2 2 2
( p+1
2
) ( q+1
2
)
= p+q+2
2 ( 2 )
Putting q = p; we get
Z
( p+1 ) ( p+1 ) 2
2 2
= (sin cos )p d
2 (p + 1) 0
Z
2 sin 2 p
= ( )d
0 2
Z
1 2
= (sin 2 )p d
2p 0

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

(m) (m) ( 12 ) (m)


= 21 2m
(2m) (m + 21 )
)
1
(m; m) = 21 2m
(m; )
2

Example 19 Show that


Z 1
xm 1 (1 x)n 1
(m; n)
I= dx =
0 (a + x)m+n an (1
+ a)m

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

(2) Prove that


n
(m; n + 1) = (m + 1; n)
m
(3) Prove that

(n) (1 n) = (0 < n < 1)


Zsin1n
xn 1
Hint : dx =
0 1+x sin n
(4) Prove that
Z 1
1
dx = (p + q; 1 q) ( p < q < 1)
1 xp+1 (x 1)q
(5) Prove that
Z
2 1 ( ( 41 ))2
q d = p
0 1 1
sin2 4
2
24 CHAPTER 1. SPECIAL FUNCTIONS

(6) Show that the area inclosed by the curve

( ( 41 ))2
x4 + y 4 = 1 is p
2

(7) Show that


1 ( (n))2
(n; n + 1) =
2 (2n)
and hence deduced that
Z r
2
4 1 sin x ( ( 14 ))2
( ) cos xdx = p
0 sin3 x 2
1.3. LEGENDRE POLYNOMIALS 25

1.3 Legendre polynomials


The di¤erential equation of the form
00 0
(1 x2 )y 2xy + n(n + 1)y = 0 (1.12)

is called Legendre di¤erential equation, where n is a positive inte-


ger.
Another form of this equation is

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

y = c1 Pn (x) + c2 Qn (x) (1.14)

where

Pn (x) is the Legendre polynomial of …rst kind of order n

Qn (x) is the Legendre polynomial of second kind of order n

In this course we are interested in Legendre polynomials of …rst


kind Pn (x); which is given by

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

Rodrigue formula This is another form for obtaining Legen-


dre polynomials
1 dn 2
Pn (x) = (x 1)n (1.17)
2n n! dxn
For example for n = 1
1 d 2
P1 (x) = 1 (x 1)
2 1! dx
= x

which is the solution of following Legendre di¤erential equation of


order one
00 0
(1 x2 )y 2xy + 1(1 + 1)y = 0 (1.18)
)
00 0
(1 x2 )y 2xy + 2y = 0 (1.19)
As a result of Rodrigue formula, it is easy to prove that

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

is a solution of the following Legendre di¤erential equation of order 4


00 0
(1 x2 )y 2xy + 20y = 0

Remark

even function if n is even


Pn (x) =
Odd function if n is odd

Example 20 Find the general solution for the following di¤erential


equation
00 0
(1 x2 )y 2xy + 6y = 0

Solution Since n(n + 1) = 6 ) n = 2; then the general


solution is
y = c1 P2 (x) + c2 Q2 (x)
)
1
P2 (x) = (3x2 1)
2
is one solution of the di¤erential equation

1.3.1 Generating function for Legendre polyno-


mial
When expanding the function
1
p
1 2xt + t2

in power of t, the coe¢ cients of tn will be Pn (x); therefore this


function is considered to be the generating for the Legendre polyno-
mial.
28 CHAPTER 1. SPECIAL FUNCTIONS

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

Example 21 Prove that


Pn (1) = 1

Proof. We know that

1 X1
p = tn Pn (x) (1.22)
1 2xt + t2
n=0

Putting x = 1 in both sides of equation (1.22), we obtain

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)

Substituting of (1.24) into (1.23), we get

X
1
1 + t + t2 + ::: + tn + ::: = tn Pn (1)
n=0

Comparing the coe¢ cient of tn ; we obtain

Pn (1) = 1

Remark: When there is no confusing regarding the variable, we


shall write Pn (x) as Pn .
30 CHAPTER 1. SPECIAL FUNCTIONS

1.3.2 Recurrence relation


The following important recurrence relations are holds for Legendre
polynomials Pn (x)

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 )

Example 22 Given P0 (x) = 1 and P1 (x) = x; use the recurrence


relations to deduce P2 (x)

Solution From recurrence relation one

nPn = (2n 1)xPn 1 (n 1)Pn 2

Put n = 2, we get

2P2 = 3xP1 1P0

Substituting P0 (x) and P1 (x); we obtain


1
P2 = (3x2 1)
2
1.3. LEGENDRE POLYNOMIALS 31

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

Pn+1 (0) = Pn 1 (0) = 0

Therefore
Z 1
1
Pn (x)dx = [1 1 0 + 0] = 0
0 2n + 1

1.3.3 Orthogonality of Legendre polynomials


Theorem The following relation holds for jxj < 1
Z 1
0 m 6= n
Pn (x)Pm (x)dx = 2 (1.25)
1 2n+1
m =n

Proof. Case (1) m 6= n: Since Pn (x) and Pm (x) satisfy Legendre


di¤erential equation, we have
00 0
(1 x2 )Pm 2xPm + m(m + 1)Pm = 0 (1.26)

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

Integrating both sides w.r.t. x from 1 to 1 gives


Z 1 h i+1
0 0
(m n)(m + n + 1) Pn Pm dx = (1 x2 )(Pn Pm Pm Pn )
1 1

Z 1
) Pn (x)Pm (x)dx = 0
1

Example Prove that


Z 1
2n
xPn Pn 1 dx = (1.28)
1 4n2 1

From recurrence relation (1) we have (putting n ! n + 1)

(n + 1)Pn+1 = (2n + 1)xPn nPn 1

)
n n+1
xPn = Pn 1 + Pn+1 (1.29)
2n + 1 2n + 1
1.3. LEGENDRE POLYNOMIALS 33

Using (1.29), we get


Z 1 Z 1
n n+1
xPn Pn 1 dx = [ Pn 1 + Pn+1 ]Pn 1 dx
1 1 2n + 1 2n + 1
Z 1 Z 1
n 2 n+1
= Pn 1 dx + Pn+1 Pn 1 dx
1 2n + 1 1 2n + 1
n 2
= +0
2n + 1 2(n 1) + 1
2n
=
(2n + 1)(2n 1)
2n
=
4n2 1
Example Prove that
Z 1
0 0 0 if m 6= n
(1 x2 )Pn Pm dx = 2n(n+1) (1.30)
1 2n+1
if m = n

Proof. Case (1) m 6= n, the integration by part gives


Z 1h i 0 h i+1
0 0
(1 x2 )Pn Pm dx = ((1 x2 )Pn )Pm
1 1
Z 1 h i
2 00 0
Pm (1 x )Pn 2xPn dx
1

Since Pn satis…es Legendre di¤erential equation, we get


00 0
(1 x2 )Pn 2xPn = n(n + 1)Pn (1.31)

)
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

Case (2) m = n, the integration by part gives


Z 1h i 0 h i+1
0 0
(1 x2 )Pn Pn dx = ((1 x2 )Pn )Pn
1 1
Z 1 h i
2 00 0
Pn (1 x )Pn 2xPn dx
1

Again using (1.31), we obtain


Z 1h i 0 Z 1
2 0
(1 x )Pn Pn dx = 0 + n(n + 1) Pn2 dx
1 1
2
= n(n + 1)
2n + 1
2n(n + 1)
=
2n + 1
1.3. LEGENDRE POLYNOMIALS 35

1.3.4 Legendre series


Let f (x) be a function de…ned from 1 < x < 1 , the Legendre
expansion of f (x) is
X
1
f (x) = Cn Pn (x) (1.32)
n=0

where Z 1
2n + 1
Cn = f (x)Pn dx (1.33)
2 1

Proof. Multiplying both sides of (1.32) by Pm and integrate from 1


to 1, we obtain
Z 1 X
1 Z 1
f (x)Pm dx = Cn Pn Pm dx
1 n=0 1

Recalling the orthogonality property, we get


Z 1
2
f (x)Pm dx = Cm
1 2m + 1
) Z 1
2m + 1
Cm = f (x)Pm dx
2 1

Replacing m by n
Z 1
2n + 1
Cn = f (x)Pn dx
2 1
36 CHAPTER 1. SPECIAL FUNCTIONS

Example Expand the function


0 if 1<x60
f (x) =
x if 0<x<1
Solution Let
X
1
f (x) = Cn Pn (x)
n=0

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

1.4 Hermite polynomials


The di¤erential equation of the form
00 0
y 2xy + 2ny = 0; (1.34)
is called Hermite di¤erential equation, where n = 0; 1; 2; ::.
The solution of this equation is Hermite polynomials
[ n2 ]
X n!
Hn (x) = ( 1)r (2x)n 2r

r=0
r! (n 2r)!
where hni n
2
if n is even
= n 1
2 2
if n is odd

1.4.1 Generating function


The generating function is
X
1
tn
t2
e2tx = Hn (x) (1.35)
n=0
n!

1.4.2 Other expression of Hermit plynomials


2 dn x2
Hn (x) = ( 1)n ex e (1.36)
dxn
From which
H0 (x) = 1
H1 (x) = 2x
H2 (x) = 4x2 2
H3 (x) = 8x3 12x
H4 (x) = 16x4 48x2 + 12
H5 (x) = 32x5 160x3 + 120x
38 CHAPTER 1. SPECIAL FUNCTIONS

1.4.3 Recurrence relation


The following important recurrence relations are holds for Hermite
polynomials
1.
Hn+1 (x) = 2xHn (x) 2nHn 1 (x); (1.37)
H1 (x) = 2xH0 (x) (1.38)

2.
0 0
Hn (x) = 2nHn 1 (x); H0 (x) = 0 (1.39)

1.4.4 Orthogonality of Hermite polynomials


Theorem The following relation holds for jxj < 1
Z 1
x2 p0 m 6= n
e Hn (x)Hm (x)dx = n (1.40)
1 2 n! m=n

1.4.5 Hermite series


Let f (x) be a function de…ned from 1 < x < 1, the Hermite
expansion of f (x) is
X
1
f (x) = Cn Hn (x) (1.41)
n=0
where Z 1
1 x2
Cn = p n e f (x)Hn dx (1.42)
2 n! 1
2
Proof. Multiplying both sides of (1.41) by e x Hm and integrate from
1 to 1, we obtain
Z 1 X1 Z 1
x2 2
e f (x)Hm dx = Cn e x Hn Hm dx
1 n=0 1
1.4. HERMITE POLYNOMIALS 39

Recalling the orthogonality property, we get


Z 1
2 p
e x f (x)Hm dx = Cm 2m m!
1

) 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

Solution We have from (1.37)


1
xHn (x) = Hn+1 (x) + nHn 1 (x)
2
so that
Z 1 Z 1
x2 x2 1
xe Hn Hn+1 dx = e Hn+1
Hn+1 (x) + nHn 1 (x) dx
1 2
Z1 Z 1
1 1 x2 2 2
= e Hn+1 + n e x Hn+1 Hn 1 dx
2 1 1
1 p n+1
= 2 (n + 1)! + n(0)
2
p n
= 2 (n + 1)!
40 CHAPTER 1. SPECIAL FUNCTIONS

1.5 Laguerre polynomials


The di¤erential equation of the form
00 0
xy + (1 x)y + ny = 0; (1.43)

is called Laguerre di¤erential equation, where n = 0; 1; 2; ::.


The solution of this equation is Laguerre polynomials
X
n
n!
Ln (x) = ( 1)r 2 (x)r
r=0
(r!) (n r)!

1.5.1 Generating function


The generating function is
xt
e( 1 t ) X n
1
= t Ln (x) (1.44)
1 t n=0

1.5.2 Other expression of Laguerre plynomials


ex dn
Ln (x) = xn e x
(1.45)
n! dxn
From which

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.5.3 Recurrence relation


The following important recurrence relations are holds for Laguerre
polynomials

1.

(n + 1) Ln+1 (x) = (2n + 1 x) Ln (x) nLn 1 (x); (1.46)

2.
0
xLn (x) = nLn (x) nLn 1 (x); (1.47)

1.5.4 Orthogonality of Laguerre polynomials


Theorem The following relation holds for 0 < x < 1
Z 1
0 m= 6 n
e x Ln (x)Lm (x)dx = (1.48)
0 1 m=n

1.5.5 Laguerre series


Let f (x) be a function de…ned from 0 < x < 1, the Laguerre expan-
sion of f (x) is
X
1
f (x) = Cn Ln (x) (1.49)
n=0

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

Recalling the orthogonality property, we get


Z 1
e x f (x)Lm dx = Cm (1)
0

) 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

Solution We have from (1.46)

xLn = (2n + 1) Ln (n + 1) Ln+1 nLn 1 ;

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

1.6 Chebyshev polynomials


The di¤erential equation of the form
00 0
1 x2 y xy + n2 y = 0; (1.50)

is called Chebyshev di¤erential equation, where n = 0; 1; 2; ::.


The solution of this equation is Chebyshev polynomials

[ n2 ]
X n!
Tn (x) = ( 1)r (x)n 2r
(1 x2 )r (1.51)
r=0
2r! (n 2r)!

1.6.1 Generating function


The generating function is

1 t2 X1

2
= T0 (x) + 2 tn Tn (x) (1.52)
1 2tx + t n=1

1.6.2 Other expression of Chebyshev plynomials


1
Tn (x) = cos n cos x (1.53)
From which

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.6.3 Recurrence relation


The following important recurrence relations are holds for Hermite
polynomials

1.
Tn+1 (x) = 2xTn (x) Tn 1 (x); (1.54)

2.
0
1 x2 Tn (x) = nxTn (x) + nTn 1 (x); (1.55)

1.6.4 Orthogonality of Chebyshev polynomials


Theorem The following relation holds for 1 < x < 1
8
Z 1 < 0 m 6= n
Tm (x)Tn (x)
p dx = m = n 6= 0 (1.56)
1 1 x2 : 2
m=n=0

1.6.5 Chebyshev series


Let f (x) be a function de…ned from 1 < x < 1, the Chebyshev
expansion of f (x) is
X
1
f (x) = Cn Tn (x) (1.57)
n=0

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

Proof. Multiplying both sides of (1.57) by pTm (x)


1 x2
and integrate from
1 to 1, we obtain
Z 1 X1 Z 1
Tm (x) Tm (x)Tn (x)
f (x) p dx = Cn p dx
1 1 x2 n=0 1 1 x 2

Recalling the orthogonality property, we get


Z 1
Tm (x) 2
m=0
f (x) p dx = Cm
1 1 x 2 m = 1; 2; :::
)
Z
2 1 Tm (x)
Cm = f (x) p dx; m = 1; 2; :::
1 1 x2
Z
1 1 f (x)
C0 = p dx
1 1 x2
Replacing m by n
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

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

8. If f (x) is polynomial of degree less than n prove that


Z 1
f (x)Pn (x)dx = 0
1

9. Expand
f (x) = x2
48 CHAPTER 1. SPECIAL FUNCTIONS

(a) In Legender series 1<x<1


(b) In Hermite series 1<x<1
(c) In Chebyshev series 1<x<1
(d) In Laguerre series 0 < x < 1

10. If Pn ( ) = 0; show that Pn 1 ( ) and Pn+1 ( ) are of opposite


signs
11. Prove that
Z 1
2n(n + 1)
x2 Pn+1 Pn 1 dx =
1 (2n + 1)(2n + 3)

12. Prove that


Z 1
1 3 1
x2 Pn2 dx = + +
1 8(2n 1) 4(2n + 1) 8(2n + 3)

13. Evaluate Z 1
x3 P4 (x)dx
1

14. Evaluate Z 1
xPn2 (x)dx
1

15. Show that

Tm+n (x) + Tm n (x) = 2Tm (x)Tn (x)

16. Show that

fTn (x)g2 Tn+1 (x)Tn 1 (x) = 1 x2


1.7. THE BESSEL FUNCTION 49

1.7 The Bessel function


One of the most important di¤erential equation is Bessel di¤erential
equation. It takes the form
00 0
x2 y + xy + (x2 n2 )y = 0 (1.58)

where n is a given number.


The general solution of Bessel di¤erential equation depends on n
as the following

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. Jn (x) is Bessel function of the …rst kind of order n. It is


denoted by
X
1
( 1)r x
Jn (x) = ( )n+2r (1.59)
r=0
r! (n + r + 1) 2

The graph of some Bessel functions for n = 0; 1; 2 are shown in


the following …gure
50 CHAPTER 1. SPECIAL FUNCTIONS

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

J0 (x) — , J1 (x) :::; J2 (x)

2 Yn (x) is Bessel function of the second kind of order n. It is


denoted by
Jn (x) cos n J n (x)
Yn (x) = (1.60)
sin n
The graph of the Bessel functions of second kind of order n which
are unbounded as x ! 0

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

Notes: (1) We concern in this course with Bessel function of


the …rst kind and of order n:(2) The following relations are very im-
portants

Example 26 Notation 27

J n (x) = ( 1)n Jn (x) (1.61)


X1
( 1)r 2r
cos x = x (1.62)
r=0
2r!
X1
( 1)r 2r+1
sin x = x (1.63)
r=0
(2r + 1)!

1.7.1 Di¤erentiations and integral identities


Bessel function satis…es the following di¤erentiations and integral iden-
tities

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

Example 29 Evaluate the following integral


Z
x4 J1 (x)dx

Solution Integrating by part, we get


Z Z
4
x J1 (x)dx = x2 :x2 J1 (x)dx
Z
2 2
= x J2 (x):x x2 J2 (x):(2x)dx
Z
= x J2 (x) 2 x3 J2 (x)dx
4

= x4 J2 (x) 2x3 J3 (x)

Example 30 Evaluate the following integral


Z
x3 J0 (x)dx

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

1.7.2 Recurrence relations


The following important recurrence relations are holds for Bessel func-
tion Jn (x)
1.
0 n
Jn (x) = Jn (x) Jn+1 (x)
x
2.
0 n
Jn (x) = Jn (x) + Jn 1 (x)
x
3.
0
2Jn (x) = Jn 1 (x) Jn+1 (x)
4.
2n
Jn (x) = Jn 1 (x) + Jn+1 (x)
x
Proof. From the di¤erentiation identity
d n
[x Jn (x)] = xn Jn 1 (x) and
dx
d
[x n Jn (x)] = x n Jn+1 (x)
dx
we have
0
xn Jn (x) + nxn 1 Jn (x) = xn Jn 1 (x) and (1.64)
0
x n Jn (x) nx n 1 Jn (x) = x n Jn+1 (x) (1.65)
Dividing (1.64) by xn and multiplying (1.65) by xn gives
0 n
Jn (x) + Jn (x) = Jn 1 (x) and (1.66)
x
0 n
Jn (x) Jn (x) = Jn+1 (x) (1.67)
x
The addition of (1.66) and (1.67) gives (3) and subtraction gives
(4)
1.7. THE BESSEL FUNCTION 55

Example 33 Prove that


0 4 2
J2 (x) = (1 2
)J1 (x) + J0 (x)
x x
Solution Putting n = 2 in recurrence relation (2)
0 2
J2 (x) = J2 (x) + J1 (x) (1.68)
x

In recurrence relation (4), put n = 1


2
J1 (x) = J0 (x) + J2 (x)
x
2
) J2 (x) = J1 (x) J0 (x) (1.69)
x
Substituting of (1.69) into (1.68) gives
0 2 2
J2 (x) = [ J1 (x) J0 (x)] + J1 (x)
x x
4 2
= (1 )J 1 (x) + J0 (x)
x2 x

1.7.3 Generating function of Bessel function


It is de…ned as
x 1
X
n=1
(t )
e 2 t = Jn (x)tn (1.70)
n= 1

That is Jn (x) is the coe¢ cient of tn in the expansion of Bessel


generating function. Equation (1.70) can be written as:

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

Important relation Assume that

t = ei

and substitute in (1.70), we get

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

Equation (1.72) is very important and can be used to prove large


numbers of the following relations.

Example 34 Prove that

cos(x sin ) = J0 + 2J2 cos 2 + 2J4 cos 4 + ::: (1.73)

and

sin(x sin ) = 2J1 sin + 2J3 sin 3 + 2J5 sin 5 + ::: (1.74)

Proof. From equation (1.72)


X
n=1
ix sin
e = Jn (x)ei n

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)
)

eix sin = J0 + J1 (ei e i ) + J2 (e2i + e 2i


) + :::
= J0 + 2J1 sin + 2J2 cos 2 + :::

cos(x sin ) + i sin(x sin ) = J0 + 2iJ1 sin + 2J2 cos 2 + :::


= J0 + 2i(J1 sin + J3 sin 3 + :::)
+2(J2 cos 2 + J4 cos 4 + :::)

Now equating real and imaginary parts, we get

cos(x sin ) = J0 + 2(J2 cos 2 + J4 cos 4 + :::) (1.75)

and
sin(x sin ) = 2(J1 sin + J3 sin 3 + :::) (1.76)

Remark: On putting = 2
in (1.75) and (1.76), we obtain

cos(x cos ) = J0 2J2 cos 2 + 2J4 cos 4 :::) (1.77)

and

sin(x cos ) = 2J1 cos 2J3 cos 3 + 2J5 cos 5 :::) (1.78)

Example 35 Prove that

cos x = J0 2J2 + 2J4 :::


sin x = 2J1 2J3 + 2J5 :::
58 CHAPTER 1. SPECIAL FUNCTIONS

Solution. Putting = 2
in (1.75) and (1.76)

Example 36 Prove that

x sin x = 2[22 J2 42 J4 + 62 J6 :::]


x cos x = 2[12 J1 32 J3 + 52 J5 :::]

Solution. Di¤erentiate (1.75) w.r.t yields

[ sin(x sin )](x cos ) = 0 4J2 sin 2 8J4 sin 4 :::

Again di¤erentiate w.r.t , we get

[ sin(x sin )]( x sin ) + (x cos )[ cos(x sin )](x cos )


= 8J2 cos 2 32J4 cos 4 ::: (1.79)

Now, putting = 2
in (1.79), we obtain

x sin x = 8J2 32J4 + :::


= 2[22 J2 42 J4 + 62 J6 :::]

Similarly di¤erentiating (1.76) twice and putting = 2:

Example 37 Show that the di¤erential equation


00 1 2n 0
y + y +y =0 (1.80)
x
is satis…ed by the solution

y = xn Jn (x) (1.81)

Solution Di¤erentiate (1.81), we get


0
y = x n Jn 1 and (1.82)
00 0
y = x n Jn 1 + nx
n 1
Jn 1 (1.83)
1.7. THE BESSEL FUNCTION 59

Substituting of (1.82), (1.83) and (1.81) into left hand side of


(1.80), we obtain

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)

Putting n ! n 1 in recurrence relation (1)


0 n
Jn = Jn Jn+1
x
)
0 n 1
Jn 1 = Jn 1 Jn (1.86)
x
)
0
xJn 1 = (n 1)Jn 1 xJn (1.87)
Substituting from (1.87) into (1.85), we get

L:H:S = xn 1 [(n 1)Jn 1 xJn nJn 1 + Jn 1 + xJn ]


= 0

1.7.4 Orthogonality of Bessel functions


If i and j are roots of the equation Jn ( a) = 0; then
Z a
0 i 6= j
xJn ( i x)Jn ( j x)dx = a2 2 (1.88)
0 J ( i a)
2 n+1
i=j
60 CHAPTER 1. SPECIAL FUNCTIONS

1.7.5 Bessel series


Theorem Every continuous function f (x) in the interval 0 < x <
a has a Bessel series expansion in the form

X
1
f (x) = Ci Jn ( i x) (1.89)
i=1

where i satis…es the equation Jn (a i ) = 0; and the coe¢ cients


Ci are calculated from the relation
Z a
2 1
Ci = 2 2 xf (x)Jn ( i x)dx (1.90)
a Jn+1 ( i a) 0

Proof. Multiply both sides of equation (1.89) by xJn ( j x) and inte-


grate from 0 to a yields
Z a X
1 Z a
xf (x)Jn ( j x)dx = Ci xJn ( j x)Jn ( i x)dx (1.91)
0 i=1 0

Using the orhogonality property (1.88), we get


Z a X
1 Z a
xf (x)Jn ( j x)dx = Ci xJn ( j x)Jn ( i x)dx
0 i=1 0

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

Then we know that [Take n = 1; a = 1; f (x) = x in (1.90)]


R1
2 0
x2 J1 ( r x)dx
Cr = (1.93)
J22 ( i )
dt
Let rx = t ) dx = r
; then we get
Z 1 Z
2 1 r

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

Using (1.93), we get

2 J2 ( r r )
Cr =
J22 ( i )
2
= (1.94)
r J2 ( r )
62 CHAPTER 1. SPECIAL FUNCTIONS

Using (1.94) in (1.92), we get

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

in terms of sines and cosines

3. Evaluate The following integral

(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

8. Use Bessel generating function to prove that


X
1
2
J0 + 2 Jn2 = 1
n=1

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

Function Orthogonal relation


R1 0 m 6= n
Pn (x) 1 n
P (x)Pm (x)dx = 2
2n+1
m=n
Ra 0 i 6= j
Jn (x) 0
xJn ( i x)Jn ( j x)dx = a2 2
J ( i a) i = j
2 n+1
R1 2 0 m 6= n
Hn (x) 1
e x Hn (x)Hm (x)dx = p n
2 n! m = n
R1 x 0 m 6= n
Ln (x) 0
e Ln (x)Lm (x)dx =
8 1 m=n
R 1 Tm (x)Tn (x) < 0 m 6= n
Tn (x) p dx = m = n 6= 0
1 1 x2 : 2
m=n=0

Function Generating P1function


1
Pn (x) p =
1 2xt+t2 P n=0
tn Pn (x)
x 1 n=1
Jn (x) e 2 (t t ) = n= 1 Jn (x)t
n
P tn
e2tx t = 1
2
Hn (x) n=0 n! Hn (x)
( xt )
e 1 t
P1 n
Ln (x) 1 t
= n=0 t Ln (x)
1 t2
P
Tn (x) 1 2tx+t2
= T0 (x) + 2 1 n
n=1 t Tn (x)
1.8. SUMMARY 67

Expansion Coe¢ cients


P1 2n+1 1
R
f (x) = n=0 Cn Pn (x) Cn = 2 R 1 f (x)Pn dx
P a
f (x) = 1 2
i=1 Ci Jn ( i x) Ci = a2 Jn+1
2
1
( i a) 0
xf (x)Jn ( i x)dx
P1 R 1 2
f (x) = n=0 Cn Hn (x) Cn = p 21n n! 1 e x f (x)Hn dx
P R1
f (x) = 1 Cn Ln (x) Cn = 0 e x f (x)Ln dx
P n=0 R1
f (x) = 1 n=0 Cn Tn (x) Cn = 2 1 f (x) pT1n (x) x2
dx; n 6= 0;
R
1 1 pf (x)
C0 = 1 1 x2
dx
68 CHAPTER 1. SPECIAL FUNCTIONS
Chapter 2

Fourier Analysis

In mathematics, Fourier analysis is a subject area which grew from the


study of Fourier series. Fourier analysis is named after Joseph Fourier,
who showed that representing a function by a trigonometric series
greatly simpli…es the study of heat propagation. Today, the subject of
Fourier analysis encompasses a vast spectrum of mathematics. In the
sciences and engineering, the process of decomposing a function into
simpler pieces is often called Fourier analysis, while the operation of
rebuilding the function from these pieces is known as Fourier synthesis.
In mathematics, the term Fourier analysis often refers to the study of
both operations.

69
70 CHAPTER 2. FOURIER ANALYSIS

gfgfvgfgfgfg
71

1. Periodic function A function f (x) is said to have a period


T or to be periodic with period T if for all x

f (x + T ) = f (x); T > 0

For example:

(a) The function sin x has a period 2 since

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

2. Piecewise continuos functions A function f (x) is said


to be piece wise continuos in an interval if

(a) The interval can be divided into a …nite number of subin-


tervals in each of which f (x) is continuos
(b) The limits of f (x) as x approaches the endpoints of each
interval are …nite

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

2.1 Fourier series


In mathematics, a Fourier series decomposes any periodic function or
periodic signal into the sum of a (possibly in…nite) set of simple oscil-
lating functions, namely sines and cosines (or complex exponential).
De…nition Let f (x) be a periodic function with period 2L.
Then the Fourier series of f (x) is given by

a0 X
1
n x n x
f (x) = + (an cos + bn sin ) (2.1)
2 n=1
L L

where the Fourier coe¢ cients a0 ; an ; bn are given by


Z L
1
a0 = f (x)dx (2.2)
L L
Z L
1 n x
an = f (x) cos dx (2.3)
L L L
Z L
1 n x
bn = f (x) sin dx (2.4)
L L L

Remarks

1. If f (x) has the period 2L;Then the coe¢ cient a0 ; an ; bn can be


determined equivalently from
Z
1 c+2L
a0 = f (x)dx (2.5)
L c
Z
1 c+2L n x
an = f (x) cos dx (2.6)
L c L
Z
1 c+2L n x
bn = f (x) sin dx (2.7)
L c L
74 CHAPTER 2. FOURIER ANALYSIS

where c is any real number

2 If L = ; then

a0 X
1
f (x) = + (an cos nx + bn sin nx) (2.8)
2 n=1

where the Fourier coe¢ cients a0 ; an ; bn are given by


Z
1
a0 = f (x)dx (2.9)
Z
1
an = f (x) cos nxdx (2.10)
Z
1
bn = f (x) sin nxdx (2.11)

2.1.1 Convergence of Fourier series


Dirichlet conditions
Suppose that

i f (x) is de…ned and single valued except possibly at a …nite num-


ber of points in ( L; L)

ii f (x) is periodic with period 2L.


0
iii f (x) and f (x) are piecewise continuous in ( L; L) .

Then the Fourier series (2.1) with coe¢ cients (2.2)-(2.3) converges

to

f (x) if x is a point of continuity


2.1. FOURIER SERIES 75

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

in a Fourier series, …nd f (0);and prove that

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

since x = 0 is point of discontinuity, then


f (0+ ) + f (0 ) +0
f (0) = = =
2 2 2
2.1. FOURIER SERIES 77

Putting x = 0 in (2.12), we get

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

for di¤erent values of r


78 CHAPTER 2. FOURIER ANALYSIS

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

Example 40 Expand the function

f (x) = x; 0 < x < 2

in Fourier series, then

1. Plot the continuation of the function

2. …nd f (0); f ( )

3. Prove that
X1
( 1)r
=
r=0
2r + 1 4

Solution The period 2L = 2 ) L = ; so

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

Referring to (2.13), we sketch the partial sum Sr for di¤erent values


of r
82 CHAPTER 2. FOURIER ANALYSIS

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

in a Fourier series, …nd f (0);and prove that


2 X
1
1
=
8 r=0
(2r + 1)2

Solution The period 2L = 4 ) L = 2; so


Z
1 2
a0 = f (x)dx
2 2
Z 0 Z 2
1
= 2dx + xdx
2 2 0
" #
2
1 0 x2
= (2x) 2 +
2 2 0
= 3

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

since x = 0 is point of discontinuity, then


f (0+ ) + f (0 ) 0+2
f (0) = = =1
2 2
Putting x = 0 in (2.14), we get

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

Referring to (2.14), we sketch the partial sum Sr for di¤erent values


of r

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)

2.1.2 The phase angle form of a Fourier series


Suppose f (x) is periodic function with period 2L and putting ! 0 = L ,
then the Fourier series is
a0 X
1
f (x) = + [an cos n! 0 x + bn sin n! 0 x] (2.15)
2 n=1

where the Fourier coe¢ cients a0 ; an ; bn are given by


Z
1 L
a0 = f (x)dx (2.16)
L L
Z
1 L
an = f (x) cos n! 0 xdx (2.17)
L L
Z
1 L
bn = f (x) sin n! 0 xdx (2.18)
L L
phase angle form
2.1. FOURIER SERIES 87

The phase angle form of the Fourier series (2.15) is

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

The term cos(n! 0 x + n) is called the harmonic of f (x)

cn is the n th harmonic amplitude of f (x)

n is the n th phase angle of f (x)

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

First, we calculate the coe¢ cients as


Z 3
1
a0 = f (x)dx
3=2 0
Z
2 3 2
= x dx
3 0
3
2 x3
=
3 3 0
= 6

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

2.1.3 Fourier series for even and odd functions


Even functions A function f (x) which is symmetrical about
the vertical axis and has the property
f ( x) = f (x)
For example

3
f(x)

-2 -1 0 1 2
x
90 CHAPTER 2. FOURIER ANALYSIS

Odd functions A function f (x) which is symmetrical about


the origin and has the property

f ( x) = f (x)

For example

3
f(x)
2

-2 -1 1 2
-1
x

-2

-3

Fourier coe¢ cients for even and odd functions

If f (x) is even function, then


Z L Z
1 2 L
a0 = f (x)dx = f (x)dx (2.20)
L L L 0
Z L Z
1 n x 2 L n x
an = f (x) cos dx = f (x) cos dx (2.21)
L L L L 0 L
Z L
1 n x
bn = f (x) sin dx = 0 (2.22)
L L L
2.1. FOURIER SERIES 91

If f (x) is odd function, then


Z
1 L
a0 = f (x)dx = 0 (2.23)
L L
Z
1 L n x
an = f (x) cos dx = 0 (2.24)
L L L
Z Z
1 L n x 2 L n x
bn = f (x) sin dx = f (x) sin dx (2.25)
L L L L 0 L
Example 43 Find the Fourier series expansion of
f (x) = x2 ; x

Hence, …nd the sum of


1 1 1 1
+ 2 + :::
12 22 3 42
Solution Since f (x) = x2 is an even function ) bn = 0; and
Z Z
2 L 2
a0 = f (x)dx = x2 dx
L 0 0
2 x3 2 2
= =
3 0 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

2.1.4 Half-range expansions

If a function f (x) is de…ned only on 0 < x < L, we can make arbitrary


de…nition of the function on L < x < 0:

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

tion is now odd.

3
f(x)
2

-2 -1 1 2
-1
x

-2

-3

3. De…ne f (x) on L < x < 0 by f (x) = f (x + L).

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

Solution The graph of f (x) = x2 , 0 < x <

12
f(x)
10

-4 -2 0 2 4
x
f (x) = x2 , 0 < x <
96 CHAPTER 2. FOURIER ANALYSIS

Case (1) in cosine series

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

Case (2) in sine series

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

Case (3) in Fourier series

f(x) 10

-4 -2 2 4
x
-5

-10

Note that here 2L = )L= 2

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

Term by term ddi¤erentiation


0
Theorem Let f (x) be continuous and f piecewise continu-
ous on [ L; L], Suppose also that f ( L) = f (L):Then, for any x in
00
( L; L) at which f exists,
"1 #
d d X n x n x
f (x) = (an cos + bn sin )
dx dx n=1 L L
100 CHAPTER 2. FOURIER ANALYSIS

Term by term integration


Theorem Let f (x) be a piecewise continuous on [ L; L]. Then,
for any x in [ L; L] represent
Z x Z x" #
a0 X
1
n x n x
f (x)dx = + (an cos + bn sin ) dx
L L 2 n=1
L L

2.2 Fourier Integral


A Fourier series can sometimes be used to represent a function over
an interval [ L; L] or [0; L]:If a function is de…ned over the entire real
line, it may still have a Fourier series representation if it is periodic. If
it is not periodic then it cannot be represented by a Fourier series for
all x. In such a case we may still be able to represent the function in
terms of sines and cosines, except that now an integral is used instead
of a summation. R1
Let f (x) be de…ned for all x and assume that 1 jf (x)j dx converges.
Then the Fourier integral of f is
Z
1 1
f (x) = [A(!) cos (!x) + B(!) sin (!x)] d!
0

in which the Fourier integral coe¢ cients are de…ned by


Z 1
A(!) = f (x) cos (!x) dx
1
Z 1
B(!) = f (x) sin (!x) dx
1

Proof. For non-periodic applications or a specialized Fourier series


when the period of the function is in…nite:L ! 1
a0 X h n xi
1
n x
f (x) = + an cos + bn sin (2.29)
2 n=1
L L
2.2. FOURIER INTEGRAL 101

Insert the integral formula for Fourier coe¢ cients


Z L " R #
1 X1 1 L
f (x) cos n x
dx cos n x
f (x) = f (x)dx + L RL L L
2L L 1 L n x n x
n=1
+ L L
f (x) sin L
dx sin L
(2.30)
Set
n
!n = and 4 ! = ! n ! n 1 =
L L
Then equation (2.30) becomes
Z L
1
f (x) = f (x)dx 4 ! (2.31)
2 L
2 R 3
L
1 X1
L
f (x) cos (! n x) dx cos (! n x)
+ 4 RL 54!
n=1 + L
f (x) sin (! n x) dx sin (! n x)

Given that as
X Z
L ! 1: T hen 4 ! ! 0; (:) 4 ! ! (:)d!

and the interval [ L; L] expands to the entire real line, then


Z L
1
f (x)dx 4 ! ! 0
2 L

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

Convergence of Fourier integral

If f (x) Ris piecewise continuous on every …nite interval and sup-


1
pose that 1
jf (x)j dx converges. Then the Fourier integral of f (x)
converges to ‘
1
f (x+ ) + f (x )
2
at each x which f has a left and right derivative. In particular,
if f is continuous at x and has a left and right derivative there, then
the Fourier integral at x converges to f (x):

Remark

If f (x) is even function, then


Z 1
A(!) = 2 f (x) cos (!x) dx; B(!) = 0
0

If f (x) is odd function, then


Z 1
A(!) = 0; B(!) = 2 f (x) sin (!x) dx
0

Example 46 Find the Fourier integral representation of the function


jxj
f (x) = e ; > 0; 1<x<1

Sketch the function, and then prove that


Z 1
cos 5! 5
2 + !2
d! = e
0 2
2.2. FOURIER INTEGRAL 103

Solution Since f (x) is even function, then


Z 1
A(!) = 2 f (x) cos (!x) dx
0
Z 1
= 2 e x cos (!x) dx
0
2
= 2 + !2

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

De…ning an expression for the approximate of Fourier integral


Z
1 n
fn = [A(!) cos (!x) + B(!) sin (!x)] d!
0
104 CHAPTER 2. FOURIER ANALYSIS

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

Example 47 Find the Fourier integral representation of the function


1 if 1 x 1
f (x) =
0 if jxj > 1

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

2.2.1 Fourier cosine integral

The Fourier cosine integral representation of f (x) 0n [0; 1) is

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

2.2.2 Fourier sine integral


The Fourier cosine integral representation of f (x) 0n [0; 1) is
Z
1 1
f (x) = B(!) sin (!x) d!
Z 01
B(!) = 2 f (x) sin (!x) dx
0

Example 48 For the function


x
f (x) = e ; > 0; 0 x<1

Find

1. Fourier cosine integral


2. Fourier sine integral

Solution Case (1) Fourier cosine integral

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

Case (2): Fourier sine integral

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

Example 49 Show that

Z 1
cos( 2 !) cos !x 2
cos x jxj < 2
d! =
0 1 !2 0 jxj > 2

Solution Let

cos x jxj < 2


f (x) =
0 jxj > 2
112 CHAPTER 2. FOURIER ANALYSIS

Using the Fourier cosine integral


Z 1
A(!) = 2 f (x) cos (!x) dx
0
Z
2
= 2 cos x cos (!x) dx
0
Z
2 2
= cos(1 !)x + cos(1 + !)xdx
2 0
sin(1 !)x sin(1 + !)x 2
= +
1 ! 1+! 0
sin(1 !) 2 sin(1 + !) 2
= +
1 ! 1+!
cos 2 ! cos 2 !
= +
1 ! 1+!
2
= cos !
1 !2 2
)
Z 1
1
f (x) = f (x) = A(!) cos (!x) d!
0
Z
2 1 cos 2 ! cos (!x)
= d!
0 1 !2
Therefore
Z 1
cos 2 ! cos (!x)
d! = f (x)
0 1 !2
cos x jxj <
= 2 2
0 jxj > 2
2.3. EXERCISES 113

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:

2. Find the Fourier series expansion of

1 if <x<0
f (x) =
x if 0<x<

2
Obtain series representation for

3 Find the Fourier series expansion of

f (x) = ex ; < x < ; f (x + 2 ) = f (x)

Hence, deduce that


X
1
1 1
= coth ;
n=1
n2 + 1 2 2
X1
( 1)n 1
= cosech ;
n=1
n2 + 1 2 2

4 Find the Fourier series expansion of

sin x if 0<x<
f (x) =
0 if <x<2

5 Find the Fourier series expansion of

2
+ x if <x<0
f (x) =
2
x if 0<x<
114 CHAPTER 2. FOURIER ANALYSIS

6 Expand the following function in Fourier series

f (x) = x2 ; < x < ; f (x + 2 ) = f (x)

Then show that


2 X1
1
= 2
;
6 n=1
n
2 X1
( 1)n+1
=
12 n=1
n2

and graph the continuation of the function

7 For the function


f (x) = x2 ; 0 < x < 4

Find

Fourier cosine series

Fourier sine series

Fourier series

8 Expand the following function in Fourier series

f (x) = jsin xj ; 0 < x < 2 ; f (x + 2 ) = f (x)

Then show that


1 1 1 1
= + + + :::
2 1:3 3:5 5:7
2.3. EXERCISES 115

9 Expand the function

f (x) = sin x; 0 < x < ;

in cosine series, then …nd the sum of the series


X1
( 1)n
n=1
4n2 1

10 Prove that
Z L X
1
1 2
f (x) dx = 2a20 + (a2n + b2n )
L L n=1

(This equation is known as Parseval identity)

11 Find the phase angle form of


1 + x if 0 < x 3
f (x) = ; f (x) = f (x + 4)
2 if 3 x < 4

12 Find the Fourier series for the following graph

1.5
f(x)
1.0

0.5

-4 -2 2 4
-0.5
x

-1.0

-1.5
116 CHAPTER 2. FOURIER ANALYSIS

13 Find the Fourier integral for


x2 if 0 x < 2
f (x) =
0 otherwise
14 Find Fourier sine and cosine integral of
8
< 3 if 0 x < 1
f (x) = 1 if 1 x < 2
:
0 if x 2
15 Find the Fourier integral for
sinh x if jxj < T
f (x) =
0 if jxj > T
16 Using The Fourier integral, verify the identities
8
Z 1 < 2 0<x<
1 cos !
sin !xd! = x=
0 ! : 4
0 x>
17 Using The Fourier integral, verify the identities
Z 1
cos !x
2+1
d! = 2 e x x > 0
0 !
18 Using The Fourier integral, verify the identities
Z 1
sin ! 2
sin x 0 x
sin !xd! =
0 1 ! 2 0 x>
19 Using The Fourier integral, verify the identities
8
Z 1 < e x
x>0
cos !x + ! sin !x
d! = 2
x=0
0 !2 + 1 :
0 x<0
Chapter 3

Partial Di¤erential
Equations (PDEs)

Partial di¤erential equations (PDEs) are models of various physical


and geometrical problems, arising when the unknown functions (the
solutions) depends on two or more variables. It is fair to say that
only the simplest physical systems can be modeled by ordinary di¤er-
ential equations (ODEs), whereas most problems in dynamics, elas-
ticity, heat transfer, electromagnetic theory, and quantum mechanics
required PDEs. Indeed, the range of applications of PDEs is enor-
mous, compared to that of ODEs.
In this chapter we concentrate on the most important PDEs of ap-
plied mathematics, the wave equations governing the vibrating string,
the heat equation, and the Laplace equation. We derive the wave
equation as an example of how physical systems can be modeled by
PDEs.

The solution of a PDE will, in general, depend on more than one


variable. An example is a vibrating string: the de‡ection of the string

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.

3.1 Basic concepts


To simplify notation, it is common to use subscripts to denote partial
@2u
derivatives. For example, ux = @u
@x
; uxy = @x@y ; and so on.

A partial di¤erential equation (PDE) is an equation involv-


ing one or more partial derivatives of an unknown function, call
it u, that depends on two or more variables.

The order of PDE is the highest order partial derivative ap-


pearing in this equation. As for PDEs, second order PDEs will
be most important ones in applications

A solution of PDE in some region R of the space of


independent variables is a function that has all the partial
derivatives appearing in the PDE in some domain D containing
3.1. BASIC CONCEPTS 119

R, and satis…es the PDE everywhere in R. In general, the totality


of solutions of a PDE is very large. Foe example, the functions

u = x2 y 2 ; u = ex cos y; u = sin x cosh y; u = ln(x2 + y 2 )

which are entirely di¤erent from each other, are solution of

uxx + uyy = 0

The unique solution of an PDE corresponding to a given


physical problem will be obtained by the use of additional con-
ditions arising from the problem. For instance, this may be the
conditions that the solution u assume given values on the bound-
ary of the region R (Boundary conditions). Or, when time t is
one of the variables, u or ut or both may be prescribed at t = 0
(Initial conditions).

Di¤erential operator notation L [:] for PDEs. Given any


PDE such as
uxx 5uy + u = xy 2 (x 5)
This equation may be written in the form

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)

The partial di¤erential operator L [u] is linear if

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]

Whilie, the operator de…ned by

L [u] = ux + uuy

is nonlinear since

L [:] = (:)x + (:) (:)y (3.2)


)
@ @
L [ v + w] = ( v + w) + ( v + w) ( v + w)
@x @y
= vx + wx + ( v + w) ( vy + wy )
= vx + wx + 2 vvy + vwy + wvy + 2 wwy
6= L [v] + L [w]

Another de…nition for linear PDEs

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

The linear PDE L [u] = f is homogeneous if f = 0; and if


f 6= 0 then it is nonhomogeneous

Boundary conditions

A set of equations that describe the behavior of the solution on the


boundary of the region under consideration

Initial conditions

A set of equations which may inter into the description of the


physical phenomena such as the initial values of the solution at time
t=0

Principle of superposition

If u1 and u2 are solutions of a homogeneous linear PDE in some


region R, then
u = c 1 u1 + c 2 u2
with any constants c1 and c2 is also a solution of that PDE in the
region R.

Second order linear PDE classi…cation The general linear


partial di¤erential equation of order two in two variables is

Auxx + Buxy + Cuyy + Dux + Euy + F u = f (3.3)

We classify (3.3) as on of three types

Parabolic if B 2 4AC = 0
Hyperbolic if B 2 4AC > 0
Elliptic if B 2 4AC < 0

in the region under consideration


122CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

Some important second order PDEs

1. Wave equation (hyperbolic)

utt = c2 uxx

2. Heat equation (parabolic)

ut = c2 uxx

3. Laplace equation (elliptic)

uxx + uyy = 0

4. Poisson equation (elliptic)

uxx + uyy = f (x; y)

Example Classify each of the following PDEs according to el-


liptic, parabolic, or hyperbolic

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)

3.1.1 Modeling of vibrating string (wave equa-


tion)
We will derive the equation that modeling small transverse vibrations
of an elastic string. We place the string along x-axis, stretch it length
L, and fasten it to at the ends x = 0 and x = L. We then distort the
string, and at some instant, call it t = 0, we release it and allow it to
vibrate. The Problem is to determine the vibrations of the string, i.e.
to …nd its de‡ection u(x; t) at any point x and at any time t > 0:

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

2. In vertical direction, apply Newton second law

@2u
T2 sin T1 sin = 4x (3.5)
@t2

where, is mass per unit length

3 Divide (3.5) by T given in (3.4)

T2 sin T1 sin 4 x @2u


=
T2 cos T1 cos T @t2
@2u
tan tan = 4x 2
@t

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

5 Dividing equation (3.6) by 4x


" #
1 @u @u @2u
=
4x @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)

3.2 Solution of the wave equation

In this section we give a full solution to the boundary value problem


of the wave equation that describes the vibration of the string with
…xed ends. Let u(x; t) denote the position of at time t of the point x
on the string. Consider the wave equation

utt = c2 uxx ; 0 < x < L; t > 0 (3.7)

Subject to the boundary conditions

u(0; t) = 0; and u(L; t) = 0; t > 0 (3.8)

and the initial conditions


@u
u(x; 0) = f (x); and (x; 0) = g(x); 0 < x < L (3.9)
@t
We will solve the problem using the method of separation of
variables.
Step 1: Separating variables in (3.7 and (3.8)
We start by seeking nonzero product solutions of (3.7) of the form

u(x; t) = X(x)T (t) (3.10)


3.2. SOLUTION OF THE WAVE EQUATION 127

where X(x) is a function of x alone and T (t) is a function of t


alone.
Di¤erentiate (3.10) with respect to t and x, we get
00 00
utt = XT and uxx = X T

Plugging these into (3.7), we obtain


00 00
XT = c2 X T

and now, dividing by c2 XT; we get


00 00
T X
= (3.11)
c2 T X
In equation (3.11) 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
00 00
T X
=k and =k
c2 T X
we rewrite the separated equations as two ordinary di¤erential
equations
00
X kX = 0
and
00
T kc2 T = 0 (3.12)
Our next move is to separate the variables in the boundary condi-
tion (3.8) using (3.10), we get

X(0)T (t) = 0 and X(L)T (t) = 0


128CHAPTER 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

X(0) = 0 and X(L) = 0

Thus we arrive at the boundary value problem in X :


00
X kX = 0; X(0) = 0 and X(L) = 0 (3.13)

Step 2: Solving the separated equations


2
Case 1 If k > 0: Let k = ; then from (3.13), we get
00 2
X X = 0; X(0) = 0 and X(L) = 0 (3.14)

The solution of the second order ordinary di¤erential equation


(3.14) is given by

X(x) = C1 cosh x + C2 sinh x (3.15)

Applying the boundary condition, we obtain

X(0) = 0 ) C1 = 0 ) X(x) = C2 sinh x

and
X(L) = 0 ) 0 = C2 sinh L ) C2 = 0
Therefore we get only the trivial solution from this case

Case 2 If k = 0: Then from (3.13), we get


00
X = 0; X(0) = 0 and X(L) = 0 (3.16)
3.2. SOLUTION OF THE WAVE EQUATION 129

The solution of the second order ordinary di¤erential equation


(3.16) is given by
X(x) = C1 + C2 x (3.17)
Applying the boundary condition, we obtain

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)

The solution of the second order ordinary di¤erential equation


(3.14) is given by

X(x) = C1 cos x + C2 sin x (3.19)

Applying the boundary condition, we obtain

X(0) = 0 ) C1 = 0 ) X(x) = C2 sin x

and
X(L) = 0 ) 0 = C2 sin L
To avoid the trivial solution, we take C2 6= 0; which forces

sin L = 0

Since the sine function vanishes at the integer multiples of , we


conclude that
L = n ; n = 1; 2; :::
130CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

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

Step 3: Fourier series solution of the problem


Using condition (3.9), we get

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

But this is a Fourier sine series, it follow that


Z
2 L n
C3 = f (x) sin x dx (3.20)
L 0 L
Similarly, we determine C4 by using second initial conditions in
(3.9), …rst

@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

But this is a Fourier sine series, it follow that


Z
2 L n
n C4 = g(x) sin x dx
L 0 L
Solving for C4 and recalling the values of n = c nL , we get
Z L
2 n
C4 = g(x) sin x dx; n = 1; 2; :::
cn 0 L
Note: Replacing C3 by bn and C4 by bn

Summary of the solution

The solution of the wave equation

utt = c2 uxx ; 0 < x < L; t > 0


132CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

With boundary conditions

u(0; t) = 0; and u(L; t) = 0; t > 0

and initial conditions


@u
u(x; 0) = f (x); and (x; 0) = g(x); 0 < x < L
@t

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

Example 50 The ends of a stretched of length L = 1 are …xed at


x = 0; x = 1: The string is set to vibrate from rest by releasing it
from an initial triangle shape modeled by the the function
3 1
10
x if 0 x 3
f (x) = 3(1 x)
20
if 31 x 1

1
Determine the subsequent motion of the string, given that c =
Solution
3.2. SOLUTION OF THE WAVE EQUATION 133

Since string is set to vibrate from rest ) g(x) = 0 ) bn = 0;


and

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

since the values of

n
n =c =n
L

We …nd the solution

9 X
1
sin n 3
u(x; t) = 2
sin n x cos nt
10 n=1
n2

By plotting u(x; t) for a …xed value of t, we get


134CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

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

Example 51 Solve for the motion of a string of length L = 2 if c = 1


and the initial displacement and velocity are given by f (x) = 0 and
g(x) = xcosx

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

In the following …gures we show some snapshots of the string at


di¤erent times

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 The one dimensional heat equation


In this section we study the temperature distribution in a uniform bar
of length L with insulated lateral surface and no internal sources of
heat, subject to certain boundary and initial conditions. To describe
the problem, let u(x; t) represents the temperature of the point x of
the bar at time t (see …gure).
In the following problems we will solve the heat equation
ut = c2 uxx ; 0 < x < L; t > 0
for di¤erent boundary and initial conditions

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

We will solve the problem using the method of separation of


variables.
Step 1: Separating variables in (3.21 and (3.22)
We start by seeking nonzero product solutions of (3.21) of the form

u(x; t) = X(x)T (t) (3.24)

where X(x) is a function of x alone and T (t) is a function of t


alone.
Di¤erentiate (3.24) with respect to t and x, we get
0 00
ut = XT and uxx = X T

Plugging these into (3.21), we obtain


0 00
XT = c2 X T

and now, dividing by c2 XT; we get


0 00
T X
2
= (3.25)
cT X
In equation (3.25) 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
we rewrite the separated equations as two ordinary di¤erential
equations
00
X kX = 0
and
0
T kc2 T = 0 (3.26)
142CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

Our next move is to separate the variables in the boundary condi-


tion (3.22) using (3.24), we get

X(0)T (t) = 0 and X(L)T (t) = 0

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

X(0) = 0 and X(L) = 0

Thus we arrive at the boundary value problem in X :


00
X kX = 0; X(0) = 0 and X(L) = 0 (3.27)

Step 2: Solving the separated equations


This equation is the same that we solved in previous section. We
found that
2 n
k= ; = n = ; n = 1; 2; :::
L
and
n
X = Xn = sin x; n = 1; 2; :::
L
2 n 2
Now, we go back to (3.26) and substitute k = = L
and
get
n 2
0
T + c T = 0; n = 1; 2; :::
L
The general solution of this equation is
2t
Tn = bn e n ; n = 1; 2; :::

where
n
n =c ; n = 1; 2; :::
L
3.3. THE ONE DIMENSIONAL HEAT EQUATION 143

We thus arrive at the product solution, or normal mode of (3.21)


2t n
un (x; t) = bn e n sin x; n = 1; 2; :::
L
Then by superposition principle, we get
X
1
2t n
u(x; t) = bn e n sin x
n=1
L

Step 3: Fourier series solution of the problem


Using condition (3.23), we get

u(x; 0) = f (x) )
X1
n
f (x) = bn sin x; 0 < x < L
n=1
L

But this is a Fourier sine series, it follow that


Z
2 L n
bn = f (x) sin x dx; n = 1; 2; ::: (3.28)
L 0 L
Summary of the solution

The solution of the heat equation

ut = c2 uxx ; 0 < x < L; t > 0

With boundary conditions

u(0; t) = 0; and u(L; t) = 0; t > 0

and initial conditions

u(x; 0) = f (x); 0 < x < L


144CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

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

A thin bar of length units is placed in boiling water (temperature


100 C). After reaching 100 C throughout, the bar is removed from
the boiling water. With lateral sides kept insulated, suddenly, at time
t = 0, the ends are immersed in a medium with constant freezing
temperature 0 C . Taking c = 1; …nd the temperature u(x; t) for
t>0
Solution The boundary value problem that we need to solve
is
ut = c2 uxx ; 0 < x < ; t > 0
With boundary conditions

u(0; t) = 0; and u(L; t) = 0; t > 0

and initial conditions

u(x; 0) = 100; 0 < x <

The solution from summary given by


n
n = c
L
n
= 1
= n
3.3. THE ONE DIMENSIONAL HEAT EQUATION 145

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

Plotting u(x; t) for a …xed value of t, we get

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.

Example 53 Steady state temperature

Describe the steady state solution in a bar of length L with one


end kept at temperature T1 and the other at temperature T2 .
Solution
Since the steady state solution is independent of t ; we must have
@u
lim =0
t!1 @t

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)

substituting in (3.21), we get

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

3.3.2 Case 2 Nonzero boundary conditions


Consider the heat boundary value problem

ut = c2 uxx ; 0 < x < L; t > 0 (3.30)

with the boundary conditions

u(0; t) = T1 and u(L; t) = T2 ; t>0 (3.31)


3.3. THE ONE DIMENSIONAL HEAT EQUATION 149

and initial condition


u(x; 0) = f (x); 0 < x < L (3.32)
The problem is nonhomogeneous when T1 and T2 are not both
zero. The problem can be reduced to homogeneous one by de…ning
the transient temperature distribution
u(x; t) = w(x; t) + v(x) (3.33)
Substituting (3.33) into (3.30) with considering (3.29), we get the
homogeneous problem

wt = c2 wxx ; 0 < x < L; t > 0 (3.34)


with the boundary conditions
w(0; t) = 0 and w(L; t) = 0; t>0 (3.35)
and initial condition
w(x; 0) = f (x) v(x)
T2 T1
= f (x) x + T1 (3.36)
L
We solved this problem and we get
X
1
2t n n
w(x; t) = bn e n sin x; n =c (3.37)
n=1
L 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)

Example 54 A thin bar of length units is placed in boiling water


(temperature 100 C). After reaching 100 C throughout, the bar is
removed from the boiling water. With lateral sides kept insulated, sud-
denly, at time t = 0, the end at x = 0 is frozen at 0 C , while the end
at x = is kept at 100 C: take c = 1; …nd the temperature u(x; t) for
t>0

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

The transient solution is


X
1
2t n n
w(x; t) = bn e n sin x; n =c =n
n=1
L L
200 X sin nx
1
n2 t
= e
n=1
n
3.3. THE ONE DIMENSIONAL HEAT EQUATION 151

therefore, the solution is

u(x; t) = w(x; t) + v(x)


200 X sin nx
1
n2 t 100
= e + x
n=1
n

u
100

80

60

40

20

0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
x

3.3.3 Case 3 Semi-in…nite bar


If the bar we have been studying is very long, we mat treat it as
semi-in…nite, that is, as extending from 0 to 1: the heat equation for
semi-in…nite bar is

ut = c2 uxx ; 0 < x; t > 0 (3.40)

with the boundary conditions

u(0; t) = 0; t>0 (3.41)


152CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

and initial condition

u(x; 0) = f (x); 0 < x (3.42)

We will solve the problem using the method of separation of


variables.
Step 1: Separating variables in (3.40 and (3.41)
We start by seeking nonzero product solutions of (3.40) of the form

u(x; t) = X(x)T (t) (3.43)

where X(x) is a function of x alone and T (t) is a function of t


alone.
Di¤erentiate (3.43) with respect to t and x, we get
0 00
ut = XT and uxx = X T

Plugging these into (3.40), we obtain


0 00
XT = c2 X T

and now, dividing by c2 XT; we get


0 00
T X
= (3.44)
c2 T 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

we rewrite the separated equations as two ordinary di¤erential


equations
00
X kX = 0
and
0
T kc2 T = 0 (3.45)
Our next move is to separate the variables in the boundary condi-
tion (3.41) using (3.43)
X(0)T (t) = 0
If X(0) 6= 0;then T (t) must be zero for all t; and so, u is identically
zero (trivial solution). To avoid this trivial solution, we set

X(0) = 0

Thus we arrive at the boundary value problem in X :


00
X kX = 0; X(0) = 0 (3.46)

Equation (3.46) has one boundary condition on u, the boundness


also requires that X remains …nite as x ! 1. So, we must choose the
solution
2
X(x) = A cos x + B sin x; k =
From boundary condition

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

satis…es our problem with the boundary conditions.


Since may take any value, then any linear combination of the
solutions is a solution. Then, the appropriate linear combination is an
integral, so u should have the form
Z 1
2 2
u(x; t) = B( ) sin x e c t d (3.47)
0

Note verify that (3.47) satisfy (3.40) and (3.41)


Applying the initial condition (3.42), we get

u(x; 0) = f (x) )
Z 1
f (x) = B( ) sin x d
0

Since this is a Fourier sine integral, we have


Z
2 1
B( ) = f (x) sin x dx
0

3.3.4 Case 4 Varying the boundary conditions


Consider the following heat equation

ut = c2 uxx ; 0 < x < L; t > 0

With boundary conditions

@u @u
(0; t) = 0; and (L; t) = 0; t > 0
@x @x
3.3. THE ONE DIMENSIONAL HEAT EQUATION 155

and initial conditions

u(x; 0) = f (x); 0 < x < L

We left this case as an exercises


156CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

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

2. Show that the function


1
u= p
x2 + y 2 + z 2

is a solution of the three dimensional Laplace equation

uxx + uyy + uzz = 0


3.4. EXERCISES 157

3. Solve the boundary value problem

utt = c2 uxx ; 0 < x < L; t > 0


u(0; t) = 0; u(L; t) = 0;
@u
u(x; 0) = f (x); (x; 0) = g(x)
@t
for a string of unit length, subject to the given conditions

(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

4. In the presence of resistance proportional to velocity, the one


dimensional wave equation becomes

utt + 2kut = c2 uxx ; 0 < x < L; t > 0; k > 0


u(0; t) = 0; u(L; t) = 0;
@u
u(x; 0) = f (x); (x; 0) = g(x)
@t
Solve this equation using the separation of variables
158CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)

5. Solve the boundary value problem

ut = c2 uxx ; 0 < x < L; t > 0


u(0; t) = 0; u(L; t) = 0;
u(x; 0) = f (x)

for a one dimensional heat equation subject to the given condi-


tions

(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

6. Prove that the solution of the heat equation

ut = c2 uxx ; 0 < x < L; t > 0

with the boundary conditions

u(0; t) = T1 and u(L; t) = T2 ; t>0

and initial condition

u(x; 0) = f (x); 0 < x < L


3.4. EXERCISES 159

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

u(0; t) = 100; u(1; t) = 100; c = 1

and
f (x) = 50x(1 x)
160CHAPTER 3. PARTIAL DIFFERENTIAL EQUATIONS (PDES)
Bibliography

[1] Kreyszig E., Advanced engineering mathematics, 9ed, Wiley, 2005.

[2] Stroud K.A., Booth D.J., Advanced engineering mathematics, 4ed.,


Palgrave-Macmillan, 2003.

[3] Greenberg M.D., Advanced engineering mathematics, 2ed.,


PH,1998.

[4] Nakhle Asmar, Partial Di¤erential Equations with Fourier Series


and Boundary Value Problems 2nd Edition, Prentice Hall 2005.

[5] Bell, W.W. Special Functions for Scientists and Engineers. Lon-
don, Van Nostrand, 1968.

[6] Strauss W.A. Partial di¤erential equations.. an introduction, Wi-


ley, 1992.

161
Part (2)

Numerical Analysis

Chapter -1 Curve Fitting 1

Chapter -2 NUMERICAL SOLUTIONS OF NONLINEAR

EQUATIONS 23

Chapter -3 Interpolation 57

Chapter -4 NUMERICAL SOLUTIONS OF ORDINARY


DIFFERENTIAL EQUATION 96

-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

We want to obtain A and B such that this value is minimum.


As we know from the study of function of several variable,
E  A, B  n
  2 yi   Axi  B   xi   0
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

With the required value from the calculated table,

-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

  56   40   524   364   256

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

y10  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

With the required value from the calculated table,


x y Y  ln y x2 xY Y2
0 1.5 0.40547 0 0
1 2.5 0.91629 1 0.91629
2 3.5 1.25276 4 2.50553
3 5 1.60944 9 4.82831
4 7.5 2.01490 16 8.05961

 10   20   6.19886   30   16.30974

- 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
y7  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 yx 
n

That is called the standard error of estimates of y on x.

In case of a regression line yest  Ax  B we have:

2

 y 2  B y  A xy
S yx 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

regression line of y on x at respective vertical distances S y  x  , 2 S y  x  , 3 S y  x 

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 yx   1.28
n
Also, the student can use the formula:

2

 y 2  B y  A xy
S yx 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

o x as a function of y then, find x(7)

o y as a function of x then, find y(5)

- 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

(c) which curve fit is best

- 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 n1    an1 x  an
or, f(x) may be known only implicitly as a transcendental function, for example,
]
f x   x  exp(  x ) .

Definition (Solution of equation)

A number  is a solution of f(x) if f() = 0. Such a solution  is called a


root or a zero of f(x) = 0.
Geometrically, a root of root
equation (1) is the value x
of x at which the graph f(x)
roots
of y = f(x) intersects the x-axis.

Definition (Types of roots)

If we can write (1) as: f x   x   m g x   0


Where g(x) is bounded and g()  0 , then  is called a multiple root of
multiplicity m.
For m =1, the root is said to be a simple root.

- 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

(b) Iterative methods.


These methods are based on the idea of successive approximation, i.e.
starting with one or more initial approximations to the root, we obtain a
sequence of approximates or iterates {xk}, which in the limit converges to
the root. These methods may give only one root at a time.
Mathematicians prove that, polynomial equation of degree < 5,
have analytical solution (although these analytical solutions are
complicated of polynomials of degree 3 and 4). They also prove that
polynomial equations of degree higher than 4, have no analytical solution
in general. In addition, transcendental equations have no useful analytical
solution in general.

- 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)

A sequence of iterates {xk} is said to be converge to the root , if


lim xk     0 (4)
k 

If xk, xk-1, …, xk-m+1 are m approximations to the root , then, a multipoint


iteration methods is defined as:
xk 1   xk , xk 1 ,, xk m1  (5)
Where, the function  is called the multipoint iteration function.
For m = 1, we get the one point iteration method
xk 1   xk  (6)
Thus, given one or more initial approximations to the root, we require a suitable
iteration function  for a given function f(x), such that the sequence of iterates
obtained from (5) or (6) converges to the root . In practice, except in the rare
cases, it is not possible to find  which satisfies the given equation exactly.
We, therefore, attempt to find an approximate root * such that either
f  *    or xk 1  xk   (2.7)

where xk and xk+1 are two consecutive iterates and  is the prescribed error
tolerance.

Definition (Initial Approximations)


Initial approximations to the root are often known from the physical
considerations of the problem. Otherwise graphical methods are generally used
to obtain initial approximations to the root. Since the value of x, at which the

- 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

Graph of y = x2+2x+1 Graph of y =cosx-xex


Fig (2.1a) Fig (2.1b)
If the equation f(x) = 0 can be conveniently written in the form f1(x) =
f2(x), then the point of intersection of the graphs of the equations y = f1(x) and y
= f2(x) gives the root of f(x) and therefore any value in the neighborhood of this
point can be taken as an initial approximation to the root see (Fig 2.1c).

y
y =x

y =e-x
cos x x
0.5 /2

Fig (2.1b): Graph of y = x and y = e-x cosx

Another commonly used method to obtain the initial approximation to


the root is based upon the Intermediate Value Theorem, which states:

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   cosx   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

 f mk    ( is prescriped very small )


 after prescribed expected number of iteration N.
 If mk    Tol . (given tolerance=small number), which

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

Hence, the approximate root is taken as 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)

Fig.2.2: The Secant method


The used formula is derived as follows:

- 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 

Advantages of the method:


 No need to change of sign of f(x)
 If the method converges, the convergence is fast.

- 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

Finally, the approximate solution is 0.51777

- 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 )

The used formula is derived as follows:


The equation of the line (tangent) to the curve f(x) at the point xk , yk 
with slop m  f ( xk ) is:
y  f  xk 
 f ( xk )
x  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 )
 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 lnx   x  0
such that:
f xk 1   10 8
Where, xk+1 is the approximate value of the root.

Solution
 20 lnx   x  0

 f ( x )  20 lnx   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.2610-3
2 1.054118562 -0.1.99 10-5
3 1.054119671 -0.5610-11
4 1.054119671 -0.5610-11

The root is 1.054119671

- 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   xn1 ., 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.

Geometrically, the method of iteration can be explained as follows:

- 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)

yx
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 ,

Since  x   cos x  1, x  [ 1,1.4 ] ,


then the method is convergent, and we use

xk 1   xk   sin xk  0.25 , k  0 ,1,2,...


x0 = 1.2,
x1  sin1.2 .  0.25  1.182039086

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  tan1 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

In the second case


xk 1   xk   xk 1  tan 1 xk , k  0 ,1,2,....
Take x0 =4.5, then
x1 =1.35213 = 1.35213 + = 4.49372.
x2 =1.35183 = 1.35183 + = 4.49342.
x3 =1.35182 = 1.35182 + = 4.49341.
x4 =1.35182 = 1.35182 + = 4.49341. (the root)

- 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 31000  x 2 / 3 dx

take x0 =10, xk 1  3 1000  xk

x1  9.66554933 , x2  9.966667165 x3  9.966666789 .

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 31  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) tanx   tanhx   0 b) x 3  x  4  0

Determine the roots correct to two decimals using the bisection method.

a) tanx   tanhx   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,

b) the Newton -Raphson 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 

satisfying the interpolation conditions:

Pn xi   yi ( i  0 ,1,..,n ),

whose degree is at most 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:

f s   Px    for all x  [ a ,b ].

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

with reminder term:


Rn x   f x   Pn x 
n1  x 
 x  x0  ,  x   x0 , x 
n 1 f
n  1!

- 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

find the error.

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

b) at x = 0.1, 1.1  P3 0.1

- 44 -
 x x
2
x 
3
1.1  1      1.0488125 .
 2 8 16 
x 0.1

The actual error is approximately 3.65(10)-6

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

The error = exact value- approximate value


=1.223958333 – 1.218951416 = 5  (10)-3
Although in some instances better approximations can be obtained if
slightly higher -degree Taylor polynomials are used, this is not always the case.

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  1k
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:

 1n1 x  1n1
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.

3-1 Linear and Quadratic Interpolation


The problem of determining a polynomial of degree one that passes
through the distinct points (x0, y0) and (x1, y1) is the same as approximating a
function f(x) for which f(x0) = y0 and f(x1) = y1, by means of a first degree
polynomial interpolating, or agreeing, with the values of f(x) at the given
points. Consider the linear polynomial:

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.5x  1 xx  1 xx  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

The value of integral can be approximated by:


1 1

 1  x dx  P2 x dx ,

0 0

1  4 
1
P2 x dx 
0.5
 3
1.5  2  1.218865508 ,
0

and the value of Error is : 8.6  (10)-5

- 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

 L0 x  yx0   L1 x  yx1   ...  LN x  yxN  (3-5)


where Lk(x) is the Lagrange coefficient polynomial, defined by:

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  yx0   L1 x  yx1   L2 x  yx2   L3 x  yx3 

P3 x  
x  x1 x  x2 x  x3  yx 
x0  x1 x0  x2 x0  x3  0

x  x0 x  x2 x  x3  yx 
x1  x0  x1  x2 x1  x3  1

x  x0 x  x1 x  x3  yx 
x2  x0 x2  x1 x2  x3  2

x  x0 x  x1 x  x2  yx 
x3  x0 x3  x1 x3  x2  3
x  1x  2x  5 x  0 x  2x  5
P3 x   ( 2 ) (3)
0  10  20  5 1  0  1  21  5
x  0 x  1x  5 x  0 x  1x  2
 (2)  ( 147 )
2  0 2  12  5 5  0 5  15  2
3  13  23  5 3  0 3  23  5
 ( 2 ) (3)
f ( 3 )  P3 ( 3 ) 
0  10  2 0  5  1  0  1  2 1  5 

3  0 3  13  5 3  0 3  13  2


 (2)  ( 147 )  15
2  0 2  12  5 5  0 5  15  2

- 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)

P3 x   P2 x   a3 x  x0 x  x1 x  x2  (4-3)

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 .

For example, for the polynomial P1(x):


P1 x   a0  a1 x  x0 ,

P1(x0) = f(x0), and P1(x1) = f(x1).

- 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

1  f x2   f x1  f x1   f x0  


a2    
x2  x0  x2  x1 x1  x0 

a2 
1
f 2  f1   f 2  f1   2 f 2 (4-7)
x2  x0 x2  x0

Generally, the Newton's polynomials can be written in the form:


PN x   a0

 a1 x  x0 

 a2 x  x0  x  x1 

 ...

 a N x  x0  x  x1 x  x2   x  x N 1 

where ak can be written in the form:

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

From This table we get:

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

The coefficients of P3(x) are:


a0 = -3, a1 = 3, a2 = 6, and a3 = 1
which appear on the diagonal of the divided differences table.
We can write P3(x) in the form:
P3 x   a0

 a1 x  x0 

 a2 x  x0  x  x1 

 a3 x  x0  x  x1 x  x2 
P3 x   3

 3x  1

 6 x  1x  2 

 x  1x  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

x1= 1 0.5403 -0.4597

x2= 2 -0.4161 -0.9564 -0.2484

x3= 3 -0.9900 -0.5738 0.1913 0.1466

x4= 4 -0.6536 0.3363 0.45510 0.08793 -0.0147

The Newton interpolating polynomials are:


P1 x   1  0.4597 x ,

P2 x   1  0.4597 x  0.2484 x x  1,


P3 x   1  0.4597 x  0.2484 x x  1  0.1466 x x  1x  2,

P4 x   P3 x   0.0147 xx  1x  2x  3.

Substitute by x = 2.1 to find the required answer.

- 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.

b) Find the cubic interpolation polynomial P3(x) using


the nodes: x0 = -1, x1 = 0, x2 =1, and x3 =2.

- 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).

b) Use cubic Lagrange interpolation based on the


nodes: x0 = 0.5, x1= 1, x2 = 2 and x3 = 3 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.

5) Consider the Lagrange coefficient polynomials Lk(x) that


are used for quadratic interpolation at the nodes x0, x1, x2.
Define g(x) = L0(x)+ L1(x)+ L2(x)-1.
a) Show that g(x) is a polynomial of degree  2.
b) Show that g(xk) = 0 for all k = 0, 1, 2.
c) Show that g(x) = 0 for all x.

- 59 -
6) Consider the function f(x) = sin (x) on the interval [0,1].
Determine the linear Lagrange interpolation

b) Quadratic Lagrange interpolation

- 60 -
7) Use Taylor Series for sin(x) and establish the result
sin(h) = h + 0(h3).

8) Use Taylor Series for cos(x) and establish the result


cos(h) = 1 + 0(h2).

- 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

3) f(x) = 3.6/x , x = 2.5, 3.5

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

5) f(x) = 3sin2(x/6) , x = 1.5, 3.5

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

the IVP yx  


ty
ty
  t
, y1  0 is given by ln t 2  y 2  2 tan 1   . Thus to
 y
find the solution y2  we have to solve the transcendental equation

  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 , yt0   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
yt0   y0 , and proceed stepwise, computing approximate values of the
solution yt  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

 f t , y  on a,b with y(a )  y0 .


dy
dt
has a unique solution y(t) over the interval [a,b] if f(t,y) is continuous with
respect to both variables and satisfies a Lipschitz condition in the variable y on
the rectangle R.

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 yt  h 3 yt 
yt  h   yt   h yt  +   ... (2)
2 6

If the step size h is chosen small enough, then we may neglect the higher
order terms and get
yt  h   yt   h yt   yt   h f ( t , y ) (3)

- 68 -
(with the right side obtained from the given IVP) and the following iteration
process.

In the first step we compute


yt1   yt0  h   yt0   h f ( t0 , y0 ) .
In the second step we compute
yt 2   yt1   h f ( t1 , y1 )
And in general
yt k 1   yt k   h f ( t k , yk ), k  0 ,1,...

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 y0   1. h = 0.25.
dt 2
The exact solution: yt   3 exp t / 2  2  t .

Solution

For step size h = 0.25, M =12 and tk = kh.

yt1   yt0   hf t0 , yt0   1.0  0.25


0  1.0   0.875,
2

y2  0.875  0.25
0.25  0.875  0.796875, etc.
2
This iteration continues until we arrive at the last step:

y3  y12  1.440573  0.25


2.75  1.440573  1.604252
2

- 69 -
Example.
Use Euler’s method to approximate the initial value problem

over 0,1 with y0   y0 and R = Const.


dy
 Ry
dt
Solution.
The step size must be chosen and then the second formula (6) can be
determined for computing the ordinates. This formula is sometimes called a
difference equation and in this case it is
yk 1  yk 1  hR  for k = 0,1,, M - 1. (4)
If we trace the solution values recursively, then, we see that
y1  y0 1  hR  ,

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 
yt  h   yt   h yt  + , 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 
yt  h   yt   hyt   yt   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 
yt  h   yt   hyt   yt     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 y0   1. Take h = 0.25.
dt 2
Solution
The exact solution: yt   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  y0   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

 f t , y dt   dy  yt1   yt0  (2)


t0 t0

When Eq.(2) is solved for y(t1) the result is


t1
yt1   yt0    f t , y dt (3)
t0

Now a numerical integration method can be used to approximate the


definite integral (3). If the Trapezoidal rule is used with step size h = t 1- t0
then the result is

yt1   yt0  
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:

yt1   yt0  
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 y0   1.
dt 2
The exact solution: yt   3 exp t / 2   2  t .

Solution
p1  yt0   hf t0 , yt0 ,
0 1
f t0 , yt0    0.5 ,
2
p1  1  0.25( 0.5 )  0.875,

y1  yt0  
h
 f t0 , y0   f t1 , p1 ,
2

0.25  0.875
f t1 , p1    0.3125 ,
2

y1  1  0.125 0.5  0.3125  0.8984375,

This iteration continues until we arrive at the last step:


y3  y12  1.672269.

- 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

6. Runge - Kutta Methods.


Each Runge-Kutta method is derived from an appropriate Taylor method
in such a way that the G.T.E. of order O(h N). A trade-off is made to perform
several function evaluations at each step and eliminate the necessity to compute
the higher derivatives. These methods can be constructed for any order N. The
Runge-Kutta method of order N = 4 is most popular. It is a good choice for
common purpose because it is quite accurate, stable, and easy to program.
Most authorities proclaim that it is not necessary to go to a higher-order
method because the increased accuracy is offset by additional computational
effort. If more accuracy is required, then a smaller step size should be used.
The forth-order Runge-Kutta method (denoted by RK4) simulates the
accuracy of the Taylor series method of order 4. The proof is algebraically
complicated and results in a formula involving a linear combination of function
values.

- 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
ty
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.250.5  0.5 
f2   0.40625 ,
2
 h h 
f 3  f  t0  , y0  f 2 ,
 2 2 
0.125  1  0.250.5  0.40625 
f3   0.4121094 ,
2
f 4  f t0  h, y0  hf 3 ,
0.125  1  0.250.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 = ?:

0.25 0.375 0.5


h/ 2 h/ 2
x
t1 t1  h / 2 t2
y1 h h
y1  f1 y1  f2 y1  h f3
2 2
f1 f2 f3 f4

Complete the solution

- 78 -
7. System of Differential Equations
Consider the initial value problem:

f t , x , y 
dx
 xt0   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.

7.1 Analytical Method


The following example shows the analytical method of solution which is
used the system of differential equations.
Example
Find the solution of the following system of differential equations.
dx
 x  2y x0   6 ,
dt with
dy
 3x  2 y y 0   4.
dt
Solution
This system of equations can written in the form:
D  1x  2 y  0 (1-a)
3 x  2  D  y  0 (1-b)
Effect on the first equation by (2- D) and the second by 2, then,
 D  2D  1x  22  D y  0 (1-c)
6 x  22  D y  0 (1-d)
Add the first equation to the second,

- 79 -
 D  2 D  1x  6 x  0 or

D 2

 3D  4 x  0

Which has the Auxiliary equation:


m 2

 3m  4  0 and m = 4 or m = -1,

x  c1e4t  c2 e t

the first equation gives:


y  0.5D  1x

y  1.5c1e4t  c2 e t .

If we use the initial conditions, we have:


6  c1  c2 ,

4  1.5c1  c2 .

The solution of the two equations gives:


c1 = 4 and c2 = 2.
and the exact solutions of (1) are:
x  4e4t  2e t ,

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,
ba
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  2g 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 x0   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  2g 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

8. Higher- Order Differential Equations.


The higher order differential equation can be transformed to system of
first order differential equation. For example,
d 2 xt  dxt 
m 2
c  kxt   f t  (1)
dt dt
Represents a mechanical system in which a spring with a spring constant k
restores a displaced mass m. Friction is assumed to be proportional to the
velocity and the function f(t) is an external force.
By solving for the second derivative, we can write a second-order initial
value problem in the form:
d 2x  dx  dx0 
 F  t , x,  with xt0   x0 and  y0
dt 2
 dt  dt
If we use the substitution
dxt  d 2 xt  dyt 
 yt , then 2
 (2)
dt dt dt
and the differential equation in (1) becomes a system

- 83 -
dx
 y xt0   x0
dt with (3)
dy
 F t , x , y  yt0   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

d 2 xt  dxt  dx0 


2
4  5 xt   0 with x0   0 ,  5
dt dt dt
a) Write down the equivalent system of two first-order equations.
b) Use the Range-Kutta method to find the solution over [0, 0.5] using h = 0.1.
c) Compare the numerical solution with the true solution:
xt   3e 2t cost   e 2t sint .

Solution
The differential equation has the form:

d 2 xt  dxt 
2
 4  5 xt .
dt dt
using the substitution

dxt  d 2 xt  dy t 
 y t , and 2

dt dt dt
we get the reformulated problem:
dx
 y xt0   3
dt with
dy
  5x  4 y yt0    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, y1  1, with h = 0.1
dt t 2 t

dy
b)  sin t  e t , 0  t  1, y0   0 , with h = 0.5
dt

c)
dy 1 2

 y y,
dt t
 1  t  3, y1  2 , with h = 0.5

- 86 -
0  t  1, y0   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, y0   0.
dt

- 87 -
dy
b)  ty , 0  t  2, y0   1.
dt

dy
c)  2t , 0  t  2, y0   1.
dt

dy
d)  ty , 0  t  4, y0   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 , y0   1.
dt

dy
4)  3 y  3t , 0  t  0.2 , y0   1.
dt

0  t  0.2 , y0   1.
dy
5)  ty ,
dt

- 89 -
dy
6)  2ty 2 , 0  t  0.2 , y0   1.
dt

7) Consider a projectile that is fired straight up and falls down. If air


resistance is proportional to the velocity, the I.V.P. for the velocity v(t) is

with, v0   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, y1  1, with h = 0.1
dt  t  t 

dy
b)  sin t  e t , 0  t  1, y0   0 , with h = 0.5
dt

c)
dy 1 2

 y y,
dt t
 1  t  3, y1  2 , with h = 0.5

- 91 -
0  t  1, y0   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 x0   2
a) dt with
dy
 2x  y y 0   3
dt
Ans. xt   3e4t  e t , yt   e4t  e t

- 92 -
dx
 3x  y x0   2
b) dt with
dy
 4x  y y 0   3
dt
Ans. xt   2et  tet , yt   3et  2tet

dx
 x  4y x0   2
c) dt with
dy
 x y y 0   3
dt
xt   et 2 cos 2t  6 sin 2t , yt   et 3 cos 2t  sin 2t 

- 93 -
12) Find x(1):
a) 2xt   5 xt   3 xt   45e 2t with x0   2, x0   1

b) xt   6 xt   9 xt   0 , with x0   4 , x0   4.

c) xt   xt   6 cost  with x0   2, x0   3.

- 94 -

You might also like