0% found this document useful (0 votes)
70 views82 pages

MTH313 Numerical Analysis PDF

The document is a lecture note on numerical analysis I. It outlines the course which covers various numerical methods for solving algebraic equations, systems of linear equations, numerical differentiation and integration, and numerical solutions to ordinary differential equations. Specific methods discussed include Newton's method, secant method, bisection method, Gaussian elimination, and Runge-Kutta method. It also provides definitions and examples of applying Newton's method to find roots of polynomials and transcendental functions.

Uploaded by

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

MTH313 Numerical Analysis PDF

The document is a lecture note on numerical analysis I. It outlines the course which covers various numerical methods for solving algebraic equations, systems of linear equations, numerical differentiation and integration, and numerical solutions to ordinary differential equations. Specific methods discussed include Newton's method, secant method, bisection method, Gaussian elimination, and Runge-Kutta method. It also provides definitions and examples of applying Newton's method to find roots of polynomials and transcendental functions.

Uploaded by

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

ABUBAKAR TAFAWA BALEWA UNIVERSITY, BAUCHI

FACULTY OF SCIENCE
Numerical analysis I DEPARTMENT OF MATHEMATICAL SCIENCES

Numerical analysis I
MTH313
Numerical analysis I
Lecture note

Dr. Kwami, A. M (Not for sale) Page 1


Course outline:
Solution of single algebraic equations: Newton’s method, Secant method, False position method,
Bisection method, Muller’s method, Barstow’s method
Solution of algebraic linear system of equations: Determinant Method, Matrix inversion Method, Gauss
elimination Method, Factorization Method, Gauss-Seidal Method, Jacobi Method.
Numerical differentiation and Integration: Midpoint rule, Trapezoidal rule, Simpsons rule.
Numerical solution of ordinary differential equations (Initial value problems): Euler’s method, Taylor
series method, Runge-Kutta method, Predictor-Corrector method, Multi-Step method, Systems of
equations and higher order equations. Finite difference calculus: Difference equations.

Dr. Kwami, A. M (Not for sale) Page 2


Introduction:
Numerical analysis is concern with the development and analysis of methods for the numerical solution
of practical problems. Traditionally, these methods have been mainly used to solve problems in physical
sciences and engineering. However, they are finding increasing relevance in a much broader range of
subjects including economics and business studies.
The first stage in the solution of a particular problem is the formulation of a mathematical model.
Mathematical symbols are introduced to represent the variables involved and physical (or economical)
principles are applied to derive equation which describe the behavior of these variables. Unfortunately,
it is often impossible to find the exact solution of the resulting mathematical problem using standard
techniques. In fact, there are very few problems for which an analytical solution can be determined. For
example, there are formulas for solving linear, quadratic, cubic, and quartic polynomial equations, but
no such formula exist for polynomial equations of degree greater than four or even for simple equation
𝑏
such as 𝑥 = cos 𝑥. Similarly, we can certainly evaluate the integral ∫𝑎 𝑒 𝑥 𝑑𝑥 as 𝑒 𝑏 − 𝑒 𝑎 , but we cannot
𝑏 2
find the exact value of ∫𝑎 𝑒 𝑥 𝑑𝑥
2
Since no function exist which differentiate to 𝑒 𝑥 . Even when the analytical solution can be found it may
be of more theoretical than practical use. For example, if the solution of a differential equation
𝑦 ′′ = 𝑓(𝑥, 𝑦, 𝑦 ′ )
Is expressed as an infinite sum of Bessel functions, then it is most unsuitable for calculating the
numerical values of 𝑦 corresponding to some numerical value of 𝑥

Solution of single algebraic equations


The problem of finding the real root of an equation of the form 𝑓(𝑥) = 0, where 𝑓(𝑥) is an Polynomial or
Transcendental function of 𝑥 is one that can be treated numerically, even if explicit solution in closed
form are not feasible.
Examples of the types of equation mentioned are;
𝑖) 𝑃(𝑥) = 12 + 2𝑥 2 − 𝑥 4 (Algebraic function)
𝑖𝑖) 𝑃(𝑥) = 𝑥 − 3 tanh 𝑥 (Transcendental function)

Definition1: Any equation of the form


𝑃(𝑥) = ∑𝑛𝑗=0 𝑎𝑗 𝑥 𝑗 = 𝑎𝑛 𝑥 𝑛 + 𝑎𝑛−1 𝑥 𝑛−1 + 𝑎𝑛−2 𝑥 𝑛−2 + . . . +𝑎0 𝑥 0

Is called polynomial function

Example: 𝑖) 𝑃(𝑥) = 3𝑥 + 1, 𝑖𝑖) 𝑃(𝑥) = 2𝑥 2 − 5𝑥 + 3 𝑖𝑖𝑖) 𝑃(𝑥) = 𝑥 3 − 2𝑥 2 + 3𝑥 − 1


𝑖𝑣) 𝑃(𝑥) = 12 + 2𝑥 2 − 𝑥 4

Methods of solution:
→ Analytic Methods: The analytic methods compute the exact value the roots in a number of steps, and
give all the roots at the same time.
→ Numerical Methods: The numerical methods are based on successive approximation to the root. The
method however produces only one root at a time.

Dr. Kwami, A. M (Not for sale) Page 3


Numerical Methods:
𝑖) One point method 𝑖𝑖) Multipoint method

One Point Method:


→ Newton-Raphson Method:
In these method, 𝑓(𝑥) and its derivative 𝑓 ′ (𝑥) are evaluated at single point, where 𝑥𝑛 , 𝑥𝑛−1 , 𝑥𝑛−2 , . . . 𝑥1 ,
are obtain from the initial approximation 𝑥0 , the method requires evaluation of two functions, and at
each step it converges to the required root.

Derivation of formula:

→ Geometrically
𝐴(𝑥𝑛 , 𝑓(𝑥𝑛 ) )

𝑦 = 𝑓(𝑥)

𝐶 𝐵 𝑁
𝑥𝑛+1 𝑥𝑛

The point 𝐴 on the curve 𝑦 = 𝑓(𝑥) has coordinates ( 𝑥𝑛 ,𝑓(𝑥𝑛 )), and the slope of the tangent to the curve
at 𝐴 is 𝑓 ′ (𝑥𝑛 ). Clearly, 𝐵 is nearer to the desired root 𝐶 than 𝑁, and from the triangle 𝐴𝐵𝑁 , we have
𝐴𝑁 𝑓(𝑥𝑛 )
𝑓 ′ (𝑥𝑛 ) = =
𝐵𝑁 𝑥𝑛 − 𝑥𝑛+1

𝒇(𝒙𝒏 )
⇨ 𝒙𝒏+𝟏 = 𝒙𝒏 − 𝑛 = 0, 1, 2, . . . . . . (1)
𝒇′(𝒙𝒏 )

b) Using Taylor’s Series expansion:


This method requires only that one point be known in the neighborhood of the desired root. Then in the
neighborhood of 𝑥0 , we may expand 𝑓(𝑥) in Taylor’s series so that.
𝑓(𝑥0 )(𝑥−𝑥0 )0 𝑓 ′(𝑥0 )(𝑥− 𝑥0 )1 𝑓 ′′ (𝑥0 )(𝑥− 𝑥0 )2 𝑓 ′′′ (𝑥0 )(𝑥− 𝑥0 )3 𝑓 ′𝑣 (𝑥0 )(𝑥− 𝑥0 )4 𝑓 𝑣 (𝑥0 )(𝑥− 𝑥0 )5
𝑓(𝑥) = + + + + + + + . . .
0! 1! 2! 3! 4! 5!

For values of 𝑥near 𝑥0 , 𝑥 − 𝑥0 will be small, it may be assumed in general that 𝑓 ′′ (𝑥0 ) and all higher
derivatives are not unduly large terms involving the powers of (𝑥 − 𝑥0 ) higher than the first may be
neglected, and to a past approximation the expression for 𝑓(𝑥) becomes
𝑓(𝑥0 ) 𝑓 ′(𝑥0 )(𝑥− 𝑥0 )1
𝑓(𝑥) = +
0! 1!

We now seek for 𝑥 such that 𝑓(𝑥) = 0


⇨ 𝑓(𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥 − 𝑥0 ) = 0
𝑓(𝑥0 )
⇨ 𝑥 = 𝑥1 = 𝑥0 − . . . (2)
𝑓 ′(𝑥0 )

The value of 𝑥 given by (2) will be nearer to the root than𝑥0 , and so forms the basis for the iteration
formula.
𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − . . . (3)
𝒇′(𝒙𝒏 )

Where 𝑛 = 0, 1, 2, . .

Dr. Kwami, A. M (Not for sale) Page 4


𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑓 ′ (𝑥𝑛 ) 𝑥𝑛+1
0 𝑥0 𝑓(𝑥0 ) 𝑓 ′ (𝑥0 ) 𝑥1
1 𝑥1 𝑓(𝑥1 ) 𝑓 ′ (𝑥1 ) 𝑥2
2 𝑥2 𝑓(𝑥2 ) 𝑓 ′ (𝑥2 ) 𝑥3
. . . . .

Example: Use Newton-Raphson method to seek for the values of 𝑥 for which the following functions
equals zero.
𝑖) 𝑓(𝑥) = 24𝑥 3 − 14𝑥 2 − 11𝑥 + 6 𝑥0 = 1
𝑖𝑖) 𝑓(𝑥) = 36𝑥 4 − 168𝑥 3 + 121𝑥 2 + 103𝑥 − 42 𝑥0 = 2
Solution:
𝑖) 𝑓(𝑥) = 24𝑥 3 − 14𝑥 2 − 11𝑥 + 6, ⇨ 𝑓 ′ (𝑥) = 72𝑥 2 − 28𝑥 − 11
𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑓 ′ (𝑥𝑛 ) 𝑥𝑛+1
0 1.0000 5.0000 33.0000 0.8484
1 0.8484 1.2466 17.0691 0.7754
2 0.7754 1.2421 10.5785 0.7525
3 0.7525 0.0215 08.7005 0.7500
4 0.7500 0.0000 08.5000 0.7500
5 0.7500 0.0000 08.5000 0.7500

𝑖𝑖) 𝑓(𝑥) = 36𝑥 4 − 168𝑥 3 + 121𝑥 2 + 103𝑥 − 42 ⇨ 𝑓 ′ (𝑥) = 144𝑥 3 − 504𝑥 2 + 242𝑥 + 103
𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑓 ′ (𝑥𝑛 ) 𝑥𝑛+1
0
1
2
.
.

Multipoint method:
→ Secant method:
Newton-Raphson method is extremely powerful, but it has some difficulty in finding derivatives,
especially when dealing with trace dental functions. To circumvent this problem, a slight variation is
derived by defining
𝑓(𝑥𝑛 )− 𝑓(𝑥)
𝑓 ′ (𝑥𝑛 ) = lim
𝑥 →𝑥𝑛 𝑥𝑛 − 𝑥

Now setting 𝑥 = 𝑥𝑛−1


𝑓(𝑥𝑛 )− 𝑓(𝑥𝑛−1 )
⇨ 𝑓 ′ (𝑥𝑛 ) ≈ . . . (4)
𝑥𝑛 − 𝑥𝑛−1
Where 𝑥𝑛−1 and 𝑥𝑛 are the two initial approximation to the required root. Substituting (4) in Newton-
Raphson formula (1) we have.
( 𝒙𝒏 − 𝒙𝒏−𝟏 ) 𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − . . . (5)
𝒇(𝒙𝒏 ) –𝒇(𝒙𝒏−𝟏 )

Where 𝑛 = 1, 2, 3 . . .
Equation (5) is called the Secant Scheme.

This technique is essentially a modification of the Newton-Raphson method having the derivative 𝑓 ′ (𝑥𝑛 )
replaced by a different expression.

Dr. Kwami, A. M (Not for sale) Page 5


𝑛 𝑥𝑛−1 𝑓(𝑥𝑛−1 ) 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1
1 𝑥0 𝑓(𝑥0 ) 𝑥1 𝑓(𝑥1 ) 𝑥2
2 𝑥1 𝑓(𝑥1 ) 𝑥2 𝑓(𝑥2 ) 𝑥3
. . . . . .
. . . . . .

Example:
Use Secant method to seek for the values of 𝑥 for which the following functions equals zero.
𝑖) 𝑓(𝑥) = 8𝑥 3 − 20𝑥 2 − 58𝑥 + 105 𝑥0 = 3 , 𝑥1 = 4
𝑖𝑖) 𝑓(𝑥) = 48𝑥 4 − 42𝑥 3 − 64𝑥 2 − 21𝑥 + 18 𝑥0 = 0, 𝑥1 = 2
Solution:
𝑖) 𝑓(𝑥) = 8𝑥 3 − 20𝑥 2 − 58𝑥 + 105 𝑥0 = 3 , 𝑥1 = 4
𝑛 𝑥𝑛−1 𝑓(𝑥𝑛−1 ) 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1
1 3.0000 −33.0000 4.0000 65.0000 3.3367
2 4.0000 65.0000 3.3367 -14.0050 3.4543
3 3.3367 -14.0050 3.4543 -04.2543 3.5056
4 3.4543 -4.25430 3.5056 00.5396 3.4998
5 3.5056 0.53960 3.4998 -00.0192 3.5000
6 3.4998 -0.01920 3.5000 00.0000 3.5000

𝑖𝑖) 𝑓(𝑥) = 48𝑥 4 − 42𝑥 3 − 64𝑥 2 − 21𝑥 + 18 𝑥0 = 0 , 𝑥1 = 2


𝑛 𝑥𝑛−1 𝑓(𝑥𝑛−1 ) 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1
1
2
.
.

→ False position method:


This method is best describe geometrically
(𝑥1 , 𝑓(𝑥1 ))
𝑦

(𝑥3 , 𝑓(𝑥3 ))

𝑥0
𝑥2 𝑐 𝑥3 𝑥1 𝑥
𝑂

(𝑥2 , 𝑓(𝑥2 ))

(𝑥0 , 𝑓(𝑥0 ))

From the graph we can determine approximately a region in which the required root of 𝑓(𝑥) = 0 lies. Let
this region be denoted by (𝑥0 , 𝑥1 ), now let the values of 𝑓(𝑥) at 𝑥0 , and 𝑥1 , be 𝑓(𝑥0 ) and 𝑓(𝑥1 )
respectively. Draw a line to join the points (𝑥0 , 𝑓(𝑥0 )) and (𝑥1 , 𝑓(𝑥1 )), and let this line intersect the 𝑥-
axis at 𝑥2 , the point 𝑥2 can easily be determine by noting that the equation of the line joining the points
(𝑥0 , 𝑓(𝑥0 )) and (𝑥1 , 𝑓(𝑥1 )), can be written in the form
𝑓(𝑥1 ) 𝑓(𝑥0 ) 𝑥1 𝑓(𝑥0 )− 𝑥0 𝑓(𝑥1 )
=− ⇨ 𝑥2 =
𝑥1 − 𝑥2 𝑥2 − 𝑥0 𝑓(𝑥0 ) – 𝑓(𝑥1 )

Dr. Kwami, A. M (Not for sale) Page 6


Let the value of 𝑓(𝑥) at 𝑥2 be 𝑓(𝑥2 ), again using the equation of the straight line joining the points (𝑥0 ,
𝑓(𝑥0 )) and (𝑥1 , 𝑓(𝑥1 )) and determining its point of intersection on the 𝑥-axis , we have.

𝑥2 𝑓(𝑥0 )− 𝑥0 𝑓(𝑥2 ) 𝑥3 𝑓(𝑥0 )− 𝑥0 𝑓(𝑥3 ) 𝑥4 𝑓(𝑥0 )− 𝑥0 𝑓(𝑥4 )


𝑥3 = , 𝑥4 = , 𝑥5 = . . .
𝑓(𝑥0 ) – 𝑓(𝑥2 ) 𝑓(𝑥0 ) – 𝑓(𝑥3 ) 𝑓(𝑥0 ) – 𝑓(𝑥4 )

This form a bases for the iteration formula


𝒙𝒏 𝒇(𝒙𝟎 )− 𝒙𝟎 𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = . . . (6)
𝒇(𝒙𝟎 ) – 𝒇(𝒙𝒏 )

Where 𝑛 = 1, 2, 3 . . .

𝑛 𝑥0 𝑓(𝑥0 ) 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1


1 𝑥0 , 𝑓(𝑥0 ) 𝑥1 𝑓(𝑥1 ) 𝑥2
2 𝑥0 , 𝑓(𝑥0 ) 𝑥2 𝑓(𝑥2 ) 𝑥3
. . . . . .

Example: Use False Position method to seek for the values of x for which the following functions equals
zero. 𝑖) 𝑓(𝑥) = 8𝑥 3 − 20𝑥 2 − 58𝑥 + 105 𝑥0 = 3, 𝑥1 = 4
𝑖𝑖) 𝑓(𝑥) = 48𝑥 4 − 42𝑥 3 − 68𝑥 2 − 21𝑥 + 18 𝑥0 = 1, 𝑥1 = 2
Solution:
𝑖) 𝑓(𝑥) = 8𝑥 3 − 20𝑥 2 − 58𝑥 + 105 𝑥0 = 3 , 𝑥1 = 4 𝑓(𝑥0 ) = −33
𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1
1 4.0000 65.00000 3.3367
2 3.3367 -14.00500 3.5849
3 3.5849 08.61660 3.4638
4 3.4638 -03.39170 3.5169
5 3.5169 01.69290 3.4917
6 3.4917 - 00.79240 3.5038
7 3.5038 00.36570 3.4983
8 3.4983 - 00.16300 3.5003
9 3.5008 00.07680 3.4996
10 3.4996 - 00.03840 3.5002
11 3.5002 00.01920 3.4999
12 3.4999 -0 0.00960 3.5000
13 3.5000 00.00000 3.5000

𝑖𝑖) 𝑓(𝑥) = 48𝑥 4 − 42𝑥 3 − 68𝑥 2 − 21𝑥 + 18 𝑥0 = 1 , 𝑥1 = 2 ⇨ 𝑓(𝑥0 ) = 𝑓(1) =


𝑛 𝑥𝑛 𝑓(𝑥𝑛 ) 𝑥𝑛+1
1
2
.
.

Theorem (Intermediate value theorem): Suppose that 𝑓 is continuous on the closed interval [𝑎, 𝑏] and 𝜔
is any number between 𝑓(𝑎) and 𝑓(𝑏). Then there is a number 𝑐 𝜀 [𝑎, 𝑏] for which 𝑓(𝑐) = 𝜔.

Dr. Kwami, A. M (Not for sale) Page 7


Illustrations:
𝑦
𝑦

𝑓(𝑏) •
𝑓(𝑏) •

𝑦=𝑤
𝑤 = 𝑓(𝑐) •
𝑦=𝑤
• • •

𝑎 𝑥
𝑥 𝑐1 𝑐2
𝑎 𝑐3 𝑏
𝑐 𝑏

• 𝑓(𝑎)

𝑓(𝑎)

Theorem: Suppose that 𝑓 is continuous on the closed interval [𝑎, 𝑏] and 𝑓(𝑎) and 𝑓(𝑏) have opposite
signs, then there is at least one number 𝑐 𝜀 (𝑎, 𝑏) for which 𝑓(𝑐) = 0.

Illustration: 𝑦

𝑓(𝑏)

𝑦 = 𝑓(𝑥)

𝑎 𝑥
𝑏

• 𝑓(𝑎)

→ Bisection method:
These method calls for repeated halving of the interval (𝑥0 , 𝑥1 ) containing the required root, and at each
step locating the half that is containing the root 𝑐

Example:
Use Bisection method to seek for the values of x for which the following functions equals zero.
𝑖) 𝑓(𝑥) = 8𝑥 3 − 20𝑥 2 − 58𝑥 + 105 𝑥0 = 2 , 𝑥1 = 4
𝑖𝑖) 𝑓(𝑥) = 48𝑥 4 − 42𝑥 3 − 68𝑥 2 − 21𝑥 + 18 𝑥0 = 0 , 𝑥1 = 2
𝑖𝑖𝑖) 𝑓(𝑥) = 𝑥 5 + 4𝑥 2 − 9𝑥 + 3 𝑥0 = −1 , 𝑥1 = 1
Solution:
Do.

Dr. Kwami, A. M (Not for sale) Page 8


→ Muller’s method:
Muller’s method uses three initial approximations 𝑥0 , 𝑥1 , and 𝑥2 and determine the next approximation
𝑥3 by considering the intersection of the 𝑥-axis with the parabola through (𝑥0 , 𝑓(𝑥0 )), (𝑥1 , 𝑓(𝑥1 ))
and (𝑥2 , 𝑓(𝑥2 )). The derivation of Muller’s method begins by considering the quadratic polynomial of
the form 𝑓(𝑥) = 𝑎(𝑥 − 𝑥2 )2 + 𝑏(𝑥 − 𝑥2 ) + c
that passes through (𝑥0 , 𝑓(𝑥0 )), (𝑥1 , 𝑓(𝑥1 )) and (𝑥2 , 𝑓(𝑥2 )). The constants 𝑎, 𝑏, and 𝑐 can be determine
from the conditions.
𝑓(𝑥0 ) = 𝑎(𝑥0 − 𝑥2 )2 + 𝑏(𝑥0 − 𝑥2 ) + 𝑐
𝑓(𝑥1 ) = 𝑎(𝑥1 − 𝑥2 )2 + 𝑏(𝑥1 − 𝑥2 ) + 𝑐
𝑓(𝑥2 ) = 𝑎(𝑥2 − 𝑥2 )2 + 𝑏(𝑥2 − 𝑥2 ) + 𝑐 ⇨ 𝑐 = 𝑓(𝑥2 )

(𝑥0 − 𝑥2 )2 [𝑓(𝑥1 ) − 𝑓(𝑥2 )] − (𝑥1 − 𝑥2 )2 [𝑓(𝑥0 ) − 𝑓(𝑥2 )] (𝑥1 − 𝑥2 )[𝑓(𝑥0 ) − 𝑓(𝑥2 )] − (𝑥0 − 𝑥2 )[𝑓(𝑥1 ) − 𝑓(𝑥2 )]
𝑏= (𝑥0 − 𝑥2 )(𝑥1 − 𝑥2 )(𝑥0 − 𝑥1 )
and, 𝑎 = (𝑥0 − 𝑥2 )(𝑥1 − 𝑥2 )(𝑥0 − 𝑥1 )

To determine 𝑥3 , we apply the quadratic formula to 𝑓(𝑥). And because of round off error problems
caused by the subtraction of nearly equal numbers, however, we apply the formula in the following
2𝑐 2𝑐
manner. (𝑥 − 𝑥2 ) = − ⇨ 𝑥 = 𝑥3 = 𝑥2 −
𝑏 ± √𝑏 2 − 4𝑎𝑐 𝑏 ± √𝑏 2 − 4𝑎𝑐
This gives two possibilities for 𝑥3 depending on the sign proceeding the radical term. Once 𝑥3 is
determined, the procedure is re-initialize using 𝑥1 , 𝑥2 , and 𝑥3 to determine the next approximation 𝑥4 .
The value of 𝑥 given by the formula above give a basis for the iteration formula
2𝑐
𝑥𝑛+1 = 𝑥𝑛 − . . . (6)
𝑏 ± √𝑏 2 − 4𝑎𝑐

Note:
1) Since at each step, the method involves the radical √𝑏 2 − 4𝑎𝑐 , the method will approximate real and
complex roots
2) In Muller’s method, the sign is chosen to agree with the sign of 𝑏. choosing in this manner, the denominator will
be the largest in magnitude, and will result in 𝑥3 being selected as the closest to the root of 𝑓(𝑥) than 𝑥2 .

Example: Use Muller’s method to seek for the values of 𝑥 for which the following functions equals zero.
𝑖) 𝑓(𝑥) = 16𝑥 4 − 40𝑥 3 + 5𝑥 2 + 20𝑥 + 16 𝑥0 = 0.5 , 𝑥1 = 1.0, 𝑥2 = 1.5
Solution: Do.

→ Barstow’s method:
This method extracts a quadratic factor of the form, 𝑥 2 − 𝑝𝑥 − 𝑞 = 0. from the polynomial 𝑃(𝑥) = 0
which may give a pair of complex or real root. We start with the division for the quadratic.
Let the polynomial be
𝑃𝑛 (𝑥) = 𝑎0 𝑥 𝑛 + 𝑎1 𝑥 𝑛−1 + 𝑎2 𝑥 𝑛−2 + . . . +𝑎𝑛 𝑥 0 . . . (1)
Then, the quadratic divisor is defined by 𝑄(𝑥) = 𝑥 2 − 𝑝𝑥 − 𝑞
We now find the coefficient of the quotient polynomial
𝑃𝑛−2 (𝑥) = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛−1 + 𝑏2 𝑥 𝑛−2 + . . . +𝑏𝑛−3 𝑥 + 𝑏𝑛−2
So that 𝑃𝑛 (𝑥) = (𝑥 2 − 𝑝𝑥 − 𝑞)𝑃𝑛−2 (𝑥) + 𝑅𝑛 (𝑥)
Where 𝑅𝑛 (𝑥) = 𝑏𝑛−1 (𝑥 − 𝑝) + 𝑏𝑛 is a linear remainder
𝑃𝑛 (𝑥) = (𝑥 2 − 𝑝𝑥 + 𝑞)(𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛−1 + 𝑏2 𝑥 𝑛−2 + . . . +𝑏𝑛−3 𝑥 + 𝑏𝑛−2 ) + 𝑏𝑛−1 (𝑥 − 𝑝) + 𝑏𝑛 . . (2)
Comparing the coefficients of 𝑃𝑛 (𝑥) in (1) and (2) we have

Dr. Kwami, A. M (Not for sale) Page 9


𝑎0 = 𝑏0
𝑎1 = 𝑏1 − 𝑝𝑏0
𝑎2 = 𝑏2 − 𝑝𝑏1 − 𝑞𝑏0
𝑎3 = 𝑏3 − 𝑝𝑏2 − 𝑞𝑏1
𝑎4 = 𝑏4 − 𝑝𝑏3 − 𝑞𝑏2
𝑎5 = 𝑏5 − 𝑝𝑏4 − 𝑞𝑏3
. . . . . . . . . . . . .
𝑎𝑛 = 𝑏𝑛 − 𝑝𝑏𝑛−1 − 𝑞𝑏𝑛−2

This shows that the desire coefficients of 𝑃𝑛−2 (𝑥) and the remainder 𝑅𝑛 (𝑥) are computed by the simple
recursive algorithm
𝑏0 = 𝑎0
𝑏1 = 𝑎1 + 𝑝𝑏0
𝑏2 = 𝑎2 + 𝑝𝑏1 + 𝑞𝑏0
𝑏3 = 𝑎3 + 𝑝𝑏2 + 𝑞𝑏1
𝑏4 = 𝑎4 + 𝑝𝑏3 + 𝑞𝑏2
𝑏5 = 𝑎5 + 𝑝𝑏4 + 𝑞𝑏3
. . . . . . . . . . . . .
𝑏𝑛 = 𝑎𝑛 + 𝑝𝑏𝑛−1 + 𝑞𝑏𝑛−2

Now, the factor (𝑥 2 − 𝑝𝑥 + 𝑞) is a divisor of 𝑃𝑛 (𝑥) if and only if the remainder 𝑅𝑛 (𝑥) is zero i.e.
𝑏𝑛−1 = 𝑏𝑛 = 0.
For a given value of 𝑝 and 𝑞 the coefficients of 𝑃𝑛−2 (𝑥) and 𝑅𝑛 (𝑥) are uniquely determined. They are
functions of two variables p and q. Thus the problem of finding quadratic divisor of 𝑃𝑛 (𝑥) is equivalent to
solving the two non-linear equations. 𝑏𝑛−1 (𝑝, 𝑞) = 0 and, 𝑏𝑛 (𝑝, 𝑞) = 0
For the unknown p and q which can be computed by Newton’s method. To do this, we need the partial
derivatives of the functions with respect to p and q.
𝜕𝑏𝑛 𝜕𝑏𝑛−1 𝜕𝑏𝑛−1 𝜕𝑏1 𝜕𝑏2
= 𝑏𝑛−1 + 𝑝 +𝑞 and = 0, = 𝑏1
𝜕𝑝 𝜕𝑝 𝜕𝑞 𝜕𝑝 𝜕𝑝
𝜕𝑏𝑛
The structure introduces the definition of new quantity 𝑐𝑛−1 =
𝜕𝑝

Thus we have
𝑐0 = 𝑏0
𝑐1 = 𝑏1 + 𝑝𝑐0
𝑐2 = 𝑏2 + 𝑝𝑐1 + 𝑞𝑐0
𝑐3 = 𝑏3 + 𝑝𝑐2 + 𝑞𝑐1
𝑐4 = 𝑏4 + 𝑝𝑐3 + 𝑞𝑐2
𝑐5 = 𝑏5 + 𝑝𝑐4 + 𝑞𝑐3
. . . . . . . . . . . . .
𝑐𝑛 = 𝑏𝑛 + 𝑝𝑐𝑛−1 + 𝑞𝑐𝑛−2

In the same way we have that


𝜕𝑏𝑛 𝜕𝑏1 𝜕𝑏2 𝜕𝑏3
𝑐𝑛−2 = Since = 0, = 0, = 𝑏1
𝜕𝑞 𝜕𝑞 𝜕𝑞 𝜕𝑞
And those required for the Newton’s method are found to be
𝜕𝑏𝑛 𝜕𝑏𝑛−1 𝜕𝑏𝑛 𝜕𝑏𝑛−1
𝑐𝑛−1 = , 𝑐𝑛−2 = ,𝑐𝑛−2 = and 𝑐𝑛−3 =
𝜕𝑝 𝜕𝑝 𝜕𝑞 𝜕𝑞
We now substitute the partial derivatives into the approximation for the root 𝑝and 𝑞.

Dr. Kwami, A. M (Not for sale) Page 10


𝜕𝑏𝑛−1 𝜕𝑏 𝜕𝑏𝑛 𝜕𝑏 − 1
𝑏𝑛 − 𝑏𝑛−1 𝑛 𝑏𝑛 − 1 − bn 𝑛
𝑝𝑘+1 = 𝑝𝑘 + 𝜕𝑏𝑛−1𝜕𝑞
𝜕𝑏𝑛
𝜕𝑞
𝜕𝑏𝑛−1 𝜕𝑏𝑛 , 𝜕𝑝
𝑞𝑘+1 = 𝑞𝑘 +𝜕𝑏𝑛−1𝜕𝑏𝑛
𝜕𝑝
𝜕𝑏𝑛−1 𝜕𝑏𝑛
− −
𝜕𝑝 𝜕𝑞 𝜕𝑞 𝜕𝑝 𝜕𝑝 𝜕𝑞 𝜕𝑞 𝜕𝑝

This is the computational scheme for the explicit form of Newton’s method in the case of system of two
non-linear equations. After substituting we get
𝑏𝑛cn−3 − 𝑏𝑛−1 cn−2 𝑏𝑛−1 cn−1 − bn cn−2
𝑝𝑘+1 = 𝑝𝑘 + 𝑞𝑘+1 = 𝑞𝑘 +
c2
n−2 − 𝑐𝑛−1 𝑐𝑛−3 c2
n−2 − 𝑐𝑛−1 cn−3

Where 𝑘 = 0, 1, 2, . . . and 𝑝0 and 𝑞0 as the given initial approximations.


The iteration is stopped as soon as the values of 𝑏𝑛−1 and 𝑏𝑛 are sufficiently small in absolute values
with respect to 𝑎𝑛−1 and 𝑎𝑛 from which they are computed.
The quantities produce by the division algorithm are arrange in a double rowed. (Horner’s Scheme)

𝑎0 𝑎1 𝑎2 𝑎3 𝑎4 . . . 𝑎𝑛−1 𝑎𝑛
𝑝0 * 𝑝0 𝑏0 𝑝0 𝑏1 𝑝0 𝑏2 𝑝0 𝑏3 . . . 𝑝0 𝑏𝑛−2 𝑝0 𝑏𝑛−1
𝑞0 * * 𝑞0 𝑏0 𝑞0 𝑏1 𝑞0 𝑏2 . . . 𝑞0 𝑏𝑛−3 𝑞0 𝑏𝑛−2
------------------------------------------------------------------------------------
𝑏0 𝑏1 𝑏2 𝑏3 𝑏4 . . . 𝑏𝑛−1 𝑏𝑛
𝑝0 * 𝑐0 𝑝0 𝑐1 𝑝0 𝑐2 𝑝0 𝑐3 . . . 𝑝0 𝑐𝑛−2 𝑝0 𝑐𝑛−1
𝑞0 * * 𝑞0 𝑐0 𝑞0 𝑐1 𝑞0 𝑐2 . . . 𝑞0 𝑐𝑛−3 𝑞0 𝑐𝑛−2
-------------------------------------------------------------------------------------
𝑐0 𝑐1 𝑐2 𝑐3 𝑐4 . . . 𝑐𝑛−1 𝑐𝑛

Example: Use Bairstow’s method to find the quadratic factors of


𝑥 4 − 1.1𝑥 3 + 2.3𝑥 2 + 0.5 = 0
Use 𝑥 2 + 𝑥 + 1 as starting factors to find the four roots of the original polynomial.
Solution:
𝑥 2 + 𝑥 + 1 = 𝑥 2 − 𝑝0 𝑥 − 𝑞0
Comparing the coefficient we have 𝑝0 = −1 and 𝑞0 = −1
1 − 1.1 2.3 0.0 0.5 1 − 1.10 2.30 0.00 0.50
−1 * −1.0 2.1 − 3.4 1.3 −0.30 * −0.30 0.42 − 0.73 0.10
−1 * * −1.0 2.1 − 3.4 −0.28 * * −0.28 0.39 − 0.68
------------------------------------------------------ ------------------------------------------------------
1 − 2.1 3.4 − 1.3 − 1.6 1 − 1.40 2.44 − 0.34 − 0.08
−1 * −1.0 3.1 − 5.5 3.7 −0.30 * −0.30 0.51 − 0.80 0.20
−1 * * −1.0 3.1 − 5.5 −0.28 * * −0.28 0.48 − 0.75
------------------------------------------------------- -------------------------------------------------------
1 − 3.1 5.5 − 3.7 − 3.4 1 − 1.70 2.67 − 0.66 − 0.63
⇨ 𝑝1 = −0.30 𝑞1 = −0.28 ⇨ 𝑝2 = −0.14 𝑞2 = −0.21

Dr. Kwami, A. M (Not for sale) Page 11


2) Solution of linear algebraic system of equations:
Definition: Any equation of the form
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + . . . +𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + . . . +𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 + . . . +𝑎3𝑛 𝑥𝑛 = 𝑏3 . . . (1)
. . . . . . . . . . . .
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + 𝑎𝑛3 𝑥3 + . . . +𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛 }

is called a linear system of algebraic equation.


Example:
2𝑥1 + 2𝑥2 = 3 𝑥1 + 2𝑥2 − 3𝑥3 = 1
2𝑥1 + 𝑥2 = 7 2𝑥1 + 4𝑥2 − 3𝑥3 = 7
𝑥1 − 𝑥2 = 2 𝑥1 + 3𝑥2 + 6𝑥3 = 3
3𝑥1 − 5𝑥2 = 4 6𝑥1 + 𝑥2 + 2𝑥3 = 4
3𝑥1 + 𝑥2 = 5 2𝑥1 + 6𝑥2 + 13𝑥3 = 5

Types of linear equations:


→ Consistent: A system of equation is said to be consistent, if they have at least one or more solution
Example
𝑥1 + 2𝑥2 = 4 𝑥1 + 2𝑥2 = 4
3𝑥1 + 2𝑥2 = 2 3𝑥1 + 6𝑥2 = 12
(Unique solution) (Infinite solution)

→ Inconsistent: A system of equation is said to be inconsistent, if they have no solution


Example
𝑥1 + 2𝑥2 = 4
3𝑥1 + 6𝑥2 = 5
(Has no solution)

Methods of solution:
→ Analytic Methods: Determinant method, Matrix inversion, Gauss elimination, Gauss-Jordan
elimination, factorization method.
→ Numerical Methods: Gauss-Seidal method, Jacobi Method, Method of Successive Over-Relaxation

Analytic Methods
Note: In analytic methods the system (1) is written in matrix equation.
𝐴𝑋 = 𝑏 . . . (2)
𝑎11 𝑎12 𝑎13 . . . . . 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 𝑎23 . . . . . 𝑎2𝑛 𝑥2 𝑏2
Where 𝐴 = 𝑎31 𝑎32 𝑎33 . . . . . 𝑎3𝑛 , 𝑋 = 𝑥3 , 𝑏 = 𝑏3
. . . . . . . . . . . . . . .
[ 𝑎𝑛1 𝑎𝑛2 𝑎𝑛3 . . . . . 𝑎𝑛𝑛 ] [𝑥𝑛 ] [𝑏𝑛 ]

→ Determinant Method:
Let us denote the determinant of 𝐴 by ∆ i.e. |𝐴| = ∆. From 𝐴, let us obtain for each 𝑖, 1 ≤ 𝑖 ≤ 𝑛 a matrix
𝐴𝑖 which is a matrix in which the 𝑖 𝑡ℎ column of𝐴 is replaced by the matrix of constant terms𝑏. Let us
denote the determinant of 𝐴𝑖 by ∆𝑖 . The system has a unique solution 𝑥 = 𝑥𝑖 if and only if ∆≠ 0. This
unique solution is given by.

Dr. Kwami, A. M (Not for sale) Page 12


∆𝑖
𝑥𝑖 = 𝑖 = 1, 2, 3, . . . 𝑛

Note: This method is sometimes called Crammers Rule.

Example:
Use determinant method to obtain the solution of the following system of equations
2𝑥1 + 𝑥2 = 7 𝑥1 + 2𝑥2 − 3𝑥3 = 14
3𝑥1 − 5𝑥2 = 4 4 𝑥1 + 5𝑥2 + 6𝑥3 = 2
7𝑥1 + 8𝑥2 + 9𝑥3 = 3
Solution: Do.

→ Matrix Inversion method:


We consider the matrix equation (2).
𝐴𝑋 = 𝑏
From 𝐴 let us find 𝐴−1 the inverse of matrix A. We then operate 𝐴−1 on the right so that.
𝐴−1 𝐴𝑋 = 𝐴−1 𝑏
⇨ 𝑋 = 𝐴−1 𝑏 (since 𝐴−1 𝐴 = 𝐼 , where 𝐼 is an identity).

Note: The system has a unique solution 𝑥 = 𝑥𝑖 if and only if 𝐴−1 exist, i.e. if and only if ∆≠ 0.

Example:
Use Matrix inversion to obtain the solution of the following system of equations
2𝑥1 − 3𝑥2 = 11 𝑥1 + 2𝑥2 − 3𝑥3 = 14 5𝑥1 + 7𝑥2 + 6𝑥3 + 5𝑥4 = 23
𝑥1 − 2𝑥2 = 4 4𝑥1 + 5𝑥2 + 6𝑥3 = 2 7𝑥1 +10𝑥2 + 8𝑥3 + 7𝑥4 = 32
7𝑥1 + 8𝑥2 + 9𝑥3 = 3 6𝑥1 + 8𝑥2 + 10𝑥3 + 9𝑥4 = 33
5𝑥1 + 7𝑥2 + 9𝑥3 + 10𝑥4 = 31
Solution: Do

→ Gauss elimination method:


This is a variable elimination technique where by the variables are eliminated once at a time to reduce
the original system to an equivalent triangular system.

Note: The solution vector remains unchanged if any of the following operations are performed.
− Multiplication (or division) of any equation by a constant
− Replacement of any equation by the sum (or difference) of that equation and any other
equation

We consider the matrix equation (2)


Step 1: We call 𝑎11 the pivot element and 𝑅1 the pivot row. We then divide 𝑅1 by 𝑎11 using property1.
and perform row operation on 𝑅2 , 𝑅3 , 𝑅4 , . . . 𝑅𝑛 using property 2 to make all the entries below 𝑎11
zero entries.

Step 2: Repeat the process in step1, using 𝑎122 as pivot element, and 𝑅2 as pivot row and make all the
entries below 𝑎122 zero entries.

Step 3: Continue the process in step1 and 2until we use 𝑎1𝑛𝑛 as pivot element and 𝑅𝑛 as pivot row.

Dr. Kwami, A. M (Not for sale) Page 13


Step 4: We then apply back substitution.

Example: Use Gauss elimination method to obtain the solution of the following system of equations
2𝑥1 − 3𝑥2 = 11 𝑥1 + 4𝑥2 − 3𝑥3 = 6 5𝑥1 + 7𝑥2 + 6𝑥3 + 5𝑥4 = 23
𝑥1 − 2𝑥2 = 4 𝑥1 + 2𝑥2 + 3𝑥3 = 14 7𝑥1 + 10𝑥2 + 8𝑥3 + 7𝑥4 = 32
𝑥1 + 4𝑥2 + 𝑥3 = 6 6𝑥1 + 8𝑥2 + 10𝑥3 + 9𝑥4 = 33
5𝑥1 + 7𝑥2 + 9𝑥3 + 10𝑥4 = 31
Solution: Do

Factorization method: The idea behind factorization method is inspired into part by the observation
that triangular systems are easy to solve. We consider the matrix equation (2).
𝐴𝑋 = 𝑏
We decompose 𝐴 into two matrices 𝐿and 𝑈. Where 𝐿 is the lower triangular matrix, and 𝑈 the upper
triangular matrix with 1’s on the leading diagonal of 𝑈. i.e.
𝐴 = 𝐿𝑈 . . . (𝑎)
𝑙11 0 0 . . . . . 0 1 𝑢12 𝑢13 . . . . . 𝑢1𝑛
𝑙21 𝑙22 0 . . . . . 0 0 1 𝑢23 . . . . . 𝑢2𝑛
𝐴 = 𝑙31 𝑙32 𝑙33 . . . . . 0 0 𝑢
. . . . . . . . . . . . . . . 0. . .1 . . . . . . . . . . . 3𝑛
. .
[ 𝑙𝑛1 𝑙𝑛2 𝑙𝑛3 . . . . . 𝑙𝑛𝑛 ] [ 0 0 0. . . . . . 1 ]

To get the entries of 𝐿 and 𝑈 corresponding to the coefficient matrix 𝐴 we use the following formulae;
𝑗−1
𝑙𝑖𝑗 = 𝑎𝑖𝑗 − ∑𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑖 𝑗 ≤ 𝑖, 𝑖 = 1, 2, 3, . . . 𝑛
𝑢𝑖𝑗 = 𝑎𝑖𝑗 - ∑𝑖−1
𝑘=1 𝑙𝑖𝑘 𝑢𝑘𝑗 𝑖 ≤ 𝑗, 𝑖 = 1, 2, 3, . . . 𝑛
𝑎1𝑗
Note: If 𝑗 = 1, the rule for 𝐿 reduces to 𝑙𝑖1 = 𝑎𝑖1 , and if 𝑖 = 1 , the rule for 𝑈 reduces to 𝑢1𝑗 = 𝑙1𝑗
.

Now if 𝐴 has been decomposed into 𝐿 and 𝑈, then the solution of the system 𝐴𝑋 = 𝑏 are found by
solving
𝐿(𝑈𝑋) = 𝑏 . . . (𝑏)
To solve (𝑏) we set
𝑈𝑋 = 𝑌 . . . (𝑐)
⇨ 𝐿𝑌 = 𝑏 . . . (𝑑)
We solve (𝑑) for 𝑌, then substitute in (𝑐) to solve for 𝑋.

Note: This substitution method was initiated by Doolittle, and is called Doolittle method.

Example:
Use factorization method to obtain the solution of the following system of equations
2𝑥1 − 3𝑥2 = 11 5𝑥1 + 4𝑥2 + 𝑥3 = 3.4 𝑥1 + 2𝑥2 − 𝑥3 + 3𝑥4 = 9
𝑥1 − 2𝑥2 = 4 10𝑥1 + 9𝑥2 + 4𝑥3 = 8.8 2𝑥1 − 𝑥2 + 3𝑥3 + 7𝑥4 = 23
10𝑥1 + 13𝑥2 + 15𝑥3 = 19.2 3𝑥1 + 3𝑥2 + 𝑥3 + 𝑥4 = 5
4𝑥1 + 5𝑥2 − 2𝑥3 + 2𝑥4 = −2
Solution: Do

Dr. Kwami, A. M (Not for sale) Page 14


Croat’s method:
This method is similar to factorization method, the major difference is that, in these method the leading
diagonal of 𝐿 contains 1’s and the leading diagonal of 𝑈 contains 𝑢𝑖𝑖
𝑙11 0 0 . . . . . 0 1 𝑢12 𝑢13 . . . . . 𝑢1𝑛
𝑙21 𝑙22 0 . . . . . 0 0 1 𝑢23 . . . . . 𝑢2𝑛
𝐴 = 𝑙31 𝑙32 𝑙33 . . . . . 0 0 𝑢3𝑛
. . . . . . . . . . . . . . . 0. . .1 . . . . . . . . . . . . .
[ 𝑙𝑛1 𝑙𝑛2 𝑙𝑛3 . . . . . 𝑙𝑛𝑛 ] [ 0 0 0. . . . . . 1 ]

→ Cholesky method:
For a symmetric, positive definite matrix 𝐴, we can in
𝐴 = 𝐿𝑈
Choose 𝑈 = 𝐿𝑇 but impose no condition on the diagonal entries.
⇨ 𝐴 = 𝐿𝐿𝑇
In terms of the entries of 𝐿 = 𝑙𝑗𝑘 the formula for the factorization are
𝑎𝑗1
𝑙11 = √𝑎11 𝑙𝑗1 = 𝑗 = 2, 3, 4, . . . 𝑛
𝑙11

𝑗−1 2
𝑙𝑗𝑗 = √𝑎𝑗𝑗 − ∑𝑠=1 𝑙𝑗𝑠 𝑗 = 2, 3, 4, . . . 𝑛
1 𝑗−1
𝑙𝑝𝑗 = (𝑎𝑝𝑗 − ∑𝑠=1 𝑙𝑗𝑠 𝑙𝑝𝑠 ) 𝑝 = 𝑗 + 1, 𝑗 + 2, . . . 𝑛
𝑙𝑗𝑗

Note: If 𝐴 is symmetric but not positive definite, this method could still be applied, but then leads to a complex
matrix 𝐿 so that it becomes impractical.

Example: Use Cholesky method to obtain the solution of the following system of equations.
4𝑥1 + 2𝑥2 + 14𝑥3 = 14 6.83𝑥1 + 2.01𝑥2 + 2.84𝑥3 − 0.84𝑥4 = −0.002
2𝑥1 + 17𝑥2 − 5𝑥3 = −101 2.01𝑥1 + 10.23𝑥2 + 0.0𝑥3 + 2.94𝑥4 = 0.003
14𝑥1 − 5𝑥2 + 83𝑥3 = 155 2.84𝑥1 + 0.0𝑥2 + 12.80𝑥3 + 3.21𝑥4 = 0.002
−0.84𝑥1 + 2.94𝑥2 + 3.21𝑥3 + 13.02𝑥4 = 0.007

Solution: Do.

Numerical Methods:
In numerical methods, we start from an approximation to the true solution and if successful obtain
better and better approximations from a computational cycle repeated as often as may be necessary for
achieving a required accuracy so that the amount of arithmetic depends upon the accuracy required and
varies from case to case, we use numerical methods if the convergence is rapid, so that we save
operations compared to analytic method. We also use numerical methods if a large system is sparse
(has very many zero coefficient so that would waste space in storing zero’s).

→ Gauss-Seidal method:
This is a numerical method of great practical importance. And the formula for the solution is given as
follows. We assume that 𝑎𝑗𝑗 = 1, for 𝑗 = 1, 2, 3, . . . 𝑛(Note that this can be achieved if we can
rearrange the equations so that no diagonal coefficient is zero) then we may divide each equation by the
corresponding diagonal coefficient.

Dr. Kwami, A. M (Not for sale) Page 15


We now write.
𝐴=𝐼+𝐿+𝑈 . . . (1)
Where 𝐼 is a unit, and 𝐿 and 𝑈 are respectively lower and upper triangular matrices with zero main
diagonals.
If we substitute (1) into𝐴𝑋 = 𝑏 we have

(𝐼 + 𝐿 + 𝑈)𝑋 = 𝑏 ⇨ 𝑋 + 𝐿𝑋 + 𝑈𝑋 = 𝑏
⇨ 𝑋 = 𝑏 − 𝐿𝑋 − 𝑈𝑋 . . . (2)
We obtain from (2) the desired iteration formula.

𝑋 (𝑚+1) = 𝑏 − 𝐿𝑋 (𝑚+1) − 𝑈𝑋 (𝑚) . . . (3)


(𝑚) (𝑚+1)
Where, 𝑎𝑗𝑗 = 1, 𝑋 (𝑚) = 𝑋𝑗 is the 𝑚𝑡ℎ approximation, and 𝑋 (𝑚+1) = 𝑋𝑗 is the (𝑚 + 1)𝑡ℎ
approximation.
The Gauss-Seidal method is a method of successive correction because we replace approximations by
corresponding new ones as soon as the latter have been computed.

Note: Below the main diagonal we took “new” approximations and above the main diagonal “old “approximations

Example: Use Gauss-Seidal method to obtain the approximate solution of the following system of
equations, do ten steps starting from a possibly poor approximation to the solution say 𝑋1(0) = 𝑋2(0) =
(0)
𝑋3 = 1. (Use six significant digits).

5𝑥1 + 𝑥2 + 2𝑥3 = 19
𝑥1 + 4𝑥2 − 2𝑥3 = −2
2𝑥1 + 3𝑥2 + 8𝑥3 = 39
Solution: Do.

Example: Use Gauss-Seidal method to obtain the approximate solution of the following system of
equations, do ten steps starting from a possibly poor approximation to the solution say 𝑋1(0) = 𝑋2(0) =
(0) (0)
𝑋3 = 𝑋4 = 100.

4𝑥1 − 𝑥2 − 𝑥3 = 200
−𝑥1 + 4𝑥2 − 𝑥4 = 200
−𝑥1 + 4𝑥3 − 𝑥4 = 100
−𝑥2 − 𝑥3 + 4𝑥4 = 100
Solution: Do.

Jacobi Method:
Jacobi method is a method of simultaneous corrections, if no componentsof an approximation 𝑋 (𝑚) is
used until all the components of 𝑋 (𝑚) have been computed. Jacobi method is similar to Gauss-Seidal
method but involves not using improved values until a step has been completed and then replacing
𝑋 (𝑚) by 𝑋 (𝑚+1) at once, directly before the beginning of the next cycle. Hence we write.
𝐴𝑋 = 𝑏 . . . (1)
with 𝑎𝑗𝑗 = 1, in the form
𝐼𝑋 − 𝐼𝑋 + 𝐴𝑋 = 𝑏
𝑋 = 𝑏 + 𝐼𝑋 − 𝐴𝑋

Dr. Kwami, A. M (Not for sale) Page 16


𝑋 = 𝑏 + (𝐼 − 𝐴)𝑋 . . . (2)
We obtain from (2) the desired iteration formula.
𝑋 (𝑚+1) = 𝑏 + (𝐼 − 𝐴)𝑋 (𝑚) . . . (3)

Example: Use Gauss-Seidal method to obtain the approximate solution of the following system of
equations, do ten steps starting from a possibly poor approximation to the solution say 𝑋1(0) = 𝑋2(0) =
(0)
𝑋3 = 1. (use six significant digit).

10𝑥1 + 𝑥2 + 𝑥3 = 6
𝑥1 + 10𝑥2 + 𝑥3 = 6
𝑥1 + 𝑥2 + 10𝑥3 = 6
Solution: Do.
Example: Use Gauss-Seidal method to obtain the approximate solution of the following system of
(0) (0)
equations, do five steps starting from a possibly poor approximation to the solution say 𝑋1 = 𝑋2 =
(0)
𝑋3 = 0.

10𝑥1 − 𝑥2 + 2𝑥3 + 0𝑥4 = 6


−𝑥1 + 11𝑥2 − 𝑥3 + 3𝑥4 = 25
2𝑥1 − 𝑥2 + 10𝑥3 − 𝑥4 = −11
0𝑥1 + 3𝑥2 − 𝑥3 + 8𝑥4 = 15

Solution: Do.

Finite differences Calculus;


The calculus of finite differences is a very convenient tool of interpolating figures when the arguments
are at equal intervals. Before we develop the finite difference techniques, we shall first define some
operators such as ∆, 𝐸, ∇ , 𝛿, 𝐷, e.t.c. used extensively in the theory of finite differences.
Let us suppose that the equidistant values of the independent variable 𝑥 are
𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, 𝑥0 + 3ℎ, 𝑥0 + 4ℎ, . . . 𝑥0 + 𝑛ℎ
Where 𝑥0 is known as the initial argument (or origin), ℎ is known as common interval of differencing.
Let the corresponding values of the independent variable 𝑦 = 𝑓(𝑥) be
𝑓(𝑥0 ), 𝑓(𝑥0 + ℎ), 𝑓(𝑥0 + 2ℎ), 𝑓(𝑥0 + 3ℎ), 𝑓(𝑥0 + 4ℎ), . . . 𝑓(𝑥0 + 𝑛ℎ)
Which are known as entries

→ The operator ∆: The operator ∆ is called forward difference operator, and is defined by
∆𝑓(𝑥0 ) = 𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 ) or ∆𝑦𝑘 = 𝑦𝑘+1 − 𝑦𝑘
∆𝑓(𝑥0 + ℎ) = 𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 + ℎ) or ∆𝑦𝑘+1 = 𝑦𝑘+2 − 𝑦𝑘+1
∆𝑓(𝑥0 + 2ℎ) = 𝑓(𝑥0 + 3ℎ) − 𝑓(𝑥0 + 2ℎ) or ∆𝑦𝑘+2 = 𝑦𝑘+3 − 𝑦𝑘+2
. . . . . . . . . . .

The differences above are known as first order forward differences. By operating the operator ∆ on the
first order differences we get a second order forward differences which are denoted by ∆2 . In particular
∆2 𝑓(𝑥0 ) = ∆[∆𝑓(𝑥0 )] = ∆[𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 )] = ∆𝑓(𝑥0 + ℎ) − ∆𝑓(𝑥0 )
= [𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 + ℎ)] − [𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 )]

Dr. Kwami, A. M (Not for sale) Page 17


= 𝑓(𝑥0 + 2ℎ) − 2𝑓(𝑥0 + ℎ) + 𝑓(𝑥0 )

∆3 𝑓(𝑥0 ) = ∆[∆2 𝑓(𝑥0 )] = ∆[𝑓(𝑥0 + 2ℎ) − 2𝑓(𝑥0 + ℎ) + 𝑓(𝑥0 ) ]


= ∆𝑓(𝑥0 + 2ℎ) − 2∆𝑓(𝑥0 + ℎ) + ∆𝑓(𝑥0 )
= [𝑓(𝑥0 + 3ℎ) − 𝑓(𝑥0 + 2ℎ)] − 2[𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 + ℎ)] + [𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 ) ]
= 𝑓(𝑥0 + 3ℎ) − 3𝑓(𝑥0 + 2ℎ) + 3𝑓(𝑥0 + ℎ) + 𝑓(𝑥0 ) etc.

Proceeding in the same way we can obtain ∆4 𝑓(𝑥0 ), ∆5 𝑓(𝑥0 ), . . . ∆𝑛 𝑓(𝑥0 ). These differences of
various order can be conveniently expressed in the form of a table called difference table.

Setting 𝑥0 = 𝑥0 ⇨ 𝑓(𝑥0 ) = 𝑦0
𝑥1 = 𝑥0 + ℎ, ⇨ 𝑓(𝑥1 ) = 𝑦1
𝑥2 = 𝑥0 + 2ℎ, ⇨ 𝑓(𝑥2 ) = 𝑦2
. . . . . . .
𝑥𝑘 = 𝑥0 + 𝑘ℎ ⇨ 𝑓(𝑥𝑘 ) = 𝑦𝑘 We have
𝑇𝑎𝑏𝑙𝑒 1.1

𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘 ∆5 𝑦𝑘 ∆6 𝑦𝑘
𝑥0 𝑦0
∆𝑦0
𝑥1 𝑦1 ∆2 𝑦0
∆𝑦1 ∆3 𝑦0
𝑥2 𝑦2 ∆2 𝑦1 ∆4 𝑦0
∆𝑦2 ∆3 𝑦1 ∆5 𝑦0
𝑥3 𝑦3 ∆2 𝑦2 ∆4 𝑦1 ∆5 𝑦0
∆𝑦3 ∆3 𝑦2 ∆5 𝑦1
𝑥4 𝑦4 ∆2 𝑦3 ∆4 𝑦2
∆𝑦4 ∆3 𝑦3 .
𝑥5 𝑦5 ∆2 𝑦4 .
∆𝑦5 .
𝑥6 𝑦6 .
.
. .

𝑦0 is known as the first entry in the difference table and ∆𝑦0 , ∆2 𝑦0 , ∆3 𝑦0 , ∆4 𝑦0 . . . are known as the
leading differences, and the table is called the diagonal (forward) difference table.

→ The operator 𝛻: The operator ∇ is called the backward difference operator and is defined by
∇𝑓(𝑥𝑘 ) = 𝑓(𝑥𝑘 + ℎ) − 𝑓(𝑥𝑘 ) or ∇𝑦𝑘 = 𝑦𝑘 − 𝑦𝑘−1
The following table gives the arguments, entries and the backward differences up to 6th order

Dr. Kwami, A. M (Not for sale) Page 18


𝑇𝑎𝑏𝑙𝑒 1.2
𝑥𝑘 𝑦𝑘 ∇𝑦𝑘 ∇2 𝑦𝑘 ∇3 𝑦𝑘 ∇4 𝑦𝑘 ∇5 𝑦𝑘 ∇6 𝑦𝑘
𝑥0 𝑦0
∇𝑦1
𝑥1 𝑦1 ∇2 𝑦2
∇𝑦2 ∇3 𝑦3
𝑥2 𝑦2 2
∇ 𝑦3 ∇4 𝑦4
∇𝑦3 ∇3 𝑦4 ∇5 𝑦5
𝑥3 𝑦3 ∇2 𝑦4 ∇4 𝑦5 ∇6 𝑦6
∇𝑦4 3 5
∇ 𝑦5 ∇ 𝑦6
𝑥4 𝑦4 ∇2 𝑦5 ∇4 𝑦6
∇𝑦5 ∇3 𝑦6
𝑥5 𝑦5 ∇2 𝑦6
∇𝑦6
𝑥6 𝑦6
. .

𝑦6 is known as the last entry in the difference table and ∆𝑦6 , ∆2 𝑦6 , ∆3 𝑦6 , ∆4 𝑦6 . . . are known as
the leading differences, and the table is called the diagonal (backward) difference table.

Note; Unless stated otherwise, interval of differencing will always be taken as unit (one)

→ The operator 𝐸: The operator 𝐸 is called the shift operator and is defined by

𝐸𝑓(𝑥0 ) = 𝑓(𝑥0 + ℎ) or 𝐸𝑦𝑘 = 𝑦𝑘+1


𝐸𝑦𝑘+1 = 𝑦𝑘+2
𝐸𝑦𝑘+2 = 𝑦𝑘+3
. . . . . . . . .
The second order differences are given as
𝐸 2 𝑦𝑘 = 𝐸[𝐸𝑦𝑘 ] = 𝐸𝑦𝑘+1 = 𝑦𝑘+2
𝐸 2 𝑦𝑘+1 = 𝐸[𝐸𝑦𝑘+1 ] = 𝐸𝑦𝑘+2 = 𝑦𝑘+3
𝐸 2 𝑦𝑘+2 = 𝐸[𝐸𝑦𝑘+2 ] = 𝐸𝑦𝑘+3 = 𝑦𝑘+4
. . . . . . . . .
The third order differences are given as
𝐸 3 𝑦𝑘 = 𝐸[𝐸 2 𝑦𝑘 ] = 𝐸𝑦𝑘+2 = 𝑦𝑘+3
𝐸 3 𝑦𝑘+1 = 𝐸[𝐸 2 𝑦𝑘+1 ] = 𝐸𝑦𝑘+3 = 𝑦𝑘+4
𝐸 3 𝑦𝑘+2 = 𝐸[𝐸 2 𝑦𝑘+2 ] = 𝐸𝑦𝑘+4 = 𝑦𝑘+5
. . . . . . . . .
The fourth order differences are given as
𝐸 4 𝑦𝑘 = 𝐸[𝐸 3 𝑦𝑘 ] = 𝐸𝑦𝑘+3 = 𝑦𝑘+4
𝐸 4 𝑦𝑘+1 = 𝐸[𝐸 3 𝑦𝑘+1 ] = 𝐸𝑦𝑘+4 = 𝑦𝑘+5
𝐸 4 𝑦𝑘+2 = 𝐸[𝐸 3 𝑦𝑘+2 ] = 𝐸𝑦𝑘+5 = 𝑦𝑘+6
. . . . . . . . .
And the higher order differences are given as
𝐸 𝑛 𝑦𝑘 = 𝐸[𝐸 𝑛−1 𝑦𝑘 ] = 𝐸𝑦𝑘+(𝑛−1) = 𝑦𝑘+𝑛
𝐸 𝑛 𝑦𝑘+1 = 𝐸[𝐸 𝑛−1 𝑦𝑘+1 ] = 𝐸𝑦𝑘+𝑛 = 𝑦𝑘+(𝑛+1)
𝐸 𝑛 𝑦𝑘+2 = 𝐸[𝐸 𝑛−1 𝑦𝑘+2 ] = 𝐸𝑦𝑘+(𝑛+1) = 𝑦𝑘+(𝑛+2)
. . . . . . . . .
These results are of much practical utility and should be committed to memory

Dr. Kwami, A. M (Not for sale) Page 19


→ The inverse shift operator 𝐸 −1 is such that 𝐸 −1 𝐸𝑦𝑘 = 𝑦𝑘 , and therefore 𝐸 −𝑛 𝑦𝑘 = 𝑦𝑘−𝑛
In particular
𝐸 −1 𝑦𝑘 = 𝑦𝑘−1
𝐸 −2 𝑦𝑘 = 𝑦𝑘−2
𝐸 −3 𝑦𝑘 = 𝑦𝑘−3
𝐸 −4 𝑦𝑘 = 𝑦𝑘−4
. . . . .
−𝑛
𝐸 𝑦𝑘 = 𝑦𝑘−𝑛

→ The operator 𝛿: The operator 𝛿 is called the central difference operator and is defined by
𝛿𝑦𝑘 = 𝑦𝑘+ℎ − 𝑦𝑘−ℎ
2 2
In particular
𝛿𝑦0 = 𝑦0+ℎ − 𝑦0−ℎ
2 2
𝛿𝑦1 = 𝑦1+ℎ − 𝑦1−ℎ
2 2
𝛿𝑦2 = 𝑦2+ℎ − 𝑦2−ℎ
2 2
𝛿𝑦3 = 𝑦3+ℎ − 𝑦3−ℎ
2 2
. . . . . . . . .
𝛿𝑦𝑘 = 𝑦𝑘+ℎ − 𝑦𝑘−ℎ
2 2

And if ℎ = 1 we have 𝛿𝑦𝑘 = 𝑦𝑘+1 − 𝑦𝑘−1


2 2

𝑑
→ The operator 𝐷: The operator 𝐷 is called differential operator and is defined by 𝐷𝑦𝑘 = 𝑑𝑥 𝑦𝑘
And the second and higher order difference are given as
𝑑2 𝑑3 𝑑4 𝑑𝑛
𝐷2 𝑦𝑘 = 𝑦𝑘 , 𝐷3 𝑦𝑘 = 𝑦𝑘 , 𝐷4 𝑦𝑘 = 𝑦𝑘 . . . 𝐷𝑛 𝑦𝑘 = 𝑦𝑘
𝑑𝑥 2 𝑑𝑥 3 𝑑𝑥 4 𝑑𝑥 𝑛

→ Relation between the operators


𝑖) 𝐸 and ∆;
We have by definition
∆𝑦𝑘 = 𝑦𝑘+1 − 𝑦𝑘 . . . (1)
𝐸𝑦𝑘 = 𝑦𝑘+1 . . . (2)
𝐸𝑦𝑘 − 𝑦𝑘 = 𝑦𝑘+1 − 𝑦𝑘 . . . (3)
From equation (1) and (3) we have
∆𝑦𝑘 = (𝐸 − 1)𝑦𝑘
And since 𝑦𝑘 is arbitrary, we get the relation
𝐸 = 1+∆ or ∆= 𝐸 − 1
Thus There are some simple equations relating ∆ and 𝐸 Viz;
𝑎) 𝐸∆= ∆𝐸
𝑖) 𝐸 = 1 + ∆, 𝑖) ∆= 𝐸 − 1
𝑖𝑖) 𝐸 2 = 1 + 2∆ + ∆2 𝑖𝑖) ∆2 = 𝐸 2 − 2𝐸 + 1,
𝑖𝑖𝑖) 𝐸 3 = 1 + 3∆ + 3∆2 + ∆3 𝑖𝑖𝑖) ∆3 = 𝐸 3 − 3𝐸 2 + 3𝐸 − 1
𝑖𝑖𝑖) 𝐸 4 = 1 + 4∆ + 6∆2 + 4∆3 + ∆4 𝑖𝑖𝑖) ∆4 = 𝐸 4 − 4𝐸 3 + 6𝐸 2 − 4𝐸 + 1
In general
𝑘 𝑘
𝐸 𝑘 = ∑𝑘𝑖=0 ( ) ∆𝑖 ∆𝑘 = ∑𝑘𝑖=0(−1)𝑖 ( ) 𝐸 𝑘−𝑖
𝑖 𝑖

Dr. Kwami, A. M (Not for sale) Page 20


Note; Strictly speaking, we should say that the operator 𝐸 and 1 + ∆ equivalent operators. These we write 𝐸 ≡ 1 +
∆. However, in practice, we use the equality sign rather than the equivalent sign.

𝑖𝑖) 𝐸 and ∇;
We have by definition that ∇𝑦𝑘 = 𝑦𝑘 − 𝑦𝑘−1 = 𝑦𝑘 − 𝐸 −1 𝑦𝑘 = (1 − 𝐸 −1 )𝑦𝑘
And since 𝑦𝑘 is arbitrary, we get the relation 𝐸 −1 = 1 − ∇ or ∆= 1 − 𝐸 −1
And since (𝐸 −1 )−1 = 𝐸 we have the relation
𝐸 = (1 − ∇)−1

𝑖𝑖𝑖) 𝐸 and 𝛿;
1 1 1 1
𝛿𝑦𝑘 = 𝑦𝑘+ℎ − 𝑦𝑘−ℎ = 𝐸 2 𝑦𝑘 − 𝐸 −2 𝑦𝑘 = (𝐸 2 − 𝐸 −2 )𝑦𝑘
2 2
1 1 1 1 1 1
Therefore 𝛿 = 𝐸 2 − 𝐸 −2 = 𝐸 −2 (𝐸 − 1) = 𝐸 −2 ∆ Also 𝛿 = 𝐸 2 (1 − 𝐸 −1 ) = 𝐸 2 ∇

𝑖𝑣) 𝐷 and ∆ ;
𝑑
𝐷𝑦𝑘 = 𝐷𝑓(𝑥) = 𝑓 ʹ (𝑥) = 𝑦𝑘
𝑑𝑥
We have by Taylor’s theorem that
ℎ ℎ2 ℎ3 ℎ4 ℎ5 ℎ6
𝑓(𝑥 + ℎ) = 𝑓(𝑥) + ʹ 𝑓 ʹ (𝑥) + 𝑓 ʹʹ (𝑥) + 𝑓 ʹʹʹ (𝑥) + 𝑓 ʹ𝑣 (𝑥) + 𝑓 𝑣 (𝑥) + 𝑓 𝑣ʹ (𝑥) + . . .
1 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ
ℎ ℎ2 ℎ3 ℎ4 ℎ5 ℎ6
𝐸𝑓(𝑥) = 𝑓(𝑥) + ʹ 𝑓 ʹ (𝑥) + 𝑓 ʹʹ (𝑥) + 𝑓 ʹʹʹ (𝑥) + 𝑓 ʹ𝑣 (𝑥) + 𝑓 𝑣 (𝑥) + 𝑓 𝑣ʹ (𝑥) + . . .
1 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ
ℎ ℎ2 ℎ3 ℎ4 ℎ5 ℎ6
= 𝑓(𝑥) + ʹ 𝐷𝑓(𝑥) + 𝐷 2 𝑓(𝑥) + 𝐷3 𝑓(𝑥) + 𝐷4 𝑓(𝑥) + 𝐷5 𝑓(𝑥) + 𝐷6 𝑓(𝑥) + . . .
1 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ
ℎ ℎ2 ℎ3 ℎ4 ℎ5 ℎ6
= (1 + ʹ 𝐷 + 𝐷2 + 𝐷3 + 𝐷4 + 𝐷5 + 𝐷6 + . . . ) 𝑓(𝑥)
1 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ

ℎ𝐷 (ℎ𝐷)2 (ℎ𝐷)3 (ℎ𝐷)4 (ℎ𝐷)5 (ℎ𝐷)6


= (1 + + + + + + + . . . ) 𝑓(𝑥)
1ʹ 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ

ℎ𝐷 (ℎ𝐷)2 (ℎ𝐷)3 (ℎ𝐷)4 (ℎ𝐷)5 (ℎ𝐷)6


Therefore 𝐸 = 1 + + + + + + + . . . = 𝑒 ℎ𝐷
1ʹ 2ʹ 3ʹ 4ʹ 5ʹ 6ʹ

Taking natural logarithm on both sides we have


∆2 ∆3 ∆4 ∆5 ∆6
ℎ𝐷 = ln 𝐸 = ln(1 + ∆) = ∆ − + − + − + . . .
2 3 4 5 6
1 ∆2 ∆3 ∆4 ∆5 ∆6
𝐷 = (∆ − + − + − + . . . )
ℎ 2 3 4 5 6

Basic properties of difference operators:


Let 𝜏, 𝜏1 and 𝜏2 , be any operators, and 𝐶, 𝐶1 and 𝐶2 be any arbitrary constants, then
𝑖) 𝜏(𝑢𝑘 + 𝑣𝑘 ) = 𝜏𝑢𝑘 + 𝜏𝑣𝑘 Difference the sum
𝑖𝑖 𝜏(𝑢𝑘 ∗ 𝑣𝑘 ) = 𝑢𝑘 𝜏𝑣𝑘 + 𝑣𝑘+1 𝜏𝑢𝑘 Difference the product
𝑢 𝑣𝑘 𝜏𝑢𝑘 −𝑢𝑘 𝜏𝑣𝑘
𝑖𝑖𝑖) 𝜏 ( 𝑘) = Difference the quotient
𝑣𝑘 𝑣𝑘+1 𝑣𝑘

𝑖𝑣) 𝜏(𝐶1 𝑢𝑘 + 𝐶2 𝑣𝑘 ) = 𝐶1 𝜏𝑢𝑘 + 𝐶2 𝜏𝑣𝑘 Linearity property


𝑣𝑖) (𝜏1 + 𝜏2 )𝑢𝑘 = 𝜏1 𝑢𝑘 + 𝜏2 𝑢𝑘 Linearity property
𝑣𝑖𝑖) (𝐶1 𝜏1 + C2 𝜏2 )𝑢𝑘 = 𝐶1 𝜏1 𝑢𝑘 + 𝐶2 𝜏2 𝑢𝑘 Linearity property
𝑣𝑖𝑖𝑖) (𝜏1 ∗ 𝜏2 )𝑢𝑘 = 𝜏1 𝜏2 𝑢𝑘 Product of operators

Dr. Kwami, A. M (Not for sale) Page 21


Example: Show that
𝑛 𝑛 𝑛 𝑛
𝑓(𝑥0 + 𝑛ℎ) = 𝑓(𝑥0 ) + ( ) ∆𝑓(𝑥0 ) + ( ) ∆2 𝑓(𝑥0 ) + ( ) ∆3 𝑓(𝑥0 ) + . . . ( ) ∆𝑛 𝑓(𝑥0 )
1 2 3 𝑛
Proof:
𝑓(𝑥0 + 𝑛ℎ) = 𝐸 𝑛 𝑓(𝑥0 ) = (1 + ∆)𝑛 𝑓(𝑥0 )
But 𝐸 = (1 + ∆)
⇨ 𝐸 𝑛 = (1 + ∆)𝑛
Therefore, 𝑓(𝑥0 + 𝑛ℎ) = (1 + ∆)𝑛 𝑓(𝑥0 )
Expanding (1 + ∆)𝑛 using binomial
𝑛 𝑛 𝑛 𝑛
𝑓(𝑥0 + 𝑛ℎ) = {1 + ( ) ∆ + ( ) ∆2 + ( ) ∆3 + . . . ( ) ∆𝑛 } 𝑓(𝑥0 )
1 2 3 𝑛
𝑛 𝑛 2 𝑛 3 𝑛
= 𝑓(𝑥0 ) + ( ) ∆𝑓(𝑥0 ) + ( ) ∆ 𝑓(𝑥0 ) + ( ) ∆ 𝑓(𝑥0 ) + . . . ( ) ∆𝑛 𝑓(𝑥0 )
1 2 3 𝑛

Finite difference on polynomials:


The function 𝑦𝑘 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + 𝑎3 𝑥 3 + . . . + 𝑎𝑛 𝑥 𝑛 , is a rational integral function of the 𝑛𝑡ℎ
degree in 𝑥, where the indices are positive integers, 𝑛 being the greatest, and 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 . . . 𝑎𝑛
are constants of which 𝑎𝑛 ≠ 0.
A rational integral function is also called a polynomial. The above expression may be called a polynomial
of degree 𝑛 in 𝑥.
As an illustration
1. Let us consider a polynomial of degree two 𝑦𝑘 = 𝑥 2 + 3𝑥 + 2, the interval of differencing is ℎ
∆𝑦𝑘 = 𝑦(𝑥 + ℎ) − 𝑦(𝑥)
= [(𝑥 + ℎ)2 + 3(𝑥 + ℎ) + 2] − [𝑥 2 + 3𝑥 + 2]
= 2ℎ𝑥 + (ℎ2 + 3ℎ)
If we set 𝑏0 = 2ℎ, 𝑏1 = (ℎ2 + 3ℎ), we have
∆𝑦𝑘 = 𝑏0 𝑥 + 𝑏1
which is a polynomial of degree one in 𝑥
∆(∆𝑦𝑘 ) = ∆2 𝑦𝑘 = [𝑏0 (𝑥 + ℎ) + 𝑏1 ] − [𝑏0 𝑥 + 𝑏1 ] = 2ℎ
which is independent of 𝑥 (= 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡)

•• Also, let us consider a polynomial of degree three in 𝑥, 𝑦𝑘 = 𝑥 3 + 2𝑥 2 + 𝑥 + 1, the interval of


differencing is ℎ
∆𝑦𝑘 = 𝑦(𝑥 + ℎ) − 𝑦(𝑥)
= [(𝑥 + ℎ)3 + 2(𝑥 + ℎ)2 + (𝑥 + ℎ) + 1] − [𝑥 3 + 2𝑥 2 + 𝑥 + 1]
= 3ℎ𝑥 2 + (3ℎ2 + 4ℎ)𝑥 + (ℎ3 + 2ℎ2 + ℎ)
If we set 𝑏0 = 3ℎ, 𝑏1 = (3ℎ2 + 4ℎ), and 𝑏2 = (ℎ3 + 2ℎ2 + ℎ), we have
∆𝑦𝑘 = 𝑏0 𝑥 2 + 𝑏1 𝑥 + 𝑏2
which is a polynomial of degree two in 𝑥
∆(∆𝑦𝑘 ) = ∆2 𝑦𝑘 = [𝑏0 (𝑥 + ℎ)2 + 𝑏1 (𝑥 + ℎ) + 𝑏2 ] − [𝑏0 𝑥 2 + 𝑏1 𝑥 + 𝑏2 ] = 6ℎ2 𝑥 + (3ℎ3 + 4ℎ2 )
If we set 𝑐0 = 6ℎ2 , 𝑐1 = (3ℎ3 + 4ℎ2 ), we have
∆2 𝑦𝑘 = 𝑐0 𝑥 + 𝑐1
which is a polynomial of degree one in 𝑥
∆(∆2 𝑦𝑘 ) = ∆3 𝑦𝑘 = [𝑐0 (𝑥 + ℎ) + 𝑐1 ] − [𝑐0 𝑥 + 𝑐1 ] = 6ℎ3
which is independent of 𝑥 (= 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡)

Dr. Kwami, A. M (Not for sale) Page 22


••• Also, let us consider a simple polynomial of degree four in 𝑥,
𝑦𝑘 = 2𝑥 4 + 4𝑥 3 − 3𝑥 2 + 2𝑥 − 3, the interval of differencing is ℎ
∆𝑦𝑘 = 𝑦(𝑥 + ℎ) − 𝑦(𝑥)
= [2(𝑥 + ℎ)4 + 4(𝑥 + ℎ)3 − 3(𝑥 + ℎ)2 + 2(𝑥 + ℎ) − 3] − [2𝑥 4 + 4𝑥 3 − 3𝑥 2 + 2𝑥 − 3]
= 8ℎ𝑥 2 + (24ℎ)𝑥 2 + (8ℎ3 + 12ℎ2 − 6ℎ)𝑥 + (2ℎ4 + 4ℎ3 − 3ℎ2 + 2ℎ)
If we set 𝑏0 = 8ℎ, 𝑏1 = (24ℎ), 𝑏2 = (8ℎ3 + 12ℎ2 − 6ℎ) and 𝑏3 = (2ℎ4 + 4ℎ3 − 3ℎ2 + 2ℎ), we have
∆𝑦𝑘 = 𝑏0 𝑥 3 + 𝑏1 𝑥 2 + 𝑏2 𝑥 + 𝑏3
which is a polynomial of degree three in 𝑥
∆2 𝑦𝑘 = [𝑏0 (𝑥 + ℎ)3 + 𝑏1 (𝑥 + ℎ)2 + 𝑏2 (𝑥 + ℎ) + 𝑏3 ] − [𝑏0 𝑥 3 + 𝑏1 𝑥 2 + 𝑏2 𝑥 + 𝑏3 ]
= 4! ℎ2 𝑥 2 + (24ℎ + 48ℎ2 )𝑥 + (32ℎ3 + 12ℎ2 − 6ℎ)
If we set 𝑐0 = 4! ℎ2 , 𝑐1 = (24ℎ + 48ℎ2 ), and 𝑐2 = (32ℎ3 + 12ℎ2 − 6ℎ), we have
∆2 𝑦𝑘 = 𝑐0 𝑥 2 + 𝑐1 𝑥 + 𝑐2
which is a polynomial of degree two in 𝑥
∆3 𝑦𝑘 = [𝑐0 (𝑥 + ℎ)2 + 𝑐1 (𝑥 + ℎ) + 𝑐2 ] − [𝑐0 𝑥 2 + 𝑐1 𝑥 + 𝑐2 ]
= 48ℎ3 𝑥 + (24ℎ4 + 48ℎ3 + 24ℎ2 )
we set 𝑑0 = 48ℎ3 , 𝑑1 = (24ℎ4 + 48ℎ3 + 24ℎ2 ),
∆3 𝑦𝑘 = 𝑑0 𝑥 + 𝑑1
which is a polynomial of degree one in 𝑥
∆4 𝑦𝑘 = [𝑑0 (𝑥 + ℎ) + 𝑑1 ] − [𝑑0 𝑥 + 𝑑1 ]
= 48ℎ4
which is independent of 𝑥 (= 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡)

Theorem; If 𝑦𝑘 is a polynomial of degree 𝑛 in 𝑥, i.e.


𝑦𝑘 = 𝑎0 𝑥𝑛 + 𝑎1 𝑥𝑛−1 + 𝑎2 𝑥𝑛−2 + 𝑎3 𝑥𝑛−3 . . . +𝑎𝑛−1 𝑥 + 𝑎𝑛
Then ∆𝑛 𝑦𝑘 = 𝑐 where 𝑐 is any arbitrary constant and ∆𝑟 𝑦𝑘 = 0 if 𝑟 > 𝑛
In other words, the 𝑛𝑡ℎ order difference of a polynomial of 𝑛𝑡ℎ degree is constant and higher order
differences are all zero

Example; As an illustration we take 𝑦𝑘 as a second degree polynomial of argument 𝑥𝑘


Let 𝑦𝑘 = 𝑝2 (𝑥) = 2𝑥 2 + 3𝑥.
The argument 𝑥𝑘 is taking at equidistance interval ℎ = 2
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘
0 1 5
22
1 3 27 16
38 0
2 5 65 16 0
54 0
3 7 119 16
70
4 9 189

Also by taking 𝑦𝑘 as a third degree polynomial of argument 𝑥𝑘


Let 𝑦𝑥 = 𝑥 3 − 3𝑥 2 + 4𝑥 − 1.
The argument 𝑥𝑘 is taking at equidistance interval ℎ = 1

Dr. Kwami, A. M (Not for sale) Page 23


𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘 ∆5 𝑦𝑘
0 1 1
2
1 2 3 6
8 6
2 3 11 12 0
20 6 0
3 4 31 18 0
38 6
4 5 69 24
62
5 6 131

We may note that in the first example second order finite difference are constant and equal to 16 in this
case and the third order and higher order differences are zero, in the second example third order finite
difference are constant and equal to 6 in this case and the fourth order and higher order differences are
zero. It may be shown that if 𝑦𝑘 is a polynomial of degree 𝑚 in 𝑥, then 𝑚𝑡ℎ order finite difference will be
constant and (𝑚 + 1)𝑡ℎ order finite difference and higher order differences are zero.

Note:
1. We often use these results in interpolation.
2. It should be understood that the operators 𝐸, ∆ and 𝛻 are define only when the arguments are to be at
equal intervals.

Finite difference on exponentials:


Given that 𝑦𝑥 = 𝑐 𝑥
⇨ ∆𝑐 𝑥 = 𝑐 𝑥+1 − 𝑐 𝑥 = 𝑐 𝑥 𝑐 − 𝑐 𝑥 = (𝑐 − 1)𝑐 𝑥
⇨ ∆2 𝑐 𝑥 = ∆((𝑐 − 1)𝑐 𝑥 ) = (𝑐 − 1)∆𝑐 𝑥 = (𝑐 − 1)(𝑐 − 1)𝑐 𝑥 = (𝑐 − 1)2 𝑐 𝑥
⇨ ∆3 𝑐 𝑥 = ∆((𝑐 − 1)2 𝑐 𝑥 ) = (𝑐 − 1)2 ∆𝑐 𝑥 = (𝑐 − 1)2 (𝑐 − 1)𝑐 𝑥 = (𝑐 − 1)3 𝑐 𝑥
⇨ ∆4 𝑐 𝑥 = ∆((𝑐 − 1)3 𝑐 𝑥 ) = (𝑐 − 1)3 ∆𝑐 𝑥 = (𝑐 − 1)3 (𝑐 − 1)𝑐 𝑥 = (𝑐 − 1)4 𝑐 𝑥
. . . . . . . . . .
⇨ ∆𝑛 𝑐 𝑥 = (𝑐 − 1)𝑛 𝑐 𝑥

In particular, if
𝑦𝑥 = 5𝑥
⇨ ∆5𝑥 = 5𝑥+1 − 5𝑥 = 5𝑥 5 − 5𝑥 = (5 − 1)5𝑥 = (4)5𝑥
⇨ ∆2 5𝑥 = ∆(∆5𝑥 ) = ∆(4(5𝑥 )) = 4∆5𝑥 = 4(4)5𝑥 = (4)2 5𝑥
⇨ ∆3 5𝑥 = ∆(∆2 5𝑥 ) = ∆(16(5𝑥 )) = (4)2 ∆5𝑥 = (4)2 (4)5𝑥 = (4)3 5𝑥
⇨ ∆4 𝑐 𝑥 = ∆(∆3 5𝑥 ) = ∆((4)3 5𝑥 ) = (4)3 ∆5𝑥 = (4)3 (4)5𝑥 = (4)4 5𝑥
. . . . . . . . . .
𝑛 𝑥 (4)𝑛 𝑥
⇨ ∆ 5 = 5

Dr. Kwami, A. M (Not for sale) Page 24


Factorial polynomial:
Definition: Factorial polynomials are defined by
𝑦𝑘 = 𝑘 (𝑛) = 𝑘(𝑘 − 1)(𝑘 − 2) (𝑘 − 3)(𝑘 − 4)(𝑘 − 5) . . . (𝑘 − 𝑛 + 1)
Where 𝑛 is a positive integer.
In particular
𝑘 (1) = 𝑘
𝑘 (2) = 𝑘(𝑘 − 1) = 𝑘 2 − 𝑘
𝑘 (3) = 𝑘(𝑘 − 1)(𝑘 − 2) = 𝑘 3 − 3𝑘 2 + 2𝑘
𝑘 (4) = 𝑘(𝑘 − 1)(𝑘 − 2)(𝑘 − 3) = 𝑘 4 − 6𝑘 3 + 11𝑘 2 − 6𝑘
𝑘 (5) = 𝑘(𝑘 − 1)(𝑘 − 2)(𝑘 − 3)(𝑘 − 4) = 𝑘 5 − 10𝑘 4 + 35𝑘 3 − 50𝑘 2 + 24𝑘
𝑘 (6) = ?
. . . . . . . . . . .
These polynomials play a central role in the theory of finite difference because of their convenient
properties.

The differences of factorial polynomial:


The various differences of the factorial polynomial are again factorial polynomials.
For the first difference,
As an example,
∆𝑘 (1) = (𝑘 + 1)(1) − 𝑘 (1) = (𝑘 + 1) − 𝑘 = 1
∆𝑘 (2) = (𝑘 + 1)(2) − 𝑘 (2) = (𝑘 + 1)𝑘 − 𝑘(𝑘 − 1) = 𝑘 2 + 𝑘 − 𝑘 2 + 𝑘 = 2𝑘 (1)
∆𝑘 (3) = (𝑘 + 1)(3) − 𝑘 (3) = (𝑘 + 1)𝑘(𝑘 − 1) − 𝑘(𝑘 − 1)(𝑘 − 2) = 3𝑘 2 − 3𝑘 = 3𝑘(𝑘 − 1) = 3𝑘 (2)
∆𝑘 (4) = (𝑘 + 1)(4) − 𝑘 (4) = (𝑘 + 1)𝑘(𝑘 − 1)(𝑘 − 2) − 𝑘(𝑘 − 1)(𝑘 − 2)(𝑘 − 3)
= 4𝑘 3 − 12𝑘 2 + 8𝑘 = 4(𝑘 3 − 3𝑘 2 + 2𝑘) = 4𝑘 (3)
And in general
∆𝑘 (𝑛) = 𝑛𝑘 (𝑛−1)

For the second difference,


∆2 𝑘 (1) = ∆(∆𝑘 (1) ) = ∆(1) = 0
∆2 𝑘 (2) = ∆(∆𝑘 (2) ) = ∆(2𝑘 (1) ) = 2(∆𝑘 (1) ) = 2
∆2 𝑘 (3) = ∆(∆𝑘 (3) ) = ∆(3𝑘 (2) ) = 3(∆𝑘 (2) ) = 3 ∗ 2 ∗ 𝑘 (1) = 6𝑘 (1)
∆2 𝑘 (4) = ∆(∆𝑘 (4) ) = ∆(4𝑘 (3) ) = 4(∆𝑘 (3) ) = 4 ∗ 3 ∗ 𝑘 (2) = 12𝑘 (2)
And in general
∆2 𝑘 (𝑛) = ∆(∆𝑘 (𝑛) ) = ∆(𝑛𝑘 (𝑛−1) ) = 𝑛∆(𝑘 (𝑛−1) ) = 𝑛(𝑛 − 1)𝑘 (𝑛−2)

For the third difference,


∆3 𝑘 (2) = ∆(∆2 𝑘 (2) ) = ∆(2) = 0
∆3 𝑘 (3) = ∆(∆2 𝑘 (3) ) = ∆(6𝑘 (1) ) = 6(∆𝑘 (1) ) = 6
∆3 𝑘 (4) = ∆(∆2 𝑘 (4) ) = ∆(12𝑘 (2) ) = 12(∆𝑘 (2) ) = 12 ∗ 2 ∗ 𝑘 (1) = 24𝑘 (1)
∆3 𝑘 (5) = ∆(∆2 𝑘 (5) ) = ∆(20𝑘 (3) ) = 20(∆𝑘 (3) ) = 20 ∗ 3 ∗ 𝑘 (2) = 60𝑘 (2)
And in general
∆3 𝑘 (𝑛) = 𝑛(𝑛 − 1)(𝑛 − 2)𝑘 (𝑛−3)

For the fourth difference,


∆4 𝑘 (𝑛) = 𝑛(𝑛 − 1)(𝑛 − 2)(𝑛 − 3)𝑘 (𝑛−4)

Dr. Kwami, A. M (Not for sale) Page 25


And the higher difference then become further factorial polynomials of diminishing degree, until
ultimately ∆𝑛 𝑘 (𝑛) = 𝑛! , With all higher differences zero.

Numerical differentiation and Integration:


Engineers and scientists are frequently faced with the problem of differentiation or integration of some
functions. If the function has a closed form representation and are amenable for standard calculus, then
differentiation and integration can be carried out.
However, in many situations, we may not know the exact functions, we will be knowing only, the values
of the function at discrete set of points. In some instances, the functions are known but they are
complicated that analytic differentiation, integration is difficult. In both these situations we seek the
help of numerical techniques to obtain the estimate of derivative / integrals. The method of obtaining
the derivative of a function using a numerical technique is known as numerical differentiation. The
𝑏
method of finding the value of an integral of the form ∫𝑎 𝑓(𝑥) 𝑑𝑥 using numerical techniques is called
numerical integration

Numerical differentiation:
The numerical differentiation techniques can be used in the following two situations:
𝑎) The function values corresponding to distinct values of the argument are known but the function is
unknown. For example, we may know the values of 𝑓(𝑥) at various values of 𝑥, 𝑥𝑖 (say) 𝑖 = 0, 1, 2, . . . 𝑛
𝑏) The function to be differentiated is complicated, and therefore difficult to differentiate by usual
procedure
Numerical differentiation is the process calculating the value of the derivative of a function at some
assigned value of the argument 𝑥 from the given set of data points (𝑥𝑖 , 𝑦𝑖 ), 𝑖 = 0, 1, 2, . . . 𝑛 which
correspond to the value of an unknown function 𝑦 = 𝑓(𝑥)
To get the derivative, we first find the curve 𝑦 = 𝑓(𝑥) through the points and then differentiate and get
its value at the required point.
If the values of 𝑥 are equally spaced, we get the interpolating polynomial due to Newton-Gregory. If the
derivative is required at a point nearer to the starting values in the table, we use Newton’s forward
interpolation formula. If we require the derivative at the end of the table, we use Newton’s backward
interpolation formula. If the value of derivative is required near the middle of the table value, we use
one of the central differences interpolation formulas. In the case of unequal interval, we can use
Newton’s divided difference formula or Lagrange’s interpolation formula to get the derivative value

→ Newton’s forward difference formula to compute the derivative;


We are given (𝑛 + 1) ordered pairs (𝑥𝑖 , 𝑦𝑖 ), 𝑖 = 0, 1, 2, 3, . . . 𝑛. We want to find the derivative of
𝑦 = 𝑓(𝑥) passing through the (𝑛 + 1) points, at a point nearer to the starting values 𝑥 = 𝑥0 .

Newton’s forward difference interpolation formula is

𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑢∆𝑓(𝑥0 ) + 𝑢(𝑢−1)


2!
∆2 𝑓(𝑥0 ) +
𝑢(𝑢−1)(𝑢−2) 3
3!
∆ 𝑓(𝑥0 ) +
𝑢(𝑢−1)(𝑢−2)(𝑢−3) 4
4!
∆ 𝑓(𝑥0 ) + . . . . . . (1𝑎)

𝑦 = 𝑦0 + 𝑢∆𝑦0 + 𝑢(𝑢−1)
2!
∆2 𝑦0 +
𝑢(𝑢−1)(𝑢−2) 3
3!
∆ 𝑦0 +
𝑢(𝑢−1)(𝑢−2)(𝑢−3) 4
4!
∆ 𝑦0 + . . . . . . (1𝑏)
2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢 5 −10𝑢4 +35𝑢3 −50𝑢2 +24𝑢
𝑦 = 𝑦0 + 𝑢∆𝑦0 + 𝑢 2−𝑢
! ∆ 𝑦0 +
2 𝑢
3!
∆3 𝑦0 +𝑢 4!
∆4 𝑦0 +𝑢 5!
∆5 𝑦0 + . . . . . . (1𝑐)

Dr. Kwami, A. M (Not for sale) Page 26


Where 𝑥 is the period of interpolation, i.e. it is the value corresponding to which entry is required; 𝑥0 is
first argument in the difference table and
𝑢 = 𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙
𝑖𝑛𝑡𝑒𝑟𝑝𝑜𝑙𝑎𝑡𝑖𝑜𝑛−𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓 𝑜𝑟𝑖𝑔𝑖𝑛
𝑜𝑓 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑖𝑛𝑔
= 𝑥−𝑥

0 . . . (1𝑑 )
𝑑𝑦 𝑑𝑦 𝑑𝑢 1 𝑑𝑦
Differentiating Eqn. (1𝑐) with respect to 𝑥 we have 𝑓 ′ (𝑥) = 𝑑𝑥 = 𝑑𝑢 ∗ 𝑑𝑥 = ℎ 𝑑𝑢
𝑑𝑦 1 2 +6𝑢+2 3 −18𝑢2 +22𝑢−6 4 −40𝑢3 +105𝑢2 −100𝑢+24
𝑖. 𝑒. = [∆𝑦0 + 2𝑢−1
2!
∆2 𝑦0 +
3𝑢
3!
𝑦 + 4𝑢
∆3 0
4!
∆4 0 𝑦 + 5𝑢 5!
∆5 0 𝑦 + ...] . . . (2)
𝑑𝑥 ℎ

𝑑2𝑦 𝑑 𝑑𝑦 𝑑𝑢 1 𝑑 𝑑𝑦 1 𝑑𝑦
Differentiating eqn. (2) with respect to 𝑥 we have 𝑓 ′′ (𝑥) = 𝑑𝑥2 = 𝑑𝑢 (𝑑𝑥 ) ∗ 𝑑𝑥 = ℎ 𝑑𝑢 (𝑑𝑥 ) = ℎ2 𝑑𝑢
𝑑2𝑦 1 2 −18𝑢+11 2𝑢3 −12𝑢2 +21𝑢−10 5
𝑖. 𝑒. = [∆2𝑦0 + (𝑢 − 1)∆3𝑦0 + 6𝑢 ∆4 𝑦0 + ∆ 0 𝑦 . . .] . . . (3)
𝑑𝑥 2 ℎ2 12 12

Differentiating eqn(3) w.r.t. 𝑥


𝑑3𝑦 1 2 −8𝑢+7
= [∆3𝑦0 + 2𝑢−3 ∆4 𝑦0 +
2𝑢
∆5 𝑦0 . . .] . . . (4)
𝑑𝑥 3 ℎ3 2 4

Equation(2), (4) and (5) give the first, second and third derivative at any general 𝑥.

→ Newton’s backward difference formula to compute the derivative;


Now, consider Newton’s backward difference interpolation formula
𝑓(𝑥) = 𝑓(𝑥0 + 𝑛ℎ) + 𝑣∇𝑓(𝑥0 + 𝑛ℎ) + 𝑣(𝑣+1)
2!
∇2𝑓(𝑥0 + 𝑛ℎ) +
𝑣(𝑣+1)(𝑣+2) 3
3!
∇ 𝑓(𝑥0 + 𝑛ℎ) + . . . . . . (1𝑎 )
𝑦 = 𝑦𝑛 + 𝑣∇𝑦𝑛 + 𝑣(𝑣+1)
2!
∇2𝑦𝑛 +
𝑣(𝑣+1)(𝑣+2) 3
3!
∇ 𝑦𝑛 +
𝑣(𝑣+1)(𝑣+2)(𝑣+3) 4
4!
∇ 𝑦𝑛 +
𝑣(𝑣+1)(𝑣+2)(𝑣+3)(𝑣+4) 5
5!
∇ 𝑦𝑛 . . . . . . (1𝑏)
2 3 +3𝑣2 +2𝑣 4 +6𝑣3 +11𝑣2+6𝑣 5 +10𝑣4 +35𝑣3 +50𝑣2 +24𝑣
𝑦 = 𝑦𝑛 + 𝑣∇𝑦𝑛 + 𝑣 2+𝑣
! ∇ 𝑦𝑛 +
2 𝑣
3!
∇3 𝑛 𝑦 +𝑣 4!
∇4 𝑛 𝑦 +𝑣 5!
∇5 𝑛 𝑦 + . . . . . . (1𝑐 )
Where 𝑥0 + 𝑛ℎ = 𝑥𝑛 is the last argument in the difference table, ∇, ∇2 , ∇3 . . . are the leading
backward difference of the last entry (and are given by the diagonal of the backward difference table)
and 𝑣 = 𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓 𝑖𝑛𝑡𝑒𝑟𝑝𝑜𝑙𝑎𝑡𝑖𝑜𝑛−𝑙𝑎𝑠𝑡 𝑎𝑟𝑔𝑢𝑚𝑒𝑛𝑡
𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑜𝑓 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑖𝑛𝑔
= 𝑥−(𝑥0ℎ+𝑛ℎ) = 𝑥−𝑥

𝑛 . . . (1𝑑 )
𝑑𝑦 𝑑𝑦 𝑑𝑣 1 𝑑𝑦
Differentiating eqn.(1c) with respect to 𝑥 we have 𝑓 ′ (𝑥) = 𝑑𝑥 = 𝑑𝑣 ∗ 𝑑𝑥 = ℎ ∗ 𝑑𝑣
𝑑𝑦 1 2 +6𝑣+2 3 +18𝑣2+22𝑣+6 4 +40𝑣3 +105𝑣2 +100𝑣+24
𝑖. 𝑒. = [∇𝑦𝑛 + 2𝑣+1
2!
∇2 𝑦𝑛 +
3𝑣
3!
𝑦 + 4𝑣
∇3 𝑛
4!
∇4 𝑛 𝑦 + 5𝑣 5!
∇5 𝑛 𝑦 + . . .] . . . (2)
𝑑𝑥 ℎ
𝑑𝑦 𝑑𝑦 𝑑𝑣 1 𝑑 𝑑𝑦 1 𝑑𝑦
Differentiating eqn.(1c) with respect to 𝑥 we have 𝑓 ′′ (𝑥) = 𝑑𝑥 = 𝑑𝑣 ∗ 𝑑𝑥 = ℎ 𝑑𝑣 (𝑑𝑥 ) = ℎ2 𝑑𝑣
𝑑2𝑦 1 2 +18𝑣+11 3 +12𝑣2 +21𝑣+10
𝑖. 𝑒 = [∇2𝑦𝑛 + (𝑣 + 1)∇3𝑦𝑛 + 6𝑣 ∇4 𝑦𝑛 + 2𝑣 ∇5 𝑦𝑛 . . .] . . . (3)
𝑑𝑥 2 ℎ2 12 12

𝑑3𝑦 1 2 +8𝑣+7
= [∇3𝑦𝑛 + 2𝑣+3 ∇4 𝑦𝑛 +
2𝑣
∇5 𝑦𝑛 . . .] . . . (4)
𝑑𝑥 3 ℎ3 2 4

Equations (2) (3) and (4) give the first, second and third derivative value at any general 𝑥.

Example: Find the value of cos(1.74) from the following table.


𝑥𝑘 1.70 1.74 1.78 1.82 1.86
𝑦𝑘 = sin 𝑥 0.9857 0.9916 0.9781 0.9691 0.9584
Solution
Let 𝑦𝑘 = sin 𝑥
We first form the difference table

Dr. Kwami, A. M (Not for sale) Page 27


𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘
1.70 0.9857
0.0059
1.74 0.9916 −0.0194
−0.0135 0.0419
1.78 0.9781 0.0225 −0.0841
0.0090 −0.0422
1.82 0.9691 −0.0197
−0.0107
1.86 0.9584

Since we require 𝑦 ′ at 𝑥 = 1.74 we use Newton’s forward difference formula


𝑑𝑦 1 2 −6𝑢+2 3 −18𝑢2 +22𝑢−6 4 −40𝑢3 +105𝑢2 −100𝑢+24
= [∆𝑦0 + 2𝑢−1
2!
∆2 𝑦0 +
3𝑢
3!
𝑦 + 4𝑢
∆3 0
4!
∆4 0 𝑦 + 5𝑢 5!
𝑦 + ...]
∆5 0
𝑑𝑥 ℎ
𝑑𝑦 0.04
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 1.74−1.70 =
0.04
=1
𝑑𝑥 𝑥=50 0.04

𝑑𝑦 1
⇨ ( ) = [∆𝑦0 + 12∆2 𝑦0 − 16∆3𝑦0 + 12
1 4 1
∆ 𝑦0 − ∆5 𝑦0 + . . . ]
20
𝑑𝑥 𝑥=1.74 0.04

𝑑𝑦 1
⇨ ( ) = [(0.0059) + 12(−0.0194) − 16(0.0419) + 12
1 1
(−0.0841) − (0)+ . . . ] ≅ −0.0178
20
𝑑𝑥 𝑥=1.74 0.04

1
Example: Find the first two derivatives of 𝑥 3 at 𝑥 = 50 and 𝑥 = 56 given the table below
𝑥𝑘 50 51 52 53 54 55 56
𝑦𝑘 3.6840 3.7084 3.7325 3.7563 3.7798 3.8030 3.8259
Solution
We first form the difference table
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘 ∆5 𝑦𝑘 ∆6 𝑦𝑘
0 50 3.6840
0.0244
1 51 3.7084 −0.0003
0.0241 0
2 52 3.7325 −0.0003 0
0.0238 0 0
3 53 3.7563 −0.0003 0 0
0.0235 0 0
4 54 3.7798 −0.0003 0
0.0232 0
5 55 3.8030 −0.0003
0.0229
6 56 3.8259

𝑖) Since we require 𝑦 ′ at 𝑥 = 50 we use Newton’s forward difference formula


𝑑𝑦 1 2 +6𝑢+2 3 −18𝑢2 +22𝑢−6 4 −40𝑢3 +105𝑢2 −100𝑢+24
= [∆𝑦0 + 2𝑢−1
2!
∆2 𝑦0 +
3𝑢
3!
𝑦 + 4𝑢
∆3 0
4!
∆4 0 𝑦 + 5𝑢 5!
𝑦 + ...]
∆5 0
𝑑𝑥 ℎ
𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 50−50 = 0
1
𝑑𝑥 𝑥=50

𝑑𝑦 1
⇨ ( ) = [∆𝑦0 − 21!∆2𝑦0 + 32!∆3𝑦0 − 46!∆4𝑦0 + 24
5!
∆5 𝑦0 + . . . ]
𝑑𝑥 𝑥=50 1

𝑑𝑦 1
⇨ ( ) = [(0.0244) − 12(−0.0003) + 32! (0) − 46!(0) + 24
5!
(0)+ . . . ] ≅ 0.0245
𝑑𝑥 𝑥=50 1

Dr. Kwami, A. M (Not for sale) Page 28


𝑑2𝑦 1 2 −18𝑢+11 2𝑢3 −12𝑢2 +21𝑢−10 5
= [∆2𝑦0 + (𝑢 − 1)∆3𝑦0 + 6𝑢 ∆4 𝑦0 + ∆ 0 𝑦 . . .]
𝑑𝑥 2 ℎ2 12 12

𝑑2𝑦 1
( ) = [∆2𝑦0 − ∆3𝑦0 + 11 ∆4 𝑦0 −
10 5
∆ 0 𝑦 . . .]
𝑑𝑥 2 𝑥=50 ℎ2 12 12

𝑑2𝑦 1
( ) = [(−0.0003) − (0) + 11 (0) −
10
(0) . . . ] ≅ −0.0003
𝑑𝑥 2 𝑥=50 1 12 12

𝑖𝑖) Since we require 𝑦 ′ at 𝑥 = 56 we use Newton’s backward difference formula


𝑑𝑦 1 2 +6𝑣+2 3 +18𝑣2 +22𝑣+6 4 +40𝑣3 +105𝑣2 +100𝑣+24
= [∇𝑦𝑛 + 2𝑣+1
2!
∇2 𝑦𝑛 +
3𝑣
3!
∇3 𝑛𝑦 + 4𝑣 4!
∇4 𝑛 𝑦 + 5𝑣 5!
𝑦 + . . .]
∇5 𝑛
𝑑𝑥 ℎ
𝑑𝑦
( ) ⇨ 𝑣 = 𝑥−𝑥

𝑛 = 50−50 = 0
1
𝑑𝑥 𝑥=56

𝑑𝑦 1
⇨ ( ) = [∇𝑦𝑛 + 21!∇2𝑦𝑛 + 32!∇3𝑦𝑛 + 46!∇4𝑦𝑛 + 24
5!
∇5𝑦𝑛 + . . . ]
𝑑𝑥 𝑥=56 ℎ

𝑑𝑦 1
⇨ ( ) = [(0.0229) + 21!(−0.0003) + 32!(0) + 46!(0) + 24
5!
(0)+ . . . ] ≅ 0.02275
𝑑𝑥 𝑥=56 1

𝑑2𝑦 1 2 +18𝑣+11 3 +12𝑣2 +21𝑣+10


= [∇2𝑦𝑛 + (𝑣 + 1)∇3𝑦𝑛 + 6𝑣 ∇4 𝑦𝑛 + 2𝑣 ∇5 𝑦𝑛 . . .]
𝑑𝑥 2 ℎ2 12 12

𝑑2𝑦 1
( ) = [∇2𝑦𝑛 + ∇3𝑦𝑛 + 11 10
∇4 𝑦𝑛 + ∇5𝑦𝑛 . . . ]
𝑑𝑥 2 𝑥=56 1 12 12

𝑑2𝑦 1
( ) = [(−0.0003) + (0) + 11 (0) + 10 (0) . . . ] ≅ −0.0003
𝑑𝑥 2 𝑥=56 1 12 12

Example: The table given below reveals the velocity 𝑣 of a body during the specified time 𝑡. Find the
acceleration at 𝑡 = 1.1
𝑡 1.0 1.1 1.2 1.3 1.4
𝑣 43.1 47.7 52.1 56.4 60.8
Solution:
We have
𝑑𝑣
𝑣 = 𝑣(𝑡) and acceleration 𝑎 = 𝑣 ′ (𝑡) = at 𝑡 = 1.1
𝑑𝑡
𝑡 𝑣 ∆𝑣 ∆2 𝑣 ∆3 𝑣 ∆4 𝑣
1.0 43.1
4.6
1.1 47.7 −0.2
4.4 0.1
1.2 52.1 −0.1 0.1
4.3 0.2
1.3 56.4 0.1
4.4
1.4 60.8

𝑑𝑣 1 2 −6𝑢+2 3 −18𝑢2 +22𝑢−6 4 −40𝑢3 +105𝑢2 −100𝑢+24


= [∆𝑣0 + 2𝑢−1
2!
∆2 𝑣0 +
3𝑢
3!
∆3 0𝑣 + 4𝑢 4!
∆4 0 𝑣 + 5𝑢 5!
𝑣 + ...]
∆5 0
𝑑𝑡 ℎ
𝑑𝑣 0.1
( ) ⇨ 𝑢 = 𝑡−𝑡

0 = 1.1−1.0 =
0.1
=1
𝑑𝑡 𝑡=1.1 0.1

𝑑𝑣 1
⇨ ( ) = [∆𝑣0 + 21!∆2𝑣0 − 31!∆3𝑣0 + 42!∆4𝑣0 − 56!∆5𝑣0 + . . . ]
𝑑𝑡 𝑡=1.1 0.1

𝑑𝑣 1
⇨ ( ) = [(4.6) + 21!(−0.2) − 31!(0.1) + 42!(0.1) − 56!(0)+ . . . ] ≅ 44.9166
𝑑𝑡 𝑡=1.1 0.1

Dr. Kwami, A. M (Not for sale) Page 29


Example: The population of a certain town is given below. Find the rate of growth of the population in
1931, 1941, 1961 and 1971
Year 𝑥𝑘 1931 1941 1951 1961 1971
Popln. In 1000𝑦𝑘 40.62 60.80 79.95 103.56 132.65
Solution:
𝑖) Since we require 𝑦 ′ at 𝑥 = 1931 and1941 we use Newton’s forward difference formula
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘
0 1931 40.62
20.18
1 1941 60.80 −1.03
19.15 5.49
2 1951 79.95 4.46 −4.47
23.61 1.02
3 1961 103.56 5.48
29.09
4 1971 132.65

𝑑𝑦 1 2 −6𝑢+2 3 −18𝑢2 +22𝑢−6 4 −40𝑢3 +105𝑢2 −100𝑢+24


= [∆𝑦0 + 2𝑢−1
2!
∆2 𝑦0 +
3𝑢
3!
𝑦 + 4𝑢
∆3 0
4!
∆4 0𝑦 + 5𝑢 5!
𝑦 + ...]
∆5 0
𝑑𝑥 ℎ
𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 1931−1931 = 0
10
𝑑𝑥 𝑥=1931

𝑑𝑦 1
⇨ ( ) = [∆𝑦0 − 21! ∆2 𝑦0 + 32!∆3𝑦0 − 46!∆4𝑦0 + 24
5!
∆5 𝑦0 + . . . ]
𝑑𝑥 𝑥=1931 10

𝑑𝑦 1
⇨ ( ) = [(20.18) − 21!(−1.03) + 32!(5.49) − 46!(−4.47) + 24
5!
(0)+ . . . ] ≅ 2.36425
𝑑𝑥 𝑥=1931 10

𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 1941−1931 = 1
10
𝑑𝑥 𝑥=1941

𝑑𝑦 1
⇨ ( ) = [∆𝑦0 + 21! ∆2 𝑦0 − 31!∆3𝑦0 + 42!∆4𝑦0 − 56!∆5𝑦0 + . . . ]
𝑑𝑥 𝑥=1941 10

𝑑𝑦 1
⇨ ( ) = [(20.18) + 21!(−1.03) − 31!(5.49) + 42!(−4.47) − 56!(0)+ . . . ] ≅ 1.83775
𝑑𝑥 𝑥=1941 10

𝑖) Since we require 𝑦 ′ at 𝑥 = 1961 and1971 we use Newton’s backward difference formula


𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘
0 1931 40.62
20.18
1 1941 60.80 −1.03
19.15 5.49
2 1951 79.95 4.46 −4.47
23.61 1.02
3 1961 103.56 5.48
29.09
4 1971 132.65

𝑑𝑦 1 2 +6𝑣+2 3 +18𝑣2 +22𝑣+6 4 +40𝑣3 +105𝑣2 +100𝑣+24


= [∇𝑦𝑛 + 2𝑣+1
2!
∇2 𝑦𝑛 +
3𝑣
3!
𝑦 + 4𝑣
∇3 𝑛
4!
𝑦 + 5𝑣
∇4 𝑛
5!
𝑦 + . . .]
∇5 𝑛
𝑑𝑥 ℎ
𝑑𝑦
( ) ⇨ 𝑣 = 𝑥−𝑥

𝑛 = 1971−1971 = 0
10
𝑑𝑥 𝑥=1971

𝑑𝑦 1
⇨ ( ) = [∇𝑦𝑛 + 21!∇2 𝑦𝑛 + 32!∇3𝑦𝑛 + 46!∇4𝑦𝑛 + 24
5!
∇5𝑦𝑛 + . . . ]
𝑑𝑥 𝑥=1971 ℎ

𝑑𝑦 1
⇨ ( ) = [(29.09) + 21!(5.48) + 32!(1.02) + 46!(−4.47) + 24
5!
(0)+ . . . ] ≅ 3.10525
𝑑𝑥 𝑥=1971 10

Dr. Kwami, A. M (Not for sale) Page 30


𝑑𝑦
( ) ⇨ 𝑣 = 𝑥−𝑥

𝑛 = 1961−1971 = −1
10
𝑑𝑥 𝑥=1961

𝑑𝑦 1
⇨ ( ) = [∇𝑦𝑛 − 21!∇2 𝑦𝑛 − 31!∇3𝑦𝑛 − 42!∇4𝑦𝑛 − 56! ∇5𝑦𝑛 + . . . ]
𝑑𝑥 𝑥=1961 ℎ

𝑑𝑦 1
⇨ ( ) = [(29.09) − 21!(5.48) − 31!(1.02) − 42!(−4.47) − 56!(0)+ . . . ] ≅ 2.65525
𝑑𝑥 𝑥=1961 10

→ Derivative using Sterling’s formulae:


Consider Sterling’s formula
2 3 4 2
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑢2[∆𝑓(𝑥0 ) + ∆𝑓(𝑥−1 )] + 𝑢2 ∆2 𝑓(𝑥−1 ) + 𝑢 12−𝑢[∆3 𝑓(𝑥−1 ) + ∆3 𝑓(𝑥−2 )] + 𝑢 24
−𝑢
∆4 𝑓(𝑥−2 )+.. . . . (1𝑎)
2 3 4 2 5 −5𝑢3 +4𝑢
𝑦 = 𝑦0 + 𝑢2[∆𝑦0 + ∆𝑦−1 ] + 𝑢2 ∆2 𝑦−1 + 𝑢 12−𝑢[∆3 𝑦−1 + ∆3 𝑦−2 ] + 𝑢 24
−𝑢
∆4 𝑦−2 + 𝑢 240
[∆5 𝑦−1 + ∆5 𝑦−2 ]+.. . . .(1𝑏)

Where 𝑥 is the period of interpolation, i.e. it is the value corresponding to which entry is required; 𝑥0 is
first argument in the difference table and
𝑢 = 𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙
𝑖𝑛𝑡𝑒𝑟𝑝𝑜𝑙𝑎𝑡𝑖𝑜𝑛−𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓 𝑜𝑟𝑖𝑔𝑖𝑛
𝑜𝑓 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑖𝑛𝑔
= 𝑥−𝑥

0

𝑑𝑦 𝑑𝑦 𝑑𝑢 1 𝑑𝑦
Differentiating Eqn. (1𝑏) with respect to 𝑥 we have 𝑓 ′ (𝑥) = 𝑑𝑥 = 𝑑𝑢 ∗ 𝑑𝑥 = ℎ ∗ 𝑑𝑢
𝑑𝑦 1 2 3 4 −15𝑢2 +4
𝑖. 𝑒. = [12(∆𝑦0 + ∆𝑦−1 ) + 2𝑢2∆2𝑦−1 + 3𝑢12−1(∆3 𝑦−1 + ∆3 𝑦−2 ) + 4𝑢 24−2𝑢∆4 𝑦−2 + 5𝑢 240
(∆5 𝑦−2 + ∆5 𝑦−3 )+ . . . ] ... (2)
𝑑𝑥 ℎ

𝑑2 𝑦 𝑑 𝑑𝑦 𝑑𝑢 1 𝑑 𝑑𝑦
Differentiating eqn. (2) with respect to 𝑥 we have 𝑓 ′′ (𝑥) = 𝑑𝑥 2 = 𝑑𝑢 (𝑑𝑥 ) ∗ 𝑑𝑥 = ℎ ∗ 𝑑𝑢 (𝑑𝑥 )
𝑑2𝑦 1 2 2𝑢3 −3𝑢
= [∆2𝑦−1 + 𝑢2(∆3 𝑦−1 + ∆3 𝑦−2 ) + 6𝑢12−1∆4𝑦−2 + (∆5 𝑦−2 + ∆5 𝑦−3 ) . . . ] . . . (3)
𝑑𝑥 2 ℎ2 24

𝑑3𝑦 1 1 3 2𝑢2 −1
= [ (∆ 𝑦−1 + ∆3 𝑦−2 ) + 12𝑢 ∆4 𝑦−2 + (∆5 𝑦−2 + ∆5 𝑦−3 ) . . . ] . . . (4)
𝑑𝑥 3 ℎ3 2 12 8

Example: Find the gradient of the road at the middle point of the elevation above a datum line of seven
points of road which are given below
𝑥𝑘 0 300 600 900 1200 1500 1800
𝑦𝑘 135 149 157 183 201 205 193
Solution:
𝑖) Since we are required to find 𝑦 ′ at 𝑥 = 900 and 𝑥 = 900 is in the middle of the table therefore we use
Sterling’s formula
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘 ∆5 𝑦𝑘 ∆6 𝑦𝑘
0 0 135
14
1 300 149 −6
8 24
2 600 157 18 −50
26 −26 70
3 900 183 −8 20 −86
18 −6 −16
4 1200 201 −14 4
4 −2
5 1500 205 −16
−12
6 1800 193

Since 𝑥 = 900 is in the middle of the table we use


𝑑𝑦 1 2 3 4 −15𝑢2 +4
= [12(∆𝑦0 + ∆𝑦−1 ) + 2𝑢
2
∆2 𝑦−1 +
3𝑢 −1
12
(∆3 𝑦−1 + ∆3 𝑦−2 ) + 4𝑢 24−2𝑢∆4𝑦−2 + 5𝑢 240
(∆5 𝑦−2 + ∆5 𝑦−3 )+ . . . ]
𝑑𝑥 ℎ

Dr. Kwami, A. M (Not for sale) Page 31


𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 900−900 = 0
300
𝑑𝑥 𝑥=900
𝑑𝑦 1 1 1 1
⇨ ( ) = [ (18 + 26) − 12 (−6 − 26) + 60 (−16 + 70)+ . . . ] ≅ 0.085222
𝑑𝑥 𝑥=900 300 2

𝑑𝑦
Example: Find 𝑑𝑥 at 𝑥 = 7.5 from the following table
𝑥𝑘 7.47 7.48 7.49 7.50 7.51 7.52 7.53
𝑦𝑘 0.193 0.195 0.198 0.201 0.203 0.206 0.208
Solution:
𝑖) Since we are required to find 𝑦 ′ at 𝑥 = 900 and 𝑥 = 900 is in the middle of the table therefore we use
Sterling’s formula
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘 ∆5 𝑦𝑘 ∆6 𝑦𝑘
0 07.47 0.193
0.002
1 7.48 0.195 0.001
0.003 −0.001
2 7.49 0.198 0.000 0.000
0.003 −0.001 −0.003
3 7.50 0.201 −0.001 0.003 −0.004
0.002 0.002 −0.007
4 7.51 0.203 0.001 −0.004
0.003 −0.002
5 7.52 0.206 −0.001
0.002
6 7.53 0.208

Since 𝑥 = 7.5 is in the middle of the table we will use Sterling’s formula
𝑑𝑦 1 2 3 4 −15𝑢2 +4
= [12(∆𝑦0 + ∆𝑦−1 ) + 2𝑢
2
∆2 𝑦−1 +
3𝑢 −1
12
(∆3 𝑦−1 + ∆3 𝑦−2 ) + 4𝑢 24−2𝑢∆4𝑦−2 + 5𝑢 240
(∆5 𝑦−2 + ∆5 𝑦−3 )+ . . . ]
𝑑𝑥 ℎ
𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 7.50−7.50 = 0
0.01
𝑑𝑥 𝑥=7.5

𝑑𝑦 1 1 1 1
⇨ ( ) = [ ( 0.002 + 0.003) − 12 (− 0.002 − 0.001) + 60 (− 0.007 − 0.003)+ . . . ] ≅ 0.225
𝑑𝑥 𝑥=7.5 0.01 2

Example: Find the first and second derivative of the function tabulated below at 𝑥 = 0.6of the road at
the middle point of the elevation above a datum line of seven points of road which are given below
𝑥𝑘 0.4 0.5 0.6 0.7 0.8
𝑦𝑘 1.5836 1.7974 2.0442 2.3275 2.6511
Solution:
We first form the difference table
𝑘 𝑥𝑘 𝑦𝑘 ∆𝑦𝑘 ∆2 𝑦𝑘 ∆3 𝑦𝑘 ∆4 𝑦𝑘
0 0.4 1.5836
0.2138
1 0.5 1.7974 0.0330
0.2468 0.0035
2 0.6 2.0442 0.0365 0.0003
0.2833 0.0038
3 0.7 2.3275 0.0403
0.3236
4 0.8 2.6511

Since we are required to find 𝑦 ′ and 𝑦 ′′ at 𝑥 = 0.6 and 𝑥 = 0.6 is in the middle of the table we use
we use Sterling’s formula
𝑑𝑦 1 1 2𝑢 3𝑢2 −1 4𝑢3 −2𝑢 5𝑢4 −15𝑢2 +4 5
= [2(∆𝑦0 + ∆𝑦−1 ) + 2 ∆2𝑦−1 + 12 (∆3 𝑦−1 + ∆3 𝑦−2 ) + 24 ∆4𝑦−2 + (∆ 𝑦−2 + ∆5 𝑦−3 )+ . . . ]
𝑑𝑥 ℎ 240

Dr. Kwami, A. M (Not for sale) Page 32


𝑑𝑦
( ) ⇨ 𝑢 = 𝑥−𝑥

0 = 0.6−0.6 = 0
0.1
𝑑𝑥 𝑥 = 0.6

𝑑𝑦 1 1 1
⇨ ( ) = [ (0.2833 + 0.2468) − 12 (0.0038 + 0.0035) ] ≅ 2.64442
𝑑𝑥 𝑥=0.6 0.1 2

𝑑2 𝑦 1 1
( ) = [(0.0365) − 12 (0.0003) ] ≅ 3.6475
𝑑𝑥 2 𝑥=0.6 (0.1)2

Numerical Integration
𝑏
We know that a definite integral ∫𝑎 𝑓(𝑥)𝑑𝑥 represent the area under a curve 𝑦 = 𝑓(𝑥) enclosed between
the limits 𝑥 = 𝑎 and 𝑥 = 𝑏. This integration is possible only if 𝑓(𝑥) is explicitly given and if it is
integrable. The problem of numerical integration can be stated as follows:
Given set of (𝑛 + 1) data points (𝑥𝑖 , 𝑦𝑖 ) 𝑖 = 1,2,3, . . . 𝑛 of the function 𝑦 = 𝑓(𝑥) where 𝑓(𝑥) is not
𝑥
known explicitly, it is required to evaluate ∫𝑥0𝑛 𝑓(𝑥) 𝑑𝑥
The problem of numerical integration, like that of numerical differentiation is solve by replacing 𝑓(𝑥)
𝑥
with an interpolating polynomial 𝑃𝑛 (𝑥) and obtaining ∫𝑥 𝑛 𝑃𝑛 (𝑥) 𝑑𝑥 which is approximately taken as the
0
𝑥
value of ∫𝑥0𝑛 𝑓(𝑥) 𝑑𝑥. Numerical integration is also known as numerical quadrature.

Newton-Cote’s Quadrature formula; (General quadrature formula)


This is the most popular and widely used numerical integration formula. It forms the basis for a number
of numerical integration methods known as Newton-Cote’s methods.
Let the interval [𝑎, 𝑏] be divided into 𝑛 equal sub-intervals such that 𝑥0 < 𝑥1 < 𝑥2 < 𝑥3 . . . 𝑥𝑛 . Then
𝑥𝑛 = 𝑥0 + 𝑛ℎ
Newton’s forward difference formula is given by
𝑢2 −𝑢 2 𝑢3 −3𝑢2 +2𝑢 3 𝑢4 −6𝑢3 +11𝑢2 −6𝑢 4 𝑢5 −10𝑢4 +35𝑢3 −50𝑢2 +24𝑢 5
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + . . .
2! 3! 4! 5!
𝑥−𝑥0
Where 𝑢 = ℎ

Now, instead of 𝑓(𝑥) we will replace it by this interpolating polynomial


𝑛𝑥 𝑛 𝑥
⇨ ∫𝑥 𝑓(𝑥) 𝑑𝑥 = ∫𝑥 𝑃𝑛 (𝑥) 𝑑𝑥, where 𝑃𝑛 (𝑥) is an interpolating polynomial of degree 𝑛.
0 0

𝑥 𝑥 2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢


∫𝑥 0+𝑛ℎ 𝑃𝑛 (𝑥) 𝑑𝑥 = ∫𝑥 0+𝑛ℎ [𝑦 = 𝑦0 + 𝑢∆𝑦0 + 𝑢 2−𝑢
! ∆ 𝑦0 +
2 𝑢
3!
∆3 0 𝑦 +𝑢 4!
∆4 0 𝑦 + . . . ] 𝑑𝑥
0 0

Since 𝑥 = 𝑥0 + 𝑢ℎ ⇨ 𝑑𝑥 = ℎ𝑑𝑢 and hence the above integral becomes


𝑛𝑥 𝑛 2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢
⇨ ∫𝑥 𝑓(𝑥) 𝑑𝑥 = ℎ ∫0 [𝑦0 + 𝑢∆𝑦0 + 𝑢 2−𝑢
! ∆ 𝑦0 +
2 𝑢
3!
∆3 𝑦0 +𝑢 4!
∆4 𝑦0 + . . . ] 𝑑𝑢
0
𝑛
𝑢2 1 𝑢3 𝑢2 1 𝑢4 𝑢3 1 𝑢5 3𝑢4 11𝑢3
= ℎ [𝑢𝑦0 + ∆𝑦0 + ! ( 3 − ) ∆2 𝑦0 + ! ( 4 − 3 3 + 𝑢2 ) ∆3 𝑦0 + (5 − + − 3𝑢2 ) ∆4 𝑦0 + . . . ]
2 2 2 3 4! 2 3 0
𝑛2 1 𝑛3 𝑛2 1 𝑛4 1 𝑛5 3𝑛4 11𝑛3
= ℎ [𝑛𝑦0 + ∆𝑦0 + ( − ) ∆2 𝑦0 + ( − 𝑛3 + 𝑛2 ) ∆3 𝑦0 + ( − + − 3𝑛2) ∆4 𝑦0 + . . . ]
2 2! 3 2 3! 4 4! 5 2 3

𝑛 1 𝑛2 𝑛 1 𝑛3 1 𝑛4 3𝑛3 11𝑛2
= ℎ𝑛 [𝑦0 + 2 ∆𝑦0 + ! ( 3 − 2 ) ∆2 𝑦0 + ! ( 4 − 𝑛2 + 𝑛) ∆3 𝑦0 + (5 − + − 3𝑛2) ∆4 𝑦0 + . . . ]
2 3 4! 2 3

𝑛 𝑛(2𝑛−3) 2 𝑛(𝑛−2)2 3 𝑛(6𝑛3 −45𝑛2 +110𝑛−90) 4


= ℎ𝑛 [𝑦0 + 2 ∆𝑦0 + 12
∆ 𝑦0 + 24
∆ 𝑦0 + 720
∆ 𝑦0 + . . .]
𝑥 2 3 −45𝑛2 +110𝑛−90)
∫𝑥 𝑛 𝑓(𝑥) 𝑑𝑥 = ℎ𝑛 [𝑦0 + 𝑛2∆𝑦0 + 𝑛(2𝑛−3)
12
∆2 𝑦0 + 𝑛(𝑛−2)
24
∆3 𝑦0 + 𝑛(6𝑛 720
∆4 𝑦0 + . . . ] . . . (1)
0

Equation (1) is called Newton-Cote’s quadrature formula. From this general formula, we can get
different integration formulae by putting 𝑛 = 1, 2, 3, . . .

Dr. Kwami, A. M (Not for sale) Page 33


Trapezoidal rule:
Here the function 𝑓(𝑥) approximated by the first-order polynomial 𝑃1 (𝑥) which passes through two
points.
Putting 𝑛 = 1 in the above general formula, all differences higher than the first will become zero and we
get
𝑥 ℎ
∫𝑥 1 𝑓(𝑥) 𝑑𝑥 = ℎ[𝑦0 + 12∆𝑦0 ] = ℎ[𝑦0 + 12(𝑦1 − 𝑦0 )] = 2 (𝑦0 + 𝑦1 )
0

In the same way, we have


2 𝑥 ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = ℎ[𝑦1 + 12∆𝑦1 ] = ℎ[𝑦1 + 12(𝑦2 − 𝑦1 )] = 2 (𝑦1 + 𝑦2 )
1

𝑥 ℎ
∫𝑥 3 𝑓(𝑥) 𝑑𝑥 = ℎ[𝑦2 + 12∆𝑦2 ] = ℎ[𝑦2 + 12(𝑦3 − 𝑦2 )] = 2 (𝑦2 + 𝑦3 )
2

4 𝑥 ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = ℎ[𝑦3 + 12∆𝑦3 ] = ℎ[𝑦3 + 12(𝑦4 − 𝑦3 )] = 2 (𝑦3 + 𝑦4 )
3

. . . . . . . . .
. . . . . . . . .
𝑥 ℎ
∫𝑥 𝑛 𝑓(𝑥) 𝑑𝑥 = ℎ[𝑦𝑛−1 + 12∆𝑦𝑛−1 ] = ℎ[𝑦𝑛−1 + 12(𝑦𝑛 − 𝑦𝑛−1 )] = 2 (𝑦𝑛−1 + 𝑦𝑛 )
𝑛−1

Hence,
𝑥 𝑥 𝑥 𝑥 𝑥 𝑥
∫𝑥 𝑛 𝑓(𝑥) 𝑑𝑥 = ∫𝑥 1 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 2 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 3 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 4 𝑓(𝑥) 𝑑𝑥 + . . . + ∫𝑥 𝑛 𝑓(𝑥) 𝑑𝑥
0 0 1 2 3 𝑛−1

ℎ ℎ ℎ ℎ ℎ
= (𝑦0 + 𝑦1 ) + (𝑦1 + 𝑦2 ) + (𝑦2 + 𝑦3 ) + (𝑦3 + 𝑦4 ) + . . . + (𝑦𝑛−1 + 𝑦𝑛 )
2 2 2 2 2

= 2 [(𝑦0 + 𝑦1 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + . . . +𝑦𝑛−1 )]

Thus,
𝑛 𝑥 ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = 2 [(𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑎𝑛𝑑 𝑡ℎ𝑒 𝑙𝑎𝑠𝑡 𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠 ) + 2(𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑟𝑒𝑚𝑎𝑖𝑛𝑖𝑛𝑔 𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠)]
0

Geometrical Interpretation: Here we are going to find the area of each trapezium using the usual
formula for the area of a trapezium.
𝑦

𝑦 = 𝑓(𝑥)

𝑦1 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7
𝑦0 𝑦2

ℎ ℎ ℎ ℎ ℎ ℎ
𝑥
𝑎 = 𝑥0

𝑂
𝑥4

𝑏 = 𝑥𝑛
𝑥7
𝑥3

𝑥5
𝑥6
𝑥2
𝑥1

The parallel sides of the trapezium are 𝑦0 & 𝑦1 , 𝑦1 & 𝑦1 ), 𝑦2 & 𝑦3 . . . 𝑦𝑛−1 & 𝑦𝑛 respectively.
Thus the total area of the n strips of trapezium is

Dr. Kwami, A. M (Not for sale) Page 34


ℎ ℎ ℎ ℎ ℎ
𝐴 = [𝑦0 + 𝑦1 ] + [𝑦1 + 𝑦2 ] + [𝑦2 + 𝑦3 ] + [𝑦3 + 𝑦4 ] + . . . [𝑦𝑛−1 + 𝑦𝑛 ]
2 2 2 2 2

𝐴 = [𝑦0 + 2𝑦1 + 2𝑦2 + 2𝑦3 + 2𝑦4 + . . . +2𝑦𝑛−1 + 𝑦𝑛 ]
2
𝑏 ℎ
⇨ ∫𝑎 𝑓(𝑥)𝑑𝑥 ≅ [(𝑦0 + 𝑦𝑛 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 + . . . +𝑦𝑛−1 ) ]
2
𝑏 ℎ
⇨ ∫𝑎 𝑓(𝑥)𝑑𝑥 ≅ [(𝑦0 + 𝑦𝑛 ) + 2(∑ 𝑅𝑒𝑚)]
2

Example1: Evaluate approximately the following integral using Trapezoidal rule.


1 𝜋
𝑖) ∫0 𝑥 3 𝑑𝑥 with five sub-interval 𝑖𝑖) ∫0 𝑥 sin 𝑥 𝑑𝑥 with six sub-interval
1
𝑖𝑖𝑖) ∫0 √1 + 𝑥 2 𝑑𝑥 with ten sub-interval

Solution:
𝑖) 𝑎 = 𝑥0 = 0, 𝑏 = 𝑥𝑛 = 1, 𝑎𝑛𝑑 𝑛 = 5 ⇨ ℎ = 0.2
𝑥𝑘 𝑥𝑘 F &L REM
0.000 0.000 0.000
0.200 0.008 0.008 1
⇨ ∫0 𝑥 3 𝑑𝑥 ≅ 0.05[(2.4142) + 2(10.2767)]
0.400 0.064 0.064
0.600 0.216 0.216 ≅ 0.1[(1.000) + 2(0.800)]
0.800 0.512 0.512
1.000 1.000 1.000 ≅ 0.260 𝑆𝑞𝑢𝑎𝑟𝑒 𝑢𝑛𝑖𝑡
**** Total 1.000 0.800

𝜋
𝑖𝑖) 𝑎 = 𝑥0 = 0, 𝑏 = 𝑥𝑛 = 𝜋, 𝑎𝑛𝑑 𝑛 = 6 ⇨ ℎ=
6
𝑥𝑘 𝑥𝑘 F &L REM
0.0 0.0000 0.000
𝜋
0.2618 0.2618 𝜋 𝜋
6 ⇨ ∫0 𝑥 sin 𝑥 𝑑𝑥 ≅ 12 [(0.0) + 2(5.8623)]
𝜋
0.9069 0.9069
3 𝜋
𝜋
1.5708 1.5708 ≅ [11.7246]
12
2
2𝜋
1.8138 1.8138 ≅ 3.0695 𝑆𝑞𝑢𝑎𝑟𝑒 𝑢𝑛𝑖𝑡
3
5𝜋 1.3090 1.3090
6
𝜋 0.0000 0.0000
**** Total 0.0000 5.8623

𝑖𝑖𝑖) 𝑎 = 0, 𝑏 = 1, 𝑎𝑛𝑑 𝑛 = 10 ⇨ ℎ = 0.1


𝑥 √1 + 𝑥 2 F &L REM
0.000 1.000 1.0000
0.100 1.0050 1.0050 1
0.200 1.0198 1.0198 ∫0 √1 + 𝑥 2 𝑑𝑥 ≅ 0.05[(2.4142) + 2(10.2767)]
0.300 1.0440 1.0440 ≅ 0.05[22.9676]
0.400 1.0770 1.0770
0.500 1.1180 1.1180 ≅ 1.1484 𝑆𝑞𝑢𝑎𝑟𝑒 𝑢𝑛𝑖𝑡
0.600 1.1662 1.1662
0.700 1.2207 1.2207
0.800 1.2806 1.2806
0.900 1.3454 1.3454
1.000 1.4142 1.4142
**** Total 2.4142 10.2767

Example1: Evaluate approximately the following integral using Trapezoidal rule.


1 𝑑𝑥 5.2
𝑖) ∫0 with six sub-interval 𝑖𝑖) ∫4 log 𝑥 𝑑𝑥 with six sub-interval
1+𝑥

Dr. Kwami, A. M (Not for sale) Page 35


1
𝑖𝑖𝑖) ∫0 √1 + 𝑥 4 𝑑𝑥 with six sub-interval
𝟏
Simpson’s 𝟑 Rule: This is another popular method. Here, the function 𝑓(𝑥) is approximated by a second
order polynomial 𝑃2 (𝑥) which passes through three successive points. Putting 𝑛 = 2 in Newton-Cote’s
quadrature formula, we have
𝑥 ( ) 2
∫𝑥 2 𝑓(𝑥) 𝑑𝑥 = 2ℎ[𝑦0 + 22∆𝑦0 + 2 4−3
12
∆ 𝑦0 ]
0

= 2ℎ[𝑦0 + (𝑦1 − 𝑦0 ) + 16(𝑦2 − 2𝑦1 + 𝑦0 )]


= 2ℎ(𝑦0 + 𝑦1 − 𝑦0 + 16𝑦2 − 16𝑦1 + 16𝑦0 )

= 3 (𝑦0 + 4𝑦1 + 𝑦2 )

In the same way, we have


𝑥 ( ) 2
∫𝑥 4 𝑓(𝑥) 𝑑𝑥 = 2ℎ[𝑦2 + 22∆𝑦2 + 2 4−3
12
∆ 𝑦2 ]
2

= 2ℎ[𝑦2 + (𝑦3 − 𝑦2 ) + 16(𝑦4 − 2𝑦3 + 𝑦2 )]


= 2ℎ(𝑦2 + 𝑦3 − 𝑦2 + 16𝑦4 − 16𝑦3 + 16𝑦2 )

= 3 (𝑦2 + 4𝑦3 + 𝑦4 )

𝑥 ( ) 2
∫𝑥 6 𝑓(𝑥) 𝑑𝑥 = 2ℎ[𝑦4 + 22∆𝑦4 + 2 4−3
12
∆ 𝑦4 ]
4

= 2ℎ[𝑦4 + (𝑦5 − 𝑦4 ) + 16(𝑦6 − 2𝑦5 + 𝑦4 )]


= 2ℎ(𝑦4 + 𝑦5 − 𝑦4 + 16𝑦6 − 16𝑦5 + 16𝑦4 )

= 3 (𝑦4 + 4𝑦5 + 𝑦6 )

. . . . . . .
. . . . . . .
𝑥𝑛 ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = 3 (𝑦𝑛−2 + 4𝑦𝑛−1 + 𝑦𝑛 )
𝑛−2
Hence,
𝑥𝑛 2 4𝑥 6 𝑥 𝑥
𝑛 𝑥
∫𝑥 𝑓(𝑥) 𝑑𝑥 = ∫𝑥 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 𝑓(𝑥) 𝑑𝑥 + . . . + ∫𝑥 𝑓(𝑥) 𝑑𝑥
0 0 2 4 𝑛−1

ℎ ℎ ℎ ℎ
= (𝑦0 + 4𝑦1 + 𝑦2 ) + (𝑦2 + 4𝑦3 + 𝑦4 ) + (𝑦 + 4𝑦5 + 𝑦6 )+ . . . + (𝑦𝑛−2 + 4𝑦𝑛−1 + 𝑦𝑛 )
3 3 3 4 3

= 3 [(𝑦0 + 𝑦𝑛 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + . . . +𝑦𝑛−1 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + . . . +𝑦𝑛−2 )]
Thus,
𝑥𝑛 ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = 3 [(𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑎𝑛𝑑 𝑡ℎ𝑒 𝑙𝑎𝑠𝑡 𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠 ) + 4(𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑜𝑑𝑑 𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠) +
0
2(𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑒𝑣𝑒𝑛 𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒𝑠)]

Dr. Kwami, A. M (Not for sale) Page 36


Geometrical Interpretation:
𝑦

𝑦 = 𝑓(𝑥)

𝑦0 𝑦1 𝑦2 𝑦3 𝑦𝑛

ℎ ℎ ℎ ℎ ℎ ℎ
𝑥
𝑂

𝑏 = 𝑥𝑛
𝑥2
𝑥1
𝑎 = 𝑥0

𝑥3

the points of division are


𝑎 = 𝑥0 , 𝑥1 , 𝑥2 , . . . 𝑥𝑛−1 , 𝑏 = 𝑥𝑛 and the values of 𝑓(𝑥) at this points are 𝑦0 , 𝑦1 , 𝑦2 , 𝑦3 , . . . 𝑦𝑛−1 , 𝑦𝑛
Respectively.
𝑥 𝑥 𝑥 𝑥 𝑥𝑛
Thus, ∫𝑥0𝑛 𝑓(𝑥) 𝑑𝑥 = ∫𝑥02 𝑓(𝑥) 𝑑𝑥 + ∫𝑥24 𝑓(𝑥) 𝑑𝑥 + ∫𝑥24 𝑓(𝑥) 𝑑𝑥 + . . . + ∫𝑥𝑛−2 𝑓(𝑥) 𝑑𝑥
ℎ ℎ ℎ ℎ
= (𝑦0 + 4𝑦1 + 𝑦2 ) + (𝑦2 + 4𝑦3 + 𝑦4 ) + (𝑦4 + 4𝑦5 + 𝑦6 )+ . . . + (𝑦𝑛−2 + 4𝑦𝑛−1 + 𝑦𝑛 )
3 3 3 3

= [(𝑦0 + 4𝑦1 + 𝑦2 ) + (𝑦2 + 4𝑦3 + 𝑦4 ) + (𝑦4 + 4𝑦5 + 𝑦6 )+ . . . +(𝑦𝑛−2 + 4𝑦𝑛−1 + 𝑦𝑛 )]
3

= [(𝑦0 + 𝑦𝑛 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + . . . +𝑦𝑛−1 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + . . . +𝑦𝑛−2 )]
3
𝑏 ℎ
⇨ ∫𝑎 𝑓(𝑥)𝑑𝑥 = 3 [(𝑦0 + 𝑦𝑛 ) + 4 ∑ 𝑜𝑑𝑑 + 2 ∑ 𝑒𝑣𝑒𝑛]

Example1: Evaluate approximately the following integrals using Simpson’s rule


4 2 2
𝑖) ∫1 𝑥 ln 𝑥 𝑑𝑥 using twenty one ordinates 𝑖𝑖) ∫0 𝑒−𝑥 𝑑𝑥 taking ℎ = 0.25
1 𝑑𝑥
𝑖𝑖𝑖) ∫0 1+𝑥2
taking ℎ = 16 . Hence, obtain an approximate value of 𝜋.
Solution;
𝑖) 𝑎 = 1, 𝑏 = 4, 𝑎𝑛𝑑 𝑛 = 10 ⇨ 2𝑛 = 20 𝑎𝑛𝑑 ℎ = 0.15
𝑥 𝑥 𝑙𝑛 𝑥 F &L Rem Odd Even
1.000 0.0000 0.0000
1.150 0.1607 0.1607 0.1607
1.300 0.3411 0.3411 0.3411
1.450 0.5388 0.5388 0.5388
1.600 0.7520 0.7520 0.7520 4
1.750 0.9793 0.9793 0.9793 ⇨ ∫1 𝑥 ln 𝑥 𝑑𝑥 =
1.900 1.2195 1.2195 1.2195
2.050 1.4716 1.4716 1.4716
0.05[(5.5452) + 4(24.4506) + 2(21.7297)]
2.200 1.7346 1.7346 1.7346
2.350 2.0079 2.0079 2.0079
= 0.05[5.5452 + 97.8024 + 43.4594]
2.500 2.2907 2.2907 2.2907
2.650 2.5826 2.5826 2.5826
2.800 2.8829 2.8829 2.8829 = 0.05[146.807]
2.950 3.1913 3.1913 3.1913
3.100 3.5073 3.5073 3.5073 = 7.34035 square unit
3.250 3.8306 3.8306 3.8306
3.400 4.1608 4.1608 4.1608
3.550 4.4977 4.4977 4.4977
3.700 4.8408 4.8408 4.8408
3.850 5.1901 5.1901 5.1901
4.000 5.5452 5.5452
**** Total 5.5452 24.4506 21.7297

Dr. Kwami, A. M (Not for sale) Page 37


2 2
𝑖𝑖) ∫0 𝑒−𝑥 𝑑𝑥 taking ℎ = 0.25
𝑖) 𝑎 = 0, 𝑏 = 2, 𝑎𝑛𝑑 ℎ = 0.25
𝑥𝑘 𝑦𝑘 F &L Rem Odd Even 2 2
0.00 1.00000 1.0000 --- ⇨ ∫0 𝑒 −𝑥 𝑑𝑥
0.25 0.93941 0.93941 0.93941 1
0.50 0.77880 0.77880 0.77880 = 12[(1.01830) + 4(1.76557) + 2(1.25208)]
0.75 0.56978 0.56978 0.56978
1
1.00 0.36788 0.36788 0.36788 = 12 [1.01830 + 7.06228 + 2.50416]
1.25 0.20961 0.20961 0.20961 1
1.50 0.10540 0.10540 0.10540 = 12 [10.58474]
1.75 0.04677 0.04677 0.04677
= 0.88206 square unit
2.00 0.01830 0.01830 ---
**** Total 1.01830 1.76557 1.25208

1 𝑑𝑥
𝑖𝑖𝑖) ∫0 1+𝑥2
taking ℎ = 16
1
𝑖) 𝑎 = 0, 𝑏 = , 𝑎𝑛𝑑 ℎ= 6
𝑥𝑘 𝑦𝑘 F &L Rem Odd Even
0.00 1.00000 1.00000 --- 2 2
1
⇨ ∫0 𝑒 −𝑥 𝑑𝑥
0.97297 0.97297 0.97297
6
1
2 0.90000 0.90000 0.90000 = 18[(1.500) + 4(2.36313) + 2(1.59231)]
6
3 0.80000 0.80000 0.80000 1
6 = 18 [1.500 + 9.45252 + 3.18462]
4 0.69231 0.69231 0.69231 1
6 = 18 [14.13714]
5 0.59016 0.59016 0.59016
6
= 0.785397 square unit
1 0.50000 0.50000 ---
**** Total 1.50000 2.36313 1.59231

Exercise: Evaluate approximately the following integrals using Simpson’s rule


2 𝑑𝑥 1.3
𝑖) ∫−1 3+𝑥 with ten sub-intervals. 𝑖𝑖) ∫1 √𝑥 𝑑𝑥 taking ℎ = 0.05.

𝟑 1
Simpson’s 𝟖
Rule: Simpson’s 3
rule was derived using three points that fit the quadratic equation. We
extend this approach by incorporating four successive points so that the rule can be extended to a
polynomial of degree three. Putting 𝑛 = 3 in Newton-Cote’s quadrature formula, all differences higher
than the third will become zero, and we obtain
𝑥 ( ) 2 ( ) 3 2
∫𝑥 3 𝑓(𝑥) 𝑑𝑥 = 3ℎ[𝑦0 + 32∆𝑦0 + 3 6−3
12
∆ 𝑦0 + 3 3−2
24
∆ 𝑦0 ]
0

= 3ℎ[𝑦0 + 32(𝑦1 − 𝑦0 ) + 34(𝑦2 − 2𝑦1 + 𝑦0 ) + 18(𝑦3 − 3𝑦2 + 3𝑦1 − 𝑦0 )]


3ℎ
= (𝑦0 + 3𝑦1 + 3𝑦2 + 𝑦3 )
8

In the same way


𝑥 ( ) 2 ( ) 2
∫𝑥 6 𝑓(𝑥) 𝑑𝑥 = 3ℎ[𝑦3 + 32∆𝑦3 + 3 6−3
12
∆ 𝑦3 + 3 3−2
24
∆ 𝑦3 ]
3

= 3ℎ[𝑦3 + 32(𝑦4 − 𝑦3 ) + 34(𝑦5 − 2𝑦4 + 𝑦3 ) + 18(𝑦6 − 3𝑦5 + 3𝑦4 − 𝑦3 )]


3ℎ
= (𝑦3 + 3𝑦4 + 3𝑦5 + 𝑦6 )
8

Dr. Kwami, A. M (Not for sale) Page 38


𝑥 ( ) 2 ( ) 2
∫𝑥 9 𝑓(𝑥) 𝑑𝑥 = 3ℎ[𝑦6 + 32∆𝑦6 + 3 6−3
12
∆ 𝑦6 + 3 3−2
24
∆ 𝑦6 ]
6

= 3ℎ[𝑦6 + 32(𝑦7 − 𝑦6 ) + 34(𝑦8 − 2𝑦7 + 𝑦6 ) + 18(𝑦9 − 3𝑦8 + 3𝑦7 − 𝑦6 )]


3ℎ
= (𝑦6 + 3𝑦7 + 3𝑦8 + 𝑦9 )
8

And
𝑥 ( ) 2 ( ) 2
∫𝑥 𝑛 𝑓(𝑥) 𝑑𝑥 = 3ℎ[𝑦𝑛−3 + 32∆𝑦𝑛−3 + 3 6−3
12
∆ 𝑦𝑛−3 + 3 3−2
24
∆ 𝑦𝑛−3 ]
𝑛−3

= 3ℎ[𝑦𝑛−3 + 32(𝑦𝑛−2 − 𝑦𝑛−3 ) + 34(𝑦𝑛−1 − 2𝑦𝑛−2 + 𝑦𝑛−3 ) + 18(𝑦𝑛 − 3𝑦𝑛−1 + 3𝑦𝑛−2 − 𝑦𝑛−3 )]
3ℎ
= (𝑦𝑛−3 + 3𝑦𝑛−2 + 3𝑦𝑛−1 + 𝑦𝑛 )
8

Hence,
𝑥
𝑛 3 𝑥 6 9 𝑥 𝑛 𝑥 𝑥
∫𝑥 𝑓(𝑥) 𝑑𝑥 = ∫𝑥 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 𝑓(𝑥) 𝑑𝑥 + ∫𝑥 𝑓(𝑥) 𝑑𝑥 + . . . + ∫𝑥 𝑓(𝑥) 𝑑𝑥
0 0 3 6 𝑛−3
3ℎ 3ℎ 3ℎ 3ℎ
= (𝑦0 + 3𝑦1 + 3𝑦2 + 𝑦3 ) + (𝑦3 + 3𝑦4 + 3𝑦5 + 𝑦6 ) + (𝑦6 + 3𝑦7 + 3𝑦8 + 𝑦9 )+ . . . + (𝑦𝑛−3 + 3𝑦𝑛−2 +
8 8 8 8

3𝑦𝑛−1 + 𝑦𝑛 )
3ℎ
= [(𝑦0 + 𝑦𝑛 ) + 3(𝑦1 + 𝑦3 + 𝑦5 + . . . +𝑦𝑛−1 ) + 3(𝑦2 + 𝑦4 + 𝑦6 + . . . +𝑦𝑛−2 )]
8

Note: While there is no restriction for the number of intervals 𝑛 in trapezoidal rule, the number of intervals 𝑛 in the
1 3
case of Simpson’s rule must be even, for Simpson’s rule must be multiple of three
3 8

Boole’s rule: Here the function 𝑓(𝑥) approximated by the fourth-order polynomial 𝑃4 (𝑥) which passes
through five points.
Putting 𝑛 = 4 in Newton-Cote’s quadrature formula, all differences higher than the fourth will become
zero and we get
𝑥 ( ) 2 ( ) 3 4[6(4) 2 3 −45(4)2 −110(4)−90]
∫𝑥 4 𝑓(𝑥) 𝑑𝑥 = 4ℎ [𝑦0 + 32∆𝑦0 + 3 6−3
12
∆ 𝑦0 + 3 3−2
24
∆ 𝑦0 + 720
∆4 𝑦0 ]
0

= 3ℎ[𝑦0 + 32(𝑦1 − 𝑦0 ) + 34(𝑦2 − 2𝑦1 + 𝑦0 ) + 18(𝑦3 − 3𝑦2 + 3𝑦1 − 𝑦0 ) + 907 (𝑦4 − 4𝑦3 + 6𝑦2 − 4𝑦1 + 𝑦0 )]
24ℎ
= (7𝑦0 + 32𝑦1 + 12𝑦2 + 32𝑦3 + 7𝑦4 )
45

We continue in the same way and establish the result.

Weddle’s rule: Here the function 𝑓(𝑥) approximated by the sixth-order polynomial 𝑃6 (𝑥) which passes
through seven points.
Putting 𝑛 = 6 in Newton-Cote’s quadrature formula, all differences higher than the sixth will become
zero and we get
𝑥
6 3ℎ
∫𝑥 𝑓(𝑥) 𝑑𝑥 = 10 (7𝑦0 + 5𝑦1 + 𝑦2 + 6𝑦3 + 𝑦4 + 5𝑦5 + 𝑦6 )
0

We continue in the same way and establish the result.

Dr. Kwami, A. M (Not for sale) Page 39


Numerical Solution of Ordinary Differential Equations (Initial value and boundary value problems)

Introduction: Numerical methods for Ordinary Differential Equations are of great importance
particularly to Equations that are very difficult to solve or sometimes impossible to solve using the
analytical methods.

Methods of Solution:
− Single-Step Methods: In these methods each step uses only values obtained from the preceding single
step, and they include
1. Euler’s Method
2. Runge-Kutta Methods
3. Picard’s method

1. Euler’s Method.
Let consider an initial value problem (IVP) of the form
𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜
Assuming 𝑓 to be such that the problem has a unique solution on some interval containing 𝑥𝑜 . We start
from the given 𝑦(𝑥𝑜 ) = 𝑦𝑜 and proceed stepwise computing approximate values of the solution 𝑦(𝑥) at
the mesh points. 𝑥1 = 𝑥𝑜 + ℎ, 𝑥2 = 𝑥𝑜 + 2ℎ, 𝑥3 = 𝑥𝑜 + 3ℎ, . . . 𝑥𝑛 = 𝑥𝑜 + 𝑛ℎ
Where step size ℎ is a fixed number.

Derivation of the method:


From Taylor series we have
ℎ0 ℎ1 ℎ2 ℎ3 ℎ4
𝑦(𝑥 + ℎ) = 𝑦(𝑥) + 𝑦 ′ (𝑥) + 𝑦 ′′ (𝑥) + 𝑦 ′′′ (𝑥) + 𝑦 ′𝑣 (𝑥) + . . . . . . (1)
0! 1! 2! 3! 4!

Now for small value of h, the higher powers ℎ2 , ℎ3 , ℎ4 . . . are negligibly small, and this suggest the crude
approximation
ℎ0 ℎ1
𝑦(𝑥 + ℎ) = 𝑦(𝑥) + 𝑦 ′ (𝑥)
0! 1!
⇨ 𝑦(𝑥 + ℎ) = 𝑦(𝑥) + ℎ𝑓(𝑥, 𝑦) . . . (2)

⇨ In the first iteration using the initial conditions we compute


𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ) which approximate 𝑦(𝑥1 ) = 𝑦(𝑥0 + ℎ)
In the second iteration we compute
𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ) which approximate 𝑦(𝑥2 ) = 𝑦(𝑥0 + 2ℎ)
In the third iteration we compute
𝑦3 = 𝑦2 + ℎ𝑓(𝑥2 , 𝑦2 ) which approximate 𝑦(𝑥3 ) = 𝑦(𝑥0 + 3ℎ)
And in general
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒇(𝒙𝒏 , 𝒚𝒏 ) 𝑛 = 0, 1, 2, 3, . . . . . . (3)
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 𝑥0 𝑦0 𝑦1
1 𝑥1 𝑦1 𝑦2
2 𝑥2 𝑦2 𝑦3
. . . .
. . . .

Dr. Kwami, A. M (Not for sale) Page 40


Euler’s method is the simplest of approximation technique. A step length ℎ is chosen and 𝑦 is
approximated at the points𝑥𝑛 = 𝑥0 + 𝑛ℎ
From (ii) we have that the Taylor formula with remainder has the form
𝒉𝟎 𝒉𝟏 𝒉𝟐
𝒚(𝒙 + 𝒉) = 𝒚(𝒙) + 𝒚′ (𝒙) + 𝒚′′ (𝒛) Where 𝑥 < 𝑧 < 𝑥 + ℎ
𝟎! 𝟏! 𝟐!
These shows that in Euler’s method, the local truncation error is proportional to ℎ2 written 𝑜(ℎ2 ) where
𝑜 suggest the order. Now over a fixed x-interval in which we want to solve an equation, the number of
1
steps is proportional to ℎ .
1
Hence the total error is proportional to ℎ2 (ℎ) = ℎ. For this reason, Euler’s method is first order
method. In addition there are round-off errors in these and other methods which may affect the
accuracy of the values of 𝑦1 , 𝑦2 , 𝑦3 . . . more and more as n increases.

Example1: Use Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦′ = 𝑥 + 𝑦, 𝑦(0) = 0 0≤𝑥≤1

𝑖𝑖) 𝑦 = 𝑥 − 𝑦 − 1, 𝑦(0) = 1 0≤𝑥≤1

Solution:
𝑖) The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)
− 𝑦′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)
𝑦 ′ = 𝑥 + 𝑦, 𝑦(0) = 0 ⇨ 𝑥𝑜 = 0, 𝑦𝑜 = 0 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥, 𝑦) = 𝑥 + 𝑦, 𝑥0 = 0 𝑦0 = 0 and ℎ = 0.1
⇨ 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 + 𝑦𝑛 , 𝑥0 = 0 𝑦0 = 0 and ℎ = 0.1
Substituting in equation (3), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝒚𝒏 + 𝟎. 𝟏𝒙𝒏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 0.0000 0.0000 0.0000 0.0000
1 0.1000 0.0000 0.0100 0.0052 0.0048
2 0.2000 0.0100 0.0311 0.0214 0.0097
3 0.3000 0.0311 0.0642 0.0499 0.0143
4 0.4000 0.0642 0.1106 0.0918 0.0188
5 0.5000 0.1106 0.1717 0.1487 0.0230
6 0.6000 0.1717 0.2489 0.2221 0.0268
7 0.7000 0.2489 0.3438 0.3138 0.0300
8 0.8000 0.3438 0.4581 0.4255 0.0326
9 0.9000 0.4581 0.5939 0.5596 0.0343
10 1.0000 0.5939 0.7533 0.7183 0.0350

𝑖𝑖) The Exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 𝑥 − 2 . . . (*)



− 𝑦 = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)
− 𝑦 ′ = 𝑥 − 𝑦 − 1, 𝑦(0) = 1 ⇨ 𝑥0 = 0, 𝑦0 = 1 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥, 𝑦) = 𝑥 − 𝑦 − 1, 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1
⇨ 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 − 1, 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1
Substituting in equation (3), we have

Dr. Kwami, A. M (Not for sale) Page 41


𝒚𝒏+𝟏 = 𝟎. 𝟗𝒚𝒏 + 𝟎. 𝟏𝒙𝒏 − 𝟎. 𝟏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.0000 0.8000 1.0000 0.2000
1 0.1000 0.8000 0.6300 0.8145 0.1845
2 0.2000 0.6300 0.4870 0.6562 0.1692
3 0.3000 0.4870 0.3683 0.5225 0.1542
4 0.4000 0.3683 0.2715 0.4110 0.1395
5 0.5000 0.2715 0.1844 0.3200 0.1356
6 0.6000 0.1844 0.1260 0.2464 0.1204
7 0.7000 0.1260 0.0834 0.1897 0.1063
8 0.8000 0.0834 0.0551 0.1480 0.0929
9 0.9000 0.0551 0.0396 0.1197 0.0801
10 1.0000 0.0396 0.0356 0.1036 0.0680

Example2: Use Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑦 − 𝑥, 𝑦(0) = 3 0≤𝑥≤1
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 + 1, 𝑦(0) = 1 0≤𝑥≤1
Solution:
𝑖) The Exact solution is 𝑦(𝑥) = 2𝑒 𝑥 + 𝑥 + 1 . . . (*)
− 𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)
− 𝑦 ′ = 𝑦 − 𝑥, 𝑦(0) = 3 ⇨ 𝑥0 = 0, 𝑦0 = 3 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥, 𝑦) = 𝑦 − 𝑥, 𝑥0 = 0 𝑦0 = 3 and ℎ = 0.1
⇨ 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑦𝑛 − 𝑥𝑛 , 𝑥0 = 0 𝑦0 = 3 and ℎ = 0.1
Substituting in equation (3), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝒚𝒏 − 𝟎. 𝟏𝒙𝒏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 3.0000 3.3000 3.0000 0.3000
1 0.1000 3.3000 3.6200 3.3103 0.3097
2 0.2000 3.6200 3.9620 3.6428 0.3192
3 0.3000 3.9620 4.3282 3.9997 0.3285
4 0.4000 4.3282 4.7210 4.3836 0.3374
5 0.5000 4.7210 5.1431 4.7974 0.3457
6 0.6000 5.1431 5.5974 5.2442 0.3532
7 0.7000 5.5974 6.0871 5.7275 0.3596
8 0.8000 6.0871 6.6158 6.2511 0.3647
9 0.9000 6.6158 7.1874 6.8192 0.3682
10 1.0000 7.1874 7.8061 7.4366 0.3695

𝑖𝑖) The Exact solution is 𝑦(𝑥) = 𝑒 −𝑥 + 𝑥 . . . (*)


− 𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)
− 𝑦 ′ = 𝑥 − 𝑦 + 1, 𝑦(0) = 1 ⇨ 𝑥0 = 0, 𝑦0 = 1 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥, 𝑦) = 𝑥 − 𝑦 + 1, 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1

⇨ 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 + 1, 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1


Substituting in equation (3), we have

Dr. Kwami, A. M (Not for sale) Page 42


𝒚𝒏+𝟏 = 𝟎. 𝟗𝒚𝒏 + 𝟎. 𝟏𝒙𝒏 + 𝟎. 𝟏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.0000 1.0000 1.0000 0.0000
1 0.1000 1.0000 1.0100 1.0048 0.0052
2 0.2000 1.0100 1.0290 1.0187 0.0103
3 0.3000 1.0290 1.0561 1.0408 0.0153
4 0.4000 1.0561 1.0905 1.0703 0.0202
5 0.5000 1.0905 1.1314 1.1065 0.0249
6 0.6000 1.1314 1.1783 1.1488 0.0295
7 0.7000 1.1783 1.2305 1.1966 0.0339
8 0.8000 1.2305 1.2874 1.2493 0.0381
9 0.9000 1.2874 1.3487 1.3066 0.0421
10 1.0000 1.3487 1.4138 1.3679 0.0459

2. Runge-Kutta Methods:
The Runge-Kutta (R-K) methods are extensions of the basic ideas of Euler’s method using
approximations which agree with more terms of the Taylor series. The basic step length of the method is
ℎ as with Euler’s method, but some intermediate points are also computed and the slopes at these
points are used to improve the overall change between 𝑥𝑛 and 𝑥𝑛 + ℎ = 𝑥𝑛+1

Corrected Euler’s Method: The corrected Euler’s (or sometimes midpoint) method is a two stage
formula
𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 )
1 1
𝑘2 = 𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + ℎ𝑘1 )
2 2
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒌𝟐 . . . (4)

This is equivalent to taking an Euler’s step with half the step length, and then using the slope of this
midpoint between 𝑥𝑛 and 𝑥𝑛+1 to estimate the average slope over this interval.

𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error


0 𝑥0 𝑦0 𝑦1
1 𝑥1 𝑦1 𝑦2
2 𝑥2 𝑦2 𝑦3
. . . .

Example1: Use Corrected Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦′ = 𝑥 + 𝑦, 𝑦(0) = 0 0≤𝑥≤1
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 − 1, 𝑦(0) = 1 0≤𝑥≤1
Solution:
𝑖) The Exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1
𝑘1 = 𝑥𝑛 + 𝑦𝑛
1 1
𝑘2 = 𝑥𝑛 + (0.1) + 𝑦𝑛 + (0.1)(𝑥𝑛 + 𝑦𝑛 ) = 1.05𝑦𝑛 + 1.05𝑥𝑛 + 0.05
2 2

Substituting 𝑘2 in equation (4), we have


𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝒙𝒏 + 𝟎. 𝟎𝟎𝟓

Dr. Kwami, A. M (Not for sale) Page 43


𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 0.0000 0.0050 0.0000 0.0050
1 0.1000 0.0050 0.0210 0.0052 0.0160
2 0.2000 0.0210 0.0492 0.0214 0.0278
3 0.3000 0.0492 0.0909 0.0499 0.0410
4 0.4000 0.0909 0.1474 0.0918 0.0556
5 0.5000 0.1474 0.2204 0.1487 0.0717
6 0.6000 0.2204 0.3115 0.2221 0.0894
7 0.7000 0.3115 0.4227 0.3138 0.1089
8 0.8000 0.4227 0.5561 0.4255 0.1306
9 0.9000 0.5561 0.7140 0.5596 0.1544
10 1.0000 0.7140 0.8990 0.7183 0.1807

𝑖𝑖) The Exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 𝑥 − 2 . . . (*)


− 𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)

− 𝑦 = 𝑥 − 𝑦 − 1, 𝑦(0) = 1 ⇨ 𝑥0 = 0, 𝑦0 = 1 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 − 1, 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1
𝑘1 = 𝑥𝑛 − 𝑦𝑛 − 1
1 1
𝑘2 = [𝑥𝑛 + (0.1)] − [𝑦𝑛 + (0.1)(𝑥𝑛 − 𝑦𝑛 − 1)] − 1 = 0.95𝑥𝑛 − 0.95𝑦𝑛 − 0.9
2 2

Substituting 𝑘2 in equation (4), we have


𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝒚𝒏 + 𝟎. 𝟎𝟗𝟓𝒙𝒏 − 𝟎. 𝟎𝟗
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 1.0000 0.8150 1.0000 0.1850
1 0.1000 0.8150 0.6571 0.8145 0.1574
2 0.2000 0.6571 0.5257 0.6562 0.1305
3 0.3000 0.5257 0.4124 0.5225 0.1101
4 0.4000 0.4124 0.3212 0.4110 0.0898
5 0.5000 0.3212 0.2482 0.3200 0.0718
6 0.6000 0.2482 0.1916 0.2464 0.0548
7 0.7000 0.1916 0.1499 0.1897 0.0398
8 0.8000 0.1499 0.1217 0.1480 0.0263
9 0.9000 0.1217 0.1056 0.1197 0.0141
10 1.0000 0.1056 0.1011 0.1036 0.0025

Example2: Use corrected Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑦 − 𝑥, 𝑦(0) = 3 0≤𝑥≤1
𝑖𝑖) 𝑦 ′ = 2𝑥 − 𝑦, 𝑦(0) = 1 0≤𝑥≤1
Solution:
− The Exact solution is 𝑦(𝑥) = 2𝑒 𝑥 + 𝑥 + 1 . . . (*)
− 𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)

− 𝑦 = 𝑦 − 𝑥, 𝑦(0) = 3 ⇨ 𝑥0 = 0, 𝑦0 = 3 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑦𝑛 − 𝑥𝑛 , 𝑥0 = 0 𝑦0 = 3 and ℎ = 0.1
𝑘1 = 𝑦𝑛 − 𝑥𝑛
1 1
𝑘2 = [𝑦𝑛 + (0.1)(𝑦𝑛 − 𝑥𝑛 )] − [𝑥𝑛 + (0.1)] = 1.05𝑦𝑛 − 1.05𝑥𝑛 − 0.05
2 2
Substituting 𝑘2 in equation (4), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 − 𝟎. 𝟏𝟎𝟓𝒙𝒏 − 𝟎. 𝟎𝟎5

Dr. Kwami, A. M (Not for sale) Page 44


𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 3.0000 3.3100 3.0000 0.3100
1 0.1000 3.3100 3.6421 3.3103 0.3318
2 0.2000 3.6421 3.9985 3.6428 0.3557
3 0.3000 3.9985 4.3819 3.9997 0.3822
4 0.4000 4.3819 4.7950 4.3836 0.4114
5 0.5000 4.7950 5.2410 4.7974 0.4436
6 0.6000 5.2410 5.7233 5.2442 0.4791
7 0.7000 5.7233 6.2457 5.7275 0.5182
8 0.8000 6.2457 6.8125 6.2511 0.5614
9 0.9000 6.8125 7.4283 6.8192 0.6091
10 1.0000 7.4283 8.0983 7.4366 0.6617

𝑖𝑖) The Exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 2𝑥 − 2 . . . (*)


− 𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (i)

− 𝑦 = 2𝑥 − 𝑦, 𝑦(0) = 1 ⇨ 𝑥0 = 0, 𝑦0 = 1 . . . (ii)
From (i) & (ii) we have
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 2𝑥𝑛 − 𝑦𝑛 , 𝑥0 = 0 𝑦0 = 1 and ℎ = 0.1
𝑘1 = 2𝑥𝑛 − 𝑦𝑛
1 1
𝑘2 = 2 [𝑥𝑛 + (0.1)] − [𝑦𝑛 + (0.1)(2𝑥𝑛 − 𝑦𝑛 )] = 1.9𝑥𝑛 − 0.95𝑦𝑛 + 0.10
2 2
Substituting 𝑘2 in equation (4), we have
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟗𝒙𝒏 + 𝟎. 𝟎𝟏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 1.0000 0.9150 1.0000 0.0850
1 0.1000 0.9150 0.8571 0.9145 0.0574
2 0.2000 0.8571 0.8237 0.8562 0.0325
3 0.3000 0.8237 0.8124 0.8225 0.0101
4 0.4000 0.8124 0.8212 0.8110 0.0102
5 0.5000 0.8212 0.8482 0.8192 0.0286
6 0.6000 0.8482 0.8916 0.8464 0.0452
7 0.7000 0.8916 0.9499 0.8898 0.0601
8 0.8000 0.9499 1.0217 0.9480 0.0737
9 0.9000 1.0217 1.1056 1.0197 0.0859
10 1.0000 1.1056 1.2006 1.1036 0.0970

Improved Euler method: The Improved Euler’s method takes the full Euler’s step, but then Improved it
by using the average of the steep slope at the two points for the modified step.
𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 )
𝑘2 = 𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + ℎ𝑘1 )
𝟏
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉[𝒌𝟏 + 𝒌𝟐 ] . . . (5)
𝟐
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 𝑥0 𝑦0 𝑦1
1 𝑥1 𝑦1 𝑦2
2 𝑥2 𝑦2 𝑦3
. . . .

The first of these is equivalent to using the midpoint rule to integrate 𝑦 ′ over [𝑥𝑛 , 𝑥𝑛+1 ] with the slope at
the midpoint predicted by Euler’s method. The second is the same principle applied with the Trapezoidal
rule.

Dr. Kwami, A. M (Not for sale) Page 45


Example1: Use Improved Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦′ = 𝑥 + 𝑦, 𝑦(0) = 0 0≤𝑥≤1
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 − 1, 𝑦(0) = 1 0≤𝑥≤1
Solution:
𝑖) The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)
𝑘1 = 𝑥𝑛 + 𝑦𝑛
𝑘2 = 𝑥𝑛 + 0.1 + 𝑦𝑛 + 0.1(𝑥𝑛 + 𝑦𝑛 ) = 1.1𝑦𝑛 + 1.1𝑥𝑛 + 0.1
Substituting 𝑘1 & 𝑘2 in equation (5), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝒙𝒏 + 𝟎. 𝟎𝟎5
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 0.0000 0.0050 0.0000 0.0050
1 0.1000 0.0050 0.0210 0.0052 0.0158
2 0.2000 0.0210 0.0492 0.0214 0.0278
3 0.3000 0.0492 0.0909 0.0499 0.0410
4 0.4000 0.0909 0.1474 0.0918 0.0556
5 0.5000 0.1474 0.2204 0.1487 0.0717
6 0.6000 0.2204 0.3116 0.2221 0.0895
7 0.7000 0.3116 0.4228 0.3138 0.1290
8 0.8000 0.4228 0.5562 0.4255 0.1307
9 0.9000 0.5562 0.7141 0.5596 0.1545
10 1.0000 0.7141 0.8991 0.7183 0.1808

𝑖𝑖) The Exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 𝑥 − 2 . . . (*)


𝑘1 = 𝑥𝑛 − 𝑦𝑛 − 1
𝑘2 = [𝑥𝑛 + 0.1] − [𝑦𝑛 + (0.1)(𝑥𝑛 − 𝑦𝑛 − 1)] = 0.9𝑥𝑛 − 0.9𝑥𝑛 − 0.8
Substituting 𝑘1 & 𝑘2 in equation (5), we have
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝒚𝒏 + 𝟎. 𝟎𝟗𝟓𝒙𝒏 − 𝟎. 𝟎𝟗
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 1.0000 0.8150 1.0000 0.1850
1 0.1000 0.8150 0.6571 0.8145 0.1574
2 0.2000 0.6571 0.5257 0.6562 0.1305
3 0.3000 0.5257 0.4124 0.5225 0.1101
4 0.4000 0.4124 0.3212 0.4110 0.0898
5 0.5000 0.3212 0.2482 0.3200 0.0718
6 0.6000 0.2482 0.1916 0.2464 0.0548
7 0.7000 0.1916 0.1499 0.1897 0.0398
8 0.8000 0.1499 0.1217 0.1480 0.0263
9 0.9000 0.1217 0.1056 0.1197 0.0141
10 1.0000 0.1056 0.1011 0.1036 0.0025

Example2: Use Improved Euler’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦′ = 𝑦 − 𝑥, 𝑦(0) = 3 0≤𝑥≤1
𝑖𝑖) 𝑦 ′ = 2𝑥 − 𝑦, 𝑦(0) = 1 0≤𝑥≤1
Solution:
− The exact solution is 𝑦(𝑥) = 2𝑒 𝑥 + 𝑥 + 1 . . . (*)
𝑘1 = 𝑦𝑛 − 𝑥𝑛
𝑘2 = 𝑦𝑛 + 0.1(𝑦𝑛 − 𝑥𝑛 ) − (𝑥𝑛 + 0.1) = 1.1𝑦𝑛 − 1.1𝑥𝑛 − 0.1
Substituting 𝑘1 & 𝑘2 in equation (5), we have

Dr. Kwami, A. M (Not for sale) Page 46


𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 − 𝟎. 𝟏𝟎𝟓𝒙𝒏 − 𝟎. 𝟎𝟎5
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 3.0000 3.3100 3.0000
1 0.1000 3.3100 3.6421 3.3103
2 0.2000 3.6421 3.9985 3.6428
3 0.3000 3.9985 4.3818 3.9997
4 0.4000 4.3818 4.7949 4.3836
5 0.5000 4.7949 5.2409 4.7974
6 0.6000 5.2409 5.7232 5.2442
7 0.7000 5.7232 6.2456 5.7275
8 0.8000 6.2456 6.8124 6.2511
9 0.9000 6.8124 7.4282 6.8192
10 1.0000 7.4282 8.0982 7.4366

𝑖𝑖) The exact solution is 𝑦(𝑥) = 3𝑒 𝑥 + 2𝑥 − 1 . . . (*)


𝑘1 = 2𝑥𝑛 − 𝑦𝑛
𝑘2 = 2(𝑥𝑛 + 0.1) − [𝑦𝑛 + 0.1(2𝑥𝑛 − 𝑦𝑛 )] = 1.8𝑥𝑛 − 0.9𝑥𝑛 − 0.2
Substituting 𝑘1 & 𝑘2 in equation (5), we have
𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟗𝒙𝒏 − 𝟎. 𝟎1
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 1.0000 0.8950 1.0000
1 0.1000 0.8950 0.8189 0.9145
2 0.2000 0.8189 0.7692 0.8562
3 0.3000 0.7692 0.7431 0.8225
4 0.4000 0.7431 0.7385 0.8110
5 0.5000 0.7385 0.7533 0.8192
6 0.6000 0.7533 0.7858 0.8464
7 0.7000 0.7858 0.8341 0.8898
8 0.8000 0.8341 0.8969 0.9480
9 0.9000 0.8969 0.9727 1.0197
10 1.0000 0.9727 1.0603 1.1036

Heun’s Method: The Heun’s method is also a two stage method


𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 )
2 2
𝑘2 = 𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + ℎ𝑘1 )
3 3
𝟏
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉[𝒌𝟏 + 𝟑𝒌𝟐 ] . . . (6)
𝟒

𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. Error


V
0 𝑥0 𝑦0 𝑦1
1 𝑥1 𝑦1 𝑦2
2 𝑥2 𝑦2 𝑦3
. . . .

Example1: Use Heun’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑥 + 𝑦, 𝑦(0) = 0 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 + 1 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
Solution:
− The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)
𝑘1 = 𝑥𝑛 + 𝑦𝑛

Dr. Kwami, A. M (Not for sale) Page 47


𝑘2 = 𝑥𝑛 + 0.0667 + 𝑦𝑛 + 0.0667(𝑥𝑛 + 𝑦𝑛 ) = 1.0667𝑥𝑛 + 1.0667𝑦𝑛 + 0.0667
Substituting 𝑘1 & 𝑘2 in equation (6), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝒙𝒏 + 𝟎. 𝟎𝟎𝟓
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 0.0000 0.0050 0.0000 0.0050
1 0.1000 0.0050 0.0210 0.0052 0.0158
2 0.2000 0.0210 0.0492 0.0214 0.0278
3 0.3000 0.0492 0.0909 0.0499 0.0410
4 0.4000 0.0909 0.1474 0.0918 0.0556
5 0.5000 0.1474 0.2204 0.1487 0.0717
6 0.6000 0.2204 0.3116 0.2221 0.0895
7 0.7000 0.3116 0.4228 0.3138 0.1090
8 0.8000 0.4228 0.5562 0.4255 0.1307
9 0.9000 0.5562 0.7141 0.5596 0.1545
10 1.0000 0.7141 0.8991 0.7183 0.1808

𝑖𝑖) The exact solution is 𝑦(𝑥) = 𝑒 −𝑥 + 𝑥 . . . (*)


𝑘1 = 𝑥𝑛 − 𝑦𝑛 + 1
𝑘2 = [𝑥𝑛 + 0.067] − [𝑦𝑛 + 0.067(𝑥𝑛 − 𝑦𝑛 + 1)] + 1 = 0.933𝑥𝑛 − 0.933𝑦𝑛 + 1
Substituting 𝑘1 & 𝑘2 in equation (6), we have
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟖𝟏𝟎𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟖𝟗𝟗𝟓𝒙𝒏 + 𝟎. 𝟐
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.00000 1.01005 1.0000
1 0.1000 1.01005 1.03710 1.0048
2 0.2000 1.03710 1.07816 1.0187
3 0.3000 1.07816 1.13035 1.0408
4 0.4000 1.13035 1.19162 1.0703
5 0.5000 1.19162 1.26024 1.1065
6 0.6000 1.26024 1.33483 1.1488
7 0.7000 1.33483 1.41424 1.1966
8 0.8000 1.41424 1.49757 1.2493
9 0.9000 1.49757 1.58408 1.3066
10 1.0000 1.58408 1.03710 1.3679

Example2: Use Heun’s method to solve the following initial value problem choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑦 − 𝑥, 𝑦(0) = 3 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦 ′ = 2𝑥 − 𝑦 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
Solution:
𝑖) The exact solution is 𝑦(𝑥) = 2𝑒 𝑥 + 𝑥 + 1 . . . (*)
𝑘1 = 𝑦𝑛 − 𝑥𝑛
𝑘2 = [𝑦𝑛 + 0.0667(𝑦𝑛 − 𝑥𝑛 )] − [𝑥𝑛 + 0.0667] = 1.0667𝑦𝑛 − 1.0667𝑥𝑛 − 0.0667
Substituting 𝑘1 & 𝑘2 in equation (6), we have
𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 − 𝟎. 𝟏𝟎𝟓𝒙𝒏 − 𝟎. 𝟎𝟎𝟓
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 3.0000 3.3100 3.0000
1 0.1000 3.3100 3.6421 3.3103
2 0.2000 3.6421 3.9985 3.6428
3 0.3000 3.9985 4.3818 3.9997
4 0.4000 4.3818 4.7949 4.3836
5 0.5000 4.7949 5.2409 4.7974
6 0.6000 5.2409 5.7232 5.2442
7 0.7000 5.7232 6.2456 5.7275
8 0.8000 6.2456 6.8124 6.2511
9 0.9000 6.8124 7.4282 6.8192
10 1.0000 7.4282 8.0982 7.4366

Dr. Kwami, A. M (Not for sale) Page 48


𝑖𝑖) The exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 2𝑥 − 2 . . . (*)
𝑘1 = 2𝑥𝑛 − 𝑦𝑛
𝑘2 = 2[𝑥𝑛 + 0.067] − [𝑦𝑛 + 0.067(2𝑥𝑛 − 𝑦𝑛 )] = 1.8667𝑥𝑛 − 0.9333𝑦𝑛 + 0.1134
Substituting 𝑘1 & 𝑘2 in equation (6), we have
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝟎𝟎𝟐𝟓𝒚𝒏 + 𝟎. 𝟏𝟗𝟎𝟎𝟎𝟐𝟓𝒙𝒏 + 𝟎. 𝟎𝟏𝟎𝟎𝟎𝟓
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.000000 0.915008 1.0000
1 0.1000 0.915008 0.857089 0.9145
2 0.2000 0.857089 0.823674 0.8562
3 0.3000 0.823674 0.812432 0.8225
4 0.4000 0.812432 0.821259 0.8110
5 0.5000 0.821259 0.848248 0.8192
6 0.6000 0.848248 0.891673 0.8464
7 0.7000 0.891673 0.949973 0.8898
8 0.8000 0.949973 1.021735 0.9480
9 0.9000 1.021735 1.105680 1.0197
10 1.0000 1.105680 1.200651 1.1036

Classical Runge-Kutta Method: A still more accurate method of great practical importance is the
classical Runge-Kutta method of order four, which is called the Runge-Kutta method. In this method we
first compute four auxiliary quantities 𝑘1 , 𝑘2 , 𝑘3 , 𝑎𝑛𝑑 𝑘4 and then the new value 𝑦𝑛+1 .
Where
𝑘1 = ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )
1 1
𝑘2 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘1 )
2 2
1 1
𝑘3 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘2 )
2 2
𝑘4 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3 )
𝟏
𝒚𝒏+𝟏 = 𝒚𝒏 + [𝒌𝟏 + 𝟐𝒌𝟐 + 𝟐𝒌𝟑 + 𝒌𝟒 ] . . . (7)
𝟔

Example1: Use Classical Runge-Kutta method to approximate the solution of the initial value problem
choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑥 + 𝑦 𝑦(0) = 0 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 + 1 , 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
Solution:
𝑖) The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)
𝑓(𝑥, 𝑦) = 𝑥 + 𝑦
𝑘1 = 0.1(𝑥𝑛 + 𝑦𝑛 ) = 0.1𝑥𝑛 + 0.1𝑦𝑛
𝑘2 = 0.1(𝑥𝑛 + 0.05 + 𝑦𝑛 + 0.5(0.1𝑥𝑛 + 0.1𝑦𝑛 )) = 0.105𝑥𝑛 + 0.105𝑦𝑛 + 0.005
𝑘3 = 0.1(𝑥𝑛 + 0.05 + 𝑦𝑛 + 0.50.105𝑥𝑛 + 0.105𝑦𝑛 + 0.005) = 0.10525𝑥𝑛 + 0.10525𝑦𝑛 + 0.00525
𝑘4 = 0.1(𝑥𝑛 + 0. + 𝑦𝑛 + 0.10525𝑥𝑛 + 0.10525𝑦𝑛 + 0.00525 ) = 0.110525𝑥𝑛 + 0.110525𝑦𝑛 + 0,010525
Substituting 𝑘1 , 𝑘2 , 𝑘3 & 𝑘4 in equation (6), we have
⇨ 𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝟏𝟗𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝟏𝟗𝒙𝒏 + 𝟎. 𝟎𝟎𝟓𝟏𝟕

Dr. Kwami, A. M (Not for sale) Page 49


𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 0.00000 0.00517 0.0000
1 0.1000 0.00517 0.0052
2 0.2000 0.0214
3 0.3000 0.0499
4 0.4000 0.0918
5 0.5000 0.1487
6 0.6000 0.2221
7 0.7000 0.3138
8 0.8000 0.4255
9 0.9000 0.5596
10 1.0000 0.7183

𝑖𝑖) The exact solution is 𝑦(𝑥) = 𝑒 −𝑥 + 𝑥 . . . (*)


𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 + 1
1 1
𝑘2 = ℎ𝑓 (𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘1 ) = 0.1[𝑥𝑛 + 0.05 − 𝑦𝑛 − 0.5𝑘1 + 1] = 0.05𝑥𝑛 − 0.15𝑦𝑛 + 0.106
2 2
1 1
𝑘3 = ℎ𝑓 (𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘2 ) = 0.1[𝑥𝑛 + 0.05 − 𝑦𝑛 − 0.5𝑘2 + 1] = 0.0975𝑥𝑛 − 0.1075𝑦𝑛 + 0.1103
2 2
𝑘4 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3 ) = 0.1[𝑥𝑛 + 0.1 − 𝑦𝑛 + 𝑘3 + 1] = 0.11075𝑥𝑛 − 0.11075𝑦𝑛 + 0.12128
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟕𝟐𝟗𝒚𝒏 + 𝟎. 𝟐𝟕𝟏𝟎𝒙𝒏 + 𝟎. 𝟐𝟕𝟔𝟐
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.0000 1.0052 1.0000
1 0.1000 1.0052 1.0048
2 0.2000 1.0187
3 0.3000 1.0408
4 0.4000 1.0703
5 0.5000 1.1065
6 0.6000 1.1488
7 0.7000 1.1966
8 0.8000 1.2493
9 0.9000 1.3066
10 1.0000 1.3679

Example2: Use Classical Runge-Kutta method to approximate the solution of the initial value problem
choosing ℎ = 0.1
𝑖) 𝑦 ′ = 𝑥 + 𝑦 𝑦(0) = 0 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦 ′ = 𝑥 − 𝑦 + 1 , 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
Solution:
𝑖) The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)
𝑓(𝑥, 𝑦) = 𝑥 + 𝑦
𝑘1 = 0.1(𝑥𝑛 + 𝑦𝑛 ) = 0.1𝑥𝑛 + 0.1𝑦𝑛
𝑘2 = 0.1(𝑥𝑛 + 0.05 + 𝑦𝑛 + 0.5(0.1𝑥𝑛 + 0.1𝑦𝑛 )) = 0.105𝑥𝑛 + 0.105𝑦𝑛 + 0.005
𝑘3 = 0.1(𝑥𝑛 + 0.05 + 𝑦𝑛 + 0.50.105𝑥𝑛 + 0.105𝑦𝑛 + 0.005) = 0.10525𝑥𝑛 + 0.10525𝑦𝑛 + 0.00525
𝑘4 = 0.1(𝑥𝑛 + 0. + 𝑦𝑛 + 0.10525𝑥𝑛 + 0.10525𝑦𝑛 + 0.00525 ) = 0.110525𝑥𝑛 + 0.110525𝑦𝑛 + 0,010525
Substituting 𝑘1 , 𝑘2 , 𝑘3 & 𝑘4 in equation (6), we have
⇨ 𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝟏𝟗𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝟏𝟗𝒙𝒏 + 𝟎. 𝟎𝟎𝟓𝟏𝟕

Dr. Kwami, A. M (Not for sale) Page 50


𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 0.00000 0.00517 0.0000
1 0.1000 0.00517 0.0052
2 0.2000 0.0214
3 0.3000 0.0499
4 0.4000 0.0918
5 0.5000 0.1487
6 0.6000 0.2221
7 0.7000 0.3138
8 0.8000 0.4255
9 0.9000 0.5596
10 1.0000 0.7183

𝑖𝑖) The exact solution is 𝑦(𝑥) = 𝑒 −𝑥 + 𝑥 . . . (*)


𝑘1 = 𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 + 1
1 1
𝑘2 = ℎ𝑓 (𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘1 ) = 0.1[𝑥𝑛 + 0.05 − 𝑦𝑛 − 0.5𝑘1 + 1] = 0.05𝑥𝑛 − 0.15𝑦𝑛 + 0.106
2 2
1 1
𝑘3 = ℎ𝑓 (𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘2 ) = 0.1[𝑥𝑛 + 0.05 − 𝑦𝑛 − 0.5𝑘2 + 1] = 0.0975𝑥𝑛 − 0.1075𝑦𝑛 + 0.1103
2 2
𝑘4 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3 ) = 0.1[𝑥𝑛 + 0.1 − 𝑦𝑛 + 𝑘3 + 1] = 0.11075𝑥𝑛 − 0.11075𝑦𝑛 + 0.12128
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟕𝟐𝟗𝒚𝒏 + 𝟎. 𝟐𝟕𝟏𝟎𝒙𝒏 + 𝟎. 𝟐𝟕𝟔𝟐
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact V Error
0 0.0000 1.0000 1.0052 1.0000
1 0.1000 1.0052 1.0048
2 0.2000 1.0187
3 0.3000 1.0408
4 0.4000 1.0703
5 0.5000 1.1065
6 0.6000 1.1488
7 0.7000 1.1966
8 0.8000 1.2493
9 0.9000 1.3066
10 1.0000 1.3679

Taylor Series Method: Euler’s method was derived from Taylor theorem with 𝑛 = 2, the method was
improved by taking additional one more term making 𝑛 = 3. In an attempt to find methods for
improving the convergence is to extend this technique of derivation to large values of 𝑛. And the
motivation for this method is that the derivative of the solution function is sometimes easily found from
the Differential Equation itself.
Suppose the solution 𝑦(𝑥) to the initial value problem
𝑦 ′ (𝑥) = 𝑓(𝑥, 𝑦(𝑥)) 𝑎<𝑥<𝑏 𝑦(𝑥0 ) = 𝛼
has (𝑛 + 1) continuous derivatives. If we expand the solution 𝑦(𝑥) in terms of its 𝑛𝑡ℎ Taylor polynomial
ℎ0 ℎ1 ℎ2 ℎ𝑛 ℎ𝑛+1
about 𝑥𝑛 we obtain 𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + 𝑦 ′ (𝑥𝑛 ) + 𝑦 ′ (𝑥𝑛 )+ . . . + 𝑦 𝑛 (𝑥𝑛 ) + 𝑦 𝑛+1 (𝑧𝑛 )
0! 1! 2! 𝑛! 𝑛+1!
ℎ2 ℎ𝑛 ℎ𝑛+1
𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + ℎ𝑦 ′ (𝑥𝑛 ) + 𝑦 ′ (𝑥𝑛 )+ . . . + 𝑦 𝑛 (𝑥𝑛 ) + 𝑦 𝑛+1 (𝑧𝑛 ) . . . (i)
2! 𝑛! (𝑛+1)!

For some 𝑥𝑛 < 𝑧𝑛 < 𝑥𝑛 .


Successive differentiation of the solution 𝑦(𝑥) gives
𝑦 ′ (𝑥) = 𝑓(𝑥, 𝑦(𝑥))
𝑦 ′′ (𝑥) = 𝑓 ′ (𝑥, 𝑦(𝑥))
𝑦 ′′′ (𝑥) = 𝑓 ′′ (𝑥, 𝑦(𝑥))
. . . .
𝑘 (𝑥) 𝑘−1
𝑦 = 𝑓 (𝑥, 𝑦(𝑥))

Dr. Kwami, A. M (Not for sale) Page 51


Substituting the derivative in (i) we have
ℎ2 ℎ𝑛 ℎ𝑛+1
𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + ℎ𝑓(𝑥𝑛 , 𝑦(𝑥𝑛 )) + 𝑓 ′ (𝑥𝑛 , 𝑦(𝑥𝑛 ))+ . . . + 𝑓 𝑛−1 (𝑥𝑛 , 𝑦(𝑥𝑛 )) + 𝑓 𝑛 (𝑧𝑛 , 𝑦(𝑧𝑛 ))
2! 𝑛! (𝑛+1)!
By deleting the remainder term involving 𝑧𝑛 , we obtained a method called Taylor series method of order 𝑛.
ℎ2 ℎ3 ℎ𝑛
𝑦(𝑥𝑛+1 ) = 𝑦(𝑥𝑛 ) + ℎ𝑓(𝑥𝑛 , 𝑦(𝑥𝑛 )) + 𝑓 ′ (𝑥𝑛 , 𝑦(𝑥𝑛 )) + 𝑓 ′′ (𝑥𝑛 , 𝑦(𝑥𝑛 ))+ . . . + 𝑓 𝑛−1 (𝑥𝑛 , 𝑦(𝑥𝑛 ))
2! 3! 𝑛!
𝒉𝟐 𝒉𝟑 𝒉𝒏
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒇(𝒙𝒏 , 𝒚𝒏 ) + 𝒇′ (𝒙𝒏 , 𝒚𝒏 ) + 𝒇′′ (𝒙𝒏 , 𝒚𝒏 )+ . . . + 𝒇𝒏−𝟏 (𝒙𝒏 , 𝒚𝒏 ) . . . (3)
𝟐! 𝟑! 𝒏!

Example1: Using Taylor series method of order two solve the initial value problem with ℎ = 0.1
𝑖) 𝑦′ = 𝑥 − 𝑦 + 1 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦′ = 𝑥 + 𝑦 𝑦(0) = 0 0 ≤ 𝑥 ≤ 1,
Solution:
𝑖) The exact solution is 𝑦(𝑥) = 𝑒 −𝑥 + 𝑥 . . . (*)
𝑓(𝑥, 𝑦) = 𝑥 − 𝑦 + 1
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 + 1
𝑓𝑥′ (𝑥𝑛 , 𝑦𝑛 ) = 1 − 𝑦𝑛′ = 1 − (𝑥𝑛 − 𝑦𝑛 + 1) = 𝑦𝑛 − 𝑥𝑛
ℎ2
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 )
2!
1
= 𝑦𝑛 + ℎ [𝑓(𝑥𝑛 , 𝑦𝑛 ) + ℎ𝑓 ′ (𝑥𝑛 , 𝑦𝑛 )] = 𝑦𝑛 + (0.1)[(𝑥𝑛 − 𝑦𝑛 + 1) + (0.05)(𝑦𝑛 − 𝑥𝑛 )]
2
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟓𝒚𝒏 + 𝟎. 𝟎𝟗𝟓𝒙𝒏 + 𝟎. 𝟏
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact Soln. Error
0 0.000 1.000 1.005 1.0000
1 0.100 1.005 0.8145
2 0.200 0.6562
3 0.300 0.5225
4 0.400 0.4110
5 0.500 0.3200
6 0.600 0.2464
7 0.700 0.1897
8 0.800 0.1480
9 0.900 0.1197
10 1.000 0.1036

𝑖𝑖) The exact solution is 𝑦(𝑥) = 𝑒 𝑥 − 𝑥 − 1 . . . (*)


𝑓(𝑥, 𝑦) = 𝑥 + 𝑦
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 + 𝑦𝑛
𝑓𝑥′ (𝑥𝑛 , 𝑦𝑛 ) = 1 + 𝑦𝑛′ = 1 + (𝑥𝑛 + 𝑦𝑛 ) = 𝑥𝑛 + 𝑦𝑛 + 1
ℎ2
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 )
2!
1
𝑦𝑛+1 = 𝑦𝑛 + ℎ [𝑓(𝑥𝑛 , 𝑦𝑛 ) + ℎ𝑓 ′ (𝑥𝑛 , 𝑦𝑛 )] = 𝑦𝑛 + 0.1[(𝑥𝑛 + 𝑦𝑛 ) + 0.05(𝑥𝑛 + 𝑦𝑛 + 1) ]
2
𝒚𝒏+𝟏 = 𝟏. 𝟏𝟎𝟓𝒚𝒏 + 𝟎. 𝟏𝟎𝟓𝒙𝒏 + 𝟎. 𝟎𝟎𝟓
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact. V Error
0 0.0000 0.0000 0.0050 0.0000 0.0050
1 0.1000 0.0050 0.0210 0.0052 0.0158
2 0.2000 0.0210 0.0492 0.0214 0.0278
3 0.3000 0.0492 0.0909 0.0499 0.0410
4 0.4000 0.0909 0.1474 0.0918 0.0556
5 0.5000 0.1474 0.2204 0.1487 0.0717
6 0.6000 0.2204 0.3116 0.2221 0.0895
7 0.7000 0.3116 0.4228 0.3138 0.1090
8 0.8000 0.4228 0.5562 0.4255 0.1307
9 0.9000 0.5562 0.7141 0.5596 0.1545
10 1.0000 0.7141 0.8991 0.7183 0.1808

Dr. Kwami, A. M (Not for sale) Page 52


Example2: Using Taylor series method of order four, solve the following initial value problem choosing
ℎ = 0.1
𝑖) 𝑦′ = 𝑥 − 𝑦 − 1 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
𝑖𝑖) 𝑦 ′ = 2𝑥 − 𝑦 𝑦(0) = 1 0 ≤ 𝑥 ≤ 1,
Solution:
𝑖𝑖) The exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 𝑥 − 2 . . . (*)
𝑓(𝑥, 𝑦) = 𝑥 − 𝑦 − 1
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 𝑥𝑛 − 𝑦𝑛 − 1
𝑓𝑥′ (𝑥𝑛 , 𝑦𝑛 ) = 1 − 𝑦𝑛′ = 1 − (𝑥𝑛 − 𝑦𝑛 − 1) = 𝑦𝑛 − 𝑥𝑛 + 2
𝑓𝑥′′ (𝑥𝑛 , 𝑦𝑛 ) = 𝑦𝑛′ − 1 = (𝑥𝑛 − 𝑦𝑛 − 1) − 1 = 𝑥𝑛 − 𝑦𝑛 − 2
𝑓𝑥′′′ (𝑥𝑛 , 𝑦𝑛 ) = 1 − 𝑦𝑛′ = 1 − (𝑥𝑛 − 𝑦𝑛 − 1) = 𝑦𝑛 − 𝑥𝑛 + 2
ℎ2 ℎ3 ℎ4
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′′ (𝑥𝑛 , 𝑦𝑛 )
2! 3! 4!
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′′ (𝑥𝑛 , 𝑦𝑛 )]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(𝑥𝑛 − 𝑦𝑛 − 1) + (𝑦𝑛 − 𝑥𝑛 + 2) + (𝑥𝑛 − 𝑦𝑛 − 2) + (𝑦𝑛 − 𝑥𝑛 + 2)]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(𝑥𝑛 − 𝑦𝑛 − 2) + 1 − (𝑥𝑛 − 𝑦𝑛 − 2) + (𝑥𝑛 − 𝑦𝑛 − 2) − (𝑥𝑛 − 𝑦𝑛 − 2)]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(1 − + − ) (𝑥𝑛 − 𝑦𝑛 − 2) + 1]
2 6 24

= 𝑦𝑛 + 0.1[(0.951625)(𝑥𝑛 − 𝑦𝑛 − 2) + 1]
= 𝑦𝑛 + 0.1[0.951625𝑥𝑛 − 0.951625𝑦𝑛 − 1.90325 + 1]
= 𝑦𝑛 + 0.0951625𝑥𝑛 − 0.0951625𝑦𝑛 − 0.090325
= 0.904838𝑦𝑛 + 0.095171𝑥𝑛 − 0.090325
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟒𝟖𝟑𝟖𝒚𝒏 + 𝟎. 𝟎𝟗𝟓𝟏𝟕𝟏𝒙𝒏 − 𝟎. 𝟎𝟗𝟎𝟑𝟐𝟓

𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact Error


0 0.0000 1.0000 0.0000
1 0.1000 0.0052
2 0.2000 0.0214
3 0.3000 0.0499
4 0.4000 0.0918
5 0.5000 0.1487
6 0.6000 0.2221
7 0.7000 0.3138
8 0.8000 0.4255
9 0.9000 0.5596
10 1.0000 0.7183

𝑖𝑖) The exact solution is 𝑦(𝑥) = 3𝑒 −𝑥 + 2𝑥 − 2 . . . (*)


𝑓(𝑥, 𝑦) = 2𝑥 − 𝑦
𝑓(𝑥𝑛 , 𝑦𝑛 ) = 2𝑥𝑛 − 𝑦𝑛
𝑓𝑥′ (𝑥𝑛 , 𝑦𝑛 ) = 2 − 𝑦𝑛′ = 2 − (2𝑥𝑛 − 𝑦𝑛 ) = 𝑦𝑛 − 2𝑥𝑛 + 2
𝑓𝑥′′ (𝑥𝑛 , 𝑦𝑛 ) = 𝑦𝑛′ − 2 = (2𝑥𝑛 − 𝑦𝑛 ) − 2 = 2𝑥𝑛 − 𝑦𝑛 − 2
𝑓𝑥′′′ (𝑥𝑛 , 𝑦𝑛 ) = 2 − 𝑦𝑛′ = 2 − (2𝑥𝑛 − 𝑦𝑛 ) = 𝑦𝑛 − 2𝑥𝑛 + 2

Dr. Kwami, A. M (Not for sale) Page 53


ℎ2 ℎ3 ℎ4
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′′ (𝑥𝑛 , 𝑦𝑛 )
2! 3! 4!
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′ (𝑥𝑛 , 𝑦𝑛 ) + 𝑓 ′′′ (𝑥𝑛 , 𝑦𝑛 )]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(2𝑥𝑛 − 𝑦𝑛 ) + (𝑦𝑛 − 2𝑥𝑛 + 2) + (2𝑥𝑛 − 𝑦𝑛 − 2) + (𝑦𝑛 − 2𝑥𝑛 + 2)]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(2𝑥𝑛 − 𝑦𝑛 − 2) + 2 − (2𝑥𝑛 − 𝑦𝑛 − 2) + (2𝑥𝑛 − 𝑦𝑛 − 2) − (2𝑥𝑛 − 𝑦𝑛 − 2)]
2 6 24
ℎ ℎ2 ℎ3
= 𝑦𝑛 + ℎ [(1 − + − ) (2𝑥𝑛 − 𝑦𝑛 − 2) + 2]
2 6 24

= 𝑦𝑛 + 0.1[(0.951625)(2𝑥𝑛 − 𝑦𝑛 − 2) + 2]
= 𝑦𝑛 + 0.1[1.903251𝑥𝑛 − 0.951625𝑦𝑛 − 1.903251 + 2]
= 𝑦𝑛 + 0.1[1.903251𝑥𝑛 − 0.951625𝑦𝑛 + 0.096749]
= 𝑦𝑛 + 0.1903251𝑥𝑛 − 0.0951625𝑦𝑛 + 0.0096749
= 0.904838𝑦𝑛 + 0.190325𝑥𝑛 − 0.009675
⇨ 𝒚𝒏+𝟏 = 𝟎. 𝟗𝟎𝟒𝟖𝟑𝟖𝒚𝒏 + 𝟎. 𝟏𝟗𝟎𝟑𝟐𝟓𝒙𝒏 − 𝟎. 𝟎𝟎𝟗𝟔𝟕𝟓
𝑛 𝑥𝑛 𝑦𝑛 𝑦𝑛+1 Exact Error
0 0.0000 1.0000 0.0000
1 0.1000 0.0052
2 0.2000 0.0214
3 0.3000 0.0499
4 0.4000 0.0918
5 0.5000 0.1487
6 0.6000 0.2221
7 0.7000 0.3138
8 0.8000 0.4255
9 0.9000 0.5596
10 1.0000 0.7183
Exercise:

1) Use the classical fourth order Runge-Kutta method to solve the following initial value problems
𝑦′ = 𝑥 − 𝑦2 𝑦(0) = 1 ℎ = 0.2 0 ≤ 𝑥 ≤ 0.5
2) Use Taylor series method of order three with ℎ = 0.1 to approximate the solution of the initial
𝑦
value problem 𝑦 ′ = 2 𝑥 + 𝑥𝑒 𝑥 1≤𝑥≤2 𝑦(1) = 0

Picard’s method of successive approximation:


Given a differential equation
𝑦 ′ (𝑥) = 𝑓(𝑥, 𝑦) subject to 𝑦(𝑥 (0) ) = 𝑦 (0)
𝑑𝑦
Now, 𝑑𝑥
= 𝑓(𝑥, 𝑦) . . . (1)

⇨ 𝑑𝑦 = 𝑓(𝑥, 𝑦)𝑑𝑥
𝑥
⇨ ∫ 𝑑𝑦 = ∫ 𝑓(𝑥, 𝑦) 𝑑𝑥
𝑥
⇨ 𝑦 = ∫ 𝑓(𝑥, 𝑦) 𝑑𝑥 + 𝑐 . . . (2)

Setting 𝑥 = 𝑥 (0) on the 𝑅. 𝐻. 𝑆 after integrating and 𝑦 = 𝑦 (0) on the 𝐿. 𝐻. 𝑆, we have


𝑥 (0)
𝑦 (0) = ∫ 𝑓(𝑥, 𝑦) 𝑑𝑥 + 𝑐 . . . (3)
From eqn. (2) and (3) we have
𝑥
𝑦 − 𝑦 (0) = ∫𝑥 (0) 𝑓(𝑥, 𝑦) 𝑑𝑥

Dr. Kwami, A. M (Not for sale) Page 54


𝑥
⇨ 𝑦 = 𝑦 (0) + ∫𝑥 (0) 𝑓(𝑥, 𝑦) 𝑑𝑥 . . . (4)
In eqn.(4), the 𝑅. 𝐻. 𝑆, the integrand 𝑓(𝑥, 𝑦) involves 𝑦 also. This type of equation is called an integral
equation. As the integration is not possible as it is, we will solve it by successive approximation.
Substitute the initial values of 𝑦 namely 𝑦 (0) in the integrand 𝑓(𝑥, 𝑦) in place of 𝑦 and then integrate the
RHS to get the approximate value of 𝑦 on the LHS
𝑥
𝑦 (1) = 𝑦 (0) + ∫𝑥 (0) 𝑓(𝑥, 𝑦 (0) )𝑑𝑥 . . . (5)
Since 𝑓(𝑥, 𝑦 (0) ) is a function of 𝑥 only, it is possible to integrate it w.r.t. 𝑥 .
After getting the first approximation 𝑦 (1) for 𝑦, use this value 𝑦 (1) in place of 𝑦 in 𝑓(𝑥, 𝑦) of eqn(4) and
then integrate to get the second approximation of 𝑦 namely 𝑦 (2) i.e.
𝑥
𝑦 (2) = 𝑦 (0) + ∫𝑥 (0) 𝑓(𝑥, 𝑦 (1) )𝑑𝑥 . . . (6)
Proceeding in this way, we get the 𝑛𝑡ℎ approximate value of 𝑦 as
𝑥
𝑦 (𝑛) = 𝑦 (0) + ∫𝑥 (0) 𝑓(𝑥, 𝑦 (𝑛−1) )𝑑𝑥 . . . (7)
Equation (7) give the general iterative formula for 𝑦. It is called Picard’s iteration formula.
The sequence 𝑦 (1) , 𝑦 (2) , 𝑦 (3) , . . . 𝑦 (𝑛) should converge to 𝑦(𝑥); otherwise the process is not valid.
𝜕𝑦
The condition for the convergence of the sequence are 𝑓(𝑥, 𝑦) and 𝜕𝑥 are continuous
𝜕𝑦
That is |𝑓(𝑥, 𝑦)| ≤ 𝑘1 and |𝜕𝑥 | ≤ 𝑘2 in a region containing the point (𝑥0 , 𝑦0 ) where 𝑘1 and 𝑘2 are

constants.

𝑑𝑦
Example1: Solve the following differential equation 𝑑𝑥 = 𝑦 − 𝑥 2 𝑦(0) = 1 by Picard’s method up to the
third approximation. Hence, find the value of 𝑦(0.1), 𝑦(0.2).
Solution:
𝑑𝑦
= 𝑦 − 𝑥2 𝑦(0) = 1 ⇨ 𝑥 (0) = 0, 𝑦 (0) = 1
𝑑𝑥

From equation (4)


𝑥
⇨ 𝑦 = 1 + ∫0 (𝑦 − 𝑥 2 ) 𝑑𝑥 . . . (1)
𝑥 𝑥3
⇨ 𝑦 (1) = 1 + ∫0 (1 − 𝑥 2 ) 𝑑𝑥 = 1 + 𝑥 − 3
. . . (2)

Substitute eqn(2) in eqn(1) we have


𝑥 3 3 𝑥4 𝑥3
⇨ 𝑦 (2) = 1 + ∫0 (1 + 𝑥 − 𝑥3 − 𝑥 2 ) 𝑑𝑥 = 1 + 𝑥 + 𝑥3 − − . . . (3)
12 3

Substitute eqn(3) in eqn(1) we have


𝑥 𝑥2 𝑥3 𝑥4
⇨ 𝑦 (3) = 1 + ∫0 (1 + 𝑥 + − 3
− − 𝑥 2 ) 𝑑𝑥
2 12

𝑥2 3 𝑥4 𝑥5
= 1+𝑥+ − 𝑥6 − − + . . . . . . (4)
2 12 60

Putting 𝑥 = 0.1 in eqn(4) we have 𝑦(0.1) = 1.1048249

Putting 𝑥 = 0.2 in eqn(4) we have 𝑦(0.2) = 1.218528

Dr. Kwami, A. M (Not for sale) Page 55


𝑑𝑦
Example2: Solve the following differential equation 𝑑𝑥
=𝑥+𝑦 𝑦(0) = 1 obtain the values of
𝑦(0.1), 𝑦(0.2), using Picard’s method and check your answer with the exact solution.
Solution:
𝑑𝑦
=𝑥+𝑦 𝑦(0) = 1 ⇨ 𝑥 (0) = 0, 𝑦 (0) = 1
𝑑𝑥

From equation (4)


𝑥
⇨ 𝑦 = 1 + ∫0 (𝑥 + 𝑦) 𝑑𝑥 . . . (1)
𝑥 2
⇨ 𝑦 (1) = 1 + ∫0 (𝑥 + 1) 𝑑𝑥 = 1 + 𝑥 + 𝑥2 . . . (2)

Substitute eqn(2) in eqn(1) we have


𝑥 2 3
⇨ 𝑦 (2) = 1 + ∫0 (𝑥 + 1 + 𝑥 + 𝑥2 ) 𝑑𝑥 = 1 + 𝑥 + 𝑥 2 + 𝑥6 . . . (3)

Substitute eqn(3) in eqn(1) we have


𝑥 3
⇨ 𝑦 (3) = 1 + ∫0 (𝑥 + 1 + 𝑥 + 𝑥 2 + 𝑥6 ) 𝑑𝑥
3 𝑥4
= 1 + 𝑥 + 𝑥 2 + 𝑥3 + + . . . . . . (4)
24

Putting 𝑥 = 0.1 in eqn(4) we have 𝑦(0.1) = 1.1103374

Putting 𝑥 = 0.2 in eqn(4) we have 𝑦(0.2) = 1.242733


𝑑𝑦
Example3: Solve the following differential equation 𝑑𝑥 = 𝑥 2 + 𝑦 2 𝑦(0) = 1, Using Picard’s method
Solution:
𝑑𝑦
= 𝑥 2 + 𝑦2 𝑦(0) = 1 ⇨ 𝑥 (0) = 0, 𝑦 (0) = 1
𝑑𝑥

Here 𝑥0 = 0, 𝑦0 = 1
𝑥
⇨ 𝑦 = 1 + ∫0 (𝑥 2 + 𝑦 2 ) 𝑑𝑥 . . . (1)
𝑥 3
⇨ 𝑦 (1) = 1 + ∫0 (1 + 𝑥 2 ) 𝑑𝑥 = 1 + 𝑥 + 𝑥3 . . . (2)

Substitute eqn(2) in eqn(1) we have


𝑥 3 2 2 1 2 1
⇨ 𝑦 (2) = 1 + ∫0 [𝑥 2 + (1 + 𝑥 + 𝑥3 ) ] 𝑑𝑥 = 1 + 𝑥 + 𝑥 2 + 𝑥 3 + 𝑥 4 + 𝑥5 + 𝑥7 . . . (3)
3 6 15 63

𝑑𝑦
Example4: Solve the following differential equation 𝑑𝑥 + 𝑦 = 𝑒 𝑥 𝑦(0) = 0, Using Picard’s method
Solution:
𝑑𝑦
+ 𝑦 = 𝑒𝑥 𝑦(0) = 0 ⇨ 𝑥 (0) = 0, 𝑦 (0) = 0
𝑑𝑥

Here 𝑥0 = 0, 𝑦0 = 0
𝑥
⇨ 𝑦 = 0 + ∫0 (𝑒 𝑥 − 1) 𝑑𝑥 . . . (1)
𝑥
⇨ 𝑦 (1) = ∫0 (𝑒 𝑥 − 0) 𝑑𝑥 = 𝑒 𝑥 − 1 . . . (2)

Substitute eqn(2) in eqn(1) we have


𝑥
⇨ 𝑦 (2) = ∫0 (𝑒 𝑥 − 𝑒 𝑥 + 1) 𝑑𝑥 = 𝑥 . . . (3)

Substitute eqn(3) in eqn(2) we have

Dr. Kwami, A. M (Not for sale) Page 56


𝑥 𝑥2
⇨ 𝑦 (3) = ∫0 (𝑒 𝑥 − 𝑥) 𝑑𝑥 = 𝑒 𝑥 − −1 . . . (4)
2

Substitute eqn(4) in eqn(3) we have


𝑥 2 𝑥3
⇨ 𝑦 (4) = ∫0 [𝑒 x − (𝑒 𝑥 + 𝑥2 − `1)] 𝑑𝑥 = +𝑥 . . . (5)
6

Substitute eqn(5) in eqn(4) we have


𝑥 3 𝑥2 𝑥4
⇨ 𝑦 (5) = ∫0 (𝑒 𝑥 − 𝑥 + 𝑥6 ) 𝑑𝑥 = 𝑒 𝑥 − − −1 . . . (6)
2 24
𝑥2 𝑥4
Approximate 𝑦 = 𝑒 𝑥 − − −1
2 24

Predictor Corrector Methods:


The methods we have discussed so far are called single step methods because they use only the
information from the last step computed. The methods of Milne’s predictor corrector, Adams-Bash forth
predictor corrector and Adams-Moulton predictor corrector formulas are multi-step methods.
𝑑𝑦
In solving the equation 𝑑𝑥
= 𝑓(𝑥, 𝑦) 𝑦(𝑥0 ) = 𝑦0 we used Euler’s formula

𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) 𝑛 = 0, 1, 2, 3, . . . . . . (1)


We improved this values by improved Euler’s method
𝑦𝑛+1 = 𝑦𝑛 + 12ℎ[𝑓(𝑥𝑛 , 𝑦𝑛 ) + 𝑓(𝑥𝑛+1 , 𝑦𝑛+1 )] 𝑛 = 0, 1, 2, 3, . . . . . . (2)

In eqn(2) to get the value of 𝑦𝑛+1 we require 𝑦𝑛+1 on the RHS. To overcome this difficulty, we calculate
𝑦𝑛+1 using Euler’s formula (1) and then use it on the RHS of eqn(2) to get the refined 𝑦𝑛+1 on the LHS of
eqn(2). Here we predict the value of 𝑦𝑛+1 from the rough formula (1) and use it in (2) to correct the
value every time we improve using. Hence eqn(1) is a predictor and eqn(2) is a corrector. A predictor
formula is used to predict the value of 𝑦𝑛+1 at 𝑥𝑛+1 and a corrector formula is used to correct the error
and to improve that value of 𝑦𝑛+1

Milne’s Predictor-Corrector Formula:


A reasonably accurate method of solving differential equation numerically has been developed by W. E.
Milne. It uses two quadrature formulae, one for integrating ahead by extrapolation and the other for
checking the extrapolated value. We may derive these formulae by Newton’s forward difference
formula.
Suppose we want to solve
𝑑𝑦
= 𝑓(𝑥, 𝑦) 𝑦(𝑥0 ) = 𝑦0 . . . (1)
𝑑𝑥

Starting from 𝑦(𝑥0 ) = 𝑦0 , we have to estimate successively


𝑦1 = 𝑦(𝑥0 + ℎ) = 𝑦(𝑥1 )
𝑦2 = 𝑦(𝑥0 + 2ℎ) = 𝑦(𝑥2 )
𝑦3 = 𝑦(𝑥0 + 3ℎ) = 𝑦(𝑥3 )
. . . . .
Where ℎ is a suitable accepted spacing, which is very small
By Newton’s forward interpolation formula, we have

Dr. Kwami, A. M (Not for sale) Page 57


𝑦 = 𝑦0 + 𝑢∆𝑦0 + 𝑢(𝑢−1)
2!
∆2 𝑦0 +
𝑢(𝑢−1)(𝑢−2) 3
3!
∆ 𝑦0 +
𝑢(𝑢−1)(𝑢−2)(𝑢−3) 4
4!
∆ 𝑦0 + . . .

2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢 5 −10𝑢4 +35𝑢3 −50𝑢2 +24𝑢


𝑦 = 𝑦0 + 𝑢∆𝑦0 + 𝑢 2−𝑢
! ∆ 𝑦0 +
2 𝑢
3!
∆3 0 𝑦 +𝑢 4!
∆4 0 𝑦 +𝑢 5!
∆5 0 𝑦 + . . . . . . (1)

Where 𝑢 = 𝑥−𝑥

0 ⇨ 𝑥 − 𝑥0 = 𝑢ℎ

Replacing 𝑦 to 𝑦 ′
2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢 5 −10𝑢4 +35𝑢3 −50𝑢2 +24𝑢
𝑦 ′ = 𝑦0′ + 𝑢∆𝑦0′ + 𝑢 2−𝑢 2 ′
! ∆ 𝑦0 +
𝑢
3!

∆3 0 𝑦 +𝑢 4!

∆4 0 𝑦 +𝑢 5!

∆5 0 𝑦 + . . . . . . (2)

Integrating (2) w.r.t. 𝑑𝑥 both sides from 𝑥0 to 𝑥4


𝑥 𝑥 2 3 −3𝑢2 +2𝑢 4 −6𝑢3 +11𝑢2−6𝑢 5 −10𝑢4 +35𝑢3 −50𝑢2+24𝑢
∫𝑥 𝑦 ′ 𝑑𝑥 = ∫𝑥 [𝑦0′ + 𝑢∆𝑦0′ + 𝑢 2−𝑢 2 ′ ′ ′ ′
4 4 𝑢
! ∆ 𝑦0 + 3!
∆3 𝑦0 +𝑢 4!
∆4 𝑦0 +𝑢 5!
∆5 𝑦0 + . . . ] 𝑑𝑥
0 0

𝑥 4 2 3 −3𝑢2+2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢 5 −10𝑢4+35𝑢3 −50𝑢2+24𝑢


𝑦]𝑥04 = ℎ ∫0 [𝑦0′ + 𝑢∆𝑦0′ + 𝑢 2−𝑢 2 ′
! ∆ 𝑦0 +
𝑢
3!

∆3 𝑦0 +𝑢 4!

∆4 𝑦0 +𝑢 5!

∆5 𝑦0 + . . . ] 𝑑𝑢

Since 𝑥 = 𝑥0 + 𝑢ℎ and 𝑑𝑥 = ℎ𝑑𝑢


4
2 3 2 4 5 3𝑢4 11𝑢3
⇨ 𝑦4 − 𝑦0 = ℎ [𝑢𝑦0′ + 𝑢2 ∆𝑦0′ + 12 ∆2(𝑢3 − 𝑢2 )𝑦0′ + 16 ∆3(𝑢4 − 𝑢3 + 𝑢2 )𝑦0′ + 1 4
24
∆ (𝑢5 − + − 3𝑢 2 ) 𝑦0′ . . . ]
2 3 0
384 704 48
= ℎ [4𝑦0′ + 16
2

𝑦 +
∆ 0
1 2 64
2

3
( − 16
2
)𝑦0′ + 1 3
6
∆ (64 − 64 + 16)𝑦0′ + 1 4
24
∆ ( 1024
5
− + − ) 𝑦0′ . . .]
1 3 1

= ℎ[4𝑦0′ + 8 ∆𝑦0′ + 20
3
′ 8 ′
∆2 𝑦0 + ∆3 𝑦0 +
3
14 4 ′
45
∆ 𝑦0 . . . ]

= ℎ[4𝑦0′ + 8 (𝐸−1)𝑦0′ + 20
3
′ 8 ′
(𝐸−1)2 𝑦0 + (𝐸−1)3 𝑦0 +
3
14 4 ′
45
∆ 𝑦0 . . . ]

= ℎ[4𝑦0′ + 8 (𝑦1′−𝑦0′) + 20
3
8
(𝑦2′ −2𝑦1′ +𝑦0′ ) + (𝑦3′ −3𝑦2′ +3𝑦1′ −𝑦0′ ) +
3
14 4 ′
45
∆ 𝑦0 . . . ]

14 4 ′
= ℎ[ (4−8+20 8 ′
3 −3)𝑦0 + (8−40 ′
3 +8)𝑦1 + (20 ′
3 −8)𝑦2 + 83𝑦3′ + 45
∆ 0 𝑦 . . .]

= ℎ[ 83𝑦1′ − 4 ′
3𝑦2 + 83𝑦3′ ] + 14
45
∆4 𝑦0 . . .


⇨ 𝑦4 − 𝑦0 = 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ] + 14
45
∆4 𝑦0 . . . . . . (3)

Taking into account only up to the third order we have


𝑦4 − 𝑦0 = 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ] . . . (4)
⇨ 𝑦4 = 𝑦0 + 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ]
𝑦4 = 𝑦0 + 4ℎ
3
[ 2𝑓1 − 𝑓2 + 2𝑓3 ]
5
The error committed in (4) is 14ℎ
45

∆4 𝑦0 , and this can be proved to be
14ℎ
45
𝑦 (𝑣) (𝜉) where 𝑥0 < 𝜉 < 𝑥4 since

∆ = 𝐸 − 1 = 𝑒 ℎ𝐷 − 1 for small values of ℎ


5
∴ the error = 14ℎ
45
𝑦 (𝑣) (𝜉) and eqn(3) becomes
5
𝑦4 − 𝑦0 = 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ] + 14ℎ
45
𝑦 (𝑣) (𝜉) . . . (5)

And in general
5
𝑦𝑛+1 = 𝑦𝑛−3 + 4ℎ
3
[ 2𝑦𝑛−2
′ − ′
𝑦𝑛−1 + 2𝑦𝑛′ ] + 14ℎ
45
𝑦 (𝑣) (𝜉1 ) where 𝑥𝑛−3 < 𝜉1 < 𝑥𝑛+1 . . . (6)

Equation (6) is called Milne’s predictor formula


To get Milne’s corrector formula integrate eqn(2) w.r.t. 𝑑𝑥 from 𝑥0 to 𝑥2
𝑥2 𝑥2
𝑢2 −𝑢 2 ′ 𝑢3 −3𝑢2 +2𝑢 3 ′ 𝑢4 −6𝑢3 +11𝑢2 −6𝑢 4 ′ 𝑢5 −10𝑢4 +35𝑢3 −50𝑢2 +24𝑢 5 ′
∫ 𝑦 ′ 𝑑𝑥 = ∫ [𝑦0′ + 𝑢∆𝑦0′ + 2!
∆ 𝑦0 + 3!
∆ 𝑦0 + 4!
∆ 𝑦0 + 5!
∆ 𝑦0 + . . . ] 𝑑𝑥
𝑥0 𝑥0

Dr. Kwami, A. M (Not for sale) Page 58


𝑥 2 2 3 −3𝑢2+2𝑢 4 −6𝑢3 +11𝑢2 −6𝑢 5 −10𝑢4+35𝑢3 −50𝑢2+24𝑢
𝑦]𝑥02 = ℎ ∫0 [𝑦0′ + 𝑢∆𝑦0′ + 𝑢 2−𝑢 2 ′
! ∆ 𝑦0 +
𝑢
3!

∆3 𝑦0 +𝑢 4!

∆4 𝑦0 +𝑢 5!

∆5 𝑦0 + . . . ] 𝑑𝑢

Since 𝑥 = 𝑥0 + 𝑢ℎ and 𝑑𝑥 = ℎ𝑑𝑢


2
2 3 2 4 5 3𝑢4 11𝑢3
⇨ 𝑦2 − 𝑦0 = ℎ [𝑢𝑦0′ + 𝑢2 ∆𝑦0′ + 12 ∆2(𝑢3 − 𝑢2 )𝑦0′ + 16 ∆3(𝑢4 − 𝑢3 + 𝑢2 )𝑦0′ + 1 4
24
∆ (𝑢5 − + − 3𝑢 2 ) 𝑦0′ . . . ]
2 3 0

= ℎ[ 2𝑦0′ + 4
2
𝑦 +
∆ 0
1 2 8
2

3
( − 4
2
)𝑦0′ + 1 3
6
∆ (4 − 8 + 4)𝑦0′ + . . .]
= ℎ[ 2𝑦0′ + 42 (𝐸−1)𝑦0′ + 12 (𝐸−1)2(83 − 42)𝑦0′ + 16 (𝐸−1)3(4 − 8 + 4)𝑦0′ + . . . ]
= ℎ[ 2𝑦0′ + 2 (𝐸−1)𝑦0′ + 13 (𝐸−1)2𝑦0′ − 90
1 4 ′
∆ 𝑦0 . . . ]

1 4 ′
= ℎ[ 2𝑦0′ + 2 (𝑦1′−𝑦0′ ) + 13 (𝑦2′−2𝑦1′+𝑦0′) − 90 ∆ 𝑦0 . . . ]

ℎ 4 ′
⇨ 𝑦2 − 𝑦0 = ℎ3[ 𝑦0′ + 4𝑦1′ + 𝑦2′ ] − 90 ∆ 𝑦0 + . . . . . . (7)

Taking into account only up to the third order we have


𝑦2 − 𝑦0 = ℎ3[ 𝑦0′ + 4𝑦1′ + 𝑦2′ ] . . . (8)
⇨ 𝑦2 = 𝑦0 + ℎ3[ 𝑦0′ + 4𝑦1′ + 𝑦2′ ]

𝑦2 = 𝑦0 + ℎ3[ 𝑓0 + 4𝑓1 + 𝑓2 ]
ℎ5
The error committed in (7) is −
ℎ 4 ′
90
∆ 0 𝑦 + . . . , and this can be proved to be 90
𝑦 (𝑣) (𝜉) where 𝑥0 < 𝜉 < 𝑥2

since ∆= 𝐸 − 1 = 𝑒 ℎ𝐷 − 1 for small values of ℎ


5
∴ the error = ℎ90 𝑦 (𝑣) (𝜉) and eqn(8) becomes
5
𝑦2 = 𝑦0 + ℎ3[ 𝑦0′ + 4𝑦1′ + 𝑦2′ ] + ℎ90 𝑦 (𝑣) (𝜉) . . . (9)
And in general
5
𝑦𝑛+1 = 𝑦𝑛−1 + ℎ3[ 𝑦𝑛−1
′ + 4 𝑦𝑛′ + 𝑦𝑛+1
′ ] + ℎ90 𝑦 (𝑣) (𝜉2 ) where 𝑥𝑛−1 < 𝜉2 < 𝑥𝑛+1 . . . (10)

Equation (10) is called Milne’s corrector formula


Hence Milne’s predict from
𝒚𝒏+𝟏 − 𝒚𝒏−𝟑 = 𝟒𝒉
𝟑
[ 𝟐𝒚′𝒏−𝟐 − 𝒚′𝒏−𝟏 + 𝟐𝒚′𝒏 ] . . . (11)

And correct from


𝒚𝒏+𝟏 = 𝒚𝒏−𝟏 + 𝒉𝟑[ 𝒚′𝒏−𝟏 + 𝟒 𝒚′𝒏 + 𝒚′𝒏+𝟏 ] . . . (12)
i.e.
𝒚𝒏+𝟏 = 𝒚𝒏−𝟏 + 𝒉𝟑[ 𝒇𝒏−𝟏 + 𝟒 𝒇𝒏 + 𝒇𝒏+𝟏 ]
𝑑𝑦 1
Example1: Using Milne’s method find 𝑦(2) if 𝑦(𝑥) is the solution of 𝑑𝑥
= (𝑥 + 𝑦) given that 𝑦(0) = 2,
2

𝑦(0.5) = 2.636, 𝑦(1) = 3.595 and 𝑦(1.5) = 4.968

Solution:
Here 𝑥0 = 0, 𝑥1 = 0.5 𝑥2 = 1.0 𝑥3 = 1.5 𝑥4 = 2.0 ℎ = 0.5 𝑦0 = 2 𝑦1 = 2.636, 𝑦2 = 3.595 𝑦3 = 4.968
𝑓(𝑥, 𝑦) = 12(𝑥 + 𝑦) = 𝑦 ′ . . . (1)

By Milne’s predictor formula


𝑦𝑛+1 = 𝑦𝑛−3 + 4ℎ
3
[ 2𝑦𝑛−2
′ − ′
𝑦𝑛−1 + 2𝑦𝑛′ ]

Dr. Kwami, A. M (Not for sale) Page 59


𝑦4 − 𝑦0 = 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ] . . . (2)

From eqn.(1)
𝑦1′ = 12(𝑥1 + 𝑦1 ) = 12(0.5 + 2.636) = 1.5680
𝑦2′ = 12(𝑥2 + 𝑦2 ) = 12(1.0 + 3.595) = 2.2975
𝑦3′ = 12(𝑥3 + 𝑦3 ) = 12(1.5 + 4.968) = 3.2340

∴ 𝑦4 = 2 + 4(0.5)
3
[ 2(1.5680) − (2.2975) + 2(3.2340) ] = 6.8710

Using Milne’s corrector


𝑦𝑛+1 = 𝑦𝑛−1 + ℎ3[ 𝑦𝑛−1
′ + 4 𝑦𝑛′ + 𝑦𝑛+1
′ ]
𝑦4 = 𝑦2 + ℎ3[ 𝑦2′ + 4 𝑦3′ + 𝑦4′ ] . . . (3)
𝑦4′ 1 1
= (𝑥4 + 𝑦4 ) = (2.0 + 6.8710) = 4.4355
2 2

Using eqn(3) we have


𝑦4 = 3.595 + 0.5
3
[(2.2975) + 4(3.2340) + 4.4355 ] = 6.8732

∴ corrected value of 𝑦 at 𝑥 = 2 is 6.8732

Example: Using Milne’s method find 𝑦(4.4) given 5𝑥𝑦 ′ + 𝑦 2 − 2 = 0 given that 𝑦(4.0) = 1, 𝑦(4.1) =
1.0049, 𝑦(4.2) = 1.0097 and 𝑦(4.3) = 1.0143

Solution:
2
𝑦 ′ = 2−𝑦
5𝑥
𝑥0 = 4.0, 𝑥1 = 4.1 𝑥2 = 4.2 𝑥3 = 4.3 𝑥4 = 4.4 ℎ = 0.1 𝑦0 = 1.0000 𝑦1 = 1.0049, 𝑦2 = 1.0097
𝑦3 = 1.0143
2
𝑓(𝑥, 𝑦) = 2−𝑦
5𝑥
= 𝑦′ . . . (1)

By Milne’s predictor formula 𝑦𝑛+1 = 𝑦𝑛−3 + 4ℎ


3
[ 2𝑦𝑛−2
′ − ′
𝑦𝑛−1 + 2𝑦𝑛′ ]

𝑦4 = 𝑦0 + 4ℎ
3
[ 2𝑦1′ − 𝑦2′ + 2𝑦3′ ]

From eqn.(1)
2−𝑦12 2−(1.0049)2 2−𝑦22 2−(1.0097)2 2−𝑦32 2−(1.0143)2
𝑦1′ = = = 0.0493 𝑦2′ = = = 0.0467 𝑦3′ = = = 0.0452
5𝑥1 5(4.1) 5𝑥2 5(4.2) 5𝑥3 5(4.3)

∴ 𝑦4 = 1 + 4(0.1)
3
[ 2(0.0493) − (0.0467) + 2(0.0452) ] = 1.01897

Using Milne’s corrector


𝑦𝑛+1 = 𝑦𝑛−1 + ℎ3[ 𝑦𝑛−1
′ + 4 𝑦𝑛′ + 𝑦𝑛+1
′ ]
𝑦4 = 𝑦2 + ℎ3[ 𝑦2′ + 4 𝑦3′ + 𝑦4′ ] . . . (3)
2−𝑦42 2−(1.01897)2
𝑦4′ = = = 0.0437
5𝑥4 5(4.4)

Using eqn(3) we have


𝑦4 = 1.0097 + 0.1
3
[(0.0467) + 4(0.0452) + (0.04374) ] = 1.01874

∴ corrected value of 𝑦 at 𝑥 = 4.4 is 1.01874

Dr. Kwami, A. M (Not for sale) Page 60


𝑑𝑦 1
Exercise: Given 𝑦 ′ = 𝑑𝑥 = 2 (1 + 𝑥 2 )𝑦 2 , 𝑦(0.0) = 1.00, 𝑦(0.1) = 1.06, 𝑦(0.2) = 1.12 and 𝑦(0.3) = 1.21

evaluate 𝑦(0.4)Using Milne’s predictor corrector method

Adams-Bash forth (Adam’s) Predictor-Corrector Formula:


We consider an initial value problem
𝑦 ′ = 𝑓(𝑥, 𝑦) 𝑦(𝑥𝑜 ) = 𝑦𝑜 . . . (1)
With 𝑓 such that the problem has a unique solution on some open interval containing 𝑥𝑜 . We integrate

𝑦 ′ = 𝑓(𝑥, 𝑦) from 𝑥𝑛 to 𝑥𝑛+1 (𝑥𝑛 + ℎ). This gives


𝑥𝑛+1 𝑥
∫𝑥 𝑦 ′ 𝑑𝑥 = 𝑦𝑛+1 − 𝑦𝑛 = ∫𝑥 𝑛+1 𝑓(𝑥, 𝑦(𝑥)) 𝑑𝑥
𝑛 𝑛

We now replace 𝑓(𝑥, 𝑦(𝑥)) by an interpolation polynomial 𝑝(𝑥) so that we can later integrate. This gives
an approximation
𝑥
𝑦𝑛+1 = 𝑦𝑛 + ∫𝑥 𝑛+1 𝑝(𝑥) 𝑑𝑥 . . . (2)
𝑛

Different choices of 𝑝(𝑥) now produces different methods. We explain the principle by considering a
polynomial of degree three 𝑝3 (𝑥) at equal distance 𝑥𝑛 , 𝑥𝑛−1 , 𝑥𝑛−2 , 𝑥𝑛−3 with
𝑓𝑛 = 𝑓(𝑥𝑛 , 𝑦𝑛 )
𝑓𝑛−1 = 𝑓(𝑥𝑛−1 , 𝑦𝑛−1 )
} . . . (3)
𝑓𝑛−2 = 𝑓(𝑥𝑛−2 , 𝑦𝑛−2 )
𝑓𝑛−3 = 𝑓(𝑥𝑛−3 , 𝑦𝑛−3 )
This will lead to a practically useful formula. We can obtain 𝑝3 (𝑥) from Newton’s backward difference
formula
𝑝3 (𝑥) = 𝑓𝑛 + 𝑣∇𝑓𝑛 + 12𝑣(𝑣 + 1)∇2 𝑓𝑛 + 16𝑣(𝑣 + 1)(𝑣 + 2)∇3 𝑓𝑛
𝑥−𝑥𝑛
Where 𝑣 = ℎ

We integrate 𝑝3 (𝑥) over 𝑥 from 𝑥𝑛 to 𝑥𝑛+1 , thus over 𝑣 from 0 to 1 since 𝑥 = 𝑥𝑛 + 𝑣ℎ and 𝑑𝑥 = ℎ𝑑𝑣
𝑥𝑛+1 1 1
1 1
∫ 𝑝3 (𝑥) 𝑑𝑥 = ℎ ∫ 𝑝3 (𝑥) 𝑑𝑣 = ℎ ∫ [𝑓𝑛 + 𝑣∇𝑓𝑛 + 2𝑣(𝑣 + 1)∇2 𝑓𝑛 + 6𝑣(𝑣 + 1)(𝑣 + 2)∇3 𝑓𝑛 ] 𝑑𝑣
𝑥𝑛 0 0

⇨ 𝑦𝑛+1 − 𝑦𝑛 = ℎ(𝑓𝑛 + ∇𝑓𝑛 + ∇ 𝑓 + 38∇3 𝑓𝑛 )


1
2
5 2
12 𝑛 . . . (4)

We replace the differences as


∇𝑓𝑛 = 𝑓𝑛 − 𝑓𝑛−1
∇2 𝑓𝑛 = 𝑓𝑛 − 2𝑓𝑛−1 + 𝑓𝑛−2
∇3 𝑓𝑛 = 𝑓𝑛 − 3𝑓𝑛−1 + 3𝑓𝑛−2 − 𝑓𝑛−3
Substituting these in eqn(4) and collecting like terms we have

𝑦𝑛+1 = 𝑦𝑛 + (55𝑓𝑛 − 59𝑓𝑛−1 + 37𝑓𝑛−2 − 9𝑓𝑛−3 ) . . . (5)
24

Equation (5) is called Adams-Bash forth (Adam’s) Predictor Formula:

Dr. Kwami, A. M (Not for sale) Page 61


Adams-Moulton Corrector Formula:
Adams-Moulton Formula are obtained if for 𝑝(𝑥) in eqn (2) above we choose a polynomial that
interpolate 𝑓(𝑥, 𝑦(𝑥)) at 𝑥𝑛+1 , 𝑥𝑛 , 𝑥𝑛−1 , 𝑥𝑛−2
We explain the principle by considering a polynomial of degree 𝑝3 (𝑥) three at equal distance 𝑥𝑛+1 , 𝑥𝑛 ,
𝑥𝑛−1 , 𝑥𝑛−2
𝑝3 (𝑥) = 𝑓𝑛+1 + 𝑣∇𝑓𝑛+1 + 12𝑣(𝑣 + 1)∇2 𝑓𝑛+1 + 16𝑣(𝑣 + 1)(𝑣 + 2)∇3 𝑓𝑛+1
𝑥−𝑥𝑛+1
Where 𝑣 = ℎ

We integrate 𝑝3 (𝑥) over 𝑥 from 𝑥𝑛 to 𝑥𝑛+1 , thus over 𝑣 from 0 to 1 since 𝑥 = 𝑥𝑛 + 𝑣ℎ and 𝑑𝑥 = ℎ𝑑𝑣
𝑥𝑛+1 1 1
1 1
∫ 𝑝3 (𝑥) 𝑑𝑥 = ℎ ∫ 𝑝3 (𝑥) 𝑑𝑣 = ℎ ∫ [𝑓𝑛+1 + 𝑣∇𝑓𝑛+1 + 2𝑣(𝑣 + 1)∇2 𝑓𝑛+1 + 6𝑣(𝑣 + 1)(𝑣 + 2)∇3 𝑓𝑛+1 ] 𝑑𝑣
𝑥𝑛 0 0
1 1 2 1 3
⇨ 𝑦𝑛+1 − 𝑦𝑛 = ℎ(𝑓𝑛+1 − ∇𝑓𝑛+1 − 12
2
∇ 𝑓𝑛 − 24 ∇ 𝑓𝑛 ) . . . (6)

We replace the differences as


∇𝑓𝑛+1 = 𝑓𝑛+1 − 𝑓𝑛
∇2 𝑓𝑛+1 = 𝑓𝑛+1 − 2𝑓𝑛 + 𝑓𝑛−1
∇3 𝑓𝑛+1 = 𝑓𝑛+1 − 3𝑓𝑛 + 3𝑓𝑛−1 − 𝑓𝑛−2
Substituting these in eqn(6) and collecting like terms we have
ℎ ∗
𝑦𝑛+1 = 𝑦𝑛 + (9𝑓𝑛+1 + 19𝑓𝑛 − 5𝑓𝑛−1 + 𝑓𝑛−2 ) . . . (7)
24

Equation (7) is called Adams-Moulton corrector Formula:

𝑑𝑦 1
Example: Find 𝑦(2) given that 𝑑𝑥
= (𝑥 + 𝑦), 𝑦(0) = 2, 𝑦(0.5) = 2.636, 𝑦(1) = 3.595 and 𝑦(1.5) = 4.968
2

by Adam’s method
Solution:
We have
𝑦0′ = 12(𝑥0 + 𝑦0 ) = 12(0.0 + 2.000) = 1.0000
𝑦1′ = 12(𝑥1 + 𝑦1 ) = 12(0.5 + 2.636) = 1.5680
𝑦2′ = 12(𝑥2 + 𝑦2 ) = 12(1.0 + 3.595) = 2.2975
𝑦3′ = 12(𝑥3 + 𝑦3 ) = 12(1.5 + 4.968) = 3.2340
By Adam’s predictor formula

𝑦𝑛+1 = 𝑦𝑛 + (55𝑦𝑛′ − 59𝑦𝑛−1
′ ′
+ 37𝑦𝑛−2 ′
− 9𝑦𝑛−3 )
24

𝑦4 = 𝑦3 + 24 (55𝑦3′ − 59𝑦2′ + 37𝑦1′ − 9𝑦0′ )
𝑦4 = 4.968 + (0.5)
24
[55(3.2340) − 59(2.2975) + 37(1.5680) − 9(1.0000)] = 6.8798
𝑦4′ = 12(𝑥4 + 𝑦4 ) = 12(2.0 + 6.8708) = 4.4354
By Adam’s corrector formula we have

Dr. Kwami, A. M (Not for sale) Page 62


ℎ ∗
𝑦𝑛+1 = 𝑦𝑛 + (9𝑓𝑛+1 + 19𝑓𝑛 − 5𝑓𝑛−1 + 𝑓𝑛−2 )
24
ℎ ′
𝑦𝑛+1 = 𝑦𝑛 + (9𝑦𝑛+1 + 19𝑦𝑛′ − 5𝑦𝑛−1
′ ′
+ 𝑦𝑛−2 )
24

𝑦4 = 𝑦3 + (9𝑦4′ + 19𝑦3′ − 5𝑦2′ + 𝑦1′ )
24
(0.5)
𝑦4 = 4.968 + [9(4.4354) + 19(3.2340) − 5(2.2975) + (1.5680)] = 6.8731
24

𝑑𝑦 1
Example: Find 𝑦(0.4) given that 𝑑𝑥
= 𝑥𝑦, 𝑦(0.0) = 1, 𝑦(0.1) = 1.010, 𝑦(0.2) = 1.022 and 𝑦(0.3) = 1.023
2
using Adam’s method
Solution:
𝑥0 = 0.0, 𝑥1 = 0.1 𝑥2 = 0.2 𝑥3 = 0.3 𝑥4 = 0.4 ℎ = 0.1 𝑦0 = 1.000 𝑦1 = 1.010, 𝑦2 = 1.022 𝑦3 = 1.023
𝑦4 = ?
We have
𝑦0′ = 12(𝑥0 𝑦0 ) = 12(0.0 ∗ 1.000) = 0.0000
𝑦1′ = 12(𝑥1 𝑦1 ) = 12(0.1 ∗ 1.010) = 0.0505
𝑦2′ = 12(𝑥2 𝑦2 ) = 12(0.2 ∗ 1.022) = 0.1022
𝑦3′ = 12(𝑥3 𝑦3 ) = 12(0.3 ∗ 1.023) = 0.1535
By Adam’s predictor method

𝑦𝑛+1 = 𝑦𝑛 + (55𝑦𝑛′ − 59𝑦𝑛−1
′ ′
+ 37𝑦𝑛−2 ′
− 9𝑦𝑛−3 )
24

𝑦4 = 𝑦3 + 24 (55𝑦3′ − 59𝑦2′ + 37𝑦1′ − 9𝑦0′ )
𝑦4 = 1.023 + (0.1)
24
[55(0.1535) − 59(0.1022) + 37(0.0505) − 9(0.0000)] = 1.0408
𝑦4′ = 12(𝑥4 𝑦4 ) = 12(0.4 ∗ 1.0408) = 0.20816
By Adam’s corrector formula we have
ℎ ∗
𝑦𝑛+1 = 𝑦𝑛 + (9𝑓𝑛+1 + 19𝑓𝑛 − 5𝑓𝑛−1 + 𝑓𝑛−2 )
24
ℎ ′
𝑦𝑛+1 = 𝑦𝑛 + (9𝑦𝑛+1 + 19𝑦𝑛′ − 5𝑦𝑛−1
′ ′
+ 𝑦𝑛−2 )
24

𝑦4 = 𝑦3 + (9𝑦4′ + 19𝑦3′ − 5𝑦2′ + 𝑦1′ )
24
(0.1)
𝑦4 = 1.023 + [9(0.20816) + 19(0.1535) − 5(0.1022) + (0.0505)] = 1.0410
24

𝑑𝑦 1
Exercise: Find 𝑦(0.1), 𝑦(0.2), 𝑦(0.3) given that 𝑑𝑥 = 2 𝑥𝑦 + 𝑦 2 , 𝑦(0.0) = 1 using Runge-Kutta method and

hence using Adam’s method find 𝑦(0.4)

Systems of equations and higher order equations:


*
*

Dr. Kwami, A. M (Not for sale) Page 63


Difference Equations:
Introduction: Our interest in difference equation is twofold. First, they do occur in many applications,
and second, numerous methods for the approximate solution of differential equations involve replacing
them by difference equations as substitutes.

Definition: An equation which expresses a relation between the independent variable, the dependent
variables and the successive differences of the dependent variable is called difference equation

Example 1:
𝑖) ∆2 𝑦𝑘 − 2∆𝑦𝑘 + 𝑦𝑘 = 0, 𝑖𝑖) ∆3 𝑦𝑘 − 4∆2 𝑦𝑘 + 7𝑦𝑘 = 𝑥 2 + cos 𝑥 + 7,
𝑖𝑖𝑖) ∆3 𝑦𝑘 − 3∆2 𝑦𝑘 + ∆𝑦𝑘 − 𝑦𝑘 = cos 2𝑥

Note: The combinations of differences are not always convenient, it may even obscure information. As a
result, difference equations are usually written directly in terms of 𝑦𝑘

Using the relation ∆= 𝐸 − 1, we can write


∆𝑦𝑘 = (𝐸 − 1)𝑦𝑘 = 𝐸𝑦𝑘 − 𝑦𝑘 = 𝑦𝑘+1 − 𝑦𝑘
∆2 𝑦𝑘 = (𝐸 − 1)2 𝑦𝑘 = (𝐸 2 − 2𝐸 + 1)𝑦𝑘 = 𝐸 2 𝑦𝑘 − 2𝐸𝑦𝑘 + 𝑦𝑘 = 𝑦𝑘+2 − 2𝑦𝑘+1 + 𝑦𝑘
∆3 𝑦𝑘 = (𝐸 − 1)3 𝑦𝑘 = (𝐸 3 − 3𝐸 2 + 3𝐸 − 1)𝑦𝑘 = 𝐸 3 𝑦𝑘 − 3𝐸 2 𝑦𝑘 + 3𝐸𝑦𝑘 + 𝑦𝑘 = 𝑦𝑘+3 − 3𝑦𝑘+2 + 𝑦𝑘+1 − 𝑦𝑘

Using the relation above the difference equations in example 1 can be written as
𝑖) ∆2 𝑦𝑘 − 2∆𝑦𝑘 + 𝑦𝑘 = (𝑦𝑘+2 − 2𝑦𝑘+1 + 𝑦𝑘 ) − 2(𝑦𝑘+1 − 𝑦𝑘 ) + 𝑦𝑘 = 0
𝑦𝑘+2 − 4𝑦𝑘+1 + 4𝑦𝑘 = 0

𝑖𝑖) ∆3 𝑦𝑘 − 4∆2 𝑦𝑘 + 7𝑦𝑘 = 𝑥 2 + cos 𝑥 + 7


(𝑦𝑘+3 − 3𝑦𝑘+2 + 3𝑦𝑘+1 − 𝑦𝑘 ) − 4(𝑦𝑘+2 − 2𝑦𝑘+1 + 𝑦𝑘 ) + 7𝑦𝑘 = 𝑥 2 + cos 𝑥 + 7
𝑦𝑘+3 − 7𝑦𝑘+2 − 5𝑦𝑘+1 + 2𝑦𝑘 = 𝑥 2 + cos 𝑥 + 7

𝑖𝑖𝑖) ∆3 𝑦𝑘 − 3∆2 𝑦𝑘 + ∆𝑦𝑘 − 𝑦𝑘 = cos 2𝑥


(𝑦𝑘+3 − 3𝑦𝑘+2 + 3𝑦𝑘+1 − 𝑦𝑘 ) − 3(𝑦𝑘+2 − 2𝑦𝑘+1 + 𝑦𝑘 ) + (𝑦𝑘+1 − 𝑦𝑘 ) − 𝑦𝑘 = cos 2𝑥
𝑦𝑘+3 − 6𝑦𝑘+2 + 10𝑦𝑘+1 = cos 2𝑥

Order and degree of a difference equation:


Definition: The order of a difference equation written in terms of 𝑦𝑘 is the difference between the
highest and the lowest subscript of 𝑦
Thus the order of
𝑖) 𝑦𝑘+3 − 4𝑦𝑘+2 = 𝑥 2 + 9 is (𝑘 + 3) − (𝑘 + 2) = 1
𝑖𝑖) 𝑦𝑘+2 − 4𝑦𝑘+1 + 4𝑦𝑘 = 0 is (𝑘 + 2) − 𝑘 = 2
𝑖𝑖𝑖) 𝑦𝑘+3 − 5𝑦𝑘+2 + 𝑦𝑘+1 = 5𝑥 2 is (𝑘 + 3) − (𝑘 + 1) = 2
𝑖𝑣) 𝑦𝑘+3 − 7𝑦𝑘+2 − 5𝑦𝑘+1 + 2𝑦𝑘 = 10𝑥 is (𝑘 + 3) − 𝑘 = 3

Dr. Kwami, A. M (Not for sale) Page 64


Definition: The degree of a difference equation written in terms of 𝑦𝑘 is the highest power of the 𝑦 ʹ 𝑠.
Thus the degree of
𝑖) 𝑦𝑘+3 − 5𝑦𝑘+2 + 𝑦𝑘+1 = 5𝑥 2 is 1
𝑖𝑖) 𝑦𝑘+1 (𝑦𝑘+2 )5 − 5𝑦𝑘+2 + (𝑦𝑘+2 )3 = cos 2𝑥 is 5

Note: The study of difference equation is analogous to the study of differential equation.

→ Formation of a difference equation:


The difference equations can be formed by differencing the ordinary algebraic equation and eliminating
arbitrary constants or can be obtained directly from some physical phenomena

Example: Form a difference equation of the lowest order by eliminating the arbitrary constants
𝑖) 𝑦 = 𝐶2𝑥 + 𝑥3𝑥−1 𝑖𝑖) 𝑦 = 𝐴2𝑥 + 𝐵3𝑥 𝑖𝑖𝑖) 𝑦 = (𝐴 + 𝐵𝑥)2𝑥
Solution:
𝑖) 𝑦𝑥 = 𝐶2𝑥 + 𝑥3𝑥−1
𝑦𝑥+1 = 𝐶2𝑥+1 + (𝑥 + 1)3𝑥 . . . (2)
Eqn.(1) × 2
2𝑦𝑥 = 𝐶2𝑥+1 + 2𝑥3𝑥−1 . . . (3)
Eqn.(3) −eqn.(2)
2𝑦𝑥 − 𝑦𝑥+1 = 𝐶2𝑥+1 + 2𝑥3𝑥−1 − 𝐶2𝑥+1 − (𝑥 + 1)3𝑥 = −(𝑥 + 3)3𝑥−1
⇒ 2𝑦𝑥 − 𝑦𝑥+1 = −(𝑥 + 3)3𝑥−1
⇒ 3𝑦𝑥+1 − 6𝑦𝑥 = (𝑥 + 3)3𝑥
Is the required equation

𝑖𝑖) 𝑦𝑥 = 𝐴2𝑥 + 𝐵3𝑥 . . . (1)


𝑦𝑥+1 = 𝐴2𝑥+1 + 𝐵3𝑥+1 . . . (2)
𝑥+2 𝑥+2
𝑦𝑥+2 = 𝐴2 + 𝐵3 . . . (3)
Eqn.(1) × 2
2𝑦𝑥 = 2𝐴2𝑥 + 2𝐵3𝑥 = 𝐴2𝑥+1 + 2𝐵3𝑥 . . . (4)
Eqn.(4) −eqn.(2)
2𝑦𝑥 − 𝑦𝑥+1 = (𝐴2𝑥+1 + 2𝐵3𝑥 ) − (𝐴2𝑥+1 + 𝐵3𝑥+1 ) = 𝐴2𝑥+1 + 2𝐵3𝑥 − 𝐴2𝑥+1 + 𝐵3𝑥+1 = −𝐵3𝑥
⇒ 2𝑦𝑥 − 𝑦𝑥+1 = −𝐵3𝑥 . . . (5)
Similarly
2𝑦𝑥+1 − 𝑦𝑥+2 = −𝐵3𝑥+1 . . . (6)
Divide eqn. (5) by eqn. (6) and cross multiply and simplify we have
𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
Which is the required equation

Dr. Kwami, A. M (Not for sale) Page 65


𝑖𝑖𝑖) 𝑦𝑥 = (𝐴 + 𝐵𝑥)2𝑥 . . . (1)
𝑥+1 𝑥+1 𝑥
𝑦𝑥+1 = (𝐴 + 𝐵(𝑥 + 1))2 = (𝐴 + 𝐵𝑥 + 𝐵)2 = 2(𝐴 + 𝐵𝑥 + 𝐵)2
⇒ 𝑦𝑥+1 = 2(𝐴 + 𝐵𝑥 + 𝐵)2𝑥 . . . (2)
𝑦𝑥+2 = (𝐴 + 𝐵(𝑥 + 2))2𝑥+2 = (𝐴 + 𝐵𝑥 + 2𝑏)2𝑥+2 = 4(𝐴 + 𝐵𝑥 + 2𝐵)2𝑥
⇒ 𝑦𝑥+2 = 4(𝐴 + 𝐵𝑥 + 2𝐵)2𝑥 . . . (3)
Using equations (1), (2) and (3) we can eliminate the arbitrary constants to obtain
𝑦𝑥+2 − 4𝑦𝑥+1 + 4𝑦𝑥 = 0
Which is the required equation

Note: We can observe that eliminating one arbitrary constant yield a difference equation of order one, eliminating
two arbitrary constants yield a difference equation of order two, and of course eliminating 𝑛 arbitrary constants
yield a difference equation of order 𝑛

→ Solution of a difference equation:


Definition: A solution of a difference equation will be a sequence of 𝑦𝑘 values for which the equation is
true, for some set of consecutive integers 𝑘. The nature of a difference equation allows solution
sequences to be computed recursively.

→ General solution:
Definition: A general solution of a difference equation of order 𝑛 is a solution which contains 𝑛 arbitrary
constants or 𝑛 arbitrary functions which are periodic of period equal to the interval of differencing

→ Particular solution:
A particular solution of a difference equation is a solution obtained from the general solution by giving
particular values to the arbitrary constants

Linear n-order difference equation:


Definition: Any equation of the form
𝑎0 𝑦𝑘+𝑛 + 𝑎1 𝑦𝑘+𝑛−1 + 𝑎2 𝑦𝑘+𝑛−2 + 𝑎3 𝑦𝑘+𝑛−3 + . . . +𝑎𝑛 𝑦𝑘 = 𝜑(𝑥) . . . (1)
𝑎0 𝐸 𝑛 𝑦𝑘 + 𝑎1 𝐸 𝑛−1 𝑦𝑘 + 𝑎2 𝐸 𝑛−2 𝑦𝑘 + 𝑎3 𝐸 𝑛−3 𝑦𝑘 + . . . +𝑎𝑛 𝑦𝑘 = 𝜑(𝑥)
(𝑎0 𝐸 𝑛 + 𝑎1 𝐸 𝑛−1 + 𝑎2 𝐸 𝑛−2 + 𝑎3 𝐸 𝑛−3 + . . . +𝑎𝑛 )𝑦𝑘 = 𝜑(𝑥) . . . (2)
𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , . . . 𝑎𝑛 and 𝜑(𝑥) are known functions of 𝑥 is called 𝑛𝑡ℎ order non-homogeneous
linear difference equation in 𝑦𝑘 .
Note: In a linear difference equation, the successive values of 𝑦 viz. 𝑦𝑘 , 𝑦𝑘+1 , 𝑦𝑘+2 , 𝑦𝑘+3 , . . . occur in the
equation only in the first degree and are not multiplied together
In particular,
If 𝑛 = 1 𝑎0 𝑦𝑘+1 + 𝑎1 𝑦𝑘 = (𝑎0 𝐸 + 𝑎1 )𝑦𝑘 = 𝜑(𝑥)
If 𝑛 = 2 𝑎0 𝑦𝑘+2 + 𝑎1 𝑦𝑘+1 + 𝑎2 𝑦𝑘 = (𝑎0 𝐸 2 + 𝑎1 𝐸 + 𝑎2 )𝑦𝑘 = 𝜑(𝑥)
If 𝑛 = 3 𝑎0 𝑦𝑘+3 + 𝑎1 𝑦𝑘+2 + 𝑎2 𝑦𝑘+1 + 𝑎3 𝑦𝑘 = (𝑎0 𝐸 3 + 𝑎1 𝐸 2 + 𝑎2 𝐸 + 𝑎3 )𝑦𝑘 = 𝜑(𝑥)
. . . . . . . . . . . . . . .

Dr. Kwami, A. M (Not for sale) Page 66


Equation (1) or (2) can be written as
𝑓(𝐸)𝑦𝑘 = 𝜑(𝑥) . . . (3)
𝑛 𝑛−1 𝑛−2 𝑛−3
Where 𝑓(𝐸) = (𝑎0 𝐸 + 𝑎1 𝐸 + 𝑎2 𝐸 + 𝑎3 𝐸 + . . . +𝑎𝑛 ) is a polynomial in 𝐸.
If 𝜑(𝑥) = 0 equation (3) take the form
𝑓(𝐸)𝑦𝑘 = 0 . . . (4)
Equation (4) is called the homogeneous equation corresponding to (3)

Note: The solution of the non-homogeneous linear equation (3) depends upon the corresponding homogeneous
linear equation (4)

Properties of the solution:


𝑖) If 𝑦𝑘 = 𝑓1 (𝑥) is a solution of equation (4), then 𝑦𝑘 = 𝐶1 𝑓1 (𝑥) is also a solution of equation (4)
𝑖𝑖) If 𝑦𝑘 = 𝑓1 (𝑥), 𝑦𝑘 = 𝑓2 (𝑥), 𝑦𝑘 = 𝑓3 (𝑥), . . . 𝑦𝑘 = 𝑓𝑛 (𝑥) are 𝑛 independent solutions of a
equation (4), then 𝑦𝑘 = ∑𝑛𝑖=1 𝐶𝑖 𝑓𝑖 (𝑥) is also a solution of equation (4)
𝑖𝑖𝑖) If 𝑦𝑘 = 𝑢𝑥 is a particular solution of equation (3), then 𝑦𝑘 = ∑𝑛𝑖=1 𝐶𝑖 𝑓𝑖 (𝑥) + 𝑢𝑘 is a general solution
of equation (3) 𝑦𝑘 = ∑𝑛𝑖=1 𝐶𝑖 𝑓𝑖 (𝑥) is called the complementary function of (3) 𝑦𝑘 = 𝐶𝐹 + 𝑃𝐼 is the
general solution of (3)

Note: If 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , . . . 𝑎𝑛 are constant in equation (2), then equation (2) is called a linear equation with
constant coefficients.

→ First we consider the case where 𝜑(𝑥) = 0


→ To find the solution of 𝑓(𝐸)𝑦𝑘 = 0 :
𝑓(𝐸)𝑦𝑘 = (𝑎0 𝐸 𝑛 + 𝑎1 𝐸 𝑛−1 + 𝑎2 𝐸 𝑛−2 + 𝑎3 𝐸 𝑛−3 + . . . +𝑎𝑛 )𝑦𝑘 = 0 . . . (1)
Replacing 𝐸 by 𝑎 in 𝑓(𝐸)
𝑓(𝑎)𝑦𝑘 = (𝑎0 𝑎𝑛 + 𝑎1 𝑎𝑛−1 + 𝑎2 𝑎𝑛−2 + . . . +𝑎𝑛 )𝑦𝑘 = 0
𝑓(𝑎) = (𝑎0 𝑎𝑛 + 𝑎1 𝑎𝑛−1 + 𝑎2 𝑎𝑛−2 + . . . +𝑎𝑛 ) = 0 is called the auxiliary equation of (1)

If the roots of 𝑓(𝑎) = 0 are 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , . . . 𝑎𝑛 then


𝑓(𝐸) = (𝐸 − 𝑎1 )(𝐸 − 𝑎2 )(𝐸 − 𝑎3 )(𝐸 − 𝑎4 )(𝐸 − 𝑎5 ) . . . (𝐸 − 𝑎𝑛 )
The corresponding homogeneous equation is 𝑓(𝐸)𝑦𝑘 = 0 is then
(𝐸 − 𝑎1 )(𝐸 − 𝑎2 )(𝐸 − 𝑎3 )(𝐸 − 𝑎4 )(𝐸 − 𝑎5 ) . . . (𝐸 − 𝑎𝑛 )𝑦𝑘 = 0 . . . (2)
If 𝑢(𝑥) satisfies (𝐸 − 𝑎1 )𝑦𝑘 = 0 then it will also satisfy
(𝐸 − 𝑎1 )(𝐸 − 𝑎2 )(𝐸 − 𝑎3 )(𝐸 − 𝑎4 )(𝐸 − 𝑎5 ) . . . (𝐸 − 𝑎𝑛 )𝑦𝑘 = 0
Hence the complete solution of (2) is composed of the component equations of the form
(𝐸 − 𝑎1 )𝑦𝑘 = 0, (𝐸 − 𝑎2 )𝑦𝑘 = 0, (𝐸 − 𝑎3 )𝑦𝑘 = 0, (𝐸 − 𝑎4 )𝑦𝑘 = 0 . . . (𝐸 − 𝑎𝑛 )𝑦𝑘 = 0
To solve (𝐸 − 𝑎1 )𝑦𝑘 = 0
i.e. 𝑦𝑘+1 − 𝑎1 𝑦𝑘 = 0 (3)

Dr. Kwami, A. M (Not for sale) Page 67


multiply both sides of equation (2) by 𝑎1−𝑘−1 we have
−(𝑘+1)
𝑎1−𝑘−1 𝑦𝑘+1 − 𝑎1−𝑘 𝑦𝑘 = 0 or 𝑎1 𝑦𝑘+1 − 𝑎1−𝑘 𝑦𝑘 = 0
i.e. ∆(𝑎1−𝑘 𝑦𝑘 ) = 0
therefore 𝑎1−𝑘 𝑦𝑘 = 𝑐1
𝑦𝑘 = 𝑐1 𝑎1𝑘
i.e. (𝐸 − 𝑎1 )𝑦𝑘 = 0 has a solution 𝑦𝑘 = ∑𝑛𝑖=1 𝑐𝑖 𝑎𝑖𝑘

case1: If 𝑎1 , 𝑎2 , 𝑎3 , . . . 𝑎𝑛 are distinct


𝑦𝑘 = 𝑐1 𝑎1𝑘 + 𝑐2 𝑎2𝑘 + 𝑐3 𝑎3𝑘 + . . . +𝑐𝑛 𝑎𝑛𝑘 = ∑𝑛𝑖=1 𝑐𝑖 𝑎𝑖𝑘 is the complete solution of (2)

Case2: If 𝑎1 = 𝑎2 , then 𝑦𝑘 = ∑𝑛𝑖=1 𝑐𝑖 𝑎𝑖𝑘 cannot be the general solution since 𝑐1 + 𝑐2 = 𝑐 will mean that
there are only (𝑛 − 1) arbitrary constants.
To solve (𝐸 − 𝑎1 )2 𝑦𝑘 = 0 we follow the steps below
Let 𝑦𝑘 = 𝑣𝑘 𝑎1𝑘 be a solution
Then (𝐸 − 𝑎1 )2 𝑦𝑘 = 0
⇒ 𝑦𝑘+2 − 2𝑎1 𝑦𝑘+1 + 𝑎12 𝑦𝑘 = 0
⇒ 𝑣𝑘+2 𝑎1𝑘+2 − 2𝑎1 𝑣𝑘+1 𝑎1𝑘+1 + 𝑎12 𝑣𝑘 𝑎1𝑘 = 0
⇒ ( 𝑣𝑘+2 − 2𝑣𝑘+1 + 𝑣𝑘 )𝑎1𝑘+2 = 0
⇒ 𝑣𝑘+2 − 2𝑣𝑘+1 + 𝑣𝑘 = 0 since 𝑎1𝑘+2 ≠ 0
⇒ (𝐸 − 1)2 𝑣𝑘 = 0 ⇒ ∆2 𝑣𝑘 = 0
⇒ 𝑣𝑘 = 𝑐1 + 𝑐2 𝑥
⇒ 𝑦𝑘 = (𝑐1 + 𝑐2 𝑥 )𝑎1𝑘 is the solution of (𝐸 − 𝑎1 )2 𝑦𝑘 = 0

Therefore If 𝑎1 = 𝑎2 the complete solution of (2) is


𝑦𝑘 = (𝑐1 + 𝑐2 𝑥 )𝑎1𝑘 + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘
If 𝑎1 = 𝑎2 = 𝑎3 = . . . 𝑎𝑛 the complete solution of (2) is
𝑦𝑘 = (𝑐1 + 𝑐2 𝑥 + 𝑐3 𝑥 2 + 𝑐4 𝑥 3 + . . . . 𝑐𝑟 𝑥 𝑟−1 )𝑎𝑟𝑘

Case3: If 𝑎1 = 𝛼 + 𝑖𝛽, 𝑎2 = 𝛼 − 𝑖𝛽 , then the complete solution of (2) is


𝑦𝑘 = 𝑐1 (𝛼 + 𝑖𝛽)𝑘 + 𝑐2 (𝛼 − 𝑖𝛽)𝑘 + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘
= 𝑐1 [𝑟(cos 𝜃 + 𝑖 sin 𝜃)] 𝑥 + 𝑐2 [𝑟(cos 𝜃 − 𝑖 sin 𝜃)]𝑥 + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘
= 𝑟 𝑘 (𝑐1 cos 𝜃𝑥 + 𝑐2 sin 𝜃𝑥) + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘
Where 𝑟 = |𝛼 + 𝑖𝛽|; 𝜃 = tan−1 (𝛽𝛼)

Case4: If 𝑎1 = 𝑎2 = 𝛼 + 𝑖𝛽, 𝑎3 = 𝑎4 = 𝛼 − 𝑖𝛽 , then the complementary function is


𝑦𝑘 = 𝑐1 (𝛼 + 𝑖𝛽)𝑘 + 𝑐2 (𝛼 − 𝑖𝛽)𝑘 + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘
= 𝑟 𝑘 [(𝑐1 + 𝑐2 𝑥) cos 𝜃𝑥 + (𝑐3 + 𝑐4 𝑥) sin 𝜃𝑥] + 𝑐3 𝑎3𝑘 + 𝑐4 𝑎4𝑘 + 𝑐5 𝑎5𝑘 . . . 𝑐𝑛 𝑎𝑛𝑘

Dr. Kwami, A. M (Not for sale) Page 68


Example: Solve the following difference equations
𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0 𝑖𝑖) 𝑦𝑘+2 − 7𝑦𝑘+1 − 8𝑦𝑘 = 0
Solution:
𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑎2 − 5𝑎 + 6) = 0 is the auxiliary equation

Solving for 𝑎 we have 𝑎 = 2, or 𝑎 = 3


Hence 𝑦 = 𝐴2𝑥 + 𝐵3𝑥

𝑖𝑖) 𝑦𝑘+2 − 7𝑦𝑘+1 − 8𝑦𝑘 = 0


⇒ (𝐸 2 − 7𝐸 − 8)𝑦𝑘 = 0
⇒ (𝑎2 − 7𝑎 − 8) = 0 is the auxiliary equation

⇒ (𝑎 − 8)(𝑎 + 1) = 0 ⇒ 𝑎 = 8, or 𝑎 = −1
Hence 𝑦 = 𝐴8𝑘 + 𝐵(−1)𝑘

Example: Solve the following difference equations


𝑖) 𝑦𝑘+3 − 2𝑦𝑘+2 − 𝑦𝑘+1 + 2𝑦𝑘 = 0 𝑖𝑖) 𝑦𝑘+3 − 5𝑦𝑘+2 + 3𝑦𝑘+1 − 9𝑦𝑘 = 0
Solution:
𝑖) 𝑦𝑘+2 − 2𝑦𝑘+2 − 𝑦𝑘+1 + 2𝑦𝑘 = 0
⇒ (𝐸 3 − 2𝐸 2 − 𝐸 + 2)𝑦𝑘 = 0
⇒ (𝑎3 − 2𝑎2 − 𝑎 + 2) = 0 is the auxiliary equation

⇒ (𝑎 − 1)(𝑎 + 1)(𝑎 − 2) = 0 ⇒ 𝑎 = 1, or 𝑎 = −1 or 𝑎 = 2
Hence 𝑦 = 𝐴1𝑘 + 𝐵(−1)𝑘 + 𝐶2𝑘

𝑖𝑖) 𝑦𝑘+3 − 5𝑦𝑘+2 + 3𝑦𝑘+1 − 9𝑦𝑘 = 0


⇒ (𝐸 3 − 5𝐸 2 + 3𝐸 − 9)𝑦𝑘 = 0
⇒ (𝑎3 − 5𝑎2 + 3 − 9) = 0 is the auxiliary equation

⇒ (𝑎 + 1)(𝑎 − 3)(𝑎 − 3) = 0 ⇒ 𝑎 = −1, or 𝑎 = 3 or 𝑎 = 3


Hence 𝑦 = 𝐴(−1)𝑘 + (𝐵 + 𝐶𝑥)3𝑘

Example: Solve the following difference equations


𝑖) 𝑦𝑛+2 − 4𝑦𝑛+1 + 4𝑦𝑛 = 0 𝑖𝑖) 𝑦𝑥+2 + 14𝑦𝑥+1 + 49𝑦𝑥 = 0 𝑖𝑖𝑖) 𝑦𝑘+2 − 𝑦𝑘+1 + 𝑦𝑘 = 0
Solution:
𝑖) 𝑦𝑛+2 − 4𝑦𝑛+1 + 4𝑦𝑛 = 0
⇒ (𝐸 2 − 4𝐸 + 4)𝑦𝑛 = 0
⇒ (𝑎2 − 4𝑎 + 4) = 0
⇒ (𝑎 − 2)(𝑎 − 2) = 0 ⇒ 𝑎 = 2, or 𝑎 = 2
Hence 𝑦 = (𝐴 + 𝐵𝑛)2𝑛

Dr. Kwami, A. M (Not for sale) Page 69


𝑖𝑖) 𝑦𝑥+2 + 14𝑦𝑥+1 + 49𝑦𝑥 = 0
⇒ (𝐸 2 + 14𝐸 + 49)𝑦𝑥 = 0
⇒ (𝑎2 + 14𝑎 + 49) = 0
⇒ (𝑎 + 7)(𝑎 + 7) = 0
𝑎 = −7, or 𝑎 = −7
Hence 𝑦 = (𝐴 + 𝐵𝑥)(−7)𝑥

Example: Solve the following difference equations


𝑖) 𝑦𝑘+2 − 𝑦𝑘+1 + 𝑦𝑘 = 0 𝑖𝑖) 𝑦𝑘+2 + 4𝑦𝑘+1 + 9𝑦𝑘 = 0
Solution:
𝑖) 𝑦𝑘+2 − 𝑦𝑘+1 + 𝑦𝑘 = 0
⇒ (𝐸 2 − 𝐸 + 1)𝑦𝑘 = 0
⇒ (𝑎2 − 𝑎 + 1) = 0
1 √3 1 √3
⇒ 𝑎 = +𝑖 , or 𝑎 = − 𝑖
2 2 2 2

1 √3 𝜋 𝜋
+𝑖 = 1 (cos 𝑘 + 𝑖 sin 𝑘)
2 2 3 3
𝜋 𝜋 𝜋 𝜋
Hence 𝑦 = 1𝑘 (𝐴 cos 3 𝑘 + 𝐵 sin 3 𝑘) = 𝐴 cos 3 𝑘 + 𝐵 sin 3 𝑘

𝑖𝑖) 𝑦𝑘+2 + 4𝑦𝑘+1 + 9𝑦𝑘 = 0


⇒ (𝐸 2 + 4𝐸 + 9)𝑦𝑘 = 0
⇒ (𝑎2 + 4𝑎 + 9) = 0
⇒ 𝑎 = −2 + 𝑖√5, or 𝑎 = −2 − 𝑖√5,
11𝜋 11𝜋
−2 + 𝑖√5, = 3 (cos 𝑘 + 𝑖 sin 𝑘)
15 15
11𝜋 11𝜋
Hence 𝑦 = 3𝑘 (𝐴 cos 15
𝑘 + 𝐵 sin
15
𝑘)

→ Next we consider the case where 𝜑(𝑥) ≠ 0


To find the solution of 𝑓(𝐸)𝑦𝑘 = 𝜑(𝑥) :
To find the solution of the non-homogeneous equation 𝑓(𝐸)𝑦𝑘 = 𝜑(𝑥), we first find the solution of
𝑓(𝐸)𝑦𝑘 = 0 (i.e. the complementary function CF), then we find the particular integral (PI). The complete
solution is then 𝑦 = 𝐶𝐹 + 𝑃𝐼

→ To find the particular integral:


To find the particular integral, we assume the general form of the function on the RHS of the equation
and determine the values of the constants
𝑇1 : Suppose 𝜑(𝑥) = 𝑎 𝑥 where 𝑎 is a constant, then the equation
𝑓(𝐸)𝑎 𝑥 = (𝑎0 𝐸 𝑛 + 𝑎1 𝐸 𝑛−1 + 𝑎2 𝐸 𝑛−2 + 𝑎3 𝐸 𝑛−3 + . . . +𝑎𝑛 )𝑎 𝑥
= 𝑎0 𝑎 𝑥+𝑛 + 𝑎1 𝑎 𝑥+𝑛−1 + 𝑎2 𝑎 𝑥+𝑛−2 + 𝑎3 𝑎 𝑥+𝑛−3 + . . . +𝑎𝑛 𝑎 𝑥
= (𝑎0 𝑎𝑛 + 𝑎1 𝑎𝑛−1 + 𝑎2 𝑎𝑛−2 + 𝑎3 𝑎𝑛−3 + . . . +𝑎𝑛 )𝑎 𝑥 = 𝑓(𝑎)𝑎 𝑥

Dr. Kwami, A. M (Not for sale) Page 70


1
Operating on both sides we have
𝑓(𝐸)
1 1
𝑓(𝐸)𝑎 𝑥 = 𝑓(𝑎) 𝑎𝑥
𝑓(𝐸) 𝑓(𝐸)

𝑎𝑥
⇒ 𝑎 𝑥 = 𝑓(𝑎)
𝑓(𝐸)

𝑎𝑥 𝑎𝑥

𝑓(𝑎)
=
𝑓(𝐸)
provided 𝑓(𝑎) ≠ 0

If 𝑓(𝑎) = 0 then (𝐸 − 𝑎) is a factor of 𝑓(𝐸)


𝑎𝑥 𝑎𝑥
⇒ =
𝑓(𝑎) (𝐸−𝑎)𝜔(𝐸)

𝑎𝑥 𝑎𝑥

𝑓(𝑎)
=
(𝐸−𝑎)𝜔(𝑎)
provided that 𝜔(𝑎) ≠ 0
𝑎𝑥 1 𝑎𝑥 1
⇒ = . = 𝑥𝑎 𝑥−1
𝑓(𝑎) 𝜔(𝑎) (𝐸−𝑎) 𝜔(𝑎)

Note:
𝑎𝑥
(𝐸−𝑎)
= 𝑥𝑎 𝑥−1 ,

𝑎𝑥 𝑥(𝑥−1) 𝑥 (2)
(𝐸−𝑎)2
= 𝑎 𝑥−2 = 𝑎 𝑥−2 ,
2! 2!

𝑎𝑥 𝑥(𝑥−1)(𝑥−2) 𝑥 (3)
(𝐸−𝑎)3
= 𝑎 𝑥−3 = 𝑎 𝑥−3
3! 3!

. . . . . .
𝑎𝑥 𝑥 (𝑟)
(𝐸−𝑎)𝑟
= 𝑎 𝑥−𝑟
𝑟!

Example: Solve the following equations


𝑖) 𝑦𝑘+2 − 6𝑦𝑘+1 + 8𝑦𝑘 = 4𝑘 𝑖𝑖) 𝑦𝑘+2 − 7𝑦𝑘+1 + 12𝑦𝑘 = 2𝑘
Solution:
𝑖) First we set 𝑦𝑘+2 − 6𝑦𝑘+1 + 8𝑦𝑘 = 0
⇒ (𝐸 2 − 6𝐸 + 8)𝑦𝑘 = 0
⇒ (𝑎2 − 6𝑎 + 8) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = 4


Hence 𝐶𝐹 = 𝐴2𝑘 + 𝐵4𝑘
4𝑘 4𝑘
𝑃𝐼 =
𝐸 2 −6𝐸+8
= (𝐸−2)(𝐸−4) Replacing 𝐸 by 4 we have
4𝑘 1 4𝑘 1
𝑃𝐼 = = ∗ (𝐸−4) = ∗ 𝑘4𝑘−1
2(𝐸−4) 2 2
1
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑘 + 𝐵4𝑘 + 2 𝑘4𝑘−1
𝑖𝑖) First we set 𝑦𝑘+2 − 7𝑦𝑘+1 + 12𝑦𝑘 = 0
⇒ (𝐸 2 − 7𝐸 + 12)𝑦𝑘 = 0
⇒ (𝑎2 − 7𝑎 + 12) = 0 is the auxiliary equation

Dr. Kwami, A. M (Not for sale) Page 71


Solving the auxiliary equation we have 𝑎 = 3, or 𝑎 = 4
Hence 𝐶𝐹 = 𝐴3𝑘 + 𝐵4𝑘
2𝑘 2𝑘
𝑃𝐼 =
𝐸 2 −7𝐸+12
= (𝐸−3)(𝐸−4) Replacing 𝐸 by 2 we have
2𝑘 2𝑘 2𝑘
𝑃𝐼 = (2−3)(2−4) = (−1)(−2) = = 2𝑘−1
2

Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴3𝑘 + 𝐵4𝑘 + 2𝑘−1

Example: Solve the following equations


𝑖) 𝑦𝑥+2 − 6𝑦𝑥+1 + 9𝑦𝑥 = 8 ∗ 3𝑥 𝑖𝑖) 𝑦𝑥+2 − 8𝑦𝑥+1 + 16𝑦𝑥 = 4𝑥
Solution:
𝑖) First we set 𝑦𝑥+2 − 6𝑦𝑥+1 + 9𝑦𝑥 = 0
⇒ (𝐸 2 − 6𝐸 + 9)𝑦𝑥 = 0
⇒ (𝑎2 − 6𝑎 + 9) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 3, or 𝑎 = 3


Hence 𝐶𝐹 = (𝐴 + 𝐵𝑥)3𝑥
8∗3𝑥 8∗3𝑥 8∗𝑥(𝑥−1)
𝑃𝐼 = = = 3𝑥−2 = 4𝑥(𝑥 − 1)3𝑥−2
𝐸 2 −6𝐸+9 (𝐸−3)2 2!

Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = (𝐴 + 𝐵𝑥)3𝑥 + 4𝑥(𝑥 − 1)3𝑥−2

𝑖𝑖) First we set 𝑦𝑥+2 − 8𝑦𝑥+1 + 16𝑦𝑥 = 0


⇒ (𝐸 2 − 8𝐸 + 16)𝑦𝑥 = 0
⇒ (𝑎2 − 8𝑎 + 16) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 4, or 𝑎 = 4


Hence 𝐶𝐹 = (𝐴 + 𝐵𝑥)4𝑥
4𝑥 4𝑥 𝑥(𝑥−1)
𝑃𝐼 = = = 4𝑥−2
𝐸 2 −8𝐸+16 (𝐸−4)2 2!
𝑥(𝑥−1)
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = (𝐴 + 𝐵𝑥)4𝑥 + 2!
4𝑥−2

Example: Solve the following equations


𝑖) 𝑦𝑛+2 − 3𝑦𝑛+1 + 2𝑦𝑛 = 5𝑛 + 2𝑛 𝑖𝑖) 𝑦𝑛+3 − 5𝑦𝑛+2 + 3𝑦𝑛+1 − 9𝑦𝑛 = 2𝑛 + 3𝑛
Solution:
𝑖) First we set 𝑦𝑛+2 − 3𝑦𝑛+1 + 2𝑦𝑛 = 0
⇒ (𝐸 2 − 3𝐸 + 2)𝑦𝑛 = 0
⇒ (𝑎2 − 3𝑎 + 2) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 1, or 𝑎 = 2


𝐶𝐹 = 𝐴1𝑛 + 𝐵2𝑛 = 𝐴 + 𝐵2𝑛

Dr. Kwami, A. M (Not for sale) Page 72


5𝑛 5𝑛 5𝑛 5𝑛 5𝑛
(𝑃𝐼)1 =
𝐸 2 −3𝐸+2
= (𝐸−1)(𝐸−2) Replacing 𝐸 by 5 we have (𝑃𝐼)1 = (5−1)(5−2) = (4)(3) = 12
2𝑛 2𝑛 2 2 𝑛 𝑛
(𝑃𝐼)2 =
𝐸 2 −3𝐸+2
= (𝐸−1)(𝐸−2) Replacing 𝐸 by 2 we have (𝑃𝐼)2 = (2−1)(𝐸−2) = (𝐸−2) = 𝑛2𝑛−1
5𝑛
Hence 𝑃𝐼 = (𝑃𝐼)1 + (𝑃𝐼)2 = 12 + 𝑛2𝑛−1
5𝑛
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴 + 𝐵2𝑛 + (12 + 𝑛2𝑛−1 )

𝑖𝑖) First we set 𝑦𝑛+3 − 5𝑦𝑛+2 + 3𝑦𝑛+1 − 9𝑦𝑛 = 0


⇒ (𝐸 3 − 5𝐸 2 + 3𝐸 − 9)𝑦𝑛 = 0
⇒ (𝑎3 − 5𝑎2 + 3𝑎 − 9) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = −1, 𝑎 = 3,or 𝑎 = 3


Hence 𝐶𝐹 = 𝐴(−1)𝑛 + (𝐵+𝐶𝑛)3𝑛
2𝑛 2𝑛 2 2 2 𝑛 𝑛 𝑛
(𝑃𝐼)1 = 3
(𝐸 −5𝐸 2 +3𝐸−9)
= (𝐸+1)(𝐸−3)2 Replacing 𝐸 by 2 we have (𝑃𝐼)1 = (2+1)(2−3)2 = (3)(1) = 3
3𝑛 3𝑛
(𝑃𝐼)2 = 3
(𝐸 −5𝐸 2 +3𝐸−9)
= (𝐸+1)(𝐸−3)2 Replacing 𝐸 by 3 we have
3𝑛 3𝑛 1 3𝑛 1 𝑛(𝑛−1) 𝑛(𝑛−1)
(𝑃𝐼)2 =
(3+1)(𝐸−3)2
= = ∗ (𝐸−3)2 = ∗ 3𝑛−2 = 3𝑛−2
4(𝐸−3)2 4 4 2! 8

2𝑛 𝑛(𝑛−1)
Hence 𝑃𝐼 = (𝑃𝐼)1 + (𝑃𝐼)2 = + 3𝑛−2
3 8

2𝑛 𝑛(𝑛−1)
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴(−1)𝑛 + (𝐵+𝐶𝑛)3𝑛 + 3
+
8
3𝑛−2

Example: Solve the following equations


𝑖) 𝑦𝑛+2 − 4𝑦𝑛+1 + 3𝑦𝑛 = 2𝑛 + 3𝑛 + 7 𝑖𝑖) 𝑦𝑛+2 + 10𝑦𝑛+1 + 25𝑦𝑛 = 2𝑛 + 3𝑛 + 𝜋
Solution:
𝑖) First we set 𝑦𝑛+2 − 4𝑦𝑛+1 + 3𝑦𝑛 = 0
⇒ (𝐸 2 − 4𝐸 + 3)𝑦𝑛 = 0
⇒ (𝑎2 − 4𝑎 + 3) = 0 is the auxiliary equation

Solving is the auxiliary equation we have 𝑎 = 1, or 𝑎 = 3


Hence 𝐶𝐹 = 𝐴1𝑛 + 𝐵3𝑛
2𝑛 2𝑛 2 2 2 𝑛 𝑛 𝑛
(𝑃𝐼)1 =
𝐸 2 −4𝐸+3
= (𝐸−1)(𝐸−3) Replacing 𝐸 by 2 we have (𝑃𝐼)1 = (2−1)(2−3) = (1)(−1) = −1 = −2𝑛
3𝑛 3𝑛 3𝑛 1 3𝑛 1
(𝑃𝐼)2 = = (𝐸−1)(𝐸−3) = (3−1)(𝐸−3) = = 𝑛3𝑛−1
𝐸 2 −4𝐸+3 2 (𝐸−3) 2

7∗1𝑛 7∗1𝑛 7∗1𝑛 7 1𝑛 7 7


(𝑃𝐼)3 = = (𝐸−1)(𝐸−3) = (𝐸−1)(1−3) = − = − 𝑛 1𝑛−1 = − 𝑛
𝐸 2 −4𝐸+3 2 (𝐸−1) 2 2
1 7
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴1𝑛 + 𝐵3𝑛 − 2𝑛 + 𝑛3𝑛−1 − 𝑛
2 2

𝑖𝑖) First we set 𝑦𝑛+2 + 10𝑦𝑛+1 + 25𝑦𝑛 = 0


⇒ (𝐸 2 + 10𝐸 + 25)𝑦𝑛 = 0
⇒ (𝑎2 + 10𝑎 + 25) = 0 is the auxiliary equation

Dr. Kwami, A. M (Not for sale) Page 73


Solving is the auxiliary equation we have 𝑎 = 5, or 𝑎 = 5
Hence 𝐶𝐹 = (𝐴 + 𝐵𝑛)5𝑛
2𝑛 2𝑛 𝑛(2)
(𝑃𝐼)1 = = = 2𝑛−2 = 𝑛(𝑛 − 1)2𝑛−3
𝐸 2 +10𝐸+25 (𝐸+5)2 2!

3𝑛 3𝑛 3𝑛
(𝑃𝐼)2 = = = replacing 𝐸 by 3
𝐸 2 +10𝐸+25 (𝐸+5)2 8

𝜋∗1𝑛 𝜋∗1𝑛 𝜋 𝜋
(𝑃𝐼)3 = = = =
𝐸 2 +10𝐸+25 (𝐸+5)2 (1+5)2 36

3𝑛 𝜋
Hence 𝑦 = 𝐶𝐹 + 𝑃𝐼 = (𝐴 + 𝐵𝑛)5𝑛 + 𝑛(𝑛 − 1)2𝑛−3 + 8
+
36

𝑇2 : Suppose 𝜑(𝑥) = 𝑥 𝑚 i.e. 𝜑(𝑥) is a polynomial of degree 𝑚. Then


𝜑(𝑥)
𝑃𝐼 = = [𝑓(1 + ∆)]−1 𝜑(𝑥)
𝑓(𝐸)

We then expand [𝑓(1 + ∆)]−1 in powers of ∆ and then operate on 𝜑(𝑥)

Example: Solve the following difference equations


𝑖) 𝑦𝑥+2 − 4𝑦𝑥 = 9𝑥 2 𝑖𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 𝑥 2 + 𝑥 + 1
Solution:
𝑖) 𝑦𝑥+2 − 4𝑦𝑥 = 9𝑥 2
First we set 𝑦𝑥+2 − 4𝑦𝑥 = 0
⇒ (𝐸 2 − 4)𝑦𝑥 = 0
⇒ (𝑎2 − 4) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = −2


Hence 𝐶𝐹 = 𝐴2𝑥 + 𝐵(−2)𝑥
To find 𝑃𝐼 we assume the particular integral
2 2 2 2 −1
𝑃𝐼 = 𝐸9𝑥 9𝑥 9𝑥 1
2 −4 = (1+∆)2 −4 = ∆2 +2∆−3 = −3 [
9
∆2 +2∆
] 𝑥 2 = −3[1 + ∆ −3
+2∆
] 𝑥2
1+ −3

2 2 2 2 3 2 4 2 5
= −3 [1 − (∆ −3
+2∆
) + (∆ −3
+2∆
) − (∆ −3
+2∆
) + (∆ −3
+2∆
) − (∆ −3
+2∆
) + . . . ] 𝑥2
7∆2
= −3 [1 + 2∆
3
+ + . . . ] 𝑥2
9
7∆2
= −3 [1 + 2∆
3
+ ] 𝑥2
9

= −3[𝑥 2 + 23∆(𝑥 2 ) + 79∆2 (𝑥 2 )]


= −3[𝑥 2 + 23(2𝑥 + 1) + 79(2)]
= −3[𝑥 2 + 43𝑥 + 20
9
]
Hence the complete solution is
𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵(−2) 𝑥 − 3(𝑥 2 − 43𝑥 − 20
9
)

or

Dr. Kwami, A. M (Not for sale) Page 74


𝑖) 𝑦𝑥+2 − 4𝑦𝑥 = 9𝑥 2 . . . (1)
First we set 𝑦𝑥+2 − 4𝑦𝑥 = 0
⇒ (𝐸 2 − 4)𝑦𝑥 = 0
⇒ (𝑎2 − 4) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = −2


Hence 𝐶𝐹 = 𝐴2𝑥 + 𝐵(−2)𝑥
To find 𝑃𝐼 we assume the particular integral
𝑦𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 . . . (2)
2
⇒ 𝑦𝑥+1 = 𝑎𝑥 + (2𝑎 + 𝑏)𝑥 + (𝑎 + 𝑏 + 𝑐) . . . (3)
⇒ 𝑦𝑥+2 = 𝑎𝑥 2 + (4𝑎 + 𝑏)𝑥 + (4𝑎 + 2𝑏 + 𝑐) . . . (4)
Substituting (2), (3) and (4) in (1) and simplify we have
−3𝑎𝑥 2 + (4𝑎 − 3𝑏)𝑥 + (4𝑎 + 2𝑏 − 3𝑐) = 9𝑥 2 + 0𝑥 + 0
⇒ 𝑎 = −3 , 𝑏 = −4 and 𝑐 = −20
3

⇒ 𝑃𝐼 = 𝑦𝑥 = −3(𝑥 2 − 43𝑥 − 20
9
)
Hence the complete solution is
𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵(−2)𝑥 − 3(𝑥2 − 43𝑥 − 209)

𝑖𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 𝑥 2 + 𝑥 + 1 . . . (1)


First we set 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑎2 − 5𝑎 + 6) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = 3


⇒ 𝐶𝐹 = 𝐴2𝑥 + 𝐵3𝑥
To find 𝑃𝐼 we assume the particular integral
2 2 2 2 −3∆ −1
𝑃𝐼 = 𝐸𝑥2−5𝐸+6
+𝑥+1
= (1+∆)𝑥2−5(1+∆)+6
+𝑥+1
= ∆𝑥2−3∆+2
+𝑥+1
= 12 [ 1
∆2 −3∆
] (𝑥 2 + 𝑥 + 1) = 12[1 + ∆ 2
] (𝑥 2 + 𝑥 + 1)
1+ 2

2 −3∆ 2 −3∆ 2 2 −3∆ 3 2 −3∆ 4 2 −3∆ 5


= 12 [1 − (∆ 2
) + (∆ 2
) − (∆ 2
) + (∆ 2
) − (∆ 2
) + . . . ] (𝑥 2 + 𝑥 + 1)
2
= 12[1 + 3∆
2
+ 7∆4 + . . . ](𝑥 2 + 𝑥 + 1)
2
= 12[1 + 3∆
2
+ 7∆4 ](𝑥 2 + 𝑥 + 1)
= 12[(𝑥 2 + 𝑥 + 1) + 32∆(𝑥 2 + 𝑥 + 1) + 74∆2 (𝑥 2 + 𝑥 + 1)]
= 12[(𝑥 2 + 𝑥 + 1) + 32∆(2𝑥 + 2) + 74(2)]
= 12[(𝑥 2 + 𝑥 + 1) + (3𝑥 + 3) + 72]
= 12[𝑥 2 + 4𝑥 + 15
2
]

Hence the complete solution is


𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵(−2) 𝑥 − 3(𝑥 2 − 43𝑥 − 20
9
)

Dr. Kwami, A. M (Not for sale) Page 75


or
𝑖𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 𝑥 2 + 𝑥 + 1 . . . (1)
First we set 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑎2 − 5𝑎 + 6) = 0 is the auxiliary equation
Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = 3
⇒ 𝐶𝐹 = 𝐴2𝑥 + 𝐵3𝑥
To find 𝑃𝐼 we assume the particular integral
𝑦𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 . . . (2)
⇒ 𝑦𝑥+1 = 𝑎𝑥 2 + (2𝑎 + 𝑏)𝑥 + (𝑎 + 𝑏 + 𝑐) . . . (3)
⇒ 𝑦𝑥+2 = 𝑎𝑥 2 + (4𝑎 + 𝑏)𝑥 + (4𝑎 + 2𝑏 + 𝑐) . . . (4)
Substituting (2), (3) and (4) in (1) we have
2𝑎𝑥 2 + 45(−6𝑎 + 2𝑏)𝑥 + (−𝑎 − 3𝑏 + 2𝑐) = 𝑥 2 + 𝑥 + 1
⇒ 𝑎 = 12 , 𝑏 = 2 and 𝑐 = 15
4

⇒ 𝑃𝐼 = 𝑦𝑥 = 12𝑥 2 + 2𝑥 + 15
4
= 12[𝑥 2 + 4𝑥 + 15
2
]
Hence the complete solution is
𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵3𝑥 + 12[𝑥2 + 4𝑥 + 152]

Example: Solve the following difference equations


𝑖) 𝑦𝑥+2 + 10𝑦𝑥+1 + 25𝑦𝑥 = 3𝑥 + 4 𝑖𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 𝑥 3 + 1
Solution:
𝑖) 𝑦𝑥+2 + 10𝑦𝑥+1 + 25𝑦𝑥 = 3𝑥 + 4
First we set𝑦𝑥+2 + 10𝑦𝑥+1 + 25𝑦𝑥 = 0
⇒ (𝐸 2 + 10𝐸 + 25)𝑦𝑥 = 0
⇒ (𝑎2 + 10𝑎 + 25) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = −5, or 𝑎 = −5


Hence 𝐶𝐹 = (𝐴 + 𝐵𝑥)(−5)𝑥
To find 𝑃𝐼 we assume the particular integral
3𝑥+4 3𝑥+4 3𝑥+4 1 1 1 2 +12∆ −1
𝑃𝐼 = 𝐸2+10𝐸+25 = (1+∆)2+10(1+∆)+25 = ∆2+12∆+36 = 36 [ ∆2 +12∆
] (3𝑥 + 4) = 36 [1 + ∆ 36
] (3𝑥 + 4)
1+ 36

1 2 +12∆ 2 +12∆ 2 2 +12∆ 3 2 +12∆ 4 2 +12∆ 5


= 36 [1 − (∆ 36
) + (∆ 36
) − (∆ 36
) + (∆ 36
) − (∆ 36
) + . . . ] (3𝑥 + 4)
1
= 36 [1 − ∆3+ . . . ](3𝑥 + 4)
1
= 36 [1 − ∆3](3𝑥 + 4)
1
= 36 [(3𝑥 + 4) − 13∆(3𝑥 + 4)]
1
= 36 [(3𝑥 + 4) − 13(3)] = 36
1 1
[(3𝑥 + 4) − 1] = 36 1
[3𝑥 + 3] = 12 [𝑥 + 1]

Hence the complete solution is


𝑦 = 𝐶𝐹 + 𝑃𝐼 = (𝐴 + 𝐵𝑥)(−5)𝑥 + 121 [𝑥 + 1]

Dr. Kwami, A. M (Not for sale) Page 76


or
𝑖) 𝑦𝑥+2 + 10𝑦𝑥+1 + 25𝑦𝑥 = 3𝑥 + 4
First we set𝑦𝑥+2 + 10𝑦𝑥+1 + 25𝑦𝑥 = 0
⇒ (𝐸 2 + 10𝐸 + 25)𝑦𝑥 = 0
⇒ (𝑎2 + 10𝑎 + 25) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = −5, or 𝑎 = −5


Hence 𝐶𝐹 = (𝐴 + 𝐵𝑥)(−5)𝑥
To find 𝑃𝐼 we assume the particular integral
𝑦𝑥 = 𝑎𝑥 + 𝑏 . . . (2)
⇒ 𝑦𝑥+1 = 𝑎(𝑥 + 1) + 𝑏 = 𝑎𝑥 + (𝑎 + 𝑏) . . . (3)
⇒ 𝑦𝑥+2 = 𝑎(𝑥 + 1) + (𝑎 + 𝑏) = 𝑎𝑥 + 𝑎 + (𝑎 + 𝑏) = 𝑎𝑥 + (2𝑎 + 𝑏) . . . (4)
Substituting (2), (3) and (4) in (1) we have
36𝑎 = 3, and 12𝑎 + 36𝑏 = 4
1 1
⇒ 𝑎 = 12 , and 𝑏 = 12
1 1 1
⇒ 𝑃𝐼 = 𝑦𝑥 = 12 𝑥 + 12 = 12 [𝑥 + 1]

Hence the complete solution is


𝑦 = 𝐶𝐹 + 𝑃𝐼 = (𝐴 + 𝐵𝑥)(−5)𝑥 + 121 𝑥 + 121

𝑖𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 𝑥 3 + 1


First we set 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑎2 − 5𝑎 + 6) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = 3


Hence 𝐶𝐹 = 𝐴2𝑥 + 𝐵3𝑥
To find 𝑃𝐼 we assume the particular integral
3 3 3 2 −3∆ −1
𝑃𝐼 = 𝐸2𝑥−5𝐸+6
+1
= (1+∆)2𝑥−5(1+∆)+6
+1
= ∆2𝑥−3∆+2
+1
= 12 [ 1
∆2 −3∆
] (𝑥 3 + 1) = 12[1 + ∆ 2
] (𝑥 3 + 1)
1+ 2

2 −3∆ 2 −3∆ 2 2 −3∆ 3 2 −3∆ 4 2 −3∆ 5


= 12 [1 − (∆ 2
) + (∆ 2
) − (∆ 2
) + (∆ 2
) − (∆ 2
) + . . . ] (𝑥 3 + 1)
2 3
= 12[1 + 3∆
2
+ 7∆4 + 15∆
8
. . . ](𝑥 3 + 1)
= 12[1 + 32∆ + 74∆2 + 15
8
∆3 ](𝑥 3 + 1)
= 12[(𝑥 3 + 1) + 32∆(𝑥 3 + 1) + 74∆2 (𝑥 3 + 1) + 15
8
∆3 (𝑥 3 + 1)]
= 12[(𝑥 3 + 1) + 32(3𝑥 2 + 3𝑥 + 1) + 74(6𝑥 + 6) + 15
8
(6)]
= 12[(𝑥 3 + 92𝑥 2 + 15𝑥 + 97
4
]

or

Dr. Kwami, A. M (Not for sale) Page 77


First we set 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = 0
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑎2 − 5𝑎 + 6) = 0 is the auxiliary equation

Solving the auxiliary equation we have 𝑎 = 2, or 𝑎 = 3


Hence 𝐶𝐹 = 𝐴2𝑥 + 𝐵3𝑥
To find 𝑃𝐼 we assume the particular integral
𝑦𝑥 = 𝑎𝑥 3 + 𝑏𝑥 2 + 𝑐𝑥 + 𝑑 . . . (2)
⇒ 𝑦𝑥+1 = 𝑎𝑥 3 + (3𝑎 + 𝑏)𝑥 2 + (3𝑎 + 2𝑏 + 𝑐)𝑥 + (𝑎 + 𝑏 + 𝑐 + 𝑑) . . . (3)
3 2
⇒ 𝑦𝑥+2 = 𝑎𝑥 + (6𝑎 + 𝑏)𝑥 + (12𝑎 + 4𝑏 + 𝑐)𝑥 + (8𝑎 + 4𝑏 + 2𝑐 + 𝑑) . . . (4)
Substituting (2), (3) and (4) in (1) we have
2𝑎𝑥 3 + (2𝑏 − 9𝑎)𝑥 2 + (2𝑐 − 3𝑎 − 6𝑏)𝑥 + (3𝑎 − 𝑏 − 3𝑐 − 4𝑑) = 𝑥 3 + 0𝑥 2 + 0𝑥 + 1
⇒ 𝑎 = 12 , 𝑏 = 94, 𝑐 = 15
2
and 𝑑 = −97
16

⇒ 𝑃𝐼 = 12𝑥 3 + 94𝑥 2 + 15
2
𝑥 − 97
16
= 12[𝑥 3 + 92𝑥 2 + 15𝑥 + 97
4
]
Hence the complete solution is
𝑦 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵3𝑥 += 12[𝑥3 + 92𝑥2 + 15𝑥 + 974]

𝑇3 : Let 𝜑(𝑥) = 𝑎 𝑥 𝐹(𝑥) where 𝐹(𝑥) is some function of 𝑥


𝑓(𝐸)[𝑎 𝑥 𝐹(𝐸)] = (𝑎0 𝐸 𝑛 + 𝑎1 𝐸 𝑛−1 + 𝑎2 𝐸 𝑛−2 + 𝑎3 𝐸 𝑛−3 + . . . +𝑎𝑛 )[𝑎 𝑥 𝐹(𝐸)]
= 𝑎0 𝑎 𝑥+𝑛 𝐹(𝑥 + 𝑛) + 𝑎1 𝑎 𝑥+𝑛−1 𝐹(𝑥 + 𝑛 − 1) + 𝑎2 𝑎 𝑥+𝑛−2 𝐹(𝑥 + 𝑛 − 2) + . . . +𝑎𝑛 𝑎 𝑥 𝐹(𝑥)
= [𝑎0 𝑎𝑛 𝐸 𝑛 𝐹(𝑥) + 𝑎1 𝑎𝑛−1 𝐸 𝑛−1 𝐹(𝑥) + 𝑎2 𝑎𝑛−2 𝐸 𝑛−2 𝐹(𝑥) + 𝑎3 𝑎𝑛−3 𝐸 𝑛−3 𝐹(𝑥) + . . . +𝑎𝑛 𝐹(𝑥)]𝑎 𝑥
= [𝑎0 𝑎𝑛 𝐸 𝑛 + 𝑎1 𝑎𝑛−1 𝐸 𝑛−1 + 𝑎2 𝑎𝑛−2 𝐸 𝑛−2 + 𝑎3 𝑎𝑛−3 𝐸 𝑛−3 + . . . +𝑎𝑛 ]𝑎 𝑥 𝐹(𝑥)
⇒ 𝑓(𝐸)[𝑎 𝑥 𝐹(𝐸)] = 𝑎 𝑥 𝑓(𝑎𝐸)𝐹(𝑥) . . . (2)
𝑥
⇒ 𝑓(𝐸)𝑦𝑘 = 𝑎 𝐹(𝑥) . . . (3)
Let 𝑦𝑘 = 𝑎 𝑥 𝑣𝑘 be a particular solution of eqn.(3),
⇒ 𝑓(𝐸)𝑎 𝑥 𝑣𝑘 = 𝑎 𝑥 𝐹(𝑥) . . . (4)
⇒ 𝑎 𝑥 𝑓(𝑎𝐸)𝑣𝑘 = 𝑎 𝑥 𝐹(𝑥) (Using eqn. (2))
⇒ 𝑓(𝑎𝐸)𝑣𝑘 = 𝐹(𝑥)
𝐹(𝑥)
⇒ 𝑣𝑘 =
𝑓(𝑎𝐸)

therefore
𝐹(𝑥)
𝑃𝐼 = 𝑎 𝑥 𝑣𝑘 = 𝑎 𝑥
𝑓(𝑎𝐸)

𝑎𝑥 𝐹(𝑥) 𝑎𝑥 𝐹(𝑥) 𝜑(𝑥)


⇒ 𝑃𝐼 = = = (Using eqn. (4))
𝑓(𝐸) 𝑓(𝑎𝐸) 𝑓(𝑎𝐸)

Dr. Kwami, A. M (Not for sale) Page 78


Example: Solve the following difference equations
𝑖) 𝑦𝑥+2 − 7𝑦𝑥+1 − 8𝑦𝑥 = 𝑥(𝑥 − 1)2𝑥 𝑖𝑖) 𝑦𝑥+2 − 2𝑦𝑥+1 + 𝑦𝑥 = 2𝑥 𝑥 2
Solution: -
𝑖) 𝑦𝑥+2 − 7𝑦𝑥+1 − 8𝑦𝑥 = 𝑥(𝑥 − 1)2𝑥
⇒ (𝐸 2 − 7𝐸 − 8)𝑦𝑥 = 0
⇒ (𝑏 2 − 7𝑏 − 8) = 0 is the auxiliary equation ⇒ 𝑏 = 8 or 𝑏 = −1

Hence 𝐶𝐹 = 𝐴8𝑥 + 𝐵(−1)𝑥


𝑥(𝑥−1)2𝑥 𝑥(𝑥−1) 𝑥(𝑥−1) 𝑥(𝑥−1) 𝑥(𝑥−1)
𝑃𝐼 = (2𝐸)2 = 2𝑥 = 2𝑥 = 2𝑥 = 2𝑥−1
−7(2𝐸)−8 4𝐸 2 −14𝐸−8 4(1+∆)2 −14(1+∆)−8 4∆2 −6∆−18 2∆2 −3∆−9
−1
2𝑥−1 2∆2 −3∆
= [1 + ] 𝑥(𝑥 − 1)
−9 −9
2 3 4
1 2∆2 −3∆ 2∆2 −3∆ 2∆2 −3∆ 2∆2 −3∆
= − 2𝑥−1 [1 − ( )+( ) −( ) +( ) − . . . ] (𝑥 2 − 𝑥)
9 −9 −9 −9 −9

2
1 2∆2 −3∆ 2∆2 −3∆
= − 2𝑥−1 [1 − ( )+( ) ] (𝑥 2 − 𝑥)
9 −9 −9

1 ∆ ∆2
= − 2𝑥−1 [1 − + ] (𝑥 2 − 𝑥)
9 3 3
1 1 1 1 2 2 1 5 2
= − 2𝑥−1 [(𝑥 2 − 𝑥) − (2𝑥) + (2) ] = − 2𝑥−1 [(𝑥 2 − 𝑥) − 𝑥 + ] = − 2𝑥−1 [𝑥 2 − 𝑥 + ]
9 3 3 9 3 3 9 3 3
𝑥 𝑥 1 5 2
⇒ 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴8 + 𝐵(−1) − 2𝑥−1 [𝑥 2 − 𝑥 + ]
9 3 3

𝑖𝑖) 𝑦𝑥+2 − 2𝑦𝑥+1 + 𝑦𝑥 = 2𝑥 𝑥 2


⇒ (𝐸 2 − 2𝐸 + 1)𝑦𝑥 = 0
⇒ (𝑏 2 − 2𝑏 + 1) = 0 is the auxiliary equation ⇒ 𝑏 = 1 or 𝑏 = 1

Hence 𝐶𝐹 = (𝐴 + 𝐵𝑥)1𝑥 = 𝐴 + 𝐵𝑥
−1
𝑥 2 2𝑥 𝑥2 𝑥2 𝑥2 𝑥2 𝑥2 2𝑥 4∆2 +4∆
𝑃𝐼 = = 2𝑥 (𝐸−1)2 = 2𝑥 (2𝐸−1)2 = 2𝑥 = 2𝑥 = 2𝑥 = [1 + ] 𝑥2
𝐸 2 −2𝐸+1 4𝐸 2 −4𝐸+1 4(1+∆)2 −4(1+∆)+1 4∆2 +4∆+1 1 1
2 3 4
4∆2 +4∆ 4∆2 +4∆ 4∆2 +4∆ 4∆2 +4∆
= 2𝑥 [1 − ( )+( ) −( ) +( ) − . . . ] (𝑥 2 )
1 1 1 1

= 2𝑥 [1 − (4∆2 + 4∆) + (4∆2 + 4∆)2 ](𝑥 2 )


= 2𝑥 [1 − 4∆ + 12∆2 ](𝑥 2 )
= 2𝑥 [𝑥 2 − 4(2𝑥 + 1) + 12(2) ] = 2𝑥 [𝑥 2 − 8𝑥 + 20 ]
⇒ 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴 + 𝐵𝑥 + 2𝑥 [𝑥 2 − 8𝑥 + 20]

Example: Solve the following difference equations


𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = (𝑥 2 − 𝑥 + 5)4𝑥 𝑖𝑖) 𝑦𝑥+2 + 𝑦𝑥+1 − 56𝑦𝑥 = 2𝑥 (𝑥 2 − 3)
Solution:
𝑖) 𝑦𝑥+2 − 5𝑦𝑥+1 + 6𝑦𝑥 = (𝑥 2 − 𝑥 + 5)4𝑥
⇒ (𝐸 2 − 5𝐸 + 6)𝑦𝑥 = 0
⇒ (𝑏 2 − 5𝑏 + 6) = 0 is the auxiliary equation ⇒ 𝑏 = 2 or 𝑏 = 3

Hence 𝐶𝐹 = 𝐴2𝑥 + 𝐵3𝑥

Dr. Kwami, A. M (Not for sale) Page 79


−1
(𝑥 2 −𝑥+5)4𝑥 (𝑥 2 −𝑥+5) (𝑥 2 −𝑥+5) (𝑥 2 −𝑥+5) 4𝑥 16∆2 +12∆
𝑃𝐼 = (4𝐸)2 = 4𝑥 = 4𝑥 = 4𝑥 = [1 + ] (𝑥 2 − 𝑥 + 5)
−5(4𝐸)+6 16𝐸 2 −20𝐸+6 16(1+∆)2 −20(1+∆)+6 16∆2 +12∆+2 2 2
2 3 4
1 16∆2 +12∆ 16∆2 +12∆ 16∆2 +12∆ 16∆2+12∆
= 4𝑥 [1 − ( )+( ) −( ) +( ) − . . . ] (𝑥 2 − 𝑥 + 5)
2 2 2 2 2

2
1 16∆2 +12∆ 16∆2 +12∆
= 4𝑥 [1 − ( )+( ) ] (𝑥 2 − 𝑥 + 5)
2 2 2
1
= 4𝑥 [1 − 6∆ + 28∆2 ](𝑥 2 − 𝑥 + 5)
2
1 1
= 4𝑥 [(𝑥 2 − 𝑥 + 5) − 6(2𝑥) + 28(2) ] = 4𝑥 [𝑥 2 − 13𝑥 + 61]
2 2
1
⇒ 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴2𝑥 + 𝐵3𝑥 + 4𝑥 [𝑥 2 − 13𝑥 + 61]
2

𝑖𝑖) 𝑦𝑥+2 + 𝑦𝑥+1 − 56𝑦𝑥 = 2𝑥 (𝑥 2 − 3)


⇒ (𝐸 2 + 𝐸 − 56)𝑦𝑥 = 0
⇒ (𝑏 2 + 𝑏 − 56) = 0 is the auxiliary equation ⇒ 𝑏 = −8 or 𝑏 = 7

Hence 𝐶𝐹 = 𝐴(−7)𝑥 + 𝐵8𝑥


(𝑥 2 −3)2𝑥 (𝑥 2 −3) (𝑥 2 −3) (𝑥 2 −3) (𝑥 2 −3)
𝑃𝐼 = (2𝐸)2 = 2𝑥 = 2𝑥 = 2𝑥 = 2𝑥−1
+(2𝐸)−56 4𝐸 2 +2𝐸−56 4(1+∆)2 +2(1+∆)−56 4∆2 +10∆−50 2∆2 +5∆−25
−1 −1
2𝑥 2∆2 +5∆ 2𝑥 2∆2 +5∆
= [1 + ] (𝑥 2 − 3) = [1 + ] (𝑥 2 − 3)
−25 −25 −25 −25
2 3 4
1 2∆2 +5∆ 2∆2 +5∆ 2∆2 +5∆ 2∆2 +5∆
= 2𝑥 [1 − ( )+( ) −( ) +( ) − . . . ] (𝑥 2 − 3)
−25 −25 −25 −25 −25
2
1 2∆2 +5∆ 2∆2 +5∆ 1 1 3
= 2𝑥 [1 − ( )+( ) ] (𝑥 2 − 3) = 2𝑥 [1 + ∆ + ∆2 ] (𝑥 2 − 3)
−25 −25 −25 −25 5 25

1 1 3
= 2𝑥 [(𝑥 2 − 3) + ∆(𝑥 2 − 3) + ∆2 (𝑥 2 − 3)]
−25 5 25
1 1 3 1 2 1 6
= 2𝑥 [(𝑥 2 − 3) + (2𝑥 + 1) + (2)] = 2𝑥 [𝑥 2 − 3 + 𝑥 + + ]
−25 5 25 −25 5 5 25
1 2 64
= 2𝑥 [𝑥 2 + 𝑥 − ]
−25 5 25
1 2 64
⇒ 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴(−7)𝑥 + 𝐵8𝑥 − 2𝑥 [𝑥 2 + 𝑥 − ]
25 5 25

Type 4: If 𝜑(𝑥) = cos 𝑘𝑥 or 𝜑(𝑥) = sin 𝑘𝑥 , where 𝑘 is any arbitrary constant, we use cos 𝑘𝑥 = 𝑅𝑒(𝑒 𝑖𝑘𝑥 )
𝑖𝑘𝑥 + 𝑒−𝑖𝑘𝑥 𝑖𝑘𝑥 − 𝑒−𝑖𝑘𝑥
and sin 𝑘𝑥 = 𝑖𝑚(𝑒 𝑖𝑘𝑥 ) or we use cos 𝑘𝑥 = 𝑒 2
and sin 𝑘𝑥 = 𝑒 2𝑖

Example: Solve the following difference equations


𝑖) 𝑦𝑥+2 + 𝑦𝑥 = sin 𝑥 𝑖𝑖) 𝑦𝑥+1 − 𝑚𝑦𝑥 = cos 𝜋𝑥
Solution:
𝑖) 𝑦𝑥+2 + 𝑦𝑥 = sin 𝑥
𝑦𝑥+2 + 𝑦𝑥 = 0
(𝐸 2 + 1) 𝑦𝑥 = 0
𝑎2 + 1 = 0 auxiliary equation
𝑎 = −𝑖 or 𝑎 = 𝑖
𝜋 𝜋
𝐶𝐹 = 𝐴 cos 𝑥 + 𝐵 sin 𝑥
2 2

Dr. Kwami, A. M (Not for sale) Page 80


Next, we find 𝑃𝐼
sin 𝑥 𝑖𝑚(𝑒𝑖𝑥 ) 𝑖𝑚(𝑒𝑖𝜋𝑥 ) 𝑒−2𝑖 + 1 𝑖𝑚(𝑒𝑖𝑥 )(𝑒−2𝑖 +1) 𝑖𝑚(𝑒𝑖(𝑥−2) +𝑒𝑖𝑥 ) 𝑖𝑚(𝑒𝑖(𝑥−2) )+𝑖𝑚(𝑒𝑖𝑥 ) sin(𝑥−2)+ sin 𝑥
𝑃𝐼 = = = ∗ = = = =
𝐸 2 +1 𝐸 2 +1 𝑒2𝑖+1 𝑒−2𝑖 + 1 (𝑒2𝑖 +1)(𝑒−2𝑖 + 1) 2+ 𝑒2𝑖 +𝑒−2𝑖 2+ 𝑒2𝑖 +𝑒−2𝑖 2+ cos 2 + cos(−2)

𝜋 𝜋 sin(𝑥−2)+ sin 𝑥 𝜋 𝜋 sin(𝑥−2)+ sin 𝑥


Hence 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴 cos 2 𝑥 + 𝐵 sin 2 𝑥 + 2+ 2 cos 2
= 𝐴 cos 𝑥 + 𝐵 sin 𝑥 +
2 2 2(1+ cos 2)

𝑖𝑖) 𝑦𝑥+1 − 𝑚𝑦𝑥 = cos 𝜋𝑥


𝑦𝑥+1 − 𝑚𝑦𝑥 = 0
(𝐸 − 𝑚) 𝑦𝑥 = 0
(𝑎 − 𝑚) = 0 auxiliary equation
𝑎=𝑚
𝐶𝐹 = 𝐴𝑚 𝑥
Next, we find 𝑃𝐼
cos 𝜋𝑥 𝑅𝑒(𝑒𝑖𝜋𝑥 ) 𝑅𝑒(𝑒𝑖𝜋𝑥 ) 𝑒−𝑖𝜋−𝑚 𝑅𝑒(𝑒𝑖𝜋𝑥 )(𝑒𝑖𝜋 −𝑚) 𝑅𝑒(𝑒𝑖𝜋(𝑥−1) −𝑒𝑖𝜋𝑥 𝑚) cos 𝜋(𝑥−1)−𝑚 cos 𝜋𝑥
𝑃𝐼 = = = ∗ = (𝑒𝑖𝜋−𝑚)(𝑒−𝑖𝜋 − 𝑚) = =
𝐸−𝑚 𝐸−𝑚 𝑒𝑖𝜋 − 𝑚 𝑒−𝑖𝜋 − 𝑚 1 − 𝑚(𝑒𝑖𝜋 + 𝑒−𝑖𝜋 ) + 𝑚2 1 − 2𝑚 cos 𝜋 + 𝑚2

cos 𝜋(𝑥−1)−𝑚 cos 𝜋𝑥


Hence 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴𝑚 𝑥 + 1 − 2𝑚 cos 𝜋 + 𝑚2

Example: Solve the following difference equations


𝑖) 𝑦𝑥+2 − 7𝑦𝑥+1 + 12𝑦𝑥 = cos 𝑥 𝑖𝑖) 𝑦𝑥+2 + 𝑦𝑥 = sin( 12𝑥)
Solution:
𝑖) 𝑦𝑥+2 − 7𝑦𝑥+1 + 12𝑦𝑥 = cos 𝑥
𝑦𝑥+2 − 7𝑦𝑥+1 + 𝑦𝑥 = 0
(𝐸 2 − 7𝐸 + 12) 𝑦𝑥 = 0
𝑎2 − 7𝑎 + 12 = 0 auxiliary equation
𝑎 = 3 or 𝑎 = 4
𝐶𝐹 = 𝐴3𝑥 + 𝐵4𝑥
Next, we find 𝑃𝐼
cos 𝑥 𝑅𝑒(𝑒𝑖𝑥 ) 𝑅𝑒(𝑒𝑖𝑥 ) (𝑒−𝑖 – 4)(𝑒−𝑖 – 3) 𝑅𝑒(𝑒𝑖𝑥 )(𝑒−𝑖 – 4)(𝑒−𝑖 – 3)
𝑃𝐼 = = (𝐸− = ∗ = (𝑒𝑖 – 4)(𝑒−𝑖 – 4)(𝑒𝑖 – 3)(𝑒−𝑖 – 3)
𝐸 2 −7𝐸+12 4)(𝐸− 3) (𝑒𝑖 – 4)(𝑒𝑖 – 3) (𝑒−𝑖 – 4)(𝑒−𝑖 – 3)

𝑅𝑒[𝑒𝑖(𝑥−2) −7𝑒𝑖 𝑥−1 +12𝑒𝑖𝑥 ]


( )
𝑅𝑒(𝑒𝑖(𝑥−2) )−7𝑅𝑒(𝑒𝑖(𝑥−1) )+12𝑅𝑒(𝑒𝑖𝑥 ) cos(𝑥−2)−7 cos(𝑥−1)+12 cos 𝑥
= = =
194 – 91𝑒𝑖 −91𝑒−𝑖 +12𝑒2𝑖 +12𝑒−2𝑖 194 – 91𝑒𝑖 −91𝑒−𝑖 +12𝑒2𝑖 +12𝑒−2𝑖 194 −91 cos 1−91 cos(−1)+12 cos 2+12 cos(−2)

cos(𝑥−2)−7 cos(𝑥−1)+12 cos 𝑥


=
24 cos 2−182 cos 1+194
cos(𝑥−2)−7 cos(𝑥−1)+12 cos 𝑥
Hence 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴3𝑥 + 𝐵4𝑥 + 24 cos 2−182 cos 1+194

𝑖𝑖) 𝑦𝑥+2 + 𝑦𝑥 = sin( 12𝑥)


𝑦𝑥+2 + 𝑦𝑥 = 0
(𝐸 2 + 1) 𝑦𝑥 = 0
𝑎2 + 1 = 0 auxiliary equation
𝑎 = −𝑖 or 𝑎 = 𝑖

Dr. Kwami, A. M (Not for sale) Page 81


𝜋 𝜋
𝐶𝐹 = 𝐴 cos 𝑥 + 𝐵 sin 𝑥
2 2

Next, we find 𝑃𝐼
1 1 1 𝑥−4 1
𝑥𝑖 𝑥𝑖 𝑥𝑖 𝑖( 2 ) 𝑥𝑖
1 𝐼𝑚(𝑒 2 ) 𝐼𝑚(𝑒 2 ) 𝐼𝑚(𝑒2 )(𝑒−2𝑖 + 1) 𝐼𝑚(𝑒 +𝑒 2 )
sin( 2𝑥) 𝑒 −2𝑖 + 1
𝑃𝐼 = = = ∗ = =
𝐸 2 +1 𝐸 2 +1 𝑒 2𝑖 +1 𝑒 −2𝑖 + 1 (𝑒2𝑖 + 1)(𝑒−2𝑖 + 1) 2+ 𝑒 2𝑖 +𝑒 −2𝑖
𝑥−4 1
𝑖( 2 ) 𝑥𝑖 𝑥−4 𝑥 𝑥−4 𝑥 𝑥−4 𝑥
𝐼𝑚(𝑒 )+𝐼𝑚(𝑒 2 ) sin( )+ sin sin( )+ sin sin( )+ sin
2 2 2 2 2 2
= = = =
2+ 𝑒 2𝑖 +𝑒 −2𝑖 2+ cos 2 + cos(−2) 2+ 2 cos 2 2(1+ cos 2 )
𝑥−4 𝑥
𝜋 𝜋 sin( )+ sin
2 2
Hence 𝑦𝑥 = 𝐶𝐹 + 𝑃𝐼 = 𝐴 cos 2 𝑥 + 𝐵 sin 2 𝑥 + 2(1+ cos 2 )

Exercises: Solve the following difference equations


𝑖) 𝑦𝑥+2 − 16𝑦𝑥 = cos 𝑥2 𝑖𝑖) 𝑦𝑥+2 + 𝑦𝑥 = cos( 12𝑥𝜋)

Dr. Kwami, A. M (Not for sale) Page 82

You might also like