0% found this document useful (0 votes)
7 views

Module for Numerical I

This chapter introduces the basic concepts of error estimation in numerical methods for engineering. It covers the sources and types of errors, including inherent and truncation errors, as well as methods for rounding and chopping numbers. Additionally, it explains absolute and relative errors, and the propagation of errors in functions dependent on independent variables.

Uploaded by

Lĩverpōol Ynwa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Module for Numerical I

This chapter introduces the basic concepts of error estimation in numerical methods for engineering. It covers the sources and types of errors, including inherent and truncation errors, as well as methods for rounding and chopping numbers. Additionally, it explains absolute and relative errors, and the propagation of errors in functions dependent on independent variables.

Uploaded by

Lĩverpōol Ynwa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 159

Numerical Method for Engineering

Chapter one

Basic Concepts on error estimation

Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of errors


❖ Identifying the source of errors
❖ Identifying the types of errors

INTRODUCTION

Numerical methods are methods for solving problems on computers by numerical calculations,
often giving a table of numbers and/or graphical representations or figures. Numerical methods
tend to emphasize the implementation of algorithms. The aim of numerical methods is therefore
to provide systematic methods for solving problems in a numerical form. The process of solving
problems generally involves starting from an initial data, using high precision digital computers,
following the steps in the algorithms, and finally obtaining the results. Often the numerical data
and the methods used are approximate ones. Hence, the error in a computed result may be caused
by the errors in the data, or the errors in the method or both.
Definition: Numerical method is the study of approximate analysis for solving problems of
mathematical analysis by means of arithmetic calculations.

Basic concepts of errors

Objectives:

At the end of this topic students should be able to:

➢ define errors
➢ identifying thesource of errors

Page 1
Numerical Method for Engineering

Analysis of errors is the central concern in the study of numerical methods and therefore we
will investigate the sources of errors, the type of errors that may be occurring in the given
problem and the subsequent propagation of errors.
1.1. Sources of errors
The main sources of errors in obtaining numerical solutions to mathematical problems are:
a. The model: To solve different problems, mathematical models are formulated to describe
them and these models do not describe them exactly and as a result errors are introduced.
b. The numerical method: The methods used to solve the mathematical models are often
not exact and as a consequence errors are induced.
c. The data: There may be errors in measuring or estimating values.
d. The representation of numbers: A computer has a finite word length and so only a
fixed number of digits of a number are inserted and as a consequence errors are
introduced.
e. The arithmetic: Frequently errors are introduced in carrying out operations such as
addition and multiplication.

Remark 1: There are two kinds of numbers which are exact and approximate numbers.

Example 1.1

a. The numbers 1,2,3, … , 1⁄2 , 3⁄2 , … , √2, 𝜋, 𝑒 and so on written in this manner are exact
numbers.
b. The numbers 3.1428, 3.14285714, 3.142857, 3.14286 and so on are approximate values
of the number 𝜋.
✓ The digits that are used to express a number are called significant digits or significant
figures.

Example1. 2

a. The numbers 3.1416, 0.66667 and 4.0687 each contain five significant digits.
b. The numbers 0.00023, 3.4000 and 2.3 each contain two significant figures.

Page 2
Numerical Method for Engineering

1.2. Approximation of errors

Objectives:

At the end of this topic students should be able to:

➢ identifying the types of errors

Classification of errors

1. Inherent errors: Most of numerical computations are inexact either due to the given data
or due to the limitations of the computing aids such as mathematical tables, desk
calculators or the digital computers. Due to these limitations numbers have to be rounded
causing errors called inherent (rounded – off) errors. These errors cannot be completely
removed but can be minimized if we select a better data and by using computing aids of
higher precision.
2. Truncation errors: The mathematical models may be algebraic or transcendental or
other types of equations. The solution of such equations may not be solved analytically,
hence we use numerical methods. In the process errors are induced and such errors are
called truncation errors. In general, truncation errors are errors due to the model and
method.
1.3. Rounding of numbers

Objectives:

At the end of this topic students should be able to:

➢ Understanding the concept chooping and rounding of errors

With 𝑡 −digit computer a number with mantissa greater than 𝑡 −digits cannot be represented
exactly. Such number must be reduced to 𝑡 −digits and there are two ways of reducing the
number of digits of the given number.

a. Chopping: In a 𝑡 −digit computation, all digits of the number to the right of 𝑡 are
dropped – off.

Page 3
Numerical Method for Engineering

Let 𝑥 = sign(𝑎 × 10𝑏 ), where𝑎 = 0. 𝑑1 𝑑2 … 𝑑𝑡 𝑑𝑡+1 … 𝑑𝑛 , then in a 𝑡 −digit computer the


mantissa 𝑎 is copped as:

𝑎̃ = 0. 𝑑1 𝑑2 … 𝑑𝑛

Therefore, the number to be represented in side the computer is given by:

𝑥̃ = Sign (𝑎̃ × 10𝑏 )

The resulted error in this process is given by the formula 𝑒 = |𝑥 − 𝑥̃|.

b. Rounding: In this method if 𝑎 = 0. 𝑑1 𝑑2 … 𝑑𝑡 𝑑𝑡+1 … 𝑑𝑛 and if


1. 𝑑𝑡+1 > 5, we add 1 to 𝑑𝑡 that is we round up.
2. 𝑑𝑡+1 < 5, we drop – off all digits after the first 𝑡 −digits.
3. 𝑑𝑡+1 = 5, then round – off to 𝑑𝑡 if 𝑑𝑡 is odd otherwise chop – off (Here the number to
be rounded – off is called correct to n significant digits).

Let 𝑥 = sign(𝑎 × 10𝑏 ), where 𝑎 = 0. 𝑑1 𝑑2 … 𝑑𝑡 𝑑𝑡+1 … 𝑑𝑛 , then

1. If 𝑑𝑡+1 ≥ 5 and 𝑑𝑡 is add (odd if 𝑑𝑡+1 = 5), then


𝑎̃ = 0. 𝑑1 𝑑2 … (𝑑𝑡 + 1)

Therefore, the number to be represented in side the computer is given by:

𝑥̃ = Sign(𝑎̃ × 10𝑏 )

2. If 𝑑𝑡+1 ≤ 5 and 𝑑𝑡 is even (even if 𝑑𝑡+1 = 5), then


𝑎̃ = 0. 𝑑1 𝑑2 … 𝑑𝑡

Therefore, the number to be represented in side the computer is given by:

𝑥̃ = Sign(𝑎̃ × 10𝑏 )

In both cases the resulted error in this process is given by the formula 𝑒 = |𝑥 − 𝑥̃|.

Example 1.3 Let 𝑥 = 0.142862 × 102 , 𝑡 = 4, then represent the number inside the computer
with the given capacity and find the error.

Page 4
Numerical Method for Engineering

Solution: Chopping form: Here 𝑎 = 0.142862 and ̃


𝑎 = 0.1428.

Therefore, the number becomes, 𝑥̃ = 0.1428 × 102 and the resulted error is given by:

𝑒 = |𝑥 − 𝑥̃| = |0.142862𝑥102 − 0.1428 × 102 | = 0.6200 × 10−2

Rounding form: Here 𝑎 = 0.142862 and 𝑎̃ = 0.1429.

Therefore, the number becomes, 𝑥̃ = 0.1429 × 102 and the resulted error is given by:

𝑒 = |𝑥 − 𝑥̃| = |0.142862𝑥102 − 0.1429 × 102 | = 0.3800 × 10−2

1.4. Absolute error and relative error

Objectives:

At the end of this topic students should be able to:

➢ Define the Absolute error and relative of errors

Absolute error: Is the numerical difference between the true value of a quantity and its
approximate value. i.e. . if 𝑥 is the true value of a quantity and 𝑥̃ is its approximate value, then
the absolute error 𝐸𝐴 is given by:

𝐸𝐴 = |𝑥 − 𝑥̃|

𝑥−𝑥̃
Relative error: The relative error 𝐸𝑅 is defined by: 𝐸𝑅 = | |
𝑥

✓ The percentage relative error 𝐸𝑃 is given by 𝐸𝑃 = 100𝐸𝑅 .

Example1. 4 Let the exact value or true value of the number is 20⁄3 and its approximate value is
6.666, then find the absolute error, relative error and the percentage relative error.

Solution: 𝐸𝐴 = |𝑥 − 𝑥̃| = |20⁄3 − 6.666| = 2⁄3000

𝑥−𝑥̃ 20⁄ −6.666


𝐸𝑅 = | |=| 3
20⁄ | = 1⁄10000
𝑥 3

𝐸𝑃 = 100𝐸𝑅 = 100 × 1⁄10000 = 1⁄100

Page 5
Numerical Method for Engineering

Example 1.5 Three approximate values of the number 1⁄3 are given as 0.30, 0.33 and 0.34.
Which one of the three is the best approximation?

Solution: The value with the smallest absolute error is the best approximation and therefore we
have to find the absolute errors. Let 𝑥̃1 = 0.30, 𝑥̃2 = 0.33 and 𝑥̃3 = 0.34

𝐸𝐴1 = |1⁄3 − 0.30| = 1⁄30

𝐸𝐴2 = |1⁄3 − 0.33| = 1⁄300

𝐸𝐴3 = |1⁄3 − 0.34| = 1⁄150

Here, 1⁄300 < 1⁄150 < 1⁄30

Therefore, the best approximation of the number is 0.33.

Example 1.6 Given the number 𝜋 is approximated using 𝑛 = 5 significant digits.

a. Determine the relative error due chopping and express it as a percentage.


b. Determine the relative error due to rounding and express it as a percentage.

Solution:

a. In case of chopping 𝜋 ≈ 3.1428, then the relative error is:


22
3.1428−𝜋 3.1428−
7
𝐸𝑅 = | |=| 22 | = 0.00001818
𝜋
7

and 𝐸𝑃 = 100𝐸𝑅 = 0.001818.


b. In case of rounding 𝜋 ≈ 3.1428(𝑠𝑖𝑛𝑐𝑒 𝑑𝑡+1 = 5 & 𝑑𝑡 𝑖𝑠 𝑒𝑣𝑒𝑛), then the relative error is:
22
3.1428−𝜋 3.1428−
7
𝐸𝑅 = | |=| 22 | = 0.00001818
𝜋
7

and 𝐸𝑃 = 100𝐸𝑅 = 0.001818.

Remark 2: If the number is rounded to 𝑁 decimal places, then the absolute error is given by:

1
∆𝑥 = 2 × 10−𝑁

Page 6
Numerical Method for Engineering

Example 1.7 If 𝑥 = 0.51 and correct to two decimal places, then find the absolute error.

1
Solution: ∆𝑥 = 2 × 10−𝑁 , but in this case 𝑁 = 2

1
= 2 × 10−2 = 0.005

1.5. Propagation of errors


Objectives:

At the end of this topic students should be able to:

➢ Define the Propagation of errors

Propagation of errors is the measure how the error in the independent variable yield an error on
the dependent variable. Suppose that we have a function 𝑓(𝑥) that is dependent on a single
independent variable𝑥. Assume that 𝑥̃ is an approximation of 𝑥. Now, we would like to assess
the effect of the discrepancy between 𝑥 and 𝑥̃ on the value of the function. That is we would like
to estimate
∆𝑓(𝑥̃) = |𝑓(𝑥) − 𝑓(𝑥̃)|
The problem with evaluating ∆𝑓(𝑥̃) is that 𝑓(𝑥) is unknown, because 𝑥 is unknown. We can
overcome this difficulty if 𝑥̃ is very close to 𝑥 and 𝑓(𝑥̃) is continuous and differentiable. If these
conditions hold, then Taylor series expansion can be employed to compute 𝑓(𝑥) near𝑓(𝑥̃).
(𝑥−𝑥̃)2 (𝑥−𝑥̃)3
𝑓(𝑥) = 𝑓(𝑥̃) + 𝑓 ′ (𝑥̃)(𝑥 − 𝑥̃) + 𝑓 ′′′ (𝑥̃) + 𝑓 ′′′ (𝑥̃) +⋯
2! 3!

For very small ∆𝑥 = 𝑥 − 𝑥̃ dropping the second and higher order derivatives and rearranging the
rest yields
𝑓(𝑥) ≈ 𝑓(𝑥̃) + 𝑓 ′ (𝑥̃)(𝑥 − 𝑥̃)
⇒ 𝑓(𝑥) − 𝑓(𝑥̃) = 𝑓 ′ (𝑥̃)(𝑥 − 𝑥̃)
⇒ |𝑓(𝑥) − 𝑓(𝑥̃)| = |𝑓 ′ (𝑥̃)(𝑥 − 𝑥̃)|

⇒ |𝑓(𝑥) − 𝑓(𝑥̃)| = |𝑓 ′ (𝑥̃)|∆𝑥̃

⇒ ∆𝑓(𝑥̃) = |𝑓 ′ (𝑥̃)|∆𝑥̃

Page 7
Numerical Method for Engineering

Where, ∆𝑓(𝑥̃) = |𝑓(𝑥) − 𝑓(𝑥̃)| represents an estimation of the error of the function 𝑓 and ∆𝑥̃ =
|𝑥 − 𝑥̃| represents an estimation of the error of 𝑥.

Example 1.8 Estimate the error committed in 𝑓(𝑥) = 𝑥 3 , when 𝑥 is approximated by 𝑥̃ = 2.5
with error ∆𝑥̃ = 0.01.

Solution: ∆𝑓(𝑥̃) = |𝑓 ′ (𝑥̃)|∆𝑥̃ = |3(𝑥̃)2 |∆𝑥̃

= 3(2.5)2 × 0.001

= 0.1875

1.6. Numerical computation


Objectives:
At the end of this topic students should be able to:

➢ Undrerstanding the concept of programming

The analytic methods have certain limitation in practical application. So, exact solution is not
possible from applied mathematics, in such cases numerical methods are very important tools to
provide practical method for calculating the solutions of the problems.

So, it is essential to use numerical methods in programming problems on computers if and only
if the method is inherently efficient and good programmed.

Therefore, to solve problems using computers we have to follow the following steps.

1. Selection(choice) of a method
2. Designing(preparation) of algorithm
3. Flow charting
4. Programming
5. Execution of the program.

Selection of the method: Is the selection of a mathematical formula to the given problem to
find the solution. In this case, there may be more than one method available and hence only one
method must be chosen.

Page 8
Numerical Method for Engineering

After the method has been decided a complete set of computational steps have to be followed in
a sequence and this sequence of steps is called an algorithm. A diagrammatic representation that
illustrates the sequence of steps to be performed to arrive at the solution is called a flow chart.

We can summarize these commonly used symbols to represent these illustrations and their
meaning as

Start or stop of the program

Input or out put

Computations

Decision making

For loops

Connector for joining of two parts of a flow chart

Example1. 9 Develop the algorithm and draw the flow chart to solve a quadratic equation.

Solution: The quadratic equation is given by 𝑥 2 + 𝑏𝑥 + 𝑐 = 0. To solve this problem, first


find the descriminant = 𝑏 2 − 4𝑎𝑐 .

Case 1: Let 𝑑 is negative, then the roots are complex roots. That is

−𝑏±√𝑏 2 −4𝑎𝑐 −𝑏±√𝑑


𝑥= = and the roots are
2𝑎 2𝑎

−𝑏+𝑖√|𝑑| −𝑏−𝑖√|𝑑|
𝑥1 = and 𝑥2 =
2𝑎 2𝑎

𝑏
Case 2: Let 𝑑 = 0, then the roots are real and equal and given by: 𝑥 = − 2𝑎

Page 9
Numerical Method for Engineering

Case 3: Let 𝑑 is positive, then we have two real roots and the roots are:

−𝑏+√𝑑 −𝑏−√𝑑
𝑥1 = and 𝑥2 =
2𝑎 2𝑎

Algorithm

1. Input 𝑎, 𝑏, 𝑐
2. 𝑑 = 𝑏 ∗ 𝑏 − 4 ∗ 𝑎 ∗ 𝑐
3. If 𝑑 < 0
4. Cout the roots are imaginary
𝑏
5. 𝑥1 = − 2𝑎

6. 𝑥2 = 𝑠𝑞𝑟𝑡(𝑎𝑏𝑠(𝑑))/2 ∗ 𝑎
7. Cout the roots are 𝑥1 + 𝑖𝑥2 , 𝑥1 − 𝑖𝑥2
8. Else if 𝑑 = 0
9. Cout the roots are equal and real
𝑏
10. 𝑥 = − 2∗𝑎

11. Cout 𝑥
12. Else
13. Cout the roots real and unequal
14. 𝑥1 = (−𝑏 + 𝑠𝑞𝑟𝑡(𝑑))/2 ∗ 𝑎
15. 𝑥2 = (−𝑏 − 𝑠𝑞𝑟𝑡(𝑑))/2 ∗ 𝑎
16. Cout 𝑥1 , 𝑥2
17. Stop

Page 10
Numerical Method for Engineering

Flow chart
Star
t

Input
𝑎, 𝑏, 𝑐

𝑑 =𝑏∗𝑏−4∗𝑎∗𝑐

Yes If 𝑑 < No
0

Display
𝑑
imaginary roots Yes
=0

No
Display
𝑏
𝑥1 = − equal real
2∗𝑎 Display two
roots
d/t real
𝑥2 = 𝑠𝑞𝑟𝑡(𝑎𝑏𝑠(𝑑))/2 ∗a
roots

−𝑏 𝑥1 = (−𝑏 + 𝑠𝑞𝑟𝑡(𝑎𝑏𝑠(𝑑)))/2 ∗ 𝑎
𝑥=
Display, 𝑥1 + 2∗𝑎 𝑥2 = (−𝑏 − 𝑠𝑞𝑟𝑡(𝑎𝑏𝑠(𝑑)))/2 ∗ 𝑎
𝑖𝑥2 , 𝑥1 − 𝑖𝑥2

Display Display
𝑥 𝑥1 , 𝑥2

Stop

Page 11
Numerical Method for Engineering

Unit Summary

In this chapter we described the concept of error, the source of error.


There are two kinds of numbers which are exact and approximate numbers.
The digits that are used to express a number are called significant digits or significant figures.
The main sources of errors in obtaining numerical solutions to mathematical problems are the
model, the numerical method, the data, the representation of numbers and the arithmetic.
We have defined absolute and relative errors, inherent errors, round-off errors, truncation
errors, machine epsilon and error propagation.
Methods for the estimation were briefly outlined.

Review Exercise
1. Determine the absolute and relative errors involved if x = 2/3 is represented in normalized
decimal form with 6 digits by
a. Round-off
b. Truncation.
2. Given that 5 digit chopping is used for arithmetic calculations involving 𝑥 𝑎𝑛𝑑 𝑦 where 𝑥 =
1 5
and 𝑦 = 7 . Determine the absolute and relative errors involved.
3

3. If x = 3.536, determine the absolute error and relative error when.


a. 𝑥 is rounded
b. 𝑥 is truncated to two decimal digits.
4. Show that the relative error 𝐸𝑟𝑥𝑦 of the product where 𝑥 = 𝑥𝑒 + 𝛥x and 𝑦 = 𝑦𝑒 + 𝛥𝑦 is
𝐸𝑟𝑥𝑦 = 𝐸𝑟𝑥 + 𝐸𝑟𝑦 . Assume |𝐸𝑟𝑥 | << 1 and |𝐸𝑟𝑦 | << 1.
5. Show that the relative error 𝐸𝑟𝑥𝑦 of the quotient where 𝑥 = 𝑥𝑒 + 𝛥 x and 𝑦 = 𝑦𝑒 + 𝛥𝑦 is
𝐸𝑟𝑥𝑦 = 𝐸𝑟𝑥 − 𝐸𝑟𝑦 Assume |𝐸𝑟𝑦 | << 1 and |𝐸𝑟𝑦 | << 1.
6. If the number x = 57.46235 is rounded off to four significant figures, find the absolute error,
relative error and the percentage relative error.
7. Determine the true error and true percentage relative error for each case.
a. If the measured length of a track is approximated by 9999 cm and the true value is 10,000 cm
b. If the measured length of a track is approximated by 9 cm and the true value is 10 cm.

Page 12
Numerical Method for Engineering

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

John F. Mathews Numericalmethods using MATLAB, third edition

John F. Mathews Numericalmethods using MATLAB, third edition

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

Page 13
Numerical Method for Engineering

Chapter Two

Non – Linear Equations

Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of direct indirect method


❖ Understand the concepts of Bisection method and False position method
❖ Understand the concept of successive approximation method, secant method and Newton-
Rabson method
❖ Identifying the differences between Bisection method, False position method
approximation method, secant method and Newton- Rabson method

Introduction
One of the most common problems encountered in engineering analysis is that given a function
𝑓 (𝑥), find the values of x for which𝑓 (𝑥) = 0. The solution (values of 𝑥) are known as the roots
of the equation𝑓 (𝑥) = 0, or the zeroes of the function 𝑓 (𝑥).
The roots of equations may be real or complex. In general, an equation may have any number of
(real) roots or no roots at all. For example, sin 𝑥 – 𝑥 = 0 has a single root, namely, 𝑥 = 0,
whereas tan x – x = 0 has infinite number of roots (𝑥 = 0, ± 4.493, ± 7.725, … ). There are two
types of methods available to find the roots of algebraic and transcendental equations of the form
𝑓 (𝑥) = 0.
1. Direct Methods: Direct methods give the exact value of the roots in a finite number of steps.
We assume here that there are no rounds off errors. Direct methods determine all the roots at the
same time.
2. Indirect or Iterative Methods: Indirect or iterative methods are based on the concept of
successive approximations. The general procedure is to start with one or more initial
approximation to the root and obtain a sequence of iterates (𝑥𝑘 ) which in the limit converges to
the actual or true solution to the root. Indirect or iterative methods determine one or two roots at a
time. The indirect or iterative methods are further divided into two categories: bracketing and open
methods. The bracketing methods require the limits between which the root lies, whereas the open
methods require the initial estimation of the solution. Bisection and False position methods are

Page 14
Numerical Method for Engineering

two known examples of the bracketing methods. Among the open methods, the Newton-Raphson
and the method of successive approximation are most commonly used. The most popular method
for solving a non-linear equation is the Newton-Raphson method and this method has a high rate
of convergence to a solution.
This chapter deals about way of solving non – linear equations using different types of numerical
methods.

The following equations are called non – linear equations

✓ Quadratic equations given by: 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0, 𝑎 ≠ 0


✓ Cubic equations given by: 𝑎𝑥 3 + 𝑏𝑥 2 + 𝑐𝑥 + 𝑑 = 0, 𝑎 ≠ 0
✓ General polynomial equations of degree 𝑛 ≥ 4, given by
𝑎𝑛 𝑥 𝑛 + 𝑎𝑛−1 𝑥 𝑛−1 + ⋯ + 𝑎1 𝑥 + 𝑎0 = 0, 𝑎𝑛 ≠ 0
✓ Equations which contains transcendental functions such as 𝑒 𝑥 , ln 𝑥 , sin 𝑥, cos 𝑥, sinh 𝑥
etc. that is: sin 𝑥 + cos 𝑥 = 0
𝑒 −𝑥 + 𝑥 2 − 𝑥 + 1 = 0

2.1 Locating roots

Let us suppose that our aim is to find some or all roots of the non – linear equation𝑓(𝑥) = 0.
Before we use a numerical method we should have some idea about the approximate location of
the roots. The usual approach involves the construction of graphs or tables of values of the
function 𝑓(𝑥). The equation 𝑓(𝑥) = 0 can be expressed by splitting 𝑓(𝑥) into two elementary
functions 𝑓1 (𝑥) and 𝑓2 (𝑥) such that

𝑓(𝑥) = 𝑓1 (𝑥)+𝑓2 (𝑥) = 0 (*)

And then sketch the graph of 𝑓1 (𝑥) 𝑎𝑛𝑑 −𝑓2 (𝑥). The desired roots are then the values of x in
the intersection points of the graphs.

Example 2.1 Locate the roots of the equation 𝑒 −𝑥 − 𝑥(𝑥 − 1) = 0.

Solution: let 𝑓1 (𝑥) = 𝑒 −𝑥 a𝑛𝑑 𝑓2 (𝑥) = −𝑥 2 + 𝑥, then the graphs of 𝑓1 and −𝑓2 are given as
follows:

Page 15
Numerical Method for Engineering

𝑓1 𝑓(𝑥)

−𝑓2

1 𝑥

Fig.1

We can deduce from the graph that the equation has only one root near 1.3 and we then tabulate
𝑓(𝑥) = 𝑒 −𝑥 − 𝑥(𝑥 − 1) near 1.3 as follows:

𝑥 1.3 1.25 1.2 1.23

𝑒 −𝑥 ) 0.2725 0.2865 0.3012 0.2923

𝑥(𝑥 − 1) 0.3900 0.3125 0.2400 0.2829

𝑓(𝑥) −0.1175 −0.026 0.0612 0.0094

Therefore, the root lies between 1.23 𝑎𝑛𝑑 1.25.

2.2 Bisection method


Objectives:

At the end of this chapter the students will be able to:


❖ Understand the concepts of Bisection method Suppose we have an equation 𝑓(𝑥) = 0,

where 𝑓 is continuous on [𝑎, 𝑏] and 𝑓(𝑎) < 0 and 𝑓(𝑏) > 0 or vice versa and now assume
the first one.

Page 16
Numerical Method for Engineering

𝑦 𝑦 True solution

𝑓(𝑎) > 0 𝑓(𝑏) > 0

𝑎 𝑏 𝑥 𝑎 𝑏 𝑥

𝑓(𝑏) < 0 𝑓(𝑎) < 0

True solution

Fig.2 Solution of 𝑓(𝑥) = 0 between 𝑥 = 𝑎 and 𝑥 = 𝑏

In order to find a root of 𝑓(𝑥) = 0 lying in the interval [𝑎, 𝑏] we divide the interval into half. i.e.

𝑎+𝑏
𝑚= 𝑎𝑛𝑑 then
2

1. If 𝑓(𝑚) = 0, then 𝑚 is the exact root of the equation.


2. If 𝑓(𝑚) < 0, then the root lies in the interval [𝑚, 𝑏].
3. If 𝑓(𝑚) > 0, then the root lies in the interval [𝑎, 𝑚].

Then the newly reduced interval denoted by [𝑎1 , 𝑏1 ] is again halved and the same
investigation is made. Finally, at some stage in the process, we get either the exact root of
𝑓(𝑥) = 0 or a finite sequence of intervals [𝑎, 𝑏] ⊇ [𝑎1 , 𝑏1 ] ⊇ ⋯ ⊇ [𝑎𝑛 , 𝑏𝑛 ] such that
𝑓(𝑎𝑛 ) < 0 and 𝑓(𝑏𝑛 ) > 0. If |𝑏𝑛 − 𝑎𝑛 )| ≤ 𝜀, 𝜀 is a given absolute error or tolerance,
then the process terminates and the approximate root is 𝑏𝑛 .

Example 2.2 Solve the equation 𝑥 3 − 5𝑥 + 3 = 0 using the Bisection method in the interval
[0,1] with error 𝜀 = 0.001.

Solution: Here 𝑓(𝑥) = 𝑥 3 − 5𝑥 + 3, 𝑎 = 0 and 𝑏 = 1

𝑓 is continuous in the given interval [0,1] and 𝑓(0) = 3 > 0, 𝑓(1) = −1 < 0. Hence, there is a
root of the equation in the given interval.

𝑎+𝑏 0+1
𝑚1 = = = 0.5 and 𝑓(0.5) = 0.625 > 0
2 2

Then, the root lies in the interval [0.5,1] and 𝑒1 = |0.5 − 1| = 0.5 > 0.001

Page 17
Numerical Method for Engineering
0.5+1
𝑚2 = = 0.75 and 𝑓(0.75) = −0.328125 < 0
2

Then, the root lies in the interval [0.5,0.75] and 𝑒2 = |0.5 − 0.75| = 0.25 > 0.001

0.5+0.75
𝑚3 = = 0.625 and 𝑓(0.625) = 0.11914 > 0
2

Then, the root lies in the interval [0.625,0.75] and 𝑒3 = |0.625 − 0.75| = 0.125 > 0.001

0.625+0.75
𝑚4 = = 0.6875 and 𝑓(0.6875) = −0.112548 < 0
2

Then, the root is in the interval [0.625,0.6875] & 𝑒4 = |0.625 − 0.6875| = 0.0.0625 > 0.001

0.625+0.6875
𝑚5 = = 0.65625 and 𝑓(0.65625) = 0.001373 > 0
2

Then, the root lies in the interval [0.65625,0.6875] and

𝑒5 = |0.65625 − 0.6875| = 0.03125 > 0.001

0.65625+0.6875
𝑚6 = = 0.671875 and 𝑓(0.671875) = −0.05607986 < 0
2

Then, the root lies in the interval [0.65625,0.671875] and

𝑒6 = |0.65625 − 0.671875| = 0.015625 > 0.001

0.65625+0.671875
𝑚7 = = 0.6640625 and 𝑓(0.6640625) = −0.02747488 < 0
2

Then, the root lies in the interval [0.65625,0.6640625] and

𝑒7 = |0.65625 − 0.6640625| = 0.0078125 > 0.001

0.65625+0.6640625
𝑚8 = = 0.66015625
2

𝑓(0.66015625) = −0.01308 < 0

Then, the root lies in the interval [0.65625,0.66015625] and

𝑒8 = |0.65625 − 0.66015625| = 0.00390625 > 0.001

Page 18
Numerical Method for Engineering
0.65625+0.66015625
𝑚9 = = 0.658203125
2

𝑓(0.658203125 ) = −0.00586 < 0

Then, the root lies in the interval [0.65625,0.658203125] and

𝑒9 = |0.65625 − 0.658203125| = 0.001953125 > 0.001

0.65625+0.658203125
𝑚10 = = 0.657226562
2

𝑓(0.657226562 ) = −0.002246 < 0

Then, the root lies in the interval [0.65625,0.657226562] and

𝑒10 = |0.65625 − 0.657226562| = 0.000976562 < 0.001

Since |0.65625 − 0.657226562| = 0.000976562 < 0.001 = 𝜀, the process terminates and the
approximate root of the equation is 𝑚10 = 0.657226562 .

Exercise 2.1 Solve the following equations using the bisection method

1. 𝑥 2 − 2 = 0 in the interval [1,2] with 𝜀 = 0.05.


2. 𝑒 𝑥 − 3𝑥 = 0 in the interval [1.5,1.6] correct to two decimal places. 𝑎𝑛𝑠 𝑥 = 1.51
3. 𝑥 3 – 4𝑥 – 8.95 = 0 in the interval 2, 3][accurate to three decimal places. 𝐴𝑛𝑠 𝑥 =
2.711

2.3 False position method


Objectives:
At the end of this chapter the students will be able to:

❖ Understand the concepts of False position method

The curve 𝑦 = 𝑓(𝑥) is not generally a straight line. Assume that 𝑓 is continuous in the interval
[𝑎, 𝑏] and 𝑓(𝑎)𝑓(𝑏) < 0.

Page 19
Numerical Method for Engineering

𝑓(𝑎) > 0

Approximate solution

𝑎 𝑏 𝑥

Exact solution 𝑓(𝑏) < 0

Fig.3 False position method

Now, the equation of the straight line which passes through the points (𝑎, 𝑓(𝑎)) and (𝑏, 𝑓(𝑏)) is
given by:

𝑦−𝑓(𝑎) 𝑓(𝑏)−𝑓(𝑎)
=
𝑥−𝑎 𝑏−𝑎

⇒ (𝑏 − 𝑎)(𝑦 − 𝑓(𝑎)) = (𝑥 − 𝑎)(𝑓(𝑏) − 𝑓(𝑎))

(𝑏−𝑎)(𝑦−𝑓(𝑎))+𝑎𝑓(𝑏)−𝑎𝑓(𝑎)
⇒𝑥= 𝑓(𝑏)−𝑓(𝑎)

Now, if we find the 𝑥 −intercept, then it is given as follows:

−𝑏𝑓(𝑎)+𝑎𝑓(𝑎)+𝑎𝑓(𝑏)−𝑎𝑓(𝑎) 𝑎𝑓(𝑏)−𝑏𝑓(𝑎)
𝑥= =
𝑓(𝑏)−𝑓(𝑎) 𝑓(𝑏)−𝑓(𝑎)

Therefore, the approximate root of the equation 𝑓(𝑥) = 0 is given by the formula

𝑎𝑓(𝑏)−𝑏𝑓(𝑎)
𝑥̃ = 𝑓(𝑏)−𝑓(𝑎)

Suppose that 𝑓(𝑎) < 0 and𝑓(𝑏) > 0, then as in the Bisection method we follow three cases.

1. If 𝑓(𝑥̃) = 0, then 𝑥̃ is the exact root of the equation.


2. If 𝑓(𝑥̃) < 0, then the root lies in the interval[𝑥̃, 𝑏].
3. If 𝑓(𝑥̃) > 0, then the root lies in the interval[𝑎, 𝑥̃].

Page 20
Numerical Method for Engineering

✓ If either case 2 or 3 occurs, then the process is repeated until the root is obtained to the
desired accuracy.

Example 2.3 Solve the equation 𝑥 3 − 5𝑥 + 3 = 0 using False position method in the interval
[0,1] with 𝜀 = 0.001.

Solution: Here 𝑓(𝑥) = 𝑥 3 − 5𝑥 + 3, 𝑎 = 0 and 𝑏 = 1.Now, 𝑓 is continuous in [0,1] and 𝑓(0) =


3 > 0, 𝑓(1) = −1 < 0. Hence there is a root of the equation in the given interval.

𝑎𝑓(𝑏)−𝑏𝑓(𝑎) 0𝑓(1)−1𝑓(0)
𝑥̃1 = = = 0.75, 𝑓(0.75) = −0.328125 < 0
𝑓(𝑏)−𝑓(𝑎) 𝑓(1)−𝑓(0)

and |𝑓(0.75)| = 0.328125 > 0.001. Then, the root lies in the interval[0,0.75].

0𝑓(0.75)−0.75𝑓(0)
𝑥̃2 = = 0.676056, 𝑓(0.676056) = −0.071287136 < 0
𝑓(0.75)−𝑓(0)

and |𝑓(0.676056)| = 0.071287136 > 0.001. Then, the root lies in the interval [0,0.676056].

0𝑓(0.676056)−0.676056𝑓(0)
𝑥̃3 = = 0.660364
𝑓(0.676056)−𝑓(0)

𝑓(0.660364) = −0.013847908 < 0 and|𝑓(0.660364)| = 0.013847908 > 0.001.

Then, the root lies in the interval[0,0.660364 ].

0𝑓(0.660364)−0.660364𝑓(0)
𝑥̃4 = = 0.65733
𝑓(0.660364)−𝑓(0)

𝑓(0.65733) = −0.002629244859 < 0 and |𝑓(0.65733)| = 0.002629244859 > 0.001.

Then, the root lies in the interval[0,0.65733 ].

0𝑓(0.65733)−0.65733𝑓(0)
𝑥̃5 = = 0.656754
𝑓(0.65733)−𝑓(0)

𝑓(0.656754) = −0.00049469 < 0 and |𝑓(0.656754)| = 0.00049469 < 0.001.

Since |𝑓(0.656754)| = 0.00049469 < 0.001 = 𝜀, the process terminates and the approximate
root of the equation is 𝑥̃5 = 0.656754.

Page 21
Numerical Method for Engineering

Exercise 2.2 Solve the following equations using False position method

1. 3𝑥𝑒 𝑥 − 1 = 0 in the interval [0.25,0.27] with 𝜀 = 0.0005.


2. 𝑒 𝑥 − 3𝑥 2 = 0 in the interval [0.5,1] to an accuracy of five digits. 𝑎𝑛𝑠 𝑥 = 0 .91
3. 𝑐𝑜𝑠 𝑥 – 3𝑥 + 5 = 0. Correct to four decimal places 𝑎𝑛𝑠 𝑥 = 1.6427

2.4 Successive approximation ( Iterative) method


Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of Successive approximation method ( Iterative method)

This method is based on the idea of successive approximation. To find the roots of 𝑓(𝑥) = 0,
first write the equation in the form of 𝑥 = 𝑔(𝑥).

Now, chose the initial value 𝑥0 by the case |𝑔′ (𝑥0 ) ≤ 1| and the next approximations are given
by: 𝑥1 = 𝑔(𝑥0 ), 𝑥2 = 𝑔(𝑥1 ), 𝑥3 = 𝑔(𝑥2 ), … , 𝑥𝑛 = 𝑔(𝑥𝑛−1 )

Remark 2: the process terminates if two consecutive approximate values of 𝑥 are nearly equal
with the prescribed error.

Example 2.4 Solve the equation 𝑥 3 − 2𝑥 − 5 = 0 using trial and error method.

5 5
Solution: Let 𝑥 3 − 2𝑥 − 5 = 0 ⟹ 𝑥(𝑥 2 − 2) = 5 ⟹ 𝑥 2 − 2 = 𝑥 ⟹ 𝑥 = √𝑥 − 2 = 𝑔(𝑥)

𝑥 3 −5
Or 𝑥 3 − 2𝑥 − 5 = 0 ⟹ 2𝑥 = 𝑥 3 − 5 ⟹ = 𝑔(𝑥)
2

3
Or 𝑥 3 − 2𝑥 − 5 = 0 ⟹ 𝑥 3 = 2𝑥 + 5 ⟹ 𝑥 = √2𝑥 + 5 = 𝑔(𝑥)

Now, let us use the first equation and initial value 𝑥0 = 0.5, then

5 5
𝑥1 = √𝑥 + 2 = √0.5 + 2 = 3.4641
0

5 5
𝑥2 = √𝑥 + 2 = √3.4641 + 2 = 1.8556
1

Page 22
Numerical Method for Engineering

5 5
𝑥3 = √𝑥 + 2 = √1.8556 + 2 = 2.1666
2

𝑥4 = 2.0754, 𝑥5 = 2.0997, 𝑥6 = 2.0949, 𝑥7 = 2.0949 etc.

Exercise 2.3 Solve the following equations using the method of successive approximation.

1. 𝑥 3 − 2𝑥 − 3 = 0 with 𝑥0 = 1 correct to three decimal places. 𝑎𝑛𝑠 𝑥 = 1.324


2. 2𝑥 − log10 𝑥 − 9 with 𝑥0 = 4 correct to four decimal places. 𝑎𝑛𝑠 𝑥 = 4.8425
3. 𝑐𝑜𝑠 𝑥 – 3𝑥 + 5 = 0. Correct to four decimal places. 𝑎𝑛𝑠 𝑥 = 1.6427

2.5 Newton Raphson method


Objectives:
At the end of this chapter the students will be able to:

❖ Understand the concepts of Newton Raphson method

This method is simple and fast. Let 𝑥0 be an initial approximate root of 𝑓(𝑥) = 0 and let 𝑥1 =
𝑥0 + ℎ such that 𝑓(𝑥1 ) = 0 and 𝑓 is continuous and differentiable. Then, using Taylor series
expansion 𝑓(𝑥) can be expanded as:

(𝑥−𝑥0 )2 (𝑥−𝑥0 )𝑛
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥 − 𝑥0 ) + 𝑓 ′′ (𝑥0 ) + ⋯ + 𝑓 (𝑛) (𝑥0 )
2! 𝑛!

(𝑥1 −𝑥0 )2 (𝑥1 −𝑥0 )𝑛


Then, 𝑓(𝑥1 ) = 𝑓(𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥1 − 𝑥0 ) + 𝑓 ′′ (𝑥0 ) + ⋯ + 𝑓 (𝑛) (𝑥0 )
2! 𝑛!

ℎ2 ℎ𝑛
0 = 𝑓(𝑥0 ) + 𝑓 ′ (𝑥0 )ℎ + 𝑓 ′′ (𝑥0 ) 2! + ⋯ + 𝑓 (𝑛) (𝑥0 ) 𝑛!

Now, neglect the second and higher order derivatives and we get

𝑓(𝑥 )
𝑓(𝑥0 ) + ℎ𝑓 ′ (𝑥0 ) = 0 ⟹ ℎ = − 𝑓′ (𝑥0 )
0

𝑓(𝑥 ) 𝑓(𝑥 )
⟹ 𝑥1 − 𝑥0 = − 𝑓′ (𝑥0 ) ⟹ 𝑥1 = 𝑥0 − 𝑓′ (𝑥0 )
0 0

𝑓(𝑥 ) 𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 ) , 𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
1 2

Page 23
Numerical Method for Engineering

In general, the Newton Raphson method is given by:

𝑓(𝑥 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑓′ (𝑥𝑛 ) With 𝑓 ′ (𝑥𝑛 ) ≠ 0
𝑛

✓ The process terminates when two successive values of 𝑥𝑖 are nearly equal with the
prescribed error.

Example 2.5 Solve the equation 𝑥 3 − 5𝑥 + 3 = 0 using Newton Raphson method with initial
point 𝑥0 = 0 and 𝜀 = 0.001.

Solution: Here, 𝑓(𝑥) = 𝑥 3 − 5𝑥 + 3, 𝑥0 = 0 and 𝑓 ′ (𝑥) = 3𝑥 2 − 5, then

𝑓(𝑥 ) 𝑓(0)
𝑥1 = 𝑥0 − 𝑓′ (𝑥0 ) = 0 − 𝑓′ (0) = 0.6
0

and |𝑥1 − 𝑥0 | = |0.6 − 0| = 0.6 > 0.001

𝑓(𝑥 ) 𝑓(0.6)
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 ) = 0.6 − 𝑓′ (0.6) = 0.65510204
1

and |𝑥2 − 𝑥1 | = |0.65510204 − 0.6| = 0.05510204 > 0.001

𝑓(𝑥 ) 𝑓(0.65510204)
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 ) = 0.65510204 − 𝑓′ (0.65510204) = 0.656619
2

and |𝑥3 − 𝑥2 | = |0.656619 − 0.65510204| = 0.00151696 > 0.001

𝑓(𝑥 ) 𝑓(0.656619)
𝑥4 = 𝑥3 − 𝑓′ (𝑥3 ) = 0.656619 − 𝑓′ (0.656619) = 0.65662
3

and |𝑥4 − 𝑥3 | = |0.65662 − 0.656619| = 0.000001 < 0.001

Since, |𝑥4 − 𝑥3 | = 0.000001 < 0.001 = 𝜀, the process terminates and the approximate root is
𝑥4 = 0.65662.

Exercise 2.4 Solve the following equations using the Newton raphson method

1. 𝑥 2 − 25 = 0 With 𝑥0 = 7 and 𝜀 = 0.0005.


2. 𝑥 4 − 11𝑥 + 8 = 0 Near 2 accurate to five decimal places. 𝑎𝑛𝑠 𝑥 = 1.89188.
3. Evaluate √29 to five decimal places with𝑥0 = 3.3. 𝑎𝑛𝑠 𝑥 = 5.38516

Page 24
Numerical Method for Engineering

2.6 Secant method

The secant method is very similar to the Newton-Raphson method. The main disadvantage of the
Newton-Raphson method is that the method requires the determination of the derivatives of the
function at several points and often the calculations of these derivatives takes too much time. To
remove these difficulties we use this method. In this method 𝑓 ′ (𝑥) given in the Newton-Raphson
method is approximated in the following way

𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1 )
𝑓 ′ (𝑥) = 𝑥𝑖 −𝑥𝑖−1

Where, 𝑥𝑖 and 𝑥𝑖−1 are two approximations of the root. Then, the iterative formula to go from the
𝑖 𝑡ℎ to the (𝑖 + 1)𝑡ℎ approximation is given by:

𝑓(𝑥 )
𝑥𝑖+1 = 𝑥𝑖 − 𝑓′ (𝑥𝑖 )
𝑖

𝑓(𝑥𝑖 )
= 𝑥𝑖 − ⁄ 𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1)
( 𝑥 −𝑥 )
𝑖 𝑖−1

(𝑥𝑖−1 )𝑓(𝑥𝑖 )−𝑥𝑖 𝑓(𝑥𝑖−1 )


= 𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1 )

(𝑥𝑖−1 )𝑓(𝑥𝑖 )−𝑥𝑖 𝑓(𝑥𝑖−1 )


⟹ 𝑥𝑖+1 = 𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1 )

✓ The process terminates when two successive values of 𝑥𝑖 are nearly equal with the
prescribed error.

Example 2.6 Solve the equation 𝑥 2 − 25 = 0 using secant method with 𝑥0 = 4, 𝑥1 = 7 and 𝜀 =
0.05.

Solution: Here 𝑓(𝑥) = 𝑥 2 − 25, 𝑥0 = 4, 𝑥1 = 7 and 𝜀 = 0.05

(𝑥𝑖−1 )𝑓(𝑥𝑖 )−𝑥𝑖 𝑓(𝑥𝑖−1 )


𝑥𝑖+1 = 𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1 )

𝑥0 𝑓(𝑥1 )−𝑥1 𝑓(𝑥0 ) 4𝑓(7)−7𝑓(4)


𝑥2 = = = 4.81818182
𝑓(𝑥1 )−𝑓(𝑥0 ) 𝑓(7)−𝑓(4)

𝑒1 = |𝑥2 − 𝑥1 | = |4.81818182 − 7| = 2.1818182 > 0.05

Page 25
Numerical Method for Engineering
𝑥1 𝑓(𝑥2 )−𝑥2 𝑓(𝑥1 ) 7𝑓(4.81818182)−4.81818182𝑓(7)
𝑥3 = = = 4.96923075
𝑓(𝑥2 )−𝑓(𝑥1 ) 𝑓(4.81818182)−𝑓(7)

𝑒2 = |𝑥3 − 𝑥2 | = |4.96923075 − 4.81818182| = 0.151048913 > 0.05

𝑥2 𝑓(𝑥3 )−𝑥3 𝑓(𝑥2 ) 4.81818182𝑓(4.96923075)−4.96923075𝑓(4.81818182)


𝑥4 = = = 5.00057164
𝑓(𝑥3 )−𝑓(𝑥2 ) 𝑓(4.96923075)−𝑓(4.81818182)

𝑒3 = |𝑥4 − 𝑥3 | = |5.00057164 − 4.96923075| = 0.03134089 < 0.05

Since 𝑒3 = 0.03134089 < 0.05 = 𝜀, the process terminates and the approximate root of the
equation is 𝑥4 = 5.00057164.

Exercise 2.5 Solve the following equations using the secant method

1. 𝑥 3 − 8𝑥 − 5 = 0 with 𝑥0 = 3 and 𝑥1 = 3.5 correct up to five significant figures.


2. sin 𝑥 + 3 cos 𝑥 − 2 = 0 with 𝑥0 = 0 and 𝑥1 = 1.5 correct up to five significant figures.
3. Solve the equation 𝑥 2 − 25 = 0 using the initial value 𝑥0 = 0.5 and 𝑥1 = 1.

Page 26
Numerical Method for Engineering

Unit Summary

In this chapter, the techniques for the numerical solution of algebraic and transcendental
equations have been presented. Numerical methods involving iterative solution of
nonlinear equations are more powerful.
These methods can be divided into two categories: Direct methods and Indirect (or
iterative) methods. The indirect or iterative methods are further divided into two
categories: bracketing and open method. The bracketing methods require the limits
between which the root lies, whereas the open methods require the initial estimation of
the solution. Bisection and False Position methods are two known examples of the
bracketing methods. Among the open methods, the Newton-Raphson and the method of
Successive Approximation are most commonly used.
The most popular method for solving a non-linear equation is the Newton-Raphson
method and this method has a quadratic rate of convergence. These methods have been
illustrated with examples.

Review Exercise

1. Use the Bisection method to find a solution accurate to four decimal places for 𝑥 = 𝑡𝑎𝑛 𝑥
in the interval (4.4, 4.6).
2. Use the Bisection method to compute the root of 𝑒 𝑥 – 3𝑥 = 0 correct to three decimal
places in the interval (1.5, 1.6).
3. Use the Bisection method to determine a root correct to three decimal places of the equation
𝑥 log10 𝑥 = 1.2. Interval (2, 3).
4. Use the method of False Position to find solution accurate to within 𝟏𝟎−𝟒 for the function
𝜋
𝑓 (𝑥) = 𝑥 – 𝑐𝑜𝑠 𝑥 in the interval (0, 2 ).

5. Use the method of False Position to solve the equation 𝑥 𝑡𝑎𝑛 𝑥 + 1 = 0 accurate to three
decimal places starting with 2.5 𝑎𝑛𝑑 3.0 as the initial approximations to the root.
6. Use the method of False Position to solve the equation 𝑥𝑒 𝑥 – 𝑐𝑜𝑠 𝑥 = 0 correct to four
decimal places in the interval (0, 1).

Page 27
Numerical Method for Engineering

7. A root of 𝑓 (𝑥) = 𝑥 3 – 10𝑥 2 + 5 = 0 lies close to 𝑥 = 0.7. Determine this root with
the Newton-Raphson method to five decimal accuracy.
8. A root of 𝑓 (𝑥) = 𝑒 𝑥 – 2𝑥 2 lies in the interval (1, 2). Determine this root with the Newton-
Raphson method to five decimal accuracy.
9. Use Newton-Raphson method to find the smallest positive root of the equation 𝑡𝑎𝑛 𝑥 = 𝑥
accurate to four decimal places.
10. Use the Successive Approximation method to find correct to four significant figures a real
root of 𝑒 –𝑥 – 10𝑥 = 0.
11. Use the Successive Approximation method to find correct to four decimal places a real root
of 2𝑥 – 𝑙𝑜𝑔10 𝑥 – 7 = 0.
12. Find the real root of the equation 𝑥 – 𝑠𝑖𝑛 𝑥 – 0.25 = 0 to three significant digits using the
Successive Approximation method.
13. Find a root of the equation x3 – 75 = 0 using the secant method with the initial approximations
of 𝑥0 = 4 and 𝑥1 = 5.
14. Find a root of the equation 𝑐𝑜𝑠 𝑥 𝑐𝑜𝑠ℎ 𝑥 – 1 = 0 using the secant method with initial
approximations 𝑥0 = 4.5 and 𝑥 1 = 5.0.

Page 28
Numerical Method for Engineering

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

John F. Mathews Numerical methods using MATLAB, third edition

Page 29
Numerical Method for Engineering

Chapter Three
Systems of linear equations
Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of direct and indirect method


❖ Understand the concepts of Gauss elimination and Gauss Jordan elimination method
❖ Understand the concepts of Matrix inversion using Jordan’s method
❖ Understand the concept of Matrix Decomposition (LU factorization) method
❖ Understand the concept of Gauss Jacobi and Gauss-Seidel methods
❖ Understand the concept of Newton’s method

Introduction
Systems of simultaneous equations occur in solving problems in a wide variety of disciplines,
including mathematics and statistics, the physical, biological, and social sciences, as well as
engineering and business. They arise directly in solving real world problems depending on the
structure of the equations. In this chapter we present the solution of n linear simultaneous
algebraic equations in n unknowns. Linear systems of equations are associated with many
problems in engineering and science, as well as with applications of mathematics to the social
sciences and quantitative study of business and economic problems.
A linear system of 𝑛 equations in 𝑛 unknowns 𝑥1 , … , 𝑥𝑛 is a set of the system of algebraic equations
has equations of the form
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
. . . . (3.1)
. . . .
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
Where, the coefficients 𝑎𝑗𝑘 and the 𝑏𝑗 are constants.
The system (3.1) is homogeneous if all the 𝑏𝑗 are zero, otherwise is non-homogeneous.
In matrix form, the system (3.1) can be written as
𝐴𝑥 = 𝑏, (3.2)

Page 30
Numerical Method for Engineering

Where,
𝑎11 𝑎12 . . . 𝑎1𝑛 𝑥1 𝑏1
𝑎21 𝑎22 . . . 𝑎2𝑛 𝑥2 𝑏2
. . . . .
𝐴= . . . . = .
. . . . .
(𝑎𝑛1 𝑎𝑛2 . . . 𝑎𝑛𝑛 ) (𝑥𝑛 ) (𝑏𝑛 )

There are two different approaches for finding numerical solutions of a system of equations,
namely
1) Direct methods (or exact methods)
2) Indirect methods (or approximated methods)

3.1 Direct methods for system of linear equations

Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of direct method


❖ Understand the concepts of Gauss elimination method, Gauss-Jordan elimination method,
Matrix Inversion method, LU-decomposition method etc.
❖ Solve system of linear equations using Gauss elimination method, Gauss-Jordan
elimination method, Matrix Inversion method, LU-decomposition method etc.

Let 𝐴𝑥 = 𝑏 be any given linear system. Then there are different numerical methods to find the
exact solution set of the given system, some of methods to be discussed in this chapter are:
1) Gauss elimination method
2) Gauss-Jordan elimination method
3) Matrix Inversion method
4) LU-decomposition method

The Backward and Forward substitution formulas

In linear system of equations, where the coefficient matrix is triangular are simple to solve.
A system𝑈𝑥 = 𝐵, where 𝑈an upper triangular matrix is has the form:

Page 31
Numerical Method for Engineering

𝑢11 𝑥1 + 𝑢12 𝑥2 + ⋯ + 𝑢1𝑛 𝑥𝑛 = 𝑏1


𝑢22 𝑥2 + ⋯ + 𝑢2𝑛 𝑥𝑛 = 𝑏2
.
.
.
𝑢𝑛𝑛 𝑥𝑛 = 𝑏𝑛
If we assume 𝑢𝑖𝑖 ≠ 0, for all𝑖 = 1,2, … , 𝑛, then the unknowns can be computed in the
order of 𝑥𝑛 , 𝑥𝑛−1 , … , 𝑥2 , 𝑥1 as follows:
𝑏𝑛
𝑥𝑛 =
𝑢𝑛𝑛
𝑏𝑛−1 − 𝑢(𝑛−1)𝑛 𝑥𝑛
𝑥𝑛−1 =
𝑢(𝑛−1)(𝑛−1)
.
.
.
𝑏1 − 𝑢1𝑛 𝑥𝑛 − 𝑢1(𝑛−1) 𝑥𝑛−1 − ⋯ − 𝑢12 𝑥2
𝑥1 =
𝑢11
This can be written in more compact form as follows:
𝑏𝑖 −∑𝑛
𝑘=𝑖+1 𝑢𝑖𝑘 𝑥𝑘
𝑥𝑖 = (Backward substitution formula)
𝑢𝑖𝑖

A linear system of equations which has a lower triangular coefficient matrix has the form 𝐿𝑥 =
𝐵 is written as:
𝑙11 𝑥1 = 𝑏1
𝑙21 𝑥1 + 𝑙22 𝑥2 = 𝑏2
.
.
.
𝑙𝑛1 𝑥1 + 𝑙𝑛2 𝑥2 + ⋯ + 𝑙𝑛𝑛 𝑥𝑛 = 𝑏𝑛
Assuming𝑙𝑖𝑖 ≠ 0, for all 𝑖 = 1,2, … , 𝑛, the unknowns are computed in the order of 𝑥1 , 𝑥2 , … , 𝑥𝑛 as
𝑏
follows: 𝑥1 = 𝑙 1
11

𝑏2 − 𝑙21 𝑥1
𝑥2 =
𝑙22
.
.
.
𝑏𝑛 − 𝑙𝑛1 𝑥1 − 𝑙𝑛2 𝑥2 − ⋯ − 𝑙𝑛(𝑛−1) 𝑥𝑛−1
𝑥𝑛 =
𝑙𝑛𝑛

Page 32
Numerical Method for Engineering

This can be written in more compact form as follows:


𝑏𝑖 −∑𝑖−1
𝑘=1 𝑙𝑖𝑘 𝑥𝑘
𝑥𝑖 = (Forward substitution formula)
𝑙𝑖𝑖

3.1.1 Gauss elimination method


In this method, the unknowns are eliminated successively and the system is reduced to an upper
triangular system from which the unknowns are found by back substitution.
For the sake of simplicity, we restrict ourselves to the system of 3 equations in 3 unknowns:
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2 (3.3)
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
Step-1: elimination of 𝑥1 from the second and the third equations. By assuming that𝑎11 ≠ 0,
we eliminate 𝑥1 from the second equation by subtracting (𝑎21 /𝑎11) times the first equation from
the second equation. Similarly, we eliminate 𝑥1 from the third equation by subtracting (𝑎31 /𝑎11)
times the first equation from the third equation. We thus, get the new system
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
′ ′
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2′ (3.4)
′ ′
𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3′ Note:
➢ In a given system of linear equations, an equation which is used to eliminate variables from
other equations is called a pivot equation and its first nonzero coefficient is called a pivot
(or pivot element). Here ‘𝑎11 ’ is called the pivot element (or the first pivot) and the first
equation is called a pivot equation.

Step-2: elimination of 𝑥2 from the third equation in the new system (3.4). Assuming that𝑎22 ≠ 0,
′ ′
we eliminate 𝑥2 from the third equation of (3.4) by subtracting (𝑎32 /𝑎22 ) times the second equation
from the third equation. We thus, get the new upper triangular system
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
′ ′
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2′
′′
𝑎33 𝑥3 = 𝑏3′′ (3.5)
Step-3: the unknowns 𝑥3 , 𝑥2 , and 𝑥1 are obtained from the upper triangular system (3.5) by back
substitution.

Remark 1: we make the above steps by applying one of the following elementary operations.

Page 33
Numerical Method for Engineering

1. Interchanging of two rows


2. Multiplication of one row by a non-zero constant
3. Addition of a multiple of one row to another row.
✓ Finally, by applying backward substitution formula we find the values of the unknowns.

Example 3.1 Use Gaussian elimination to solve the linear system


10𝑥1 − 7𝑥2 + 3𝑥3 + 5𝑥4 = 6
−6𝑥1 + 8𝑥2 − 𝑥3 − 4𝑥4 = 5
3𝑥1 + 𝑥2 + 4𝑥3 + 11𝑥4 = 2
5𝑥1 − 9𝑥2 − 2𝑥3 + 4𝑥4 = 7
Solution: Set the equations as
10𝑥1 − 7𝑥2 + 3𝑥3 + 5𝑥4 = 6 (i)
−6𝑥1 + 8𝑥2 − 𝑥3 − 4𝑥4 = 5 (ii)
3𝑥1 + 𝑥2 + 4𝑥3 + 11𝑥4 = 2 (iii)
5𝑥1 − 9𝑥2 − 2𝑥3 + 4𝑥4 = 7 (iv)
First, to eliminate 𝑥1 from (ii), (iii), and (iv), we operate [(𝑖𝑖) + 6/10(𝑖)], [(𝑖𝑖𝑖) − 3/10(𝑖)], and
[(𝑖𝑣) − 5/10(𝑖)]. We obtain,
10𝑥1 − 7𝑥2 + 3𝑥3 + 5𝑥4 = 6 (i)
3.8𝑥2 + 3.1𝑥3 − 𝑥4 = 8.6 (v)
3.1𝑥2 + 3.1𝑥3 + 9.5𝑥4 = 0.2 (vi)
−5.5𝑥2 − 3.5𝑥3 + 1.5𝑥4 = 4 (vii)
Second, to eliminate 𝑥2 from (vi) and (vii), we operate [(vi)-3.1/3.8(v)] and
[(𝑣𝑖𝑖) + 5.5/3.8(𝑣)]. We obtain,
10𝑥1 − 7𝑥2 + 3𝑥3 + 5𝑥4 = 6 (i)
3.8𝑥2 + 3.1𝑥3 − 𝑥4 = 8.6 (v)
2.4473684𝑥3 + 10.315789𝑥4 = −6.8157895 (vii)
−2.3421053𝑥3 + 0.0526315𝑥4 = 16.447368 (ix)
Next, to eliminate 𝑥3 from (ix), we operate [(𝑖𝑥) + 2.3421053/2.4473684(𝑣𝑖𝑖𝑖)]. We thus, get
a system of upper triangular form
10𝑥1 − 7𝑥2 + 3𝑥3 + 5𝑥4 = 6
3.8𝑥2 + 3.1𝑥3 − 𝑥4 = 8.6

Page 34
Numerical Method for Engineering

2.4473684𝑥3 + 10.315789𝑥4 = −6.8157895


9.9249319𝑥4 = 9.9245977
Finally, the unknowns are obtained by back substitution as
𝑥4 = 1, 𝑥3 = −7, 𝑥2 = 4, and 𝑥1 = 5.
Example 3.2 Given the system of equations

2𝑥1 + 3𝑥2 + 5𝑥3 = 23

3𝑥1 + 4𝑥2 + 𝑥3 = 14

6𝑥1 + 7𝑥2 + 2𝑥3 = 26

Solve for 𝑥1 , 𝑥2 and 𝑥3 by using Gaussian elimination method.

Solution: The augmented matrix of the system is:

2 3 5 23
[𝐴: 𝑏] = (3 4 1 14)
6 7 2 26

Step 1:

2 3 5 23 −3𝑅 +𝑅 2 3 5 23
2 1 2 1 13 41
(3 4 1 14) −3𝑅 +𝑅 (0 − 2 − 2 − 2 ) = [𝐴(1) , 𝑏 (1) ]
1 3
6 7 2 26 0 −2 −13 −43

Step 2:

2 3 5 23 2 3 5 23
1 13 41 1 13 41
(0 −2 −2 − 2 ) − 4𝑅2 + 𝑅3 (0 − 2 − 2 − 2 ) = [𝑈, 𝑦]
0 −2 −13 −43 0 0 13 39

2 3 5 23
1 13 41
Here, (0 −2 − 2 − 2 ) is the augmented matrix of the system of equations given below
0 0 13 39

2𝑥1 + 3𝑥2 + 5𝑥3 = 23 (1)

1 13 41
− 2 𝑥2 − 𝑥3 = − (2)
2 2

Page 35
Numerical Method for Engineering

13𝑥3 = 39 (3)

Now, to find the values of 𝑥1 , 𝑥2 and 𝑥3 we apply the backward substitution formula. i.e.

From equation (3), we get 𝑥3 = 3 and substitute this into equation (2) and solve for 𝑥2 and we
get 𝑥2 = 2. Finally, substitute values of 𝑥2 and 𝑥3 in equation (1) and solve for 𝑥1 , then we get
𝑥1 = 1.
Therefore, the solution of the system is 𝑥 = {(𝑥1 , 𝑥2 , 𝑥3 )𝑡 = (1,2,3)𝑡 }.
Exercise 3.1 Using Gaussian elimination method solve the following system of linear equations.

1. 𝑥 + 𝑦 + 𝑧 − 𝑤 = 2
4𝑥 + 4𝑦 + 𝑧 + 𝑤 = 11
𝑥 − 𝑦 − 𝑧 + 2𝑤 = 0
2𝑥 + 𝑦 + 2𝑧 − 2𝑤 = 2
1 1 1 1 𝑥 3
2 −1 3 0 𝑦 3
2. ( )( ) = ( )
0 2 0 3 𝑧 1
−1 0 2 1 𝑤 0

3.1.2 Gauss elimination with partial pivoting

If the pivot is zero, the entire process in Gaussian elimination fails and if it closes to zero, round
off errors may occur. These problems can be avoided by adopting a procedure called pivoting. In
the first step, the numerically largest coefficient of 𝑥1 is chosen from all the equations from all the
equations and brought as the first pivot by interchanging the first equation with the equation having
the largest coefficient of 𝑥1 . In the second step, the numerically largest coefficient of 𝑥2 is chosen
from the remaining equations (leaving the first equation) and brought as the second pivot by
interchanging the second equation with the equation having the largest coefficient of 𝑥2 . This
process is continued till we arrive at the equation with the single variable. This modified procedure
is called partial pivoting.
Example 3.3 Use Gaussian elimination with partial pivoting method to solve the linear system
8𝑥2 + 2𝑥3 = −7
3𝑥1 + 5𝑥2 + 2𝑥3 = 8
6𝑥1 + 2𝑥2 + 8𝑥3 = 26

Page 36
Numerical Method for Engineering

Solution: Using Gaussian elimination with partial pivoting, since the first pivot element is zero,
interchanging the third equation with the first equation we have,
6𝑥1 + 2𝑥2 + 8𝑥3 = 26 (i)
3𝑥1 + 5𝑥2 + 2𝑥3 = 8 (ii)
8𝑥2 + 2𝑥3 = −7 (iii)
Then, to eliminate 𝑥1 from (ii), we operate [(ii)-3/6(i)]. We thus, get the new system

6𝑥1 + 2𝑥2 + 8𝑥3 = 26


4𝑥2 − 2𝑥3 = −5 (iv)
8𝑥2 + 2𝑥3 = −7
Next, interchanging (iii) with (iv) we have the system
6𝑥1 + 2𝑥2 + 8𝑥3 = 26
8𝑥2 + 2𝑥3 = −7
4𝑥2 − 2𝑥3 = −5
Then also, to eliminate 𝑥2 from the third equation in the above system, we subtract (4/8) times the
second equation from the third equation leaving the first equation. We then obtain a system of an
upper triangular form
6𝑥1 + 2𝑥2 + 8𝑥3 = 26
8𝑥2 + 2𝑥3 = −7
−3𝑥3 = −3/2
So that the unknowns are obtained by back substitution as follows:
𝑥3 = 1/2
1 1
𝑥2 = 8 [−7 − 2 (2)] = −1
1 1
𝑥1 = 6 [26 − 2(−1) − 8 (2)] = 4.

Exercise 3.2 Use Gauss elimination with partial pivoting method to solve the system

2𝑥1 + 𝑥2 + 4𝑥3 = 12
8𝑥1 − 3𝑥2 + 2𝑥3 = 20
4𝑥1 + 11𝑥2 − 𝑥3 = 33

Page 37
Numerical Method for Engineering

3.1.3 Gauss-Jordan elimination method

This is a modification of the Gaussian elimination method. In this method, elimination of the
unknowns is performed not in the equations below but in the equations above also, ultimately
reducing the system to a diagonal matrix form, i.e., equation involving only one unknown. From
the resulting system of equations the unknowns can be obtained readily.

Principle of the method: The Gauss Jordan method works by transforming the linear system
𝐴𝑥 = 𝑏 into an equivalent system 𝐴′ 𝑥 = 𝑏 ′ , where 𝐴 is an arbitrary non – singular matrix and 𝐴′
is an identity matrix of order 𝑛, so that 𝑥 = 𝑏 ′ is the solution of the original linear system.

Description of the method: Consider the following matrix equations

𝑎11 𝑎12 . . . 𝑎1𝑛 𝑥1 𝑏1


𝑎21 𝑎22 . . . 𝑎2𝑛 𝑥2 𝑏2
. . . . .
. . . . = .
. . . . .
(𝑎𝑛1 𝑎𝑛2 . . . 𝑎𝑛𝑛 ) (𝑥𝑛 ) (𝑏𝑛 )

Step 1: Assume that 𝑎11 ≠ 0, then replace 𝑎11 by 1 in the augmented matrix [𝐴: 𝑏] and this is
1
possible by pre – multiplying [𝐴: 𝑏] by elementary matrix 𝐸1 (𝑎 ). So after normalization the
11

first row of matrix [𝐴: 𝑏] becomes

𝑎1𝑗
𝑎1𝑗 (1) = ⁄𝑎11, for all 𝑗 = 1,2, … , 𝑛 + 1

Now, we make the non – diagonal elements of the first column of 𝐴 to become zero. That is
𝑎𝑖1 = 0, for all 𝑖 = 2,3, … , 𝑛.

Step 2: Assuming 𝑎22 (2) ≠ 0, then replace 𝑎22 (2) by 1 in the augmented matrix [𝐴: 𝑏](1) and this
1
is possible by pre – multiplying [𝐴: 𝑏] by elementary matrix 𝐸2 (𝑎 ). So after normalization the
22

second row of matrix [𝐴: 𝑏](2) becomes

𝑎2𝑗 (1)
𝑎2𝑗 (2) = ⁄ (1) , for all 𝑗 = 2,3, … , 𝑛 + 1
𝑎22

Page 38
Numerical Method for Engineering

Now, we make the non – diagonal elements of the second column of 𝐴 to become zero. That is
𝑎𝑖2 = 0, for all 𝑖 = 1,3, … , 𝑛.

1
Step k: Assume 𝑎𝑘𝑘 (𝑘−1) ≠ 0, then multiply [𝐴: 𝑏](𝑘−1) by the elementary matrix 𝐸𝑘 (𝑎 (𝑘−1) ) to
𝑘𝑘

change 𝑎𝑘𝑘 (𝑘−1) to 1. The other coefficients of the 𝑘 𝑡ℎ row are given by:

𝑎𝑘𝑗 (𝑘−1)
𝑎𝑘𝑗 (𝑘) = ⁄ (𝑘−1) , for all 𝑗 = 𝑘, 𝑘 + 1, … , 𝑛 + 1.
𝑎𝑘𝑘

The non – diagonal elements of the 𝑘 𝑡ℎ column must be zero. That is 𝑎𝑖𝑘 = 0, ∀𝑖 = 1,2, … , 𝑘 −
1, 𝑘 + 1, … , 𝑛.

Remark 2: Similar to the Gaussian elimination method the steps listed above are done by
applying the three elementary operations.

Example 3.4 Using Gauss Jordan method, solve the matrix equation defined by:

1 3 3 𝑥1 0
(2 2 𝑥
0) ( 2 ) = ( 2 )
3 3 6 𝑥3 11

Solution: The augmented matrix of the system of equation is given by:

1 3 3 0
[𝐴: 𝑏] = (2 2 0 2)
3 3 6 11

Step 1: Eliminate the coefficients of the first column below the diagonal element.

1 3 3 0 1 3 3 0
−2𝑅1 +𝑅2
(2 2 0 2 ) −3𝑅 +𝑅 (0 −4 −6 2 ) = [𝐴: 𝑏](1)
1 3
3 3 6 11 0 −6 −3 11

1
Step 2: Normalization is obtained on by pre – multiplying [𝐴: 𝑏](1) by 𝐸2 (− 4). i.e.

1 3 3 0 1 3 3 0
1 3 1
(0 −4 −6 2 ) − 𝑅2 (0 1 2
− 2)
4
0 −6 −3 11 0 −6 −3 11

Once again eliminate the non – diagonal elements of the second column. i.e.

Page 39
Numerical Method for Engineering
3 3
1 3 3 0 1 0 −2 2
3 1 −2𝑅2 +𝑅1
(0 1 2
− 2) (0 1 3 − 1) = [𝐴: 𝑏](2)
6𝑅2 +𝑅3
2 2
0 −6 −3 11 0 0 6 8

1
Step 3: Normalization is obtained on by pre – multiplying [𝐴: 𝑏](2) by 𝐸3 (6). i.e.

3 3
1 0 −2
3 3 1 0 −2 2
2 3 1
1
(0 − 2) 6 𝑅2 0 1 −2
3 1
1 2
2 4
0 0 6 8 0 0 1
( 3 )

Then, eliminate the non – diagonal elements of the third column. i.e.

3 3 7
1 0 −2 1 0 0
2 3 2
3 1 − 𝑅3 +𝑅2 5
0 1 2
−2 3
2
0 1 0 −2 = [𝐴: 𝑏](3)
𝑅 +𝑅1
2 3
4 4
0 0 1 0 0 1
( 3 ) ( 3 )

7
1 0 0
2
5
Here, 0 1 0 −2 is the augmented matrix of the system of equation given below.
4
0 0 1
( 3 )
7
𝑥1 = 2
5
𝑥2 = − 2
4
𝑥3 = 3
7 5 4 𝑡
Therefore, the solution of the system is 𝑥 = {(𝑥1 , 𝑥2 , 𝑥3 )𝑡 = (2 , − 2 , 3) }.

Example 3.5 Use Gauss-Jordan elimination method to sole the system


𝑥1 + 𝑥2 + 𝑥3 = 9
2𝑥1 − 3𝑥2 + 4𝑥3 = 13
3𝑥1 + 4𝑥2 + 5𝑥3 = 40
Solution: Set

Page 40
Numerical Method for Engineering

𝑥1 + 𝑥2 + 𝑥3 = 9 (i)
2𝑥1 − 3𝑥2 + 4𝑥3 = 13 (ii)
3𝑥1 + 4𝑥2 + 5𝑥3 = 40 (iii)
First, to eliminate 𝑥1 from (ii) and (iii), we operate [(ii)-2(i)] and [(iii)-3(i)]. We get,
𝑥1 + 𝑥2 + 𝑥3 = 9 (i)
−5𝑥2 + 2𝑥3 = −5 (iv)
𝑥2 + 2𝑥3 = 13 (v)
Second, to eliminate 𝑥2 from (i) and (v), we operate [(i)+1/5(iv)] and [(v)+1/5(iv)]. We get,
7
𝑥1 + 5 𝑥3 = 8 (vi)

−5𝑥2 + 2𝑥3 = −5 (iv)


12
𝑥3 = 12 (vii)
5

Next, to eliminate 𝑥3 from (iv) and (vi), we operate [(iv)-5/6(vii)] and [(vi)-7/12(vii)].
Finally, we obtain the diagonal system
𝑥1 = 1
−5𝑥2 = −15
12
𝑥3 = 12
5

Hence, the solutions are obtained directly as 𝑥1 = 1, 𝑥2 = 3, and 𝑥3 = 5.

Exercise 3.3 Use Gauss-Jordan elimination methods to solve the system


a. 𝑥 + 5𝑦 − 𝑧 = 4 b . 2𝑥 + 𝑦 − 3𝑧 = 11
2𝑥 − 𝑦 + 3𝑧 = 7 4𝑥 − 2𝑦 + 3𝑧 = 8
3𝑥 − 𝑦 + 5𝑧 = 12 −2𝑥 + 2𝑦 − 𝑧 = −6

c. 2𝑥1 + 𝑥2 + 4𝑥3 = 12
8𝑥1 − 3𝑥2 + 2𝑥3 = 20
4𝑥1 + 11𝑥2 − 𝑥3 = 33

Page 41
Numerical Method for Engineering

3.1.4 Matrix inversion using Jordan’s method


In this section we consider some algebra associated with matrices and show how it can be used to
solve problems involving linear systems.
Definition: Two matrices A and B are equal if they have the same number of rows and columns,
say 𝑛 × 𝑚, and if 𝑎𝑖𝑗 = 𝑏𝑖𝑗 , for each 𝑖 = 1,2, … , 𝑛 and 𝑗 = 1,2, … , 𝑚.
Definition: Let A be an 𝑛 × 𝑚 matrix and B an 𝑚 × 𝑝 matrix. The matrix product of A and B,
denoted AB, is an 𝑛 × 𝑝 matrix C whose entries 𝑐𝑖𝑗 are
𝑐𝑖𝑗 = ∑𝑚
𝑘=1 𝑎𝑖𝑘 𝑏𝑘𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 + ⋯ + 𝑎𝑖𝑚 𝑏𝑚𝑗 , for each 𝑖 = 1,2, … , 𝑛 and 𝑗 = 1,2, … , 𝑝.

The computation of 𝑐𝑖𝑗 can be viewed as the multiplication of the entries of the 𝑖𝑡ℎ row of A with
corresponding entries in the 𝑗𝑡ℎ column of B, followed by a summation; that is,
𝑏1𝑗
[𝑎𝑖1 … 𝑎𝑖𝑚 ] [ ⋮ ] = 𝑐𝑖𝑗 , where 𝑐𝑖𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 + ⋯ + 𝑎𝑖𝑚 𝑏𝑚𝑗 .
𝑏𝑚𝑗
This explains why the number of columns of A must equal the number of rows of B for the product
AB to be defined.
Definition: A square matrix has the same number of rows as columns. A diagonal matrix D=[𝑑𝑖𝑗 ]
is a square matrix with 𝑑𝑖𝑗 = 0 whenever 𝑖 ≠ 𝑗. The identity matrix of order 𝑛, 𝐼𝑛 = [𝛿𝑖𝑗 ], is a
1, 𝑖𝑓 𝑖 = 𝑗
diagonal matrix with entries 𝛿𝑖𝑗 = { .
0, 𝑖𝑓 𝑖 ≠ 𝑗
Definition: An 𝑛 × 𝑛 matrix A is nonsingular (or invertible) if an 𝑛 × 𝑛 matrix 𝐴−1 exists with
𝐴𝐴−1 = 𝐴−1 𝐴 = 𝐼𝑛 . The matrix 𝐴−1 is called the inverse of A. A matrix without an inverse is
called singular (or noninvertible).
Reading assignment
✓ determinant of a matrix
Condition for the existence of inverse
If the determinant of a square matrix A is nonzero, i.e., if det (𝐴) ≠ 0, then the matrix A is
nonsingular.
Consider a system of 𝑛 equations in 𝑛 unknowns
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2

Page 42
Numerical Method for Engineering

. . .. . .
. . . .
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
In matrix form, it is written as
𝐴𝑥 = 𝑏,
Where,
𝑎11 𝑎12 … . 𝑎1𝑛 𝑥1 𝑏1
𝑎
𝐴 = [ 21. 𝑎22. … . 𝑎2𝑛 𝑥 𝑏
. ] , 𝑥 = [ 2. ] , 𝑏 = [ 2. ]
𝑎𝑛1 𝑎𝑛2 … . 𝑎𝑛𝑛 𝑥𝑛 𝑏𝑛
If the coefficient matrix A is invertible, then the solution of the above system is given by the
formula
𝑥 = 𝐴−1 𝑏
The task to solve a certain system of linear equations using matrix-inversion method is then to find
the inverse of the coefficient matrix. There are several methods of finding the inverse of a matrix.
Some of the methods include:
✓ method of adjoint,
✓ Gauss elimination method, and
✓ Gauss-Jordan method.
In this section we will discuss Gauss-Jordan elimination method in finding the inverse of a
nonsingular coefficient matrix of a system of linear equations. In this method, the matrix is
converted in to an identity matrix.
In practice, we apply the elementary row operations for the augmented matrix formed by
combining the coefficient matrix A and the identity matrix 𝐼𝑛 . As soon as A is reduced to identity,
the other matrix represents the inverse 𝐴−1 of the coefficient matrix.

The augmented matrix of the coefficient matrix A and 𝐼𝑛 is of the form


𝑎11 𝑎12 … . 𝑎1𝑛 ⋮ 1 0 … 0
[ 21. 𝑎22. … . 𝑎2𝑛
𝑎 . ⋮ 0 1 … 0]
𝑎𝑛1 𝑎𝑛2 … . 𝑎𝑛𝑛 ⋮ 0 0 … 1

Let A be any matrix. Consider the following operation on the rows of A :

Page 43
Numerical Method for Engineering

(1) Interchange of any two rows of A, symbolically, 𝑅𝑖 ↔ 𝑅𝑗 .


(2) Add scalar multiple one row of A to another row, i.e., 𝑅𝑖 + 𝛼𝑅𝑗 → 𝑅𝑖 , where 𝛼 ≠ 0.
(3) Multiply a row A with a nonzero scalar, i.e., 𝛼𝑅𝑖 → 𝑅𝑖 .
These operations are called elementary row operations of A.
We illustrate this procedure in the following example.
Example 3.6 Use Matrix inversion using Jordan’s method to solve the system
3𝑥1 + 𝑥2 + 2𝑥3 = 3
2𝑥1 − 3𝑥2 − 𝑥3 = −3
𝑥1 + 2𝑥2 + 𝑥3 = 4
Solution: The corresponding coefficient matrix A is given by
3 1 2
𝐴 = [2 −3 −1] and det(𝐴) = 8. So that, A is nonsingular and hence 𝐴−1 exists.
1 2 1
Now, the task is to find the inverse of A and we use the Jordan’s method to do this.
Then the augmented matrix of A and 𝐼3 is defined as
3 1 2 1 0 0
(𝐴|𝐼3 ) = (2 −3 −1|0 1 0)
1 2 1 0 0 1
Using elementary row operations,
3 1 2 1 0 0
2 1
(2 −3 −1|0 1 0) [𝑅2 − 𝑅1 → 𝑅2 , 𝑅3 − 𝑅1 → 𝑅3 ]
3 3
1 2 1 0 0 1
3 1 2 1 0 0
3
~ ( 0 −11/3 −7/3 |−2/3 1 0) [ 𝑅2 → 𝑅2 , 3𝑅3 → 𝑅3 ]
11
0 5/3 1/3 −1/3 0 1
3 1 2 1 0 0
~ (0 −1 −7/11|−2/11 3/11 0) [𝑅1 + 𝑅2 → 𝑅1 , 𝑅3 + 5𝑅2 → 𝑅3 ]
0 5 1 −1 0 3
3 0 15/11 9/11 3/11 0
7 15
~ (0 −1 −7/11 | −2/11 3/11 0) [𝑅2 − 𝑅3 → 𝑅2 , 𝑅1 + 𝑅3 → 𝑅1 ]
24 24
0 0 −24/11 −21/11 15/11 3
3 0 0 −9/24 27/24 45/24
1 11
~ (0 −1 0 | 9/24 −3/24 −21/24) [ 𝑅1 → 𝑅1 , −𝑅2 → 𝑅2 , − 𝑅3 → 𝑅3 ]
3 24
0 0 −24/11 −21/11 15/11 3
1 0 0 −3/24 9/24 15/24
~ (0 1 0|−9/24 3/24 21/24 ).
0 0 1 21/24 −15/24 −33/24

Page 44
Numerical Method for Engineering

Note: The symbol ~ is used to say that the given augmented matrix and the successive augmented
matrices are equivalent.
Hence, the inverse of the given coefficient matrix A is
−3/24 9/24 15/24
−1
𝐴 = [−9/24 3/24 21/24 ]
21/24 −15/24 −33/24
Thus, the solution of the system is given by
9 27 60
− −+
−3/24 9/24 15/24 24 24 24
3 27 9 84 1
−1
𝑥 = 𝐴 𝑏 = [−9/24 3/24 21/24 ] [−3] = − − + =[ 2 ]
21/24 −15/24 −33/24 4 24 24 24 −1
63 45 132
[ 24 + 24 − 24 ]
That is, 𝑥1 = 1, 𝑥2 = 2, and 𝑥3 = −1.
Note:
✓ Matrix inversion using Jordan’s method fails if the coefficient matrix A is a singular matrix.
✓ Matrix inversion using Jordan’s method It is not suitable for a large system.
Example 3.7 Using Gauss Jordan method find the inverse of the matrix
1 3 3
𝐴 = (2 2 0 )
3 2 6
Solution: The augmented matrix of 𝐴 and 𝐼 is given by:
1 3 3 1 0 0
[𝐴: 𝐼3 ] = (2 2 0 0 1 0)
3 2 6 0 0 1
Transform the elements below the diagonal element in the first column of [𝐴: 𝐼3 ] to zero,
i.e.
1 3 3 1 0 0 1 3 3 1 0 0
−2𝑅 +𝑅
(2 2 0 0 1 0) −3𝑅1+𝑅2 (0 −4 −6 −2 1 0) = [𝐴: 𝐼](1)
1 3
3 2 6 0 0 1 0 −7 −3 −3 0 1
1
Now, multiply [𝐴: 𝐼](1) by 𝐸2 (− 4) to change 𝑎22 = −4 to 1. i.e.

1 3 3 1 0 0 1 3 3 1 0 0
1 3 1 1
(0 −4 −6 −2 1 0) − 4 𝑅2 (0 1 2 2
−4 0)
0 −7 −3 −3 0 1 0 −7 −3 −3 0 1
Then, eliminate the non – diagonal elements of the second column, i.e.

Page 45
Numerical Method for Engineering
3 1 3
1 0 −2 −2 0
1 3 3 1 0 0 4
3 1 1 −3𝑅2 +𝑅1 3 1 1
(0 1 2 2
− 4 0) 0 1 2 2
−4 0 = [𝐴: 𝐼](2)
7𝑅2 +𝑅3
0 −7 −3 −3 0 1 15 1 7
0 0 −4 1
( 2 2 )
2 15
Now, multiply [𝐴: 𝐼](2) by 𝐸3 (15) to change 𝑎33 = to 1. i.e.
2
3 1 3 3 1 3
1 0 −2 −2 0 1 0 −2 −2 0
4 4
3 1 1 2 3 1 1
0 1 −4 0 𝑅3 0 1 −4 0
2 2 15 2 2
15 1 7 1 7 2
0 0 − 1 0 0 1 −
( 2 2 4 ) ( 15 30 15)

Then, eliminate the non – diagonal elements of the third column, i.e.
3 1 3 2 2 1
1 0 −2 −2 0 1 0 0 −5
4 3 5 5
3 1 1 𝑅 +𝑅1 2 1 1
2 3
0 1 2 2
−4 0 3 0 1 0 5 10
−5 = [𝐴: 𝐼](3)
− 𝑅3 +𝑅2
2
1 7 2 1 7 2
0 0 1 − 30 0 0 1 − 30
( 15 15) ( 15 15 )
Here, the last matrix is the end of the gauss Jordan method and in this 𝐴 is changed to
identity and this shows 𝐴 is invertible and its inverse is
2 2 1
−5 5 5
−1 2 1 1
𝐴 = −5
5 10
1 7 2
− 30
( 15 15 )

Exercise 3.4 Use Matrix inversion using Jordan’s method to solve the system
2𝑥1 − 𝑥2 = 7
−𝑥1 + 2𝑥2 − 𝑥3 = 1
−𝑥2 + 2𝑥3 = 1
3.1.5 Matrix decomposition method
This method is also known as LU-decomposition method.

This method is based on the fact a square matrix 𝐴 can be factorized into the form 𝐿𝑈, where 𝐿 is
lower triangular matrix and 𝑈 is unit upper triangular matrix. Provided that the principal minors
of 𝐴 are non – singular. i.e.

Page 46
Numerical Method for Engineering
𝑎11 𝑎12 𝑎13
𝑎11 𝑎12
𝑎11 ≠ 0, |𝑎 𝑎 𝑎22 𝑎23 | ≠ 0, etc.
21 𝑎22 | ≠ 0, | 21
𝑎31 𝑎32 𝑎33

Now, let us consider the three equations

𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1

𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2

𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3

𝑎11 𝑎12 𝑎13 𝑥1 𝑏1


𝑎
That is 𝐴𝑥 = 𝑏, where 𝐴 = ( 21 𝑎22 𝑎23 ) , 𝑥 = (𝑥2 ) and 𝑏 = (𝑏2 )
𝑎31 𝑎32 𝑎33 𝑥3 𝑏3

𝑙11 0 0 1 𝑢12 𝑢13


Then, let 𝐴 = 𝐿𝑈, where 𝐿 = (𝑙21 𝑙22 0 ) and 𝑈 = (0 1 𝑢23 )
𝑙31 𝑙32 𝑙33 0 0 1

𝑙11 0 0 1 𝑢12 𝑢13 𝑎11 𝑎12 𝑎13


Therefore, 𝐿𝑈 = (𝑙21 𝑙22 0 ) (0 1 𝑢23 ) = (𝑎21 𝑎22 𝑎23 )
𝑙31 𝑙32 𝑙33 0 0 1 𝑎31 𝑎32 𝑎33

Now, solve for the unknowns, then we get the following

𝑙11 = 𝑎11 , 𝑙21 = 𝑎21 , 𝑙31 = 𝑎31

𝑎
𝑙11 × 𝑢12 = 𝑎12 ⟹ 𝑢12 = 𝑎12
11

𝑎
𝑙11 × 𝑢13 = 𝑎13 ⟹ 𝑢13 = 𝑎13
11

𝑎21 ×𝑎12
𝑙21 × 𝑢12 + 𝑙22 = 𝑎22 ⟹ 𝑙22 = 𝑎22 − 𝑎11

𝑎
𝑙31 × 𝑢12 + 𝑙32 = 𝑎32 ⟹ 𝑙32 = 𝑎32 − 𝑎31 × 𝑎12
11

1 𝑎
𝑙21 × 𝑢13 + 𝑙22 × 𝑢23 = 𝑎23 ⟹ 𝑢23 = 𝑙 (𝑎23 − 𝑎21 × 𝑎13 )
22 11

𝑎
𝑙31 × 𝑢13 + 𝑙32 × 𝑢23 + 𝑙33 = 𝑎33 ⟹ 𝑙33 = 𝑎33 − 𝑎31 × 𝑎13 − 𝑙32 × 𝑢23
11

Page 47
Numerical Method for Engineering

Now, 𝐴𝑥 = 𝑏 ⟹ 𝐿𝑈𝑥 = 𝑏, then let 𝑈𝑥 = 𝑣 ⟹ 𝐿𝑣 = 𝑏.

𝑙11 0 0 𝑥1 𝑏1
⟹ (𝑙21 𝑙22 𝑥
0 ) ( 2 ) = (𝑏2 )
𝑙31 𝑙32 𝑙33 𝑥3 𝑏3

⟹ 𝑙11 × 𝑣1 = 𝑏1

𝑙21 × 𝑣1 + 𝑙22 × 𝑣2 = 𝑏2

𝑙31 × 𝑣1 + 𝑙32 × 𝑣2 + 𝑙31 × 𝑣3 = 𝑏3

Then, solve for 𝑣1 , 𝑣2 and 𝑣3 by forward substitution formula. Then we have

1 𝑢12 𝑢13 𝑥1 𝑣1
𝑈𝑥 = 𝑣 ⟹ (0 1 𝑢23 ) (𝑥2 ) = (𝑣2 )
0 0 1 𝑥3 𝑣3

⟹ 𝑥1 + 𝑢12 × 𝑥2 + 𝑢13 × 𝑥3 = 𝑣1
𝑥2 + 𝑢23 × 𝑥3 = 𝑣2
𝑥3 = 𝑣3
Then, solve for 𝑥1 , 𝑥2 and 𝑥3 using the backward substitution formula.
Example 3.8 Using matrix decomposition method solve the following system of linear
equations.
𝑥+𝑦+𝑧 =1
4𝑥 + 3𝑦 − 𝑧 = 6
3𝑥 + 5𝑦 + 3𝑧 = 4
Solution: The system is given as:
1 1 1 𝑥 1
(4 3 −1) (𝑦) = (6)
3 5 3 𝑧 4
Let 𝐿𝑈 = 𝐴
𝑙11 0 0 1 𝑢12 𝑢13 1 1 1
⟹ (𝑙21 𝑙22 0 ) (0 1 𝑢23 ) = (4 3 −1)
𝑙31 𝑙32 𝑙33 0 0 1 3 5 3
Then, solve the unknowns by equating the two matrices and we get
𝑙11 = 1, 𝑙21 = 4, 𝑙31 = 3

Page 48
Numerical Method for Engineering

𝑢12 = 1, 𝑢13 = 1
𝑙22 = −1, 𝑙32 = 2
𝑢23 = 5 and 𝑙33 = −10
Then, we have
1 0 0 𝑣1 1
𝐿𝑣 = 𝑏 ⟹ (4 −1 𝑣
0 ) ( 2 ) = (6 )
3 2 −10 𝑣3 4
⟹ 𝑣1 = 1
4𝑣1 − 𝑣2 = 6
3𝑣1 + 2𝑣2 − 10𝑣3 = 4

Then, by applying the forward substitution formula we get


1
𝑣1 = 1, 𝑣2 = −2 and 𝑣3 = − 2

1 1 1 𝑥 1
−2
Then, 𝑈𝑥 = 𝑣 ⟹ (0 1 5) (𝑦) = ( 1)
0 0 1 𝑧 −2

⟹𝑥+𝑦+𝑧 =1
𝑦 + 5𝑧 = −2
1
𝑧 = −2

Then, by applying the backward substitution formula we get


1 1
𝑧 = − 2 , 𝑦 = 2 and 𝑥 = 1
1 1 𝑡
Therefore, the solution of the system is 𝑥 = {(𝑥, 𝑦, 𝑧)𝑡 = (1, 2 , − 2) }.

Example 3.9 Use Matrix decomposition method to solve the system


2𝑥1 + 3𝑥2 + 𝑥3 = 9
𝑥1 + 2𝑥2 + 3𝑥3 = 6
3𝑥1 + 𝑥2 + 2𝑥3 = 8
Solution: the corresponding coefficient matrix is
2 3 1
𝐴 = [1 2 3]
3 1 2

Page 49
Numerical Method for Engineering

1 0 0 𝑢11 𝑢12 𝑢13 2 3 1


Let [𝑙21 1 0] [ 0 𝑢22 𝑢23 ] = [1 2 3]
𝑙31 𝑙32 1 0 0 𝑢33 3 1 2
i) Clearly, 𝑢11 = 2, 𝑢12 = 3, 𝑢13 = 1, and 𝑙21 𝑢11 = 1, 𝑙31 𝑢11 = 3. So that, 𝑙21 = 1/2, and
𝑙31 = 3/2.
For 𝑢22 and 𝑢23 , we have the equations 𝑙21 𝑢12 + 𝑢22 = 2 and 𝑙21 𝑢13 + 𝑢23 = 3. This implies that,
𝑢22 = 1/2 and 𝑢23 = 5/2. Finally, 𝑙32 and 𝑢33 are obtained from 𝑙31 𝑢12 + 𝑙32 𝑢22 = 1 and
𝑙31 𝑢13 + 𝑙32 𝑢23 + 𝑢33 = 2 and hence, 𝑙32 = −7 and 𝑢33 = 18. It follows that,
1 0 0 2 3 1
𝐿𝑈 = [1/2 1 0] [0 1/2 5/2] (ii)
3/2 −7 1 0 0 18
Then the system of equations can be written as
1 0 0 𝑣1 9
𝐿𝑣 = [ 1/2 1 0] [𝑣2 ] = [6] (iii)
3/2 −7 1 𝑣3 8
Where,
2 3 1 x1 𝑣1
[0 1/2 x 𝑣
5/2] [ 2 ] = [ 2 ] (iv)
0 0 18 x3 𝑣3
Hence solving the system in (iii) by forward substitution, we get
v1 = 9, v2 = 3/2, and v3 = 5.
Thus, solving the system in (iv) by backward substitution for the unknowns, we obtain
x1 = 35/18, x2 = 29/18, and x3 = 5/18.

Exercise 3.5 Solve the following system of linear equations using matrix decomposition method.
a. 2𝑥 + 𝑦 + 4𝑧 = 12 b. 2𝑥 + 𝑦 − 3𝑧 = 11
8𝑥 − 3𝑦 + 2𝑧 = 20 4𝑥 − 2𝑦 + 3𝑧 = 8
4𝑥 + 11𝑦 − 𝑧 = 33 −2𝑥 + 2𝑦 − 𝑧 = −6

3.1.6 Thomas Algorithm for Tridiagonal System

Page 50
Numerical Method for Engineering

Consider the system of linear simultaneous algebraic equations given by 𝑨𝒙 = 𝑏


Where A is a tridiagonal matrix, 𝑥 = [𝑥1 , 𝑥2 , … , 𝑥𝑛 ]𝑇 𝑎𝑛𝑑 𝑏 = [𝑏1 , 𝑏2 , … , 𝑏𝑛 ]𝑇 .
Hence, we consider a 4 × 4 tridiagonal system of equations given by
𝑎12 𝑎13 0 0 𝑥1 𝑏1
𝑎 𝑎22 𝑎23 0 𝑥2 𝑏
[ 21 ] [ ] = [ 2] (1)
0 𝑎31 𝑎32 𝑎33 𝑥3 𝑏3
0 0 𝑎41 𝑎42 𝑥4 𝑏4
equation (1) can be written as
𝑎12 𝑥1 + 𝑎13 𝑥2 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥2 + 𝑎32 𝑥3 + 𝑎33 𝑥4 = 𝑏3 (2)
𝑎41 𝑥3 + 𝑎42 𝑥4 = 𝑏4
The system of equations given by Eq. (2) is solved using Thomas Algorithm which is described
in three steps as shown below:
𝑎𝑖1 𝑎(𝑖−1)3
Step 1: Set 𝑦1 = 𝑎12 and compute 𝑦𝑖 = 𝑎𝑖2 − 𝑖 = 2,3,4 … 𝑛
𝑦𝑖−1
𝑏 𝑏𝑖 −𝑎𝑖1 𝑧𝑖−1
Step 2: Set 𝑧1 = 𝑦1 = and compute 𝑧𝑖 = 𝑖 = 2,3,4 … 𝑛
1 𝑦𝑖
𝑎𝑖3 𝑥𝑖+1
Step 2: Set 𝑥𝑛 = 𝑧𝑛 and compute 𝑥𝑖 = 𝑧𝑖 − 𝑖 = 𝑛 − 1, 𝑛 − 2 , … ,1.
𝑦𝑖

Example 3.10 Solve the following equations by Thomas Algorithm.


3𝑥1 − 𝑥2 = 5
2𝑥1 − 3𝑥2 + 2𝑥3 = 5
𝑥2 + 2𝑥3 + 5𝑥4 = 10
𝑥3 − 𝑥4 = 1
3 − 1 0 0 𝑥1 5
2 − 3 2 0 𝑥2 5
Solution Here [ ] ⌈𝑥 ⌉=⌈ ⌉
0 1 2 5 3 10
0 0 1 − 1 𝑥4 1
⌈𝑎21 𝑎31 𝑎41 ⌉ = [2 1 1]
⌈𝑎12 𝑎22 𝑎32 𝑎42 ⌉ = [3 − 3 2 − 1]
⌈𝑎13 𝑎23 𝑎33 ⌉ = [−1 2 5]

⌈𝑏1 𝑏2 𝑏3 𝑏4 ⌉ = [5 5 10 1]

Page 51
Numerical Method for Engineering
𝑎𝑖1 𝑎(𝑖−1)3
Step 1: Set 𝑦1 = 𝑎12 and compute 𝑦𝑖 = 𝑎𝑖2 − 𝑖 = 2,3,4 … 𝑛
𝑦𝑖−1
𝑎21 𝑎13 2(−1) 7
𝑦1 = 3 𝑖=2 𝑦2 = 𝑎22 − = −3 − = −3
𝑦1 3

𝑎31 𝑎23 1𝑥2 20


𝑖=3 𝑦3 = 𝑎32 − =2− =
𝑦2 −7⁄ 7
3
𝑎41 𝑎33 1𝑥5 55
𝑖=4 𝑦4 = 𝑎42 − = −1 − =−
𝑦3 20⁄ 20
7
𝑏 5 𝑏𝑖 −𝑎𝑖1 𝑧𝑖−1
Step 2: Set 𝑧1 = 𝑦1 =3 and compute 𝑧𝑖 = 𝑖 = 2,3,4 … 𝑛
1 𝑦𝑖

𝑏2 − 𝑎21 𝑧1 5 − 2(5⁄3) 5
𝑖=2 𝑧2 = = =−
𝑦2 −7⁄ 7
3
𝑏3 − 𝑎31 𝑧2 10 − 1(−5⁄7) 75
𝑖=3 𝑧3 = = =
𝑦3 20⁄ 20
7
𝑏4 − 𝑎41 𝑧3 1 − 1(75⁄20)
𝑖=4 𝑧4 = = =1
𝑦4 −55⁄
20
𝑎𝑖3 𝑥𝑖+1
Step 2: Set 𝑥4 = 𝑧4 = 1 and compute 𝑥𝑖 = 𝑧𝑖 − 𝑖 = 𝑛 − 1, 𝑛 − 2 , … ,1.
𝑦𝑖

𝑎33 𝑥4 75 5𝑥1
𝑖=3 𝑥3 = 𝑧3 − = − =2
𝑦3 20 20⁄7
𝑎23 𝑥3 5 2𝑥2
𝑖=2 𝑥2 = 𝑧2 − = − =1
𝑦2 7 −7⁄3
𝑎13 𝑥2 5 (−1)(2)
𝑖=1 𝑥1 = 𝑧1 − = − =2
𝑦1 3 3
Exercise 3.6
Solve the following set of tridiagonal set of algebraic equations using Thomas’s method.

𝑥1 + 4𝑥2 = 10
2𝑥1 + 10𝑥2 − 4𝑥3 = 7
𝑥2 + 8𝑥3 − 𝑥4 = 6
𝑥3 − 6𝑥4 = 4

3.2 In direct methods for system of linear equations

Page 52
Numerical Method for Engineering

Objectives

At the end of this topic students should be able to:

➢ Identify Gauss Jacobi method and Gauss Seidel method of solving of system of linear
equation
➢ Solve system of linear equations using Gauss Jacobi and Gauss Seidel methods

Introduction: As a numerical technique, Gaussian elimination is rather unusual because it is


direct. That is, a solution is obtained after a single application of Gaussian elimination. Once a
“solution” has been obtained, Gaussian elimination offers no method of refinement. The lack of
refinements can be a problem because, as the previous section shows, Gaussian elimination is
sensitive to rounding error.

Numerical techniques more commonly involve an iterative method. For example, in


Calculus we probably studied Newton’s iterative method for approximating the zeros of a
differentiable function. In this section we will look at two iterative methods for approximating the
solution of a system of n linear equations in n variables.
3.2.1. Gauss Jacobi Method

The first iterative technique is called the Jacobi method, after Carl Gustav Jacob Jacobi
(1804–1851). This method makes two assumptions:

1. The system given by


𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
⋮ ⋮ ⋮ ⋮
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
has a unique solution
2. The coefficient matrix 𝐴 has no zeros on its main diagonal, namely 𝑎11 , 𝑎22 , … , 𝑎𝑛𝑛 are
nonzeros. That is, if any of the diagonal entries are zero, then rows or columns must be
interchanged to obtain a coefficient matrix that has nonzero entries on the main diagonal.

Main idea of Jacobi

Page 53
Numerical Method for Engineering

To begin, solve the 1st equation for 𝑥1 , the 2nd equation for 𝑥2 and so on to obtain the rewritten
equations:
1
𝑥1 = (𝑏 − 𝑎12 𝑥2 − 𝑎13 𝑥3 − ⋯ − 𝑎1𝑛 𝑥𝑛 )
𝑎11 1
1
𝑥2 = (𝑏 − 𝑎21 𝑥1 − 𝑎23 𝑥3 − ⋯ − 𝑎2𝑛 𝑥𝑛 )
𝑎22 2

1
𝑥𝑛 = (𝑏 − 𝑎𝑛1 𝑥1 − 𝑎𝑛2 𝑥2 − ⋯ − 𝑎𝑛−1 𝑥𝑛−1
𝑎𝑛𝑛 𝑛
Then make an initial guess (assumption) of the solution 𝑋 (0) = (𝑥1 (0) , 𝑥2 (0) , … , 𝑥𝑛 (0) ). Substitute
these values into the right hand side the of the rewritten equations to obtain the first approximation,
(𝑥1 (1) , 𝑥2 (1) , … , 𝑥𝑛 (1) ).
This accomplishes one iteration.
In the same way, the second approximation (𝑥1 (2) , 𝑥2 (2) , … , 𝑥𝑛 (2) ) is computed by substituting
the first approximation’s 𝑋 − values into the right hand side of the rewritten equations.

By repeated iterations, we form a sequence of approximations

𝑋 (𝑘) = (𝑥1 (𝑘) , 𝑥2 (𝑘) , … , 𝑥𝑛 (𝑘) ), 𝑘 = 1,2,3, ….

The Jacobi Method, for each 𝑘 ≥ 1, generate the components of from 𝑥𝑖 (𝑘) of 𝑋 (𝑘) by

𝑛
(𝑘)
1
𝑥𝑖 = ∑(−𝑎𝑖𝑗 𝑥𝑗 (𝑘−1) ) + 𝑏𝑖 , 𝑓𝑜𝑟 𝑖 = 1,2, … , 𝑛
𝑎𝑖𝑖
𝑗=1,
[ 𝑗≠𝑖 ]

Example 3.11: Apply the Jacobi method to solve

5𝑥1 − 2𝑥2 + 3𝑥3 = −1

−3𝑥1 + 9𝑥2 + 𝑥3 = 2

2𝑥1 − 𝑥2 − 7𝑥3 = 3

Page 54
Numerical Method for Engineering

Continue the iterations until two successive approximations are identical when rounded to three
significant digits.
Solution: To begin, write the system in the form

1 2 3
𝑥1 = − + 𝑥2 − 𝑥3
5 5 5

2 3 1
𝑥2 = + 𝑥1 − 𝑥3
9 9 9

3 2 1
𝑥3 = − + 𝑥1 − 𝑥2
7 7 7

Because we do not know the actual solution, choose

𝑥1 = 0, 𝑥2 = 0, 𝑥3 = 0 Initial approximation

as a convenient initial approximation. So, the first approximation is

1 2 3
𝑥1 = − + (0) − (0) = −0.200
5 5 5

2 3 1
𝑥2 = + (0) − (0) ≈ 0.222
9 9 9

3 2 1
𝑥3 = − + (0) − (0) ≈ −0.429
7 7 7

That is (𝑥1 (1) , 𝑥2 (1) , 𝑥3 (1) ) = (−0.200, 0.222, −0.429)

Continuing this procedure, we obtain the sequence of approximations shown in Table 3.2.

Table 3.2
𝑛 0 1 2 3 4 5 6 7
𝑥1 0.000 −0.200 0.146 0.192 𝑜. 181 0.185 0.186 0.186
𝑥2 0.000 0.222 0.203 0.328 0.332 0.329 0.331 0.331
𝑥3 0.000 −0.429 −0.517 −0.416 −0.421 −0.424 −0.423 −0.423

Because the last two columns in Table 3.2 are identical, we can conclude that to three significant
digits the solution is

Page 55
Numerical Method for Engineering

𝑥1 = 0.186, 𝑥2 = 0.331, 𝑎𝑛𝑑 𝑥3 = −0.423.

Note: For the system of linear equations given in Example 3.10, the Jacobi method is said to
converge. That is, repeated iterations succeed in producing an approximation that is correct to
three significant digits. As is generally true for iterative methods, greater accuracy would require
more iteration.
3.2.2. The Gauss-Seidel Method

You will now look at a modification of the Jacobi method called the Gauss-Seidel method, named
after Carl Friedrich Gauss (1777–1855) and Philipp L. Seidel (1821–1896). This modification is
no more difficult to use than the Jacobi method, and it often requires fewer iterations to produce
the same degree of accuracy.
With the Jacobi method, the values of 𝑥𝑖 obtained in the nth approximation remain
Unchanged until the entire (𝑛 + 1)th approximation has been calculated. With the Gauss-
Seidel method, on the other hand, we use the new values of each as soon as they are known. That
is, once we have determined 𝑥1 from the first equation, its value is then used in the second equation
to obtain the new 𝑥2 .
Similarly, the new 𝑥1 and 𝑥2 are used in the third equation to obtain the new 𝑥3 and so on. This
procedure is demonstrated in
Example 3.12 Use the Gauss-Seidel iteration method to approximate the solution to the system
of equations given in Example 3.10.
Solution: The first computation is identical to that given in Example 3.10. That is, using

(𝑥1 , 𝑥2 , 𝑥3 ) = (0,0,0)
as the initial approximation, we obtain the following new value for 𝑥1 .

1 2 3
𝑥1 = − + (0) − (0) = −0.200
5 5 5

Now that we have a new value for 𝑥1 , however, use it to compute a new value for 𝑥2 . That is,
2 3 1
𝑥2 = + (−0.200) − (0) ≈ 0.156
9 9 9
Similarly, use 𝑥1 = −0.200 and 𝑥2 = 0.156 to copmute a new value for 𝑥3 . That is,
3 2 1
𝑥3 = − 7 + 7 (−0.200) − 7 (0.156) ≈ −0.508.

Page 56
Numerical Method for Engineering

So the first approximation is 𝑥1 = −0.200, 𝑥2 = 0.156, 𝑎𝑛𝑑 𝑥3 = −0.508. Continued iterations


produce the sequence of approximations shown in Table 3.3.
Table 3.3

𝑛 0 1 2 3 4 5

𝑥1 0.000 −0.200 0.167 0.191 0.186 0.186

𝑥2 0.000 0.156 0.334 0.333 0.331 0.331

𝑥3 0.000 −0.508 −0.429 −0.422 −0.423 −0.423

Note that after only five iterations of the Gauss-Seidel method, we achieved the same accuracy as
was obtained with seven iterations of the Jacobi method in Example 3.2.
Note: Neither of the iterative methods presented in this section always converges. That is, it is
possible to apply the Jacobi method or the Gauss-Seidel method to a system of linear equations
and obtain a divergent sequence of approximations. In such cases, it is said that the method
diverges.
Example 3.13: (An Example of Divergence) Apply the Jacobi method to the system

𝑥1 = 5𝑥2 = −4

7𝑥1 − 𝑥2 = 6
using the initial approximation (𝑥1 , 𝑥2 ) = (0,0), and show that the method diverges.

Solution: As usual, begin by rewriting the given system in the form


𝑥1 = −4 + 5𝑥2

𝑥2 = −6 + 7𝑥1
Then the initial approximation (0, 0) produces
𝑥1 = −4 + 5(0) = −4

𝑥2 = −6 + 7(0) = −6

As the first approximation. Repeated iterations produce the sequence of approximations shown in
Table 3.4.

Page 57
Numerical Method for Engineering

Table 3.4

𝑛 0 1 2 3 4 5 6 7

𝑥1 0 −4 −34 −174 −1244 −6124 −42874 −214374

𝑥2 0 −6 −34 −244 −1244 −6574 −42874 −300124

For this particular system of linear equations we can determine that the actual solution is 𝑥1 = 1
and 𝑥2 = 1. So we can see from Table 3.4 that the approximations given by the Jacobi method
become progressively worse instead of better, and you can conclude that the method diverges.
The problem of divergence in Example 3.3 is not resolved by using the Gauss-Seidel method rather
than the Jacobi method. In fact, for this particular system the Gauss-Seidel method diverges more
rapidly, as shown in Table 3.4.
Table 3.4
𝑛 0 1 2 3 4 5

𝑥1 0 −4 −174 −6124 −214374 −7503124

𝑥2 0 −34 −1224 −42874 −1500624 −52521874

With an initial approximation of (𝑥1 , 𝑥2 ) = (0,0) neither the Jacobi method nor the Gauss-Seidel
method converges to the solution of the system of linear equations given in Example 3.3. We will
now look at a special type of coefficient matrix 𝐴, called a strictly diagonally dominant matrix, for
which it is guaranteed that both methods will converge.
Definition: (Strictly Diagonally Dominant Matrix)
An 𝑛 × 𝑛 matrix A is strictly diagonally dominant if the absolute value of each entry on the main
diagonal is greater than the sum of the absolute values of the other entries in the same row. That
is,
|𝑎11 | > |𝑎12 | + |𝑎13 | + ⋯ + |𝑎1𝑛 |
|𝑎22 | > |𝑎21 | + |𝑎23 | + ⋯ + |𝑎2𝑛 |

Page 58
Numerical Method for Engineering

|𝑎𝑛𝑛 | > |𝑎𝑛1 | + |𝑎𝑛2 | + ⋯ + |𝑎𝑛,𝑛−1 |


Example 3.14 which of the following systems of linear equations has a strictly diagonally
dominant coefficient matrix?

a) 3𝑥1 − 𝑥2 = −4
2𝑥1 + 5𝑥2 = 2
b) 4𝑥1 + 2𝑥2 − 𝑥3 = −1
𝑥1 + 2𝑥3 = −4
3𝑥1 − 5𝑥2 + 𝑥3 = 3

Solution

a) The coefficient matrix of the system is


3 −1
𝐴=[ ]
2 5
And is strictly diagonally dominant because|3| > |−1|𝑎𝑛𝑑 |5| > |2|.
b) The coefficient matrix of the system is
4 2 −1
𝐴 = [1 0 2]
3 −5 1
is not strictly diagonally dominant because the entries in the second and third rows do not conform
to the definition. For instance, in the second row 𝑎21 = 1, 𝑎22 = 0, 𝑎23 = 2 and it is not true that
|𝑎22 | > |𝑎21 | + |𝑎23 |. Interchanging the second and third rows in the original system of linear
equations, however, produces the coefficient matrix
4 2 −1
𝐴 = [3 −5 1 ]
1 0 2

and this matrix is strictly diagonally dominant.


The following theorem, which is listed without proof, states that strict diagonal dominance is
sufficient for the convergence of either the Jacobi method or the Gauss-Seidel method.
Theorem 3.2 (Convergence of the Jacobi and Gauss-Seidel methods)
If 𝐴 is strictly diagonally dominant, then the system of linear equations given by 𝐴𝒙 = 𝒃 has a
unique solution to which the Jacobi method and the Gauss-Seidel method will converge for any
initial approximation.

Page 59
Numerical Method for Engineering

In Example 3.13 we looked at a system of linear equations for which the Jacobi and Gauss-Seidel
methods diverged. In the following example you can see that by interchanging the rows of the
system given in Example 3.13, we can obtain a coefficient matrix that is strictly diagonally
dominant. After this interchange, convergence is assured.
Example 3.15: Interchange the rows of the system
𝑥1 − 5𝑥2 = −4
7𝑥1 − 𝑥2 = 6
to obtain one with a strictly diagonally dominant coefficient matrix. Then apply the Gauss-Seidel
method to approximate the solution to four significant digits.
Solution: Begin by interchanging the two rows of the given system we obtain
7𝑥1 − 𝑥2 = 6
𝑥1 − 5𝑥2 = −4
Note that the coefficient matrix of this system is strictly diagonally dominant. Then solve
for 𝑥1 and 𝑥2 as follows.
6 1
𝑥1 = + 𝑥
7 7 2
4 1
𝑥2 = + 𝑥1
5 5
Using the initial approximation (𝑥1 , 𝑥2 ) = (0,0) you can obtain the sequence of approximations
shown in Table 3.5.
Table 3.5
𝑛 0 1 2 3 4 5

𝑥1 0.0000 0.8571 0.9959 0.9999 1.000 1.000

𝑥2 0.0000 0.9714 0.9992 1.000 1.000 1.000

So we can conclude that the solution is 𝑥1 = 1 𝑎𝑛𝑑 𝑥2 = 1.

Note: Theorem 3.2 does not imply that strict diagonal dominance is a necessary condition for
convergence of the Jacobi or Gauss-Seidel methods. For instance, the coefficient matrix of the
system
−4𝑥1 + 5𝑥2 = 1
𝑥1 + 2𝑥2 = 3

Page 60
Numerical Method for Engineering

Here the coefficient of the system is not a strictly diagonally dominant matrix, and yet both
methods converge to the solution 𝑥1 = 1 and 𝑥2 = 1 when you use an initial approximation of
(𝑥1 , 𝑥2 ) = (0,0).
Exercise 3.7
1. Apply the Jacobi and Gauss-Seidel methods to the given system of linear equations, using
the initial approximation(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = (0,0, … ,0). Continue performing iterations until
two successive approximations are identical when rounded to three significant digits.
a) 3𝑥1 − 𝑥2 = 2
𝑥1 + 4𝑥2 = 5
b) 2𝑥1 − 𝑥2 =2
𝑥1 − 3𝑥2 + 𝑥3 = −2
−𝑥1 + 𝑥2 − 3𝑥3 = −6
c) 4𝑥1 + 𝑥2 + 𝑥3 = 7
𝑥1 − 7𝑥2 + 2𝑥3 = −2
3𝑥1 + 4𝑥3 = 11
2. Show that the Gauss-Seidel method diverges for the given system using the initial
approximation(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = (0,0, … ,0).
a) 𝑥1 − 2𝑥2 = −1
2𝑥1 + 𝑥2 = 3
b) 2𝑥1 − 3𝑥2 = −7
𝑥1 + 3𝑥2 − 10𝑥3 = 9
3𝑥1 + 𝑥3 = 13
3. Determine whether the following matrices are strictly diagonally dominant or not.
2 1
a) 𝐴 = [ ]
3 5
12 6 0
b) 𝐴 = [ 2 −3 2]
0 6 13
7 5 −1
c) 𝐴 = [1 −4 1]
0 2 −3

Page 61
Numerical Method for Engineering

4. Interchange the rows of the system of linear equations in Exercise 2 (a) to obtain a system
with a strictly diagonally dominant coefficient matrix. Then apply the Gauss-Seidel method
to approximate the solution to two significant digits.
5. Interchange the rows of the system of linear equations
−𝑥1 + 4𝑥2 = 1
3𝑥1 − 2𝑥2 = 2
to obtain a system with a strictly diagonally dominant coefficient matrix. Then apply the
Gauss-Seidel method to approximate the solution to two significant digits.
6. The coefficient matrices of the following system of linear equations are not strictly
diagonally dominant. Show that the Jacobi and Gauss-Seidel methods converge using an
initial approximation of (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = (0,0, … ,0).
a) −4𝑥1 + 5𝑥2 = 1
𝑥1 + 2𝑥2 = 3
b) 4𝑥1 + 2𝑥2 − 2𝑥3 = 0
𝑥1 − 3𝑥2 − 𝑥3 = 7
3𝑥1 − 𝑥2 + 4𝑥3 = 5
3.3. Solving systems of Non-linear Equations using Newton’s Method

Objectives:

At the end of this topic students will be able to:

➢ Identify linear and non-linear system of equations


➢ Identify Newton’s formula for non-linear system of equations
➢ Solve system of non-linear equation using Newton’s method

Introduction:

Solving a system of nonlinear equations is a problem that is avoided when possible, customarily
by approximating the nonlinear system by a system of linear equations. When this is
unsatisfactory, the problem must be tackled directly
Page 62
Numerical Method for Engineering

Definition: A system of nonlinear equations has the form

𝑓1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

𝑓2 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

⋮ ⋮

𝑓𝑛 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

where each function 𝑓𝑖 can be thought of as mapping a vector 𝒙 = (𝑥1 , 𝑥2 , . . . , 𝑥𝑛 )𝑡


of the 𝑛-dimensional space ℝ𝑛 into the real line ℝ.

In general, we can usually find solutions to a system of equations when the number of unknowns
matches the number of equations. Thus, we wish to find solutions to systems that have the form:

𝑓1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

𝑓2 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0

⋮ ⋮

𝑓𝑛 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0. (1)

For convenience we can think of 𝑥1 , 𝑥2 , … , 𝑥𝑛 ) as a vector 𝒙 and (𝑓1 , 𝑓2 , … , 𝑓𝑛 ) as a vector valued


function 𝑓 . With this notation, we can write the system of equations (1) simply as: 𝒇(𝒙) = 𝟎.
That is, we wish to find a vector that makes the vector function equal to the zero vectors.
As in Newton’s method for one variable, we need to start with an initial guess 𝒙0 . In theory, the
more variables one has, the harder it is to find a good initial guess. In practice, this must be
overcome by using physically reasonable assumptions about the possible values of a solution, i.e.
take advantage of engineering knowledge of the problem. Once 𝒙0 is chosen, let
∆𝒙 = 𝒙𝟏 − 𝒙𝟎 .
Linear Approximation for Vector Functions
In the single variable case, Newton’s method was derived by considering the linear approximation
of the function 𝑓 at the initial guess 𝒙0. From Calculus, the following is the linear approximation
of 𝑓 at 𝒙0 , for vectors and vector-valued functions:
𝒇(𝒙) ≈ 𝒇(𝒙0 ) + 𝐷𝒇(𝒙0 )(𝒙 − 𝒙0 ).

Page 63
Numerical Method for Engineering

Here 𝐷𝒇(𝒙0 ) is an 𝑛 × 𝑛 matrix whose entries are the various partial derivative of the components
of . Specifically:
𝜕𝑓1 𝜕𝑓1 𝜕𝑓1
(𝒙0 ) (𝒙0 ) (𝒙0 )
𝜕𝑥1 𝜕𝑥2 𝜕𝑥𝑛
𝜕𝑓2 𝜕𝑓2
⋯ 𝜕𝑓2
(𝒙0 ) (𝒙0 ) (𝒙0 )
𝐷𝒇(𝒙0 ) = 𝜕𝑥 𝜕𝑥2 𝜕𝑥𝑛 (2)
⋮ ⋮ ⋱ ⋮
𝜕𝑓𝑛 𝜕𝑓𝑛 𝜕𝑓𝑛
(𝒙0 ) (𝒙0 ) ⋯ (𝒙0 )]
[ 𝜕𝑥 1 𝜕𝑥 2 𝜕𝑥𝑛

The matrix 𝐷𝑓(𝑥0 ) is called the Jacobian matrix and id denoted by 𝐽(𝒙0 )and has a number of
applications in analysis. That is
𝜕𝑓1 𝜕𝑓1 𝜕𝑓1
(𝒙0 ) (𝒙 ) (𝒙 )
𝜕𝑥1 𝜕𝑥2 0 𝜕𝑥𝑛 0

𝜕𝑓2 𝜕𝑓2 𝜕𝑓2
𝐽(𝒙0 ) = 𝜕𝑥 (𝒙0 ) 𝜕𝑥2 (𝒙0 ) (𝒙 )
𝜕𝑥𝑛 0
⋮ ⋮ ⋱ ⋮
𝜕𝑓𝑛 𝜕𝑓𝑛 𝜕𝑓𝑛
(𝒙 ) (𝒙 ) ⋯ (𝒙 )
[𝜕𝑥1 0 𝜕𝑥2 0 𝜕𝑥𝑛 0 ]

Newton’s method

We wish to find 𝒙 that makes 𝒇 equal to the zero vectors, so let’s choose 𝒙1 so that

𝒇(𝒙0 ) + 𝐽(𝒙0 )(𝒙1 − 𝒙0 ) = 0

Since 𝐷𝒇(𝒙0 ) is a square matrix, we can solve this equation by

𝒙1 = 𝒙0 − (𝐽(𝒙0 ))−1 𝒇(𝒙0 )

provided that the inverse exists. The formula is the vector equivalent of the Newton’s method
formula we learned before. However, in practice we never use the inverse of a matrix for
computations, so we cannot use this formula directly. Rather, we can do the following. First solve
the equation
𝐽(𝒙0 )∆𝒙 = −𝒇(𝒙0 ) (3)

Page 64
Numerical Method for Engineering

Since 𝐽(𝒙0 ) is a known matrix and −𝒇 (𝒙0 ) is a known vector, this equation is just a system of
linear equations, which can be solved efficiently and accurately. Once we have the solution vector
∆𝒙, we can obtain our improved estimate 𝒙1 by:
𝒙1 = 𝒙0 + ∆𝒙
For subsequent steps, we have the following process:
❖ Solve 𝐽(𝒙𝑖 )∆𝒙 = −𝒇(𝒙𝑖 ) for ∆𝒙
❖ Let 𝒙𝑖+1 = 𝒙1 + ∆𝒙
Example 3.16 Solve the following non-linear system equations using Newton’s method by leting
𝑥0 = (2,1) for about four approximations.
𝑥 2 + 𝑦 2 − 50 = 0
𝑥𝑦 − 25 = 0
Solution: let
𝑓1 (𝑥, 𝑦) = 𝑥 2 + 𝑦 2 − 50 = 0
𝑓2 (𝑥, 𝑦) = 𝑥𝑦 − 25 = 0
𝑥 2 + 𝑦 2 − 50
⟹ 𝑓(𝒙) = [ ]
𝑥𝑦 − 25
From this we have
2𝑥 2𝑦
𝐽(𝒙) = [ ]
𝑦 𝑥
and ∆𝒙 = 𝐽(𝒙)−1 (−𝑓(𝒙))

−45
Where 𝑓(𝒙0 ) = [ ] because 𝒙0 = (2,1), which implies
−23
45 4 2 1 2 −2
−𝑓(𝒙0 ) = [ ] and 𝐽(𝒙0 ) = [ ] ⟹ 𝐽(𝒙0 )−1 = 6 [ ]
23 1 2 1 4
Hence
22
∆𝑥0 = 𝐽(𝒙0 )−1 (−𝑓(𝒙0 )) = [ 3 ]
53
6
28
3 9.33333
⟹ 𝒙1 = 𝒙0 + ∆𝒙0 = [59 ]=[ ]
8.83333
6

Page 65
Numerical Method for Engineering

9.33333
Again consider 𝒙1 = [ ] as initial value and hence calculate the next Approximation.
8.83333
9.33333 115.1389 −115.1389
Here 𝒇(𝒙1 ) = 𝒇 [ ]=[ ] ⟹ −𝒇(𝒙1 ) = [ ]
8.83333 57.44444 −57.44444
18.66667 17.66667 0.513761 −0.97248
and 𝐽(𝒙1 ) = [ ] ⟹ 𝐽(𝒙1 )−1 = [ ]
8.833333 9.333333 −0.48624 1.027523
−3.29052
∆𝒙1 = 𝐽(𝒙1 )−1 (−𝑓(𝑥1 )) = [ ]
−3.04052
Thus
6.042813
𝒙2 = 𝒙1 + ∆𝒙1 = [ ]
5.792813
6.042813
Again consider 𝒙2 = [ ] as initial value and hence calculate the next approximation. Then
5.792813
6.042813 20.072289 −20.0723
𝒇(𝒙2 ) = 𝒇 [ ]=[ ] ⟹ −𝒇(𝒙2 ) = [ ]
5.792813 10.00489 −10.0049
12.08563 11.58563 1.021123 −1.95775
And 𝐽(𝒙2 ) = [ ] ⟹ 𝐽(𝒙2 )−1 = [ ] and
5.792813 6.042813 −0.97888 2.042245

−0.90914
∆𝒙𝟐 = 𝐽(𝒙2 )−1 (−𝑓(𝒙2 )) = [ ]
−0.78414
Hence
5.133673
𝒙3 = 𝒙2 + ∆𝒙2 = [ ]
5.008673
5.133673
Again consider 𝒙3 = [ ] as initial value and hence calculate the next approximation.
5.008673
5.133673 1.441411 −1.441411
Then 𝒇(𝒙3 ) = 𝒇 [ ]=[ ] ⟹ −𝒇(𝒙3 ) = [ ]
5.008673 0.712893 −0.712893
10.26735 10.01735 2.024649 −3.9507
And 𝐽(𝒙3 ) = [ ] ⟹ 𝐽(𝒙3 )−1 = [ ] and
5.008673 5.133673 −1.97535 4.049298

−0.10192
∆𝒙𝟑 = 𝐽(𝒙3 )−1 (−𝑓(𝒙3 )) = [ ]
−0.03942
Hence
5.031749
𝒙4 = 𝒙3 + ∆𝒙3 = [ ]
4.969249
Note: We precede this process until we get the idea ‖∆𝑥𝑛 ‖ ≤ 𝜀 or ‖𝑥𝑛 − 𝑥𝑛−1 ‖ ≤ 𝜀. Where 𝜀 is
called pre specified error (or tolerance) and is usually given.
Exercise 3.8

Page 66
Numerical Method for Engineering

1. Solve the system of non-linear equations


1
3𝑥1 − cos(𝑥2𝑥3 ) − =0
2
𝑥1 2 − 81(𝑥2 + 0.1)2 + 𝑠𝑖𝑛𝑥3 + 1.06 = 0
1
𝑒 −𝑥1𝑥2 + 20𝑥3 + (10𝜋 − 3) = 0
3
Using Newton’s method up to two iterations when the initial approximation is
𝒙0 = (0.1, 0.1, −0.1)𝑡 .
2. Solve the system of non-linear equations
𝑥3 + 𝑦 = 1
𝑦 3 − 𝑥 = −1
Using Newton’s method for about three iterations with an initial approximation
𝒙0 = (1,0)𝑡 .
3. Solve the system of linear equations
𝑥1 2 − 𝑥2 2 + 2𝑥2 = 0
2𝑥1 + 𝑥2 2 − 6 = 0
with an initial approximation 𝒙0 = (−5, −4)𝑡 , (2, −1)𝑡 , (0.5, 2)𝑡 , and (−2,3)𝑡 .

Unit Summary
➢ The solution of n linear simultaneous algebraic equations in n unknowns is presented.

Page 67
Numerical Method for Engineering

➢ There are two classes of methods of solving system of linear algebraic equations: direct
and iterative methods.
➢ Direct methods transform the original equation into equivalent equations that can be solved
more easily.
➢ Iterative or indirect methods start with a guess of the solution x, and then repeatedly refine
the solution until a certain convergence criterion is reached.
➢ Direct methods (matrix inversion method, Gauss elimination method, Gauss-Jordan
method, Matrix decomposition method and Thomas algorithm for tridiagonal system) are
presented.
➢ Two indirect or iterative methods (Jacobi’s iteration method and Gauss-Seidal iteration
method) re presented.
➢ The LU decomposition method is closely related to Gauss elimination method. LU
decomposition is computationally very effective if the coefficient matrix remains the same
but the right hand side vector changes.
➢ Gauss-Jordan method is a very stable method for solving linear algebraic equations. Gauss-
Seidal iterative substitution technique is very suitable for predominantly diagonal systems.
It requires a guess of the solution.

Review Exercise
1. Using Gaussian elimination method solve the following system of linear equations
𝑎 𝑥+𝑦+𝑧−𝑤 =2 𝑏. 𝑥+𝑦+𝑧+𝑤 =3
4𝑥 + 4𝑦 + 𝑧 + 𝑤 = 11 2𝑥 − 𝑦 + 3𝑧 + 0 = 3
𝑥 − 𝑦 − 𝑧 + 2𝑤 = 0 2𝑦 + 3𝑤 = 1
2𝑥 + 𝑦 + 2𝑧 − 2𝑤 = 2 −𝑥 + 𝑧 + 𝑤 = 0
2. Solve the system of equations by Gauss Jordan method
𝑎. 𝑥 + 5𝑦 − 𝑧 = 4 b. 2𝑥 + 𝑦 − 3𝑧 = 11 c. 𝑥 + 3𝑦 + 2𝑧 = 17
2𝑥 − 𝑦 + 3𝑧 = 7 4𝑥 − 2𝑦 + 3𝑧 = 8 𝑥 + 3𝑦 + 3𝑧 = 16
3𝑥 − 𝑦 + 5𝑧 = 12 −2𝑥 + 2𝑦 − 𝑧 = −6 2𝑥 − 𝑦 + 4𝑧 = 13

3. Using Gauss-Jacobi method find the first three approximate solutions of the following
systems with 𝑥 0 = 𝑦 0 = 𝑧 0 = 0 and 𝑥 0 = 𝑦 0 = 𝑧 0 = 1 respectively.

Page 68
Numerical Method for Engineering

a. 15𝑥 + 3𝑦 − 2𝑧 = 85 b. 𝑥 + 2𝑦 + 𝑧 = 0
2𝑥 + 10𝑦 + 𝑧 = 51 3𝑥 + 𝑦 − 𝑧 = 0
𝑥 − 2𝑦 + 8𝑧 = 5 𝑥 − 𝑦 + 4𝑧 = 3
4. Solve the following system of linear equations using matrix decomposition method.
b. 2𝑥 + 𝑦 + 4𝑧 = 12 b. 2𝑥 + 𝑦 − 3𝑧 = 11
8𝑥 − 3𝑦 + 2𝑧 = 20 4𝑥 − 2𝑦 + 3𝑧 = 8
4𝑥 + 11𝑦 − 𝑧 = 33 −2𝑥 + 2𝑦 − 𝑧 = −6
𝑐. 𝑥 + 𝑦 + 𝑧 − 𝑤 = 2 d . 2𝑥 − 6𝑦 + 8𝑧 = 24
𝑥 − 𝑦 − 𝑧 + 2𝑤 = 0 5𝑥 + 4𝑦 − 3𝑧 = 2
4𝑥 + 4𝑦 + 𝑧 + 𝑤 = 11 3𝑥 + 𝑦 + 2𝑧 = 16
2𝑥 + 𝑦 + 2𝑧 − 2𝑤 = 2
5. Solve the following set of simultaneous linear equations by the matrix inverse method.
a. 2𝑥 + 3𝑦 – 𝑧 = – 10 b. 𝑥1 + 2𝑥2 + 3𝑥3 + 4𝑥4 = 8
– 𝑥 + 4𝑦 + 2𝑧 = – 4 2𝑥1 − 2𝑥2 − 𝑥3 − 𝑥4 = −3
2𝑥 – 2𝑦 + 5𝑧 = 35 𝑥1 − 3𝑥2 + 4𝑥3 − 𝑥4 = 8
2𝑥1 + 2𝑥2 − 3𝑥3 + 4𝑥4 = −2
6. Solve the following tridiagonal system of equations using the Thomas algorithm.
a. 2𝑥1 + 𝑥2 = 4 b. 2𝑥1 + 𝑥2 = 3
3𝑥1 + 2𝑥2 + 𝑥3 = 8 𝑥1 + 3𝑥2 + 𝑥3 = 3
𝑥2 + 2𝑥3 + 2𝑥4 = 8 𝑥2 + 4𝑥3 + 2𝑥4 = 4
2𝑥3 + 4𝑥4 = 9 2𝑥3 + 4𝑥4 = 4

7. Using Gauss-seidel method find the first three approximate solutions of the following
systems with 𝑥 0 = 𝑦 0 = 𝑧 0 = 0 and 𝑥 0 = 𝑦 0 = 𝑧 0 = 1 respectively.

a. 8𝑥 + 2𝑦 − 2𝑧 = 8 b. 𝑥 + 2𝑦 + 𝑧 = 0
𝑥 − 8𝑦 + 3𝑧 = −4 3𝑥 + 𝑦 − 𝑧 = 0
2𝑥 + 𝑦 + 9𝑧 = 12 𝑥 − 𝑦 + 4𝑧 = 3
8. Solve the system of non-linear equations
1
3𝑥1 − cos(𝑥2𝑥3 ) − =0
2

Page 69
Numerical Method for Engineering

𝑥1 2 − 81(𝑥2 + 0.1)2 + 𝑠𝑖𝑛𝑥3 + 1.06 = 0


1
𝑒 −𝑥1𝑥2 + 20𝑥3 + (10𝜋 − 3) = 0
3
Using Newton’s method up to two iterations when the initial approximation is
𝒙0 = (0.1, 0.1, −0.1)𝑡 .
9. Solve the system of non-linear equations
𝑥3 + 𝑦 = 1
𝑦 3 − 𝑥 = −1
Using Newton’s method for about three iterations with an initial approximation
𝒙0 = (1,0)𝑡 .
10. Solve the system of linear equations
𝑥1 2 − 𝑥2 2 + 2𝑥2 = 0
2𝑥1 + 𝑥2 2 − 6 = 0
with an initial approximation 𝒙0 = (−5, −4)𝑡 , (2, −1)𝑡 , (0.5, 2)𝑡 , and (−2,3)𝑡

References

Burden, R.L., and Faires, J.D., Numerical analysis, 9th ed., PWS publishing, Boston, 1993.

Page 70
Numerical Method for Engineering

Chapra, S.C., and Raymond, P.C., Numerical Methods for Engineering, 6th ed.,

Grewal, B.S., Numerical Methods in Engineering and Science, Khanna, New Delhi, 1994.

Yang, Won-young, Applied Numerical Methods Using MATLAB, 3rd ed.,

John F. Mathews Numerical methods using MATLAB, third edition

Chapter Four

Finite Differences

Page 71
Numerical Method for Engineering

Objectives:

At the end of this chapter the students will be able to:

❖ Understand the concepts of all finite differences


❖ Appreciate the concept of shift operators
❖ Identify forward, back ward and central difference operators
❖ Solve different related problems

Overview of the chapter:

This chapter concentrates on shift operators, forward difference operators, backward difference
operators and central difference operators.

Introduction:

Consider a function 𝑦 = 𝑓 (𝑥) defined on (a, b), 𝑥 and 𝑦 are the independent and dependent
variables respectively. If the points 𝑥𝑜 , 𝑥1 , … . , 𝑥𝑛 are taken at equidistance that is, 𝑥𝑖 =
𝑥𝑜 + 𝑖ℎ, for 𝑖 = 0, 1, 2, … . , 𝑛, then the value of y, when 𝑥 = 𝑥𝑖 , is denoted by 𝑦𝑖 , where 𝑦𝑖 =
𝑓(𝑥𝑖 ). Here, the values of x are called arguments and the values of y are called as entries. The
interval h is called the difference interval. The differences 𝑦1 – 𝑦𝑜 , 𝑦2 – 𝑦1 , … , 𝑦𝑛 – 𝑦𝑛−1 are
called the first differences of the function 𝑦 and are denoted by ∆𝑦𝑜 , ∆𝑦1 , … , ∆𝑦𝑛−1 etc. That is

∆𝑦𝑜 = 𝑦1 – 𝑦𝑜
∆𝑦1 = 𝑦2 – 𝑦1

∆𝑦𝑛−1 = 𝑦𝑛 – 𝑦𝑛−1 (4.1)

The symbol ∆ in these equations is called the difference operator.

4.1. Shift Operators

Objectives

At the end of this topic students should be able to:

Page 72
Numerical Method for Engineering

➢ Define shift operator


➢ Identify orders of shift operatos
➢ Relate shift operators

Actvity4.1: Let 𝑓(𝑥) = 𝑥 2 + 2𝑥 − 4. Find 𝑓(𝑥 + ℎ), 𝑓(𝑥 + 2ℎ) and 𝑓(𝑥 + 3ℎ).

Shift operator, E:
Difinition4.1. The shift operator 𝐸 of a function 𝑓 denoted by 𝐸𝑓(𝑥) is defined as
𝐸𝑓 (𝑥) = 𝑓 (𝑥 + ℎ) or
𝐸𝑦𝑖 = 𝑦𝑖+1
Hence, shift operator sifts the function value 𝑦𝑖 to the next higher value 𝑦𝑖+1. The second shift
operator is given as follow.
𝐸 2 𝑓(𝑥) = 𝐸[𝐸𝑓(𝑥)] = 𝐸[𝑓(𝑥 + ℎ)] = 𝑓(𝑥 + 2ℎ)
E is linear and obeys the law of indices. And hence the generalized shift operator is given by

𝐸 𝑛 𝑓 (𝑥) = 𝑓 (𝑥 + 𝑛ℎ) 𝑜𝑟 𝐸 𝑛 𝑦𝑖 = 𝑦𝑖+𝑛ℎ


The inverse shift operator denoted by 𝐸 −1 is defined as
𝐸 −1 𝑓 (𝑥) = 𝑓 (𝑥 – ℎ)
In a similar manner, second and higher inverse operators are given by
𝐸 −2 𝑓 (𝑥) = 𝑓 (𝑥 – 2ℎ) and 𝐸 −𝑛 𝑓(𝑥) = 𝑓 (𝑥 – 𝑛ℎ)
The more general form of shift operator 𝐸 is given by
𝐸 𝑟 𝑓 (𝑥) = 𝑓 (𝑥 + 𝑟ℎ)
where 𝑟 is a nonzero rational number (that is, 𝑟 is positive as well as negative rationals).

Example4.1.: Let 𝑓(𝑥) = 𝑥 2 + 3𝑥. Find the first three shift operators.

Solution: the first three shift operators are 𝐸𝑓(𝑥), 𝐸 2 𝑓(𝑥)𝑎𝑛𝑑 𝐸 3 𝑓(𝑥). Thus

𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ) = (𝑥 + ℎ)2 + 3(𝑥 + ℎ)

= 𝑥 2 + 2𝑥ℎ + ℎ2 + 3𝑥 + 3ℎ = 𝑥 2 + 3𝑥 + 2𝑥ℎ + ℎ2 + 3ℎ

𝐸 2 𝑓(𝑥) = 𝐸𝑓(𝑥 + ℎ) = 𝑓(𝑥 + 2ℎ) = (𝑥 + 2ℎ)2 + 3(𝑥 + 2ℎ)

= 𝑥 2 + (4ℎ + 3)𝑥 + 4ℎ2 + 6ℎ

Page 73
Numerical Method for Engineering

And 𝐸 3 𝑓(𝑥) = 𝐸 2 𝑓(𝑥 + ℎ) = 𝐸𝑓(𝑥 + 2ℎ)

= 𝑓(𝑥 + 3ℎ)

= (𝑥 + 3ℎ)2 + 3(𝑥 + 3ℎ)

= 𝑥 2 + (6ℎ + 3)𝑥 + 9ℎ(ℎ − 1)

Average operator, 𝜇:

The average operator 𝜇 is defined as


1
𝜇𝑓(𝑥) = [ 𝑓(𝑥 + ℎ /2 ) + 𝑓( 𝑥 − ℎ/2)]
2
That is
𝜇𝑦𝑖 = [𝑦𝑖+1/2 + 𝑦𝑖−1/2 ]
4.2. Forward difference operators

Objectives:

At the end of his topic students will be able to:

➢ Define forward difference operator


➢ Identify relationship between shift operators and forward difference operators

Definition 4.2.: The forward difference or simply difference operator is denoted by ∆ and is
defined as ∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) – 𝑓(𝑥)

or writing in terms of 𝑦, at 𝑥 = 𝑥𝑖, this above equation becomes


∆ 𝑓(𝑥𝑖 ) = 𝑓(𝑥𝑖 + ℎ) – 𝑓(𝑥𝑖 ) or
∆𝑦𝑖 = 𝑦𝑖+1 − 𝑦𝑖 , 𝑖 = 0, 1, 2, … . , 𝑛 – 1
The differences of the first differences are called the second differences and they are denoted by
∆2 𝑦𝑜 , ∆2 𝑦1 , … . , ∆2 𝑦𝑛−1 .
Hence
∆𝑦𝑜 = 𝑦1 − 𝑦𝑜 , ∆𝑦1 = 𝑦2 − 𝑦1 , . . . , ∆𝑦𝑛−1 = 𝑦𝑛 − 𝑦𝑛−1
∆2 𝑦𝑜 = ∆𝑦1 – ∆𝑦𝑜 = (𝑦2 – 𝑦1 ) – (𝑦1 – 𝑦𝑜 ) = 𝑦2 – 2𝑦1 + 𝑦𝑜
∆2 𝑦1 = ∆𝑦2 – ∆𝑦1 = (𝑦3 – 𝑦2 ) – (𝑦2 – 𝑦1 ) = 𝑦3 – 2𝑦2 + 𝑦1

Page 74
Numerical Method for Engineering

∆3 𝑦𝑜 = ∆2 𝑦1 – ∆2 𝑦𝑜 = (𝑦3 – 2𝑦2 + 𝑦1 ) – (𝑦2 – 2𝑦1 + 𝑦𝑜 ) = 𝑦3 – 3𝑦2 + 3𝑦1 – 𝑦𝑜


∆3 𝑦1 = 𝑦4 – 3𝑦3 + 3 𝑦2 – 𝑦1 , etc.
In general, we have
∆𝑛+1 𝑓 (𝑥) = ∆[∆𝑛 𝑓 (𝑥)], 𝑖. 𝑒. , ∆𝑛+1 𝑦𝑖 = ∆[∆𝑛 𝑦𝑖 ], 𝑛 = 0, 1, 2, ….
Also,

∆𝑛+1 𝑓 (𝑥) = ∆𝑛 [𝑓 (𝑥 + ℎ) – 𝑓 (𝑥)] = ∆𝑛 𝑓 (𝑥 + ℎ) – ∆𝑛 𝑓 (𝑥)

and ∆𝑛+1 𝑦𝑖 = ∆𝑛 𝑦𝑖+1 − ∆𝑛 𝑦𝑖 , 𝑛 = 0,1,2, ….

Where ∆0 is call an identity operator. That is ∆0 𝑓(𝑥) = 𝑓(𝑥) 𝑎𝑛𝑑 ∆1 = ∆.

The tabular representation for forward difference is put as follow.

Table 4.1. Forward difference table

x y ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

Page 75
Numerical Method for Engineering

𝑥𝑜 𝑥𝑜

∆𝑦𝑜

𝑥1 𝑥1 ∆2 𝑦𝑜

∆𝑦1 ∆3 𝑦𝑜

𝑥2 𝑥2 ∆2 𝑦1 ∆4 𝑦𝑜

∆𝑦2 ∆3 𝑦1 ∆5 𝑦𝑜

𝑥3 𝑥3 ∆2 𝑦2 ∆4 𝑦1

∆𝑦3 ∆3 𝑦2

𝑥4 𝑥4 ∆2 𝑦3

∆𝑦4

𝑥5 𝑥5

The forward differences for the arguments 𝑥𝑜 , 𝑥1 , … . , 𝑥5 are shown in Table 4.1. Table 4.1 is called
a diagonal difference table or forward difference table. The first term in Table 4.1 is 𝑦𝑜 and is
called the leading term. The differences ∆𝑦𝑜 , ∆2 𝑦𝑜 , ∆3 𝑦𝑜 , …., are called the leading differences.
Similarly, the differences with fixed subscript are called forward differences.
Example 4.2.

1. Construct a forward difference table for the following data


𝑥 0 10 20 30

𝑦 0 0.174 0.347 0.518

Solution: The forward difference table for the given data is shown below.

Table4.2. Forward difference table for the above data


𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦

Page 76
Numerical Method for Engineering

0 0

0.174

10 0.174 −0.001

0.173 −0.001

20 0.347 −0.002

0.171

30 0.518

2. Draw the forward difference table for 𝑦 = 𝑓(𝑥) = 𝑥 3 + 2𝑥 + 1, 𝑓𝑜𝑟 𝑥 = 1,2,3,4,5.


Solution: The forward difference table is given below.
Table4.3. Forward difference table for (2)

𝑦 = 𝑓(𝑥) ∆𝑓(𝑥) ∆2 𝑓(𝑥) ∆3 𝑓(𝑥) ∆4 𝑓(𝑥)

Page 77
Numerical Method for Engineering

1 4

2 6 1

3 −1

3 9 0 3

3 2

4 12 2

5 17

Exercise 4.1: Construct the forward difference table for the following.
1.
x 0 1 2 3 4 5 6

y 1 2 33 254 1054 3126 7777

2. 𝑓(𝑥) = 𝑥𝑙𝑛𝑥 2 , 𝑓𝑜𝑟 𝑥 = 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4
4.3. Backward difference operators
Objectives:
At the end of this topic students should be able to:
➢ Define backward difference operator
➢ Differentiate backward difference from forward difference
➢ Identify the tabular representation of backward difference
Activity4.2: Let 𝑦 = 𝑓(𝑥) = 𝑒 𝑥 + 2𝑥 3 + 6, 𝑓𝑜𝑟 𝑥 = −1,0,1,2,3,4. Find
𝑦1 − 𝑦𝑜 , 𝑦2 − 𝑦1 , 𝑦3 − 𝑦2 , 𝑦4 − 𝑦3 , 𝑦5 − 𝑦4 , 𝑎𝑛𝑑𝑦2 − 2𝑦1 + 𝑦𝑜
Definition4.3: The backward difference operator denoted by ∇ is defined as

Page 78
Numerical Method for Engineering

∇𝑓(𝑥) = 𝑓 (𝑥) – 𝑓 (𝑥 – ℎ) .
This equation can be written as
∇𝑦𝑖 = 𝑦𝑖 – 𝑦𝑖−1 , 𝑖 = 𝑛, 𝑛 – 1, … . , 1.
or ∇𝑦1 = 𝑦1 – 𝑦𝑜 , ∇𝑦2 = 𝑦2 – 𝑦1 , … . , ∇𝑦𝑛 = 𝑦𝑛 – 𝑦𝑛−1 (4.2)
The differences in equation (4.2) are called first differences. The second differences are denoted
by
∇2 𝑦2 , ∇2 𝑦3 , … . , ∇2 𝑦𝑛 .
Hence
∇2 𝑦2 = ∇(∇𝑦2 ) = ∇(𝑦2 – 𝑦1 ) = ∇𝑦2 – ∇𝑦1 = (𝑦2 – 𝑦1 ) – (𝑦1 – 𝑦𝑜 ) = 𝑦2 – 2𝑦1 + 𝑦𝑜 .
Similarly,
∇2 𝑦3 = 𝑦3 – 2𝑦2 + 𝑦1 , ∇2 𝑦4 = 𝑦4 – 2𝑦3 + 𝑦2 , and so on.

In general, we have
∇𝑘 = ∇k−1 yi − ∇k−1 yi−1 , 𝑖 = 𝑛, 𝑛 − 1, … , 𝑘
Where ∇0 𝑦𝑖 = 𝑦𝑖 , and hence ∇1 𝑦𝑖 = ∇𝑦𝑖
The backward differences written in a tabular form is shown in Table 4.4 below. In Table 4.4, the
differences ∇n 𝑦 with a fixed subscript ‘𝑖’ lie along the diagonal upward sloping.

Table 4.4: Backward difference table

Page 79
Numerical Method for Engineering

𝑥 𝑦 ∇𝑦 ∇2 y ∇3 y ∇4 y

𝑥𝑜 𝑦𝑜

∇𝑦1

𝑥1 𝑦1 ∇2 y2

∇𝑦2 ∇3 y3

𝑥2 𝑦2 ∇2 y3 ∇4 y4

∇𝑦3 ∇3 y4

𝑥3 𝑦3 ∇2 y4

∇𝑦4

𝑥4 𝑦4

Table 4.4 is called the backward difference or horizontal table.


Example 4.3:
1. Construct the backward difference table of the following and find ∇2 y2 , ∇2 y3 and ∇3 y3 .
𝑥 0 10 20 30

𝑦 0 0.174 0.347 0.518

Solution: The backward difference of this problem is given as follow.

Table 4.5: backward difference table

Page 80
Numerical Method for Engineering

𝑥 𝑦 ∇𝑦 ∇2 y ∇3 y

0 0

0.174

10 0.174 −0.001

0.173 −0.001

20 0.347 −0.002

0.171

30 0.518

Here ∇2 y2 = −0.001, ∇2 y3 = −0.002 and ∇3 y3 = −0.001.


2. Obtain the backward differences for the function 𝑓 (𝑥) = 𝑥 3 from 𝑥 = 1 to 1.05 to two
decimals chopped and find ∇𝑦5 , ∇2 𝑦5 , ∇3 𝑦5 , ∇4 𝑦5 𝑎𝑛𝑑 ∇5 𝑦5 .
Solution:
The backward difference table is computed as below.

Table 4.6: backward difference table

Page 81
Numerical Method for Engineering

𝑥 𝑦 ∇𝑦 ∇2 𝑦 ∇3 𝑦 ∇4 𝑦 ∇5 𝑦

1.00 1

0.030

1.01 1.030 0.001

0.031 −0.001

1.02 1.061 0.000 0.002

0.031 0.001 −0.003

1.03 1.092 0.001 −0.001

0.032 0.000

1.04 1.124 0.001

0.033

1.05 1.157

Here, ∇𝑦5 = 0.033, ∇2 𝑦5 = 0.001, ∇3 𝑦5 = 0.000, ∇4 𝑦5 = −0.001, ∇5 𝑦5 = −0.003


3. Find the missing term in the table below.
𝑥 0 1 2 3 4

𝑦 3 2 3 ? 11

Solution: Let the missing term be 𝑎, then using backward difference table, we have;

Table 4.7: backward difference

Page 82
Numerical Method for Engineering

𝑥 𝑦 ∇𝑦 ∇2 𝑦 ∇3 𝑦 ∇4 𝑦

0 3

−1

1 2 2

1 𝑎−6

2 3 𝑎−4

𝑎−3 18 − 4𝑎

3 𝑎 14 − 2𝑎

11 − 𝑎

4 11

From the table we see that 𝑎 = 6 and hence the missing term.
Exercise 4.3:
1. Construct a backward difference table for the following data.
𝑥 45 55 65 75

𝑦 20 60 120 180

2. If 𝑚 is a positive integer and the interval of differencing is 1, show that 𝑥 𝑚 =


𝑥(𝑥 − 1) … [𝑥 − (𝑥 − 1)].
3. Find the missing term in the table below.

𝑥 0 1 2 3 4

𝑦 1 3 13 ? 81

Page 83
Numerical Method for Engineering

4.4 Central difference operators


Objectives
At the end of this topic students should be able to;
➢ Define central difference operator
➢ Differentiate central difference operator from forward and backward difference operators
Activity 4.4
Let 𝑓(𝑥) = 𝑒 𝑥 + 2. Compute 𝑓(𝑥 + ℎ/2) − 𝑓(𝑥 − ℎ/2) for ℎ = 0, 1, 2, 3.
Definition 4.4: The central difference operator is denoted by the symbol 𝛿 and is defined by
𝛿 𝑓 (𝑥) = 𝑓 (𝑥 + ℎ/2) – 𝑓 (𝑥 – ℎ/2)
where h is the interval of differencing.
In terms of 𝑦, the first central difference is written as
𝛿𝑦𝑖 = 𝑦𝑖+1/2 – 𝑦𝑖−1/2
where 𝑦𝑖+1/2 = 𝑓 (𝑥𝑖 + ℎ/2) 𝑎𝑛𝑑 𝑦𝑖−1/2 = 𝑓 (𝑥𝑖 – ℎ/2).
Hence
𝛿𝑦1/2 = 𝑦1 − 𝑦𝑜 , 𝛿𝑦3/2 = 𝑦2 − 𝑦1 , … , 𝛿𝑦𝑛−1/2 = 𝑦𝑛 − 𝑦𝑛−1 .
The second central differences are given by
𝛿 2 𝑦𝑖 = 𝛿𝑦𝑖+1/2 − 𝛿𝑦𝑖−1/2
= (𝑦𝑖+1 − 𝑦𝑖 ) − (𝑦𝑖 − 𝑦𝑖−1 )
= 𝑦𝑖+1 − 2𝑦𝑖 + 𝑦𝑖−1
In general
𝛿 𝑛 𝑦𝑖 = 𝛿 𝑛−1 𝑦𝑖+1/2 − 𝛿 𝑛−1 𝑦𝑖−1/2 .
The central difference table for the seven arguments 𝑥0 , 𝑥1 , … , 𝑥6 is given in table 4.7.

Table 4.8 central difference table

Page 84
Numerical Method for Engineering

𝑥 𝑦 𝛿𝑦 𝛿 2𝑦 𝛿 3𝑦 𝛿 4𝑦 𝛿 5𝑦 𝛿 6𝑦

𝑥0 𝑦0

𝛿𝑦1/2

𝑥1 𝑦1 𝛿 2 𝑦1

𝛿𝑦3/2 𝛿 3 𝑦3/2

𝑥2 𝑦2 𝛿 2 𝑦2 𝛿 4 𝑦2

𝛿𝑦5/2 𝛿 3 𝑦5/2 𝛿 5 𝑦5/2

𝑥3 𝑦3 𝛿 2 𝑦3 𝛿 4 𝑦3 𝛿 6 𝑦3

𝛿𝑦7/2 𝛿 3 𝑦7/2 𝛿 5 𝑦7/2

𝑥4 𝑦4 𝛿 2 𝑦4 𝛿 4 𝑦4

𝛿𝑦9/2 𝛿 3 𝑦9/2

𝑥5 𝑦5 𝛿 2 𝑦5

𝛿𝑦11/2

𝑥6 𝑦6

It is noted in table 4.7 that all the odd differences have fraction suffices and all the even differences
are integral suffices.
Exercise 4.4:
1. Construct the central difference table for

𝑥 1 2 3 4 5

Page 85
Numerical Method for Engineering

𝑦 4 6 9 12 17

2. Let 𝑓(𝑥) = 𝑥𝑠𝑖𝑛𝑥. Formulate the central difference table for 𝑥 = 0, 2, 4, 6, 8, 10.
4.5. Properties of the operators
Objectives
At the end of this topic the students will be able to;
➢ Identify relationships of the operators
➢ Prove properties of the operators
➢ Solve different related problems
Activity 4.5:
1. Let 𝑓(𝑥) = 6, find ∆𝑓(𝑥).
2. Let 𝑓(𝑥) = 𝑥 2 + 5𝑥 + 3. Compute ∆𝐸𝑓(𝑥).
Properties of ∆.
1. If 𝑐 is a constant then ∆𝑐 = 0.
2. ∆[𝑓(𝑥) ± 𝑔(𝑥)] = ∆𝑓(𝑥) ± ∆𝑔(𝑥)
3. ∆[𝑐𝑓(𝑥)] = 𝑐∆𝑓(𝑥), for a constant 𝑐.
4. If 𝑚 and 𝑛 are positive integers, then ∆𝑚 ∆𝑛 𝑓(𝑥) = ∆𝑚+𝑛 𝑓(𝑥)
5. ∆[𝑓(𝑥)𝑔(𝑥)] = 𝑓(𝑥)∆𝑔(𝑥) + 𝑔(𝑥)∆𝑓(𝑥)
𝑓(𝑥) 𝑔(𝑥)∆𝑓(𝑥)−𝑓(𝑥)∆𝑔(𝑥)
6. ∆ [𝑔(𝑥)] = 𝑔(𝑥)𝑔(𝑥+ℎ)

Proof (1):
Let 𝑓(𝑥) = 𝑐
Hence 𝑓(𝑥 + ℎ) = 𝑐, ℎ is the interval of differencing.
Then ∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥) = 𝑐 − 𝑐 = 0 or
∆𝑐 = 0
Proof (2):
∆[𝑓(𝑥) + 𝑔(𝑥)] = [𝑓(𝑥 + ℎ) + 𝑔(𝑥 + ℎ)] − [𝑓(𝑥) + 𝑔(𝑥)]
= 𝑓(𝑥 + ℎ) − 𝑓(𝑥) + 𝑔(𝑥 + ℎ) − 𝑔(𝑥)
= ∆𝑓(𝑥) + ∆𝑔(𝑥)
Similarly
∆[𝑓(𝑥) − 𝑔(𝑥)] = ∆𝑓(𝑥) − ∆𝑔(𝑥)
and hence

Page 86
Numerical Method for Engineering

∆[𝑓(𝑥) ± 𝑔(𝑥)] = ∆𝑓(𝑥) ± ∆𝑔(𝑥)

Proof (3): ∆[𝑐𝑓(𝑥)] = [𝑐𝑓(𝑥 + ℎ) − 𝑐𝑓(𝑥)]

= 𝑐[𝑓(𝑥 + ℎ) − 𝑓(𝑥)]

= 𝑐∆𝑓(𝑥)

𝑚 𝑓𝑎𝑐𝑡𝑜𝑟𝑠 𝑛 𝑓𝑎𝑐𝑡𝑜𝑟𝑠

Proof (4) 𝑚 𝑛 ⏞× ∆ × … × ∆) (∆
∆ ∆ 𝑓(𝑥) = (∆ ⏞× ∆ × … × ∆) 𝑓(𝑥)

𝑚+𝑛 𝑓𝑎𝑐𝑡𝑜𝑟𝑠
⏞× ∆ × ∆ × … × ∆) 𝑓(𝑥)
= (∆

= ∆𝑚+𝑛 𝑓(𝑥)

Similarly we can prove (5) and (6).


Relations between the operators
1. For the operators ∆ and 𝐸, we have the following.
∆= 𝐸 − 1 and 𝐸 = ∆ + 1
Proof: ∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥) and 𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ)
This implies that
∆𝑓(𝑥) = 𝐸𝑓(𝑥) − 𝑓(𝑥)
= (𝐸 − 1)𝑓(𝑥)
⟹ ∆= 𝐸 − 1
And 𝐸 =∆+1
2. 𝐸∆𝑓(𝑥) = 𝐸(𝑓(𝑥 + ℎ) − 𝑓(𝑥))
= 𝐸𝑓(𝑥 + ℎ) − 𝐸𝑓(𝑥)
= 𝑓(𝑥 + 2ℎ) − 𝑓(𝑥 + ℎ)
= ∆𝑓(𝑥 + ℎ)
= ∆𝐸𝑓(𝑥)
𝐸∆= ∆𝐸
Hence 𝐸∆= ∆𝐸

Page 87
Numerical Method for Engineering
∆𝑓(𝑥)
Example 4.5: Show that ∆log𝑓(𝑥) = log (1 + ).
𝑓(𝑥)

Solution: Let ℎ be the interval of differencing


𝑓(𝑥 + ℎ) = 𝐸𝑓(𝑥) = (∆ + 1)𝑓(𝑥) = ∆𝑓(𝑥) + 𝑓(𝑥)
𝑓(𝑥+ℎ) ∆𝑓(𝑥)
⟹ = +1
𝑓(𝑥) 𝑓(𝑥)

Taking logarithms on both sides we get


𝑓(𝑥 + ℎ) ∆𝑓(𝑥)
log [ ] = log [1 + ]
𝑓(𝑥) 𝑓(𝑥)
∆𝑓(𝑥)
⟹ log𝑓(𝑥 + ℎ) − log𝑓(𝑥) = log [1 + ]
𝑓(𝑥)
∆𝑓(𝑥)
⟹ ∆log𝑓(𝑥) = log [1 + ]
𝑓(𝑥)

∆2
Example 4.5: Evaluate ( 𝐸 )𝑥 3

Solution: Let ℎ be the interval of differencing


∆2
( ) 𝑥 3 = (∆2 𝐸 −1 )𝑥 3
𝐸
= (𝐸 − 1)2 𝐸 −1 𝑥 3 (Since ∆= 𝐸 − 1)
= (𝐸 2 − 2𝐸 + 1)𝐸 −1 𝑥 3
= (𝐸 − 2 + 𝐸 −1 )𝑥 3
= 𝐸𝑥 3 − 2𝑥 3 + 𝐸 −1 𝑥 3
= (𝑥 + ℎ)3 − 2𝑥 3 + (𝑥 − ℎ)3
= 6𝑥ℎ
∆2
Note: If ℎ = 1, then ( 𝐸 ) 𝑥 3 = 6𝑥
∆2 𝐸𝑒 𝑥
Example 4.6: Prove that 𝑒 𝑥 = 𝑒 𝑥 ∙ ∆2𝑒 𝑥 , the interval of differencing being ℎ.
𝐸

Solution: We know that


𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ), then
𝐸𝑒 𝑥 = 𝑒 𝑥+ℎ
Again ∆𝑒 𝑥 = 𝑒 𝑥+ℎ − 𝑒 𝑥 = 𝑒 𝑥 (𝑒 ℎ − 1)
⟹ ∆2 𝑒 𝑥 = 𝑒 𝑥 ∙ (𝑒 ℎ − 1)

Page 88
Numerical Method for Engineering
∆2
Hence ( 𝐸 ) 𝑒 𝑥 = (∆2 𝐸 −1 )𝑒 𝑥

= ∆2 𝑒 𝑥−ℎ = 𝑒 −ℎ (∆2𝑒 𝑥 )
= 𝑒 −ℎ 𝑒 𝑥 (𝑒 ℎ − 1)2
𝑒 𝑥+ℎ
Therefore, the right hand side = 𝑒 −ℎ 𝑒 𝑥 (𝑒 ℎ − 1) 𝑒 𝑥 (𝑒 ℎ −1) = 𝑒 𝑥

Relation between 𝑬 and 𝛁:


∇𝑓(𝑥) = 𝑓(𝑥) − 𝑓(𝑥 − ℎ) = 𝑓(𝑥) − 𝐸 −1 𝑓(𝑥)
⟹ ∇= 1 − 𝐸 −1
𝐸−1
⟹ ∇= 𝐸

Example 4.7: Prove that (a) (1 + ∆)(1 − ∇) = 1 (b) ∆∇= ∆ − ∇


Solution:
a) (1 + ∆)(1 − ∇)𝑓(𝑥) = 𝐸𝐸 −1 𝑓(𝑥)
= 𝐸𝑓(𝑥 − ℎ)
= 𝑓(𝑥) = 1 ∙ 𝑓(𝑥)
Thus (1 + ∆)(1 − ∇) = 1.
b) ∆∇𝑓(𝑥) = (𝐸 − 1)(1 − 𝐸 −1 )𝑓(𝑥)
= (𝐸 − 1)[𝑓(𝑥) − 𝑓(𝑥 − ℎ)]
And (∆ − ∇)𝑓(𝑥) = ((𝐸 − 1) − (1 − 𝐸 −1 ))𝑓(𝑥)
= (𝐸 − 1)[𝑓(𝑥) − 𝑓(𝑥 − ℎ)]
Therefore ∆∇= ∆ − ∇.
3. 𝛿 = 𝐸1/2 − 𝐸 −1/2
Proof:
We know that
𝛿[𝑓(𝑥)] = 𝑓(𝑥 + ℎ/2) − 𝑓(𝑥 − ℎ/2)
= 𝐸1/2 𝑓(𝑥) − 𝐸 −1/2 𝑓(𝑥)
= (𝐸1/2 − 𝐸 −1/2 )𝑓(𝑥)
Which implies that 𝛿 = 𝐸1/2 − 𝐸 −1/2.
4. ∆= 𝐸∇= ∇𝐸 = 𝛿𝐸1/2
Proof:
𝐸∇𝑓(𝑥) = 𝐸[𝑓(𝑥) − 𝑓(𝑥 − ℎ)]

Page 89
Numerical Method for Engineering

= 𝐸𝑓(𝑥) − 𝐸𝑓(𝑥 − ℎ)
= 𝑓(𝑥 + ℎ) − 𝑓(𝑥) = ∆𝑓(𝑥)
Thus 𝐸∇= ∆ --------------------------------------------------------- (1)
Again
∇𝐸𝑓(𝑥) = ∇𝑓(𝑥 + ℎ)
= 𝑓(𝑥 + ℎ) − 𝑓(𝑥) = ∆𝑓(𝑥)
Hence we have ∇𝐸 = ∆ ---------------------------------------------------------- (2)
Also 𝛿𝐸1/2 𝑓(𝑥) = 𝛿𝑓(𝑥 + ℎ/2)
= 𝑓(𝑥 + ℎ) − 𝑓(𝑥) = ∆𝑓(𝑥)
Which implies 𝛿𝐸1/2 = ∆ -------------------------------------------------------------- (3)
From (1), (2) and (3), we have that
∆= 𝐸∇= ∇𝐸 = 𝛿𝐸1/2
5. ∆∇= ∇∆= 𝛿 2
Proof:
Since ∆∇𝑓(𝑥) = ∆[𝑓(𝑥) − 𝑓(𝑥 − ℎ)]
= ∆𝑓(𝑥) − ∆𝑓(𝑥∆ − ℎ)
= [𝑓(𝑥 + ℎ) − 𝑓(𝑥)] − [𝑓(𝑥) − 𝑓(𝑥 − ℎ)]
= 𝛿𝑓(𝑥 + ℎ/2) − 𝛿𝑓(𝑥 − ℎ/2)
= 𝛿 2 𝑓(𝑥)
⟹ ∆∇= 𝛿 2 --------------------------------------------------------------- (1)
Also ∇∆𝑓(𝑥) = ∇[𝑓(𝑥 + ℎ) − 𝑓(𝑥)]
= ∇𝑓(𝑥 + ℎ) − ∇𝑓(𝑥)
= [𝑓(𝑥 + ℎ) − 𝑓(𝑥)] − [𝑓(𝑥) − 𝑓(𝑥 − ℎ)]
= 𝛿𝑓(𝑥 + ℎ/2) − 𝛿𝑓(𝑥 − ℎ/2)
= 𝛿 2 𝑓(𝑥)
⟹ ∇∆= 𝛿 2 ------------------------------------------------- (2)
Therefore from (1) and (2), we have;
∆∇= ∇∆= 𝛿 2
Example 4.8: Find ∆3 (1 − 3𝑥)(1 − 2𝑥)1 − 𝑥).
Solution:

Page 90
Numerical Method for Engineering

Let 𝑓(𝑥) = (1 − 3𝑥)(1 − 2𝑥)1 − 𝑥) = −6𝑥 3 + 11𝑥 2 − 6𝑥 + 1


Here, 𝑓(𝑥) is a polynomial function of degree three and the coefficient of 𝑥 3 is −6.
Therefore ∆3 𝑓(𝑥) = (−6)3! = −36.
Exercise 4.5:
1. Show that
a) ∆∇= ∆ − ∇
b) ∇= ∆𝐸 −1
c) 𝐸 𝑛 = (1 + ∆)𝑛
2. Find the following
a) ∆𝑒 𝑎𝑥 c) ∆2 (3𝑒 𝑥 )

b) d) ∆sin (𝑎𝑥 + 𝑏)
1+𝑥 2

3. Let 𝑣𝑜 = 1, 𝑣1 = 5, 𝑣2 = 10, 𝑣3 = 30, 𝑣4 = 30. Find ∆4 𝑣𝑜 .

Unit summery

Page 91
Numerical Method for Engineering

The following are the main points of this chapter.


If the points 𝑥𝑜 , 𝑥1 , … . , 𝑥𝑛 are taken at equidistance that is,
𝑥𝑖 = 𝑥𝑜 + 𝑖ℎ, for 𝑖 = 0, 1, 2, … . , 𝑛, then the value of y, when 𝑥 = 𝑥𝑖 , is
denoted by 𝑦𝑖 , and is given by 𝑦𝑖 = 𝑓(𝑥𝑖 ).
The shift operator 𝐸 of a function 𝑓 is an operator defined as
𝐸𝑓 (𝑥) = 𝑓 (𝑥 + ℎ) or
𝐸𝑦𝑖 = 𝑦𝑖+1
An operator 𝜇 defined by
1
𝜇𝑓(𝑥) = [ 𝑓(𝑥 + ℎ /2 ) + 𝑓( 𝑥 − ℎ/2)]
2
is called an average operator.
The forward difference or simply difference operator ∆ is defined by
∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) – 𝑓(𝑥) or ∆𝑦𝑖 = 𝑦𝑖+1 − 𝑦𝑖 , 𝑖 = 0, 1, 2, … . , 𝑛 – 1.
The backward difference operator ∇ is defined as
∇𝑓(𝑥) = 𝑓 (𝑥) – 𝑓 (𝑥 – ℎ) or ∇𝑦𝑖 = 𝑦𝑖 – 𝑦𝑖−1 , 𝑖 = 𝑛, 𝑛 – 1, … . , 1 for 𝑦𝑖 =
𝑓(𝑥𝑖 )
An operator 𝛿 which is defined by
𝛿 𝑓 (𝑥) = 𝑓 (𝑥 + ℎ/2) – 𝑓 (𝑥 – ℎ/2)
is called central difference operator; where h is the interval of differencing.
Review exercise
1. Construct table of forward, backward and central differences of the following.
a)
𝑥 40 50 60 70 80 90

𝑦 204 224 246 270 296 324

b) 𝑓(𝑥) = 𝑥 2 + 6𝑥 − 9, for 𝑥 = 1,2,3,4,6,7,8


c) 𝑓(𝑥) = 𝑒 𝑥 + 2𝑥 for 𝑥 = 0,1,2,3,4,5
d) 𝑓(𝑥) = ln (𝑥 2 ) for 𝑥 = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6
2. Find the missing term of the following.

𝑥 1 2 3 4 5

Page 92
Numerical Method for Engineering

a) 𝑦 8 17 38 ? 140

b)
𝑥 0 1 2 3 4

𝑦 1 −2 −1 ? 37

3. Evaluate the following.


a) ∆(𝑒 𝑎𝑥 log bx)
b) ∆𝑡𝑎𝑛−1 𝑥
5𝑥+12
c) ∆[𝑥 2+5𝑥+6]
∆2
d) ( 𝐸 )𝑥 3 (with interval of differencing ℎ = 1)
1
e) 𝑥 𝑛 [ 𝑥 ]

4. Prove the following.


a) 𝛿 = ∆(1 + ∆)−1/2
b) ∆3 𝑦2 = ∇3 𝑦5
∆ ∇
c) −∆= ∆+∇

5. Given 𝑢𝑜 = 5, 𝑢1 = 24, 𝑢2 = 81, 𝑢3 = 200, 𝑢4 = 100 and 𝑢5 = 8. Find ∆5 𝑢𝑜 .

Page 93
Numerical Method for Engineering

CHAPTER FIVE INTERPOLATIONS

UNIT OBJECTIVES

At the end of this unit each student should able to:

▪ Understand the concept of interpolation.


▪ Understand the concept of Lagrange interpolation formula
▪ Understand the concept of Newton's forward interpolation formula
▪ Understand the concept of Newton's back ward interpolation formula
▪ Understand the concept of Numerical differentiation
▪ Understand the concept of Numerical integration

INTRODUCTION

Interpolation is the technique of estimating the value of a function for any intermediate value of
the independent variable. The process of computing or finding the value of a function for any value
of the independent variable outside the given range is called extrapolation. Here, interpolation
denotes the method of computing the value of the function 𝑦 = 𝑓(𝑥) for any given value of the
independent variable 𝑥 when a set of values of 𝑦 = 𝑓 (𝑥) for certain values of 𝑥 are known or
given.
Hence, 𝑖𝑓 ( 𝑥𝑖 , 𝑦𝑖 ), 𝑖 = 0, 1, 2, … . , 𝑛 are the set of (𝑛 + 1) given data points of the function 𝑦 =
𝑓 (𝑥), then the process of finding the value of y corresponding to any value of 𝑥 = 𝑥𝑖
Between 𝑥0 𝑎𝑛𝑑 𝑥𝑛 , is called interpolation.
If the function 𝑓(𝑥) is known explicitly, then the value of 𝑦 corresponding to any value of 𝑥 can
easily be obtained. On the other hand, if the function 𝑓 (𝑥) is not known, then it is very hard to
find the exact form of 𝑓 (𝑥) with the tabulated values( 𝑥𝑖 , 𝑦𝑖 ) . In such cases, the function 𝑓 (𝑥)
can be replaced by a simpler, function, say, p(𝑥), which has the same values as 𝑓 (𝑥) for
𝑥0, 𝑥1, 𝑥2 , … , 𝑥𝑛 . The function 𝑝(𝑥) is called the interpolating or smoothing function and any other
value can be computed from 𝑝 (𝑥).
If 𝑝(𝑥) is a polynomial, then 𝑝(𝑥) is called the interpolating polynomial and the process of
computing the intermediate values of 𝑦 = 𝑓 (𝑥) is called the polynomial interpolation.

Page 94
Numerical Method for Engineering

Let 𝑦 = 𝑓(𝑥) be a real valued continuous function defined in an interval[𝑎, 𝑏]. Let
𝑥0 , 𝑥1 , … , 𝑥𝑛 be (𝑛 + 1) distinct points and the corresponding values of the function are
𝑦0 , 𝑦1 , … , 𝑦𝑛 . Our aim is to construct the unique approximate polynomial which passes through the
given points. Since (𝑛 + 1) points are given, we can represent the function 𝑦 = 𝑓(𝑥) is a
Polynomial in 𝑥 of degree 𝑛 with 𝑃(𝑥) such that 𝑃(𝑥𝑖 ) = 𝑓(𝑥𝑖 ) = 𝑓𝑖 , 𝑖 = 0,1, … , 𝑛. But to
construct this polynomial we follow two different approaches which are interpolation with equal
intervals and interpolation with unequal intervals.

5.1 Linear Interpolation


Here 𝑛 = 1 and we want determine a polynomial 𝑝(𝑥) = 𝑎0 + 𝑎1 𝑥 where 𝑎0 𝑎𝑛𝑑 𝑎1 are
arbitrary constant which satisfies the interpolating conditions 𝑓(𝑥0 ) = 𝑝(𝑥0 ) 𝑎𝑛𝑑 𝑓(𝑥1 ) =
𝑝(𝑥1 ).
we have 𝑓(𝑥0 ) = 𝑝(𝑥0 ) = 𝑎0 + 𝑎0 𝑥
𝑓(𝑥1 ) = 𝑝(𝑥1 ) = 𝑎1 + 𝑎1 𝑥
Example5.1 find the polynomial 𝑝(𝑥) which passes through((3, 6), (4, 12) and
approximate𝑓(2).
Solution: since we have 𝑥0 = 3, 𝑥1 = 4 , 𝑓0 = 6 𝑎𝑛𝑑𝑓1 = 1
𝑥−𝑥1 𝑥−4
𝑙0 (𝑥) = 𝑥 = 3−4 = −(𝑥 − 4)
0 −𝑥1

𝑥−𝑥0 𝑥−3
𝑙1 (𝑥) = 𝑥 = 4−3 = 𝑥 − 3
1 −𝑥0

then 𝑝(𝑥) = 𝑙0 (𝑥)𝑓1 + 𝑙1 (𝑥)𝑓1


= −(𝑥 − 4)(6) + (𝑥 − 3)(12) = −6𝑥 + 24 + 12𝑥 − 36 = 6𝑥 − 12
Hence, 𝑝(𝑥) = 6𝑥 − 12 and 𝑝(𝑥) = 6(2) − 12 = 12 − 12 = 0

5.2 Lagrange Interpolation Formula

Objective

At the end of this lesson students will be able to:

➢ Define Lagrange Interpolation Formula.


➢ Solve problem using Lagrange Interpolation Formula

Page 95
Numerical Method for Engineering

Let 𝑦 = 𝑓(𝑥) be a real valued continuous function defined in an interval [𝑎, 𝑏]. Let
𝑥0 , 𝑥1 , … , 𝑥𝑛 be (𝑛 + 1) distinct points which are not necessarily equally spaced and the
corresponding values of the function are 𝑦0 , 𝑦1 , … , 𝑦𝑛 . Since (𝑛 + 1) values of the function
are given corresponding to the (𝑛 + 1) values of the independent variable𝑥, we can represent
the function 𝑓(𝑥) as a polynomial in 𝑥 of degree 𝑛.
Let the polynomial is represented by
𝑓(𝑥) = 𝑎0 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 ) + 𝑎1 (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 )
+𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) … (𝑥 − 𝑥𝑛 ) + ⋯ + 𝑎𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) … (𝑥 − 𝑥𝑛−1 )
To find the values of 𝑎0 , 𝑎1 , … , 𝑎𝑛 substitute 𝑥 = 𝑥0 , 𝑥1 , … , 𝑥𝑛 respectively in the above
formula. That is
Let 𝑥 = 𝑥0 , the we obtain
𝑓(𝑥0 ) = 𝑎0 (𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 )
𝑓(𝑥0 )
Or 𝑎0 = (𝑥
0 −𝑥1 )(𝑥0 −𝑥2 )…(𝑥0 −𝑥𝑛 )

If we take 𝑥 = 𝑥1 , then we obtain


𝑓(𝑥1 ) = 𝑎1 (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 )
𝑓(𝑥1 )
Or 𝑎1 = (𝑥
1 −𝑥0 )(𝑥1 −𝑥2 )…(𝑥1 −𝑥𝑛 )

Similarly putting 𝑥 = 𝑥2 , 𝑥 = 𝑥3 , … , 𝑥 = 𝑥𝑛 we obtain


𝑓(𝑥2 ) 𝑓(𝑥𝑛 )
𝑎2 = , … , 𝑎𝑛 =
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) … (𝑥2 − 𝑥𝑛 ) (𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … (𝑥𝑛 − 𝑥𝑛−1 )
Substituting the values of 𝑎0 , 𝑎1 , … , 𝑎𝑛 in the above equation we get
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 )
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑓(𝑥1 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 )
(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 )…(𝑥−𝑥𝑛−1 )
+⋯+ (𝑥𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )…(𝑥𝑛 −𝑥𝑛−1 )
𝑓(𝑥𝑛 )

or 𝑓(𝑥) = ∑𝑛𝑖=0 𝐿𝑖 (𝑥)𝑓𝑖


𝑥−𝑥
Where, 𝐿𝑖 (𝑥) = ∏𝑛𝑗=0 𝑥 −𝑥𝑗 , 𝑖 = 0,1,2, … , 𝑛.
𝑖 𝑗
𝑗≠𝑖

This formula is called Lagrange interpolation formula


Example 5.2: Using the Lagrange interpolation formula find the polynomial 𝑃3 (𝑥) which passes
through(0, – 12), (1, 0), (3, 6), (4, 12). and approximate 𝑓(2).
Solution: The polynomial is given by:

Page 96
Numerical Method for Engineering

𝑃3 (𝑥) = 𝐿0 (𝑥)𝑓0 + 𝐿1 (𝑥)𝑓1 + 𝐿2 (𝑥)𝑓2 + 𝐿3 (𝑥)𝑓3


= −12𝐿0 (𝑥) + 0𝐿1 (𝑥) + 6𝐿2 (𝑥) + 12𝐿3 (𝑥),
= −12𝐿0 (𝑥) + 6𝐿2 (𝑥) + 12𝐿3 (𝑥), where
(𝑥−𝑥1 )(𝑥−𝑥2 )(𝑥−𝑥3 ) (𝑥−1)(𝑥−3)(𝑥−4)
𝐿0 (𝑥) = (𝑥 =
0 −𝑥1 )(𝑥0 −𝑥2 )(𝑥0 −𝑥3 ) (0−1)(0−3)(0−4)

1
= − 12 (𝑥 3 − 8𝑥 2 + 19𝑥 − 12)

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


𝐿1 (𝑥) = (𝑥 =
1 −𝑥0 )(𝑥1 −𝑥2 )(𝑥1 −𝑥3 ) (1−0)(1−3)(1−4)

1
= 6 (𝑥 3 − 7𝑥 2 + 12𝑥)

(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 ) (𝑥−0)(𝑥−1)(𝑥−4)


𝐿2 (𝑥) = (𝑥 =
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 ) (3−0)(3−1)(3−4)

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

(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 ) (𝑥−0)(𝑥−1)(𝑥−3)


𝐿3 (𝑥) = (𝑥 =
3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 ) (4−0)(4−1)(4−3)
1
= 12 (𝑥 3 − 4𝑥 2 + 3𝑥)

Therefore,
1 −1 1
𝑃3 (𝑥) = −12 (− 12 (𝑥 3 − 8𝑥 2 + 19𝑥 − 12)) + 6 ( 6 (𝑥 3 − 5𝑥 2 + 4𝑥)) + 12 (12 (𝑥 3 − 4𝑥 2 +

3𝑥)) = 𝑥 3 − 7𝑥 2 + 18𝑥 − 12

Hence, the polynomial is 𝑃3 (𝑥) = 𝑥 3 − 7𝑥 2 + 19𝑥 − 12 and

𝑓(2) = 𝑃3 (2) = (2)3 − 7(2)2 + 18(2) − 12 = 4.

Example 5.3: Let 𝑃3 (𝑥) is the interpolating polynomial for the data (0,0), (0.5, 𝑦), (1,3) and
(2,2). Then find 𝑦 if the coefficient of 𝑥 3 in 𝑃3 (𝑥) is 6.

Solution: The polynomial is given by:

𝑃3 (𝑥) = 𝐿0 (𝑥)𝑓0 + 𝐿1 (𝑥)𝑓1 + 𝐿2 (𝑥)𝑓2 + 𝐿3 (𝑥)𝑓3

𝑦𝐿1 (𝑥) + 3𝐿2 (𝑥) + 2𝐿3 (𝑥), where

Page 97
Numerical Method for Engineering
(𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 ) (𝑥−0)(𝑥−1)(𝑥−2)
𝐿1 (𝑥) = (𝑥 = (0.5−0)(0.5−1)(0.5−2)
1 −𝑥0 )(𝑥1 −𝑥2 )(𝑥1 −𝑥3 )

8
= 3 (𝑥 3 − 3𝑥 2 + 2𝑥)

(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 ) (𝑥−0)(𝑥−0.5)(𝑥−2)


𝐿2 (𝑥) = (𝑥 =
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 ) (1−0)(1−0.5)(1−2)

= −2𝑥 3 + 5𝑥 2 − 2𝑥

(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 ) (𝑥−0)(𝑥−0.5)(𝑥−1)


𝐿3 (𝑥) = (𝑥 =
3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 ) (2−0)(2−0.5)(2−1)

1
= (𝑥 3 − 1.5𝑥 2 + 0.5𝑥)
3

Therefore,
8 1
𝑃3 (𝑥) = 𝑦 (3 (𝑥 3 − 3𝑥 2 + 2𝑥)) + 3(−2𝑥 3 + 5𝑥 2 − 2𝑥) + 2 (3 (𝑥 3 − 1.5𝑥 2 + 0.5𝑥))
8 16 16 17
= (3 𝑦 − ) 𝑥 3 + (−8𝑦 + 14)𝑥 2 + ( 3 𝑦 − )
3 3
8 16
Now, the coefficient of 𝑥 3 in the polynomial 𝑃3 (𝑥) is (3 𝑦 − ).
3
8 16 14
⟹ (3 𝑦 − )=6⟹𝑦=
3 7
14
Therefore, the value of the unknown 𝑦 is .
7

Exercise: 5.1
1. Using the Lagrange interpolation formula find the polynomial 𝑝2 (𝑥)with 𝑥0 = 2, 𝑥1 = 2.5
1
and 𝑥2 = 4 and 𝑓(𝑥) = 𝑥.

2. Apply Lagrange’s interpolation formula to find a polynomial which passes through the
points (0, – 20), (1, – 12), (3, – 20) 𝑎𝑛𝑑 (4, – 24).
3. Using Lagrange’s interpolation formula, find the value of 𝑦 corresponding to 𝑥 = 10
from the following data.
𝑥 5 6 9 11

𝑦 380 −2 196 509

Page 98
Numerical Method for Engineering

5.3 Newton’s Interpolation Formula


Objective

At the end of this lesson students will be able to:

➢ Define Newton's forward and backward Interpolation Formula.


➢ Solve problem using Newton’s forward and backward Interpolation Formula.

Here, we assume that for function𝑦 = 𝑓(𝑥), the set of (𝑛 + 1) functional values 𝑦0 , 𝑦1 , … , 𝑦𝑛 are
given corresponding to the set of (𝑛 + 1) equally spaced values of the independent variable, 𝑥𝑖 =
𝑥0 + 𝑖ℎ, 𝑖 = 0,1,2, … , 𝑛, where ℎ is the spacing.
5 .3.1 Newton’s Forward Interpolation Formula
Let 𝑦 = 𝑓 (𝑥), which takes the values 𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 that is the set of (n + 1) functional values
𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 are given corresponding to the set of (n + 1) equally spaced values of the
independent variable, 𝑥 𝑖 = 𝑥0 + 𝑖ℎ, 𝑖 = 0, 1, 2, … . , 𝑛 where ℎ is the spacing. Let 𝑝(𝑥) be a
polynomial of the 𝑛𝑡ℎ degree in 𝑥 taking the same values as 𝑦 corresponding to 𝑥 =
𝑥0 , 𝑥1 , 𝑥2 , … . , 𝑥𝑛. Then, 𝑝(x) represents the continuous function 𝑦 = 𝑓(𝑥) such that
𝑓 (𝑥𝑖 ) = 𝑝(𝑥𝑖 ) for i = 0, 1, 2, …., n and at all other points f (x) =p(x) + R(x) where R(x) is called
the error term (remainder term) of the interpolation formula.
Let 𝑝(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + ⋯ +
𝑎𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛−1 ) (5.1)
and 𝑝(𝑥𝑖 ) = 𝑦𝑖 𝑖 = 0,1,2,3 … 𝑛 (5.2)
The constants, 𝑎0 , 𝑎1 , 𝑎2 , … ., an can be determined as follows:
Substituting 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 , … . , 𝑥𝑛. successively in Eq.(5.1), we get

𝑎0 = 𝑦0 (5.3)

𝑦1 = 𝑎0 + 𝑎1 (𝑥1 − 𝑥0 )
𝑦1 = 𝑦0 + 𝑎1 (𝑥1 − 𝑥0 )

𝑦 −𝑦 ∆𝑦0
𝑎1 = 𝑥1−𝑥0 = (5.4)
1 0 ℎ

𝑦2 = 𝑎0 + 𝑎1 (𝑥2 − 𝑥0 ) + 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )

Page 99
Numerical Method for Engineering

𝑦2 − 𝑦0 − 𝑎1 (𝑥2 − 𝑥0 ) = 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )

𝑦2 − 𝑦0 − 𝑎1 (𝑥2 − 𝑥0 ) = 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )

𝑦 −𝑦
(𝑦2 − 𝑦0 ) − 𝑥1−𝑥0 (𝑥2 − 𝑥0 ) = 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )
1 0

(𝑦1 −𝑦0 )2ℎ


(𝑦2 − 𝑦0 ) − = 𝑎2 2ℎℎ

𝑦2 −2𝑦1 +𝑦0 ∆2 𝑦0
𝑎2 = = (5.5)
2ℎ2 2!ℎ2

∆3 𝑦 ∆𝑛 𝑦
Similarly, we obtain 𝑎3 = 3!ℎ30 𝑎𝑛 = 𝑛!ℎ𝑛0 (5.6)

Hence, from Eq. (5.1), we have

∆𝑦0 ∆2 𝑦0 ∆3 𝑦0
𝑝(𝑥) = 𝑦0 + (𝑥 − 𝑥0 ) + 2
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + ⋯ +
ℎ 2!ℎ 3!ℎ3
∆𝑛 𝑦0
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛−1 ) (5.7)
𝑛!ℎ𝑛

Let x = x0 + uh or x - x0 = uh

𝑎𝑛𝑑 x – x1 = (x – x0) – (x1 – x0) = uh – h = (u – 1)h (5.8)


x – x2 = (x – x1) – (x2 – x1) = (u – 1)h – h = (u – 2)h, etc

Using the values from Eq.(5.8), Eq.(5.7) reduces to

𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2) 𝑢(𝑢−1)(𝑢−2)…(𝑢−𝑛+1)


𝑝(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ⋯ + ∆𝑛 𝑦0 (5.9)
2! 3! 𝑛!

The formula given in Eq. (5.9) is called the Newton’s forward interpolation formula. This
formula is used to interpolate the values of y near the beginning of a set of equally spaced tabular
values.
Example 5.4 Given that √15500 = 124.4990, √15510 =124.5392, √15520 = 124.5793
and √15530 = 124.6194, 𝑓𝑖𝑛d the value of √15516 .

Solution: The difference table is given below:

Page 100
Numerical Method for Engineering

𝑥 𝑦=√𝑥 ∆𝑦 ∆2 𝑦 ∆3 𝑦

15500 124.4990

0.0402

15510 124.5392 -0.0001

0.0401 0.0001

15520 124.5793 0

0.0401

15530 124.6194

Here 𝑥0 = 15500 ℎ = 10 𝑎𝑛𝑑 𝑥 = 15516

𝑥−𝑥0 15516−15500
𝑢= = = 1.6
10 10

Newton’s forward difference formula is

𝑢(𝑢−1) 𝑢(𝑢−1(𝑢−2)
𝑓(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0
2! 3!

1.6(1.6 − 1)
𝑓(15516) = 124.4990 + 1.6(0.0402) + (−0.0001)
2!
1.6(1.6 − 1)(1.6 − 2)
+ (.0001) = 124.5632656
3!

Example 5.5
A second degree polynomial passes through the points (1, – 1), (2, – 2), (3, – 1) 𝑎𝑛𝑑 (4, 2).
Find the polynomial.
Solution: The difference table is constructed with the given values of 𝑥 𝑎𝑛𝑑 𝑦 as shown below:

Page 101
Numerical Method for Engineering

𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦

1 −1

−1

2 −2 2

1 0

3 −1 2

4 2

Here 𝑥0 = 1, ℎ = 1, 𝑦0 = – 1, 𝛥𝑦0 = – 1 𝑎𝑛𝑑 ∆2 𝑦0 = 2

𝑥−𝑥0
𝑢= =𝑥−1

From the Newton’s forward interpolation formula, we have

𝑢(𝑢−1)
𝑦 = 𝑓(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0
2!

(𝑥 − 1)(𝑥 − 1 − 1)
𝑓(𝑥) = −1 + (𝑥 − 1)(−1) + (2) = 𝑥 2 − 4𝑥 + 2
2

Example 5.6 The values of 𝑠𝑖𝑛 𝑥 are given below for different values of 𝑥. Find the value of
sin 42º.
𝑥 40 45 50 55 60

𝑦 = 𝑠𝑖𝑛𝑥 0.6428 0.7071 0.7660 0.8192 0.8660

Solution: x = 42º is near the starting value x0 = 40º

Hence, we use Newton’s forward interpolation formula

Page 102
Numerical Method for Engineering

𝑥 𝑦 = 𝑠𝑖𝑛𝑥 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

400 0.6428

0.0643

450 0.7071 −0.0054

0.0589 −0.0003

500 0.7660 −0.0057 -0.0004

0.0532 −0.0007

550 0.8192 −0.0064

0.0468

600 0.8660

𝑥 − 𝑥0 420 − 400
𝑢= = = 0.4
ℎ 5

We have 𝑦0 = 0.6428, ∆𝑦0 = 0.0643, ∆2 𝑦0 = −0.0054, ∆3 𝑦0 = −0.0003, ∆4 𝑦 = −0.0004

Putting these values in Newton’s forward interpolation formula we get

𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3


𝑓(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3!

0.4(0.4 − 1)
𝑓(420 ) = 0.6428 + 0.4(0.0643) + (−0.0054)
2
0.4(0.4 − 1)(0.4 − 2(−0.0003))
+
6
0.4(0.4 − 1)(0.4 − 2)(0.4 − 3)(−0.0004)
+ = 0.66915
24

Page 103
Numerical Method for Engineering

Example 5.7
The profits of a company (in thousands of rupees) are given below:

𝑌𝑒𝑎𝑟 (𝑥) 1990 1993 1996 1996 2002

𝑃𝑟𝑜𝑓𝑖𝑡 𝑦 = 𝑓(𝑥) 120 100 111 108 99

Calculate the total profits between 1990– 2002.


Solution: The forward difference table is constructed as shown further:
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

1990 120

−20

1993 100 31

11 −45

1996 111 −14 53

−3 8

1999 108 −6

−9

2002 99

To calculate profits at 1991

𝑥−𝑥0 1991−1990
Let 𝑥0 = 1990, 𝑥 = 1991, ℎ = 3, 𝑝 = = = 0.33
ℎ 3

Using Newton’s forward interpolation formula we obtain

Page 104
Numerical Method for Engineering
𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2) 𝑢(𝑢−1)(𝑢−2)(𝑢−3)
𝑓(1991) = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ∆4 𝑦0 + ⋯
2! 3! 4!

0.33(0.33 − 1) 0.33(0.33 − 1)(0.33 − 2)


= 120 + 0.33(−20) + (31) + (−45)
2 6
0.33(0.33 − 1)(0.33 − 2)(0.33 − 3)
+ (53) = 104.93
24

Or 105 thousand rupees.

Exercise 5.2
1. Find 𝑦 = 𝑒 3𝑥 for 𝑥 = 0.05 using the following table.
𝑥 0 0.1 0.2 0.3 0.3

𝑒 3𝑥 1 1.3499 1.8221 2.4596 3.3201

2. Use forward interpolation formula to find y for 𝑥 = 16 given that

𝑥 11 15 19 23 27

𝑦 19.5673 18.8243 18.2173 17.1236 16.6162

5.3.2 Newton’s Backward Interpolation Formula

Newton’s forward interpolation formula is not suitable for interpolation values of y near the end
of a table of values.
Let 𝑦 = 𝑓 (x) be a function which takes the values 𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 corresponding to the values
𝑥0 , 𝑥1 , 𝑥2 , … 𝑥𝑛 of the independent variable𝑥. Let the values of 𝑥 be equally spaced with ℎ as the
interval of differencing. That is 𝑥𝑖 = 𝑥0 + 𝑖ℎ, 𝑖 = 0, 1, 2, … . , 𝑛
Let 𝑝(𝑥) be a polynomial of the nth degree in 𝑥 taking the same values of y corresponding to
𝑥 = 𝑥0 , 𝑥1 , 𝑥2 , … 𝑥𝑛 That is, 𝑝(𝑥) represents 𝑦 = 𝑓 (𝑥) such that f (xi) = 𝑝(xi), 𝑖 = 0, 1, 2, … .
Hence we can write 𝑝(x) as
𝑝 (𝑥𝑖 ) = 𝑦𝑖 𝑖 = 𝑛, 𝑛 – 1, … . , 1, 0
𝑎𝑛𝑑 𝑥𝑛−𝑖 = 𝑥𝑛−𝑖ℎ , 𝑖 = 1, 2, … . , 𝑛

Let 𝑝(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥𝑛 ) + 𝑎2 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) + ⋯ + 𝑎𝑛 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 )


Page 105
Numerical Method for Engineering

(𝑥 − 𝑥𝑛−2 ) … (𝑥 − 𝑥0 ) (5.10)

Substituting 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 , … 𝑥𝑛 successively, we obtain

𝑎0 = 𝑦𝑛 (5.11)

𝑦𝑛−1 = 𝑎0 + 𝑎1 (𝑥𝑛−1 − 𝑥𝑛 )

𝑦 −𝑦 ∇yn
𝑎1 = 𝑥𝑛−1−𝑥𝑛 = (5.12)
𝑛−1 𝑛 ℎ

∇2 yn ∇𝑛 𝑦𝑛
Similarly, we obtain 𝑎2 == , …, 𝑎𝑛 = (5.13)
2!ℎ2 𝑛!ℎ𝑛

Substituting the values from Esq. (5.11), (5.12) and (5.13) in Eq. (5.10), we get

∇yn ∇2 yn ∇n yn
p(𝑥) = yn + (x − xn ) + (x − x n )(𝑥 − 𝑥𝑛−1 ) + ⋯ (x − xn )
h 2! h2 n! hn

(𝑥 − 𝑥𝑛−1 ) … (𝑥 − 𝑥0 ) (5.14)

Now, setting 𝑥 = xn + 𝑣ℎ, we obtain x – 𝑥n = 𝑣ℎ


𝑥 – 𝑥n–1 = (𝑣 + 1)ℎ

𝑥 – 𝑥0 = (𝑣 + 𝑛 – 1)ℎ

Hence, Eq. (5. 14) reduces to

v(v+1) v(v+1)(v+2)(v+3)…..(v+n−1)
p(𝑥) = yn + v∇yn + ∇2 yn + ⋯ + ∇𝑛 𝑦𝑛 (5.15)
2! n!

𝑥−𝑥𝑛
Where 𝑣 = ℎ

The formula given in Eq. (5.15) is called the Newton’s backward interpolation formula. This
formula is used for interpolating values of 𝑦 near the end of the tabulated values and also used for
extrapolating values of y a little backward of 𝑦n.

Example 5.8

Page 106
Numerical Method for Engineering

Calculate the value of f (84) for the data given in the table below:

𝑥 40 50 60 70 80 90

𝑓(𝑥) 204 224 246 270 296 324

Solution:
The value of 84 is near the end of Table. Hence, we use the Newton’s backward interpolation
formula. The difference table is shown below:

𝑥 𝑓(𝑥) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

40 204

20

50 224 2

22 0

60 246 2 0

24 0 0

70 270 2 0

26 0

80 296 2

28

90 324

We have 𝑥𝑛 = 90 𝑥 = 10, ℎ = 10, 𝑡𝑛 = 𝑦𝑛 = 324, ∇t n = ∇yn = 28, ∇2 𝑦𝑛 = 2 and 𝑓ℎ = 𝑓ℎ

∇3 𝑦𝑛 = ∇4 𝑦𝑛 = ∇5 𝑦𝑛 = 0,

𝑥−𝑥𝑛 80−90
𝑢= = = −0.6
ℎ 10

Page 107
Numerical Method for Engineering

From Newton’s backward formula


u(u + 1) 2
𝑓(84) = 𝑡𝑛 + 𝑢∇t n + ∇ tn + ⋯
2

(−0.6)(−0.6+1)
𝑓(84) = 324 − 0.6(28) + (2) = 324 − 16.8 − 0.24 = 306.96
2

Example 5.9
From the following table estimate the number of students who obtained marks in computer
programming between 75 𝑎𝑛𝑑 80.
𝑚𝑎𝑟𝑘𝑠 35 − 45 45 − 55 55 − 65 65 − 75 75 − 85

𝑁𝑜. 𝑜𝑓 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 20 40 60 60 20

Solution: The cumulative frequency table is shown in Table.


Marks less than (𝑥) No. of students (y) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

45 20

55 60 20

65 120 60 20

75 180 60 0 −20

85 200 20 −40 −40 −20

To find the number of students with 𝑚𝑎𝑟𝑘𝑠 𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 80

𝑥−𝑥0 80−85
Let 𝑥𝑛 = 85, 𝑥 = 80, ℎ = 10 𝑝 = = = −0.5
ℎ 10

Then using Newton’s backward interpolation formula we obtain

v(v + 1) 2 v(v + 1)(V + 2) 3 v(v + 1)(v + 2)(v + 3) 4


y = yn + v∇yn + ∇ yn + ∇ yn + ∇ 𝑦𝑛
2! 3! 4!

Page 108
Numerical Method for Engineering

−0.5(−0.5 + 1) −0.5(−0.5 + 1)(−0.5 + 2)


= 200 + (−0.5)(20) + (−40) + (−40)
2 6
−0.5(−0.5 + 1)(−0.5 + 2)(−0.5 + 3)
+ (−40)(−20) = 198.2813
24

So number of students getting marks in computer programming between 75 𝑎𝑛𝑑 80


= 198 – 180 = 18

Exercise 5.3

1. The population of a town in the decennial census is given below. Estimate the
population for the year 1925.

Year :𝑥 1891 1901 1911 1921 1931

Population:𝑦 46 66 81 93 101

2. If 𝑓 (𝑥) is known at the following data points.

𝑥𝑖 0 1 2 3 4

𝑓𝑖 1 7 23 55 109

Find 𝑓(3.5) using Newton’s backward difference formula.

5.4 Application interpolation

Page 109
Numerical Method for Engineering

5.4 .1 Numerical Differentiation

Objective

At the end of this lesson students will be able to:

➢ Understand the concepts of Derivatives based on Newton's forward a


➢ Understand the concepts of Derivatives based on backward Interpolation Formula.
➢ Understand the concepts of Derivatives based on Stirling’s Interpolation Formula
➢ Solve problem using of Derivatives based on Newton's forward, backward and
Stirling’s Interpolation Formula.

5.4.1.1 Derivatives Based on Newton’s Forward Interpolation formula

Numerical differentiation deals with the following problem: given the function
𝑦 = 𝑓 (𝑥) finds one of its derivatives at the point 𝑥 = 𝑥𝑘 Here, the term given implies that
w e either have an algorithm for computing the function, or possesses a set of discrete data points
(𝑥𝑖 , 𝑦𝑖 ) , 𝑖 = 1, 2, … . , 𝑛. In other words, we have a finite number of (𝑥, 𝑦) data points or pairs
from which we can compute the derivative. Numerical differentiation is a method to compute the
derivatives of a function at some values of independent variable 𝑥, when the function 𝑓 (𝑥) is
explicitly unknown; however it is known only for a set of arguments.

Suppose the function 𝑦 = 𝑓 (𝑥) is known at (n + 1) equispaced points 𝑥0 , 𝑥1 , 𝑥2 , … 𝑥𝑛 and


they are 𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 respectively i.e., 𝑦𝑖 =f (𝑥𝑖 ), 𝑖 = 0, 1, … . , 𝑛.

𝑥−𝑥𝑖
Let 𝑥𝑖 = 𝑥0 + 𝑖ℎ, and 𝑢 = where ℎ is the spacing

Since the Newton’s forward interpolation formula is given by

𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3 𝑢(𝑢−1)…(𝑢−𝑛+1) 𝑛


𝑦 = 𝑓(𝑥) = 𝑦0 + 𝑢∆𝑦0 + 2!
∆ 𝑦0 + 3!
∆ 𝑦0 +⋯+ 𝑛!
∆ 𝑦0

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


= 𝑦0 + 𝑢∆𝑦0 + 2!
∆ 𝑦0 + 3!
∆ 𝑦0 + 4!
∆ 𝑦0
𝑢5 +10𝑢4 +35𝑢3 −50𝑢2 +24𝑢 5
+ 5!
∆ 𝑦0 +⋯ (5.16)

Page 110
Numerical Method for Engineering

Differentiating Eq. (5.16) w .r. t. x, we get

𝑑𝑦 1 2𝑢−1 3𝑢2 −6𝑢+2 3 4𝑢3 −18𝑢2 +22𝑢−6 4


= 𝑓 ′ (𝑥) = [∆𝑦0 + 2! ∆2 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0
𝑑𝑥 ℎ 3! 4!

5𝑢4 −40𝑢3 +105𝑢2 −50𝑢2 +24 5


+ 5!
∆ 𝑦0 +⋯ ] (5.17)

𝑑𝑢
Note here that = ℎ1 since 𝑢 = 𝑋−𝑋

𝑖
𝑑𝑥

Differentiating Eq. (5.17) w .r. t. x, we get

𝑑2 𝑦 1 2 6𝑢−6 12𝑢2 −36𝑢+22 4 20𝑢3 −120𝑢2 +210𝑢−100 5


= 𝑓′′(𝑥) = [∆ 𝑦0 + 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0
𝑑𝑥 2 ℎ2 3! 4! 5!

+⋯ ] (5.18)

and so on.

Equations (5.17) and (5.18) give the approximate derivatives of f(x) at arbitrary point
x = x0 + uh.
When x = x0, u = 0, Esq. (5.17) and (5.18) become

1 1 1 1 1 5
𝑓 ′ (𝑥0 ) = ℎ[∆𝑦0 − 2∆2 𝑦0 + 3∆3 𝑦0 − 4∆4 𝑦0 + ∆ 𝑦0 − ⋯ ] (5.19)
5

1 11 5 5
𝑓 ′ ′(𝑥0 ) = ℎ2 [∆2 𝑦0 − ∆3 𝑦0 + 12∆4 𝑦0 − ∆ 𝑦0 + ⋯ ] (5.20)
6

And so on.
𝑑𝑦 𝑑2 𝑦
Example 5.10: From the following table find the value of 𝑎𝑛𝑑 𝑑𝑥 2 at the point x = 1.0
𝑑𝑥

x 1 1.1 1.2 1.3 1.4 1.5

y 5.4680 5.6665 5.9264 6.2551 6.6601 7.1488

Solution:
The forward difference table is

Page 111
Numerical Method for Engineering

𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

1.0 5.4680

0.1985

1.1 5.6665 0.0614

0.2599 0.0074

1.2 5.9264 0.0688 0.0001

0.3287 0.0075 -0.0002

1.3 6.2551 0.0763 -0.0001

0.4050 0.0074

1.4 6.6601 0.0837

0.4887

1.5 7.1488

Here x0 = 1.0 and h = 0.1. Then u = 0 and hence


𝑑𝑦 1 1 1 1 1
= 𝑓 ′ (𝑥0 ) = ℎ[∆𝑦0 − 2∆2 𝑦0 + 3∆3 𝑦0 − 4∆4 𝑦0 + ∆5 𝑦0 − ⋯ ]
𝑑𝑥 5
1 1 1 1 1
𝑓 ′ (1.0) = 0.1[.01985 − (0.0614) + 3(0.0074)− 4(0.0001−5(0.0002)]=1.70202
2

𝑑2𝑦 ′ 1 2 3 11 4 5 5
= 𝑓 ′(𝑥0 ) = [∆ 𝑦0 − ∆ 𝑦0 + ∆ 𝑦0 − ∆ 𝑦0 + ⋯ ]
𝑑𝑥 2 ℎ 2 12 6

𝑑2 𝑦 ′
1 11 5
= 𝑓 ′(1.0) = [0.0614 − 0.0074 − (0.0001) + (0.0002)] = 5.4040
𝑑𝑥 2 (0.1)2 12 6
Example 5.11:
Obtain the first and second derivatives of the function tabulated below at the points x = 1.1 and

Page 112
Numerical Method for Engineering

x = 1.2
x 1 1.2 1.4 1.6 1.8 2.0
y 0 0.128 0.544 1.298 2.440 4.020

Solution: We first construct the forward difference table as shown below

𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

1.0 0

0.128

1.2 0.128 0.288

0.416 0.05

1.4 0.544 0.338 0

0.754 0.05 0

1.6 1.298 0.388 0

1.142 0.05

1.8 2.440 0.438

1.580

2.0 4.020

Since x = 1.1 is a non-tabulated point near the beginning of the table, we take
𝑥0 = 1.0 and compute 𝑝 = 1.1−1.0
0.2
= 0.5

𝑑𝑦 1 2𝑝−1 3𝑝2 −6𝑝+6


Hence, = ℎ [∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 ]
𝑑𝑥 2 6

Page 113
Numerical Method for Engineering
𝑑𝑦 1 2(0.5)−1 3(0.5)2 −6(0.5)+2
= 0.2 [0.128 + (0.288) + (0.05)] = 0.62958
𝑑𝑥 2 6

𝑑2𝑦 1 1
2
= 2 [∆2 𝑦0 + (𝑝 − 1)∆3 𝑦0 ] = (0.2)2 [0.288 + (0.5 − 1)(0.05) = 6.575
𝑑𝑥 ℎ

Now, 𝑥 = 1.2 is a tabulated point near the beginning of the table.


For x = x0 = 1.2, p = 0 and
𝑑𝑦 1 1 1 1 1 1
= ℎ[∆𝑦0 − 2∆2 𝑦0 + 3∆3 𝑦0 ] = [0.416 − (0.338) + (0.05)] = 1.31833
𝑑𝑥 0.2 2 3
𝑑2𝑦 1 2 3 ]
1
= [∆ 𝑦0 − ∆ 𝑦0 = [0.338 − 0.05] = 7.2
𝑑𝑥 2 ℎ 2
(0.2)2
I Example 5 .12: Let 𝑓(1) = 1, 𝑓(3) = −1, 𝑓(5) = 4, 𝑓(7) = 10, 𝑓(9) = 13, 𝑓(11) = 18
and 𝑓(13) = 24, then find 𝑓 ′ (1) , 𝑓 ′ (5) and 𝑓 ′′ (3).

Solution: First we find the forward differences using forward difference table as follows

𝑥 𝑓(𝑥) ∆ ∆2 ∆3 ∆4 ∆5 ∆6

1 1 −2 7 −6 2 7 −22

3 −1 5 1 −4 9 −15

5 4 6 −3 5 −6

7 10 3 2 −1

9 13 5 1

11 18 6

13 24

1 ∆2 𝑦0 ∆3 𝑦0 ∆4 𝑦0 ∆5 𝑦0 ∆6 𝑦0
Then, 𝑓 ′ (1) = ℎ (∆𝑦0 − + − + − ),ℎ = 2
2 3 4 5 6

1 1 1 1 1 1
= 2 (−2 − 2 (7) + 3 (−6) − 4 (2) + 5 (7) − 6 (−22))

Page 114
Numerical Method for Engineering
1 7 1 7 11 22
= 2 (−2 − 2 − 2 − 2 + 5 + ) = − 15
3

1 ∆2 𝑦2 ∆3 𝑦2 ∆4 𝑦2
𝑓 ′ (5) = ℎ (∆𝑦2 − + − ),ℎ = 2
2 3 4

1 1 1 1 1 3 5 3 22
= 2 (6 − 2 (−3) + 3 (5) − 4 (−6)) = 2 (6 + 2 + 3 + 2) = 3

1 11 5
𝑓 ′′ (3) = ℎ2 (∆2 𝑦1 − ∆3 𝑦1 + 12 ∆4 𝑦1 − 6 ∆5 𝑦1 ) , ℎ = 2

1 11 5 1 33 25 103
= 4 (1 − (−4) + 12 (9) − 6 (−15)) = 4 (1 + 4 + + )=
4 2 16

Exercise 5.4

1. From the following table of values, estimate 𝑦′(1.0) 𝑎𝑛𝑑 𝑦′′(1.0):


𝑥 1 2 3 4 5 6

𝑦 −4 3 22 59 120 211

2. From the following table of values, estimate 𝑦′ 𝑎𝑛𝑑 𝑦′′ at the points 𝑥 = 1.5 and
𝑥 = 1.25

𝑥 1 1.5 2 2.5 3 3.5


𝑦 2.7 −5.5188 −27.8 −75.4688 −163.3 −309.5188

5.4.1. 2 Derivatives Based on Newton’s Backward Interpolation formula


IVES BA Here, we assume the function y = f (x) is known at (n + 1) points
𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 i.e., 𝑥𝑖 = 𝑓 (𝑥𝑖 ), 𝑖 = 0, 1, 2, … . , 𝑛 are known. Let 𝑥𝑖 = 𝑥0 + 𝑖ℎ,
𝑥−𝑥𝑛
𝑖 = 0, 1, 2, … . , 𝑛 and 𝑣 = ℎ

Then, the Newton’s backward interpolation formula from Chapter 4 is given by


𝑣(𝑣+1) 2 𝑣(𝑣+1)(𝑣+2) 3 𝑣(𝑣+1)…(𝑣+𝑛−1) 𝑛
𝑦 = 𝑓(𝑥) = 𝑦𝑛 + 𝑣∇𝑦𝑛 + 2!
∇ 𝑦𝑛 + 3!
∇ 𝑦𝑛 +⋯+ 𝑛!
∇ 𝑦𝑛

𝑣 2 +𝑣 2 𝑣 3 +3𝑣 2 +2𝑣 3 𝑣 4 +6𝑣 3 +11𝑣 2 +6𝑣 4 𝑣 5 +10𝑣 4 +35𝑣 3 +50𝑣 2 +24𝑣 5


= 𝑦𝑛 + 𝑣∇𝑦𝑛 + 2!
∇ 𝑦𝑛 + 3!
∇ 𝑦𝑛 + 4!
∆ 𝑦𝑛 + 5!

+⋯ (5.21)

Page 115
Numerical Method for Engineering

When the Eq. (5.21) is differentiated w.r.t. x successively, we obtain

1 2 +6𝑣+2
𝑓 ′ (𝑥) = ℎ [∇𝑦𝑛 + 2𝑣+1
2!
∇2 𝑦𝑛 + 3𝑣 3!
∇3 𝑦𝑛 +
4𝑣3 +18𝑣2 +22𝑣+6
4!
∇4 𝑦𝑛 +. . . ] (5.22)
INTERPOLATI FOULA
(𝑥) 1 2 6𝑣+6 12𝑣 2 +36𝑣+22 4 20𝑣 3 +120𝑢2 +210𝑣+100 5
𝑓 ′′ = 2
[∇ 𝑦𝑛 + 3! ∇3 𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛
ℎ 4! 5!

+⋯ ] (5.23)

Equations (5.22) and (5.23) can be used to determine the approximate differentiation of first,
second, etc. order at any point x, where 𝑥 = 𝑥𝑛 + 𝑣ℎ.
If 𝑥 = 𝑥𝑛 , then v = 0. Equations (5.22) and (5.23) become
1 1 1 1 1 5
𝑓 ′ (𝑥0 ) = ℎ[∇𝑦𝑛 + 2∇2 𝑦𝑛 + 3∇3 𝑦𝑛 + 4∇4 𝑦𝑛 + ∆ 𝑦𝑛 + ⋯ ] (5.24)
5

1 11 5 5
𝑓 ′ ′(𝑥0 ) = ℎ2 [∇2 𝑦𝑛 + ∇3 𝑦𝑛 + 12∇4 𝑦𝑛 + ∇ 𝑦𝑛 + ⋯ ] (5.25)
6

and so on.
Example 5.13
A slider in a machine moves along a fixed straight rod. Its distance x (m) along the rod are given
in the following table for various values of the time t (seconds).
𝑡(𝑠𝑒𝑐) 1 2 3 4 5 6

𝑥(𝑚) 0.0201 0.0844 0.3444 1.0100 2.3660 4.7719

Find the velocity and acceleration of the slider at time t = 6 s


Solution: The backward difference table is

𝑡(𝑠𝑒𝑐) 𝑥(𝑚) ∇𝑥 ∇2 𝑥 ∇3 𝑥 ∇4 𝑥 ∇5 𝑥

Page 116
Numerical Method for Engineering

1 0.0201

2 0.0844 0.0643

3 0.3444 0.2600 0.1957

4 1.0100 0.6656 0.4056 0.2100

5 2.3660 1.3560 0.6904 0.2847 0.0748

6 4.7719 2.4059 1.0499 0.3595 0.0748 0.0000

Here ℎ = 1.0

𝑑𝑥 1 1 1 1 1
= ℎ[∇𝑦𝑛 + 2∇2 𝑦𝑛 + 3∇3 𝑦𝑛 + 4∇4 𝑦𝑛 + ∆5 + ⋯ ]
𝑑𝑡 5

1 1 1 1 1
= 1.0 [2.4059 + 2(1.0499) + 3(0.3595) + 4(0.0748) + (0.0)]
5
= 3.0 694
𝑑2𝑥 1 11 5
2
= ℎ2[∇2 𝑦𝑛 + ∇3 𝑦𝑛 + 12∇4 𝑦𝑛 + ∇5 𝑦𝑛 + ⋯ ]
𝑑𝑡 6
𝑑2 𝑥 1 11 5
2
= (1.0)2[1.0499 + 0.3595 + 12(0.0748) + (0.0) = 1.4780
𝑑𝑡 6
Exercise 5.5
1. Find the values of 𝑦′(4) and 𝑦′′(4) from the following table

𝑥 0 1 2 3 4

𝑦 5 8 12 17 26

2. Compute the values of 𝑦′(2.6) and 𝑦′′(2.6) from the following table:

Page 117
Numerical Method for Engineering

𝑥 1 1.5 2 2.5 3

𝑦 −2 2 3.456 5.674 8.4592

5.4.1.3 Derivatives Based on Stirling’s Interpolation formula


Suppose 𝑦±𝑖 = 𝑓(𝑥±𝑖 ), 𝑖 = 0, 1, … . , 𝑛 are given for 2𝑛 + 1 equispaced points
𝑥0 , 𝑥±1 , 𝑥±2 , … . , 𝑥±𝑖 , 𝑤ℎ𝑒𝑟𝑒 𝑥±𝑖 = 𝑥0 ± 𝑖ℎ, 𝑖 = 0, 1, … . , 𝑛.
The Stirling’s interpolation polynomial is given by

𝑢 ∆𝑦−1 + ∆𝑦0 𝑢2 𝑢2 − 𝑢 ∆3 𝑦−2 + ∆3 𝑦−1 𝑢4 − 𝑢2 4


𝑓(𝑥) = 𝑦0 + [ ] + ∆2 𝑦−1 + [ ]+ ∆ 𝑦−2
1! 2 2! 3! 2 4!
𝑢5 − 𝑢3 + 4𝑢 ∆3 𝑦−3 + ∆3 𝑦−2
+ [ ]+⋯ (5.26)
5! 2
𝑥−𝑥0
Where 𝑢 = ℎ

When Eq. (5.26) is differentiated with respect to x successively, we obtain


1 ∆𝑦−1 + ∆𝑦0 2
3𝑢2 − 1 ∆3 𝑦−2 + ∆3 𝑦−1 2𝑢3 − 𝑢 4
𝑓 (𝑥) = [ + 𝑢∆ 𝑦−1 ( )+ ∆ 𝑦−2
ℎ 2 6 2 12
5𝑢4 − 15𝑢2 + 4 ∆5 𝑦−3 + ∆5 𝑦−2
+ ( )+⋯] (5.27)
120 2
and
1 2 ∆3 𝑦−2 + ∆3 𝑦−1 6𝑢2 − 1 4 2𝑢3 − 3𝑢 ∆5 𝑦−3 + ∆5 𝑦−2
𝑓′′(𝑥) = 2 [∆ 𝑦−1 + 𝑢 ( )+ ∆ 𝑦−2 + ( )
ℎ 2 12 120 2

+⋯] (5.28)

At x = x0, u = 0 and Esq. (5.27) and (5.28) become

1 ∆𝑦−1 + ∆𝑦0 1 ∆3 𝑦−2 + ∆3 𝑦−1 1 ∆5 𝑦−3 + ∆5 𝑦−2


𝑓 ′ (𝑥0 ) = [ − ( )+ ( )+⋯] (5.29)
ℎ 2 6 2 30 2

1 2 1 4
𝑓′′(𝑥0 ) = 2
[∆ 𝑦−1 − ∆ 𝑦−2 + ⋯ ] (5.30)
ℎ 12

Page 118
Numerical Method for Engineering

𝑑𝑦 𝑑2 𝑦
Example 5.14: Find 𝑎𝑛𝑑 for 𝑥 = 0.2 for the given in the following table.
𝑑𝑥 𝑑𝑥 2

𝑥 0 0.1 0.2 0.3 0.4 0.5

𝑦 0 0.10017 0.20134 0.30452 0.41076 0.52115

Solution: Construct the following difference table.


𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

0 0

0.10017

0.1 0.10017 0.001

0.10117 0.00101

0.2 0.20134 0.00201 0.00004

0.10318 0.00105 0

0.3 0.30452 0.00306 0.00004

0.10624 0.00109

0.4 0.41076 0.00415

0.11039

0.5 0.52115

𝑑𝑦 1 ∆𝑦−1 + ∆𝑦0 1 ∆3 𝑦−2 + ∆3 𝑦−1


= [ − ( )] =
𝑑𝑥 ℎ 2 6 2

𝑑𝑦 1 0.1017 + 0.10318 1 0.00101 + 0.00105


= [ − ( )] = 1.020033
𝑑𝑥 0.1 2 6 2

Page 119
Numerical Method for Engineering

𝑑2 𝑦 1 1 4 1 1
2
= 2 [∆2 𝑦−1 − ∆ 𝑦−2 ] = 2
[0.00201 + (0.00004)]
𝑑𝑥 ℎ 12 (0.1) 12
= 0.200666
Example 5.15
Compute the values of f '(3.1) and f '(3.2) using the following table.

𝑥 1 2 3 4 5
𝑦 = 𝑓(𝑥) 0 1.4 3.3 5.6 8.1

Solution: The central difference table is


𝑥 𝑦 = 𝑓(𝑥) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

𝑥− 2 = 1 0

1.4

𝑥− 1 = 2 1.4 0.5

1.9 -0.1

𝑥0 = 1 3.3 0.4 -0.1

2.3 -0.2

𝑥1 = 1 5.6 0.2

2.5

𝑥2 = 1 8.1

3.1−3
Let 𝑥0 = 3, ℎ = 1, 𝑢 = = 0.1
1

1 ∆𝑦−1 + ∆𝑦0 3𝑢2 − 1 ∆3 𝑦−2 + ∆3 𝑦−1 2𝑢3 − 𝑢 4


𝑓 ′ (𝑥) = [ + 𝑢∆2 𝑦−1 ( )+ ∆ 𝑦−2 + ⋯ ]
ℎ 2 6 2 12

Page 120
Numerical Method for Engineering

1 1.9 + 2.3 3(0.1)2 − 1 −0.1 − 0.2 2(0.1)3 − 0.1


𝑓 ′ (3.1) = [ + 0.1(0.4) + ( )+ (−0.1)]
1 2 6 2 12
= [2.1 + 0.04 + 0.02425 + 0.00082] = 2.16507

1 2 ∆3 𝑦−2 + ∆3 𝑦−1 6𝑢2 − 1 4


𝑓 ′′ (3.1) = [∆ 𝑦−1 + 𝑢 ( ) + ∆ 𝑦−2 ]
ℎ2 2 12
1 −0.1 − 0.2 6(0.1)2 − 1
= [0.4 + 0.1 ( ) + (−0.1)] = [0.4 − 0.015 + 0.00783] = 0.39283
12 2 12
Exercise 5.7
1. Compute the values of y'(3) and y''(3) from the following table:

𝑥 1 2 3 4 5

𝑦 0 1.4 1.65 5.673 8.0978

2. Compute the values of y'(2) and y''(2) from the following table

𝑥 1 1.5 2 2.5 3

𝑦 −2 2 3.456 5.674 8.4592

5.4.2 Numerical Integration

Page 121
Numerical Method for Engineering

Objective

At the end of this lesson students will be able to:

➢ Understand the concepts of Numerical integration


➢ Identifying the techniques of Numerical integration
➢ Solve problems using Trapezoidal rule, Simpson’s 1/3 rule and Simpson’s 3/8 rule.

If F(x) is a differentiable function whose derivative is f (x), then we can evaluate the definite
integral I as
𝑏
𝐼 = ∫𝑎 𝑓(𝑥)𝑑𝑥 = 𝐹(𝑏) − 𝐹(𝑎) 𝐹 ′ (𝑥) = 𝑓(𝑥) (5.31)
Equation (5.31) is known as the fundamental theorem of calculus. Most integrals can be
evaluated by the formula given by Eq. (5.31) and there exists many techniques for making such
evaluations. However, in many applications in science and engineering, most integrals cannot be
evaluated because most integrals do not have anti-derivatives F(x) expressible in terms of
elementary functions.
In other circumferences, the integrands could be empirical functions given by certain measured
values. In all these instances, we need to resort to numerical methods of integration. It should be
noted here that, sometimes, it is difficult to evaluate the integral by analytical methods. Numerical
integration (or numerical quadrature, as it is sometimes called) is an alternative approach to solve
such problems. As in other numerical techniques, it often results in approximate solution. The
integration can be performed on a continuous function or a set of data.
The integration given by Eq. (5.31) is called closed since the function values at the two points
(a, b) where the limits of integration are located are used to find the integral.
In open integration, information on the function at one or both limits of integration is not required.
The range of integration (b – a) is divided into a finite number of intervals in numerical integration.
The integration techniques consisting of equal intervals are based on formulas known as Newton-
Cotes closed quadrature formulas.
In this chapter, we present the following methods of integration with illustrative examples:
1. Trapezoidal rule.
2. Simpson’s 1/3 rule.
3. Simpson’s 3/8 rule.

Page 122
Numerical Method for Engineering

Newton-cotes closed Quadrature formula

The general form of the problem of numerical integration may be stated as follows:
Given a set of data points (𝑥𝑖 , 𝑦𝑖 ), 𝑖 = 0, 1, 2, … ., n of a function y = f (x), where f (x) is not
𝑏
explicitly known. Here, we are required to evaluate the definite integral 𝐼 = ∫𝑎 𝑦𝑑𝑥 (5.32)

In what follows, we derive a general formula for numerical integration by using Newton’s forward
difference formula. Here, we assume the interval (a, b) is divided into n-equal subintervals such
𝑏−𝑎
that ℎ= 𝑛

𝑎 = 𝑥 0 < 𝑥2 < 𝑥3 … . < 𝑥𝑛 = 𝑏 (5.33)


With 𝑥 𝑛 = 𝑥0 + 𝑛 ℎ
Where ℎ = the internal size
𝑛 = the number of subintervals
𝑎 and 𝑏 = the limits of integration with 𝑏 > 𝑎.
Hence, the integral in Eq. (5.31) can be written as
𝑥
𝐼 = ∫𝑥 𝑛 𝑦𝑑𝑥 (5.34)
0

Using Newton’s forward interpolation formula, we have

𝑥
𝐼 = ∫𝑥 𝑛[𝑦0 + 𝑝∆𝑦0 + 𝑝(𝑝−1)
2!
∆2 𝑦0 + 𝑝(𝑝−1)(𝑝−2)
3!
∆3 𝑦0 + ⋯ ]𝑑𝑥 (5.35)
0

Where x = x0 + ph

𝑛 2 3 −3𝑝2 +2𝑝
= ℎ ∫0 [𝑦0 + 𝑢∆𝑦0 + 𝑝 2−𝑝∆2 𝑦0 + 𝑝 6
∆3 𝑦0 + ⋯ ]𝑑𝑝 (5.36)

Hence, after simplification, we


𝑥 2
𝐼 = ∫𝑥 𝑛 𝑦𝑑𝑛 = 𝑛ℎ [𝑦0 + 𝑛2∆𝑦0 + 𝑛(2𝑛−3)
12
∆2 𝑦0 + 𝑛(𝑛−2)
24
∆3 𝑦0 +
0

⋯] (5.37)

Page 123
Numerical Method for Engineering

The formula given by Eq.(5.37) is known as Newton-Cotes closed quadrature formula.


From the general formula (Eq. (5.37)), we can derive or deduce different integration formulae by
substituting n = 1, 2, 3, etc

A) Trapezoidal Rule
In this method, the known function values are joined by straight lines. The area enclosed by these
lines between the given end points is computed to approximate the integral as shown in Fig. 1.

Fig.1.

Each subinterval with the line approximation for the function forms a trapezoid as shown in
Fig 1. The area of each trapezoid is computed by multiplying the interval size h by the average
value of the function value in that subinterval. After the individual trapezoidal areas are obtained,
they are all added to obtain the overall approximation to the integral.
Substituting n = 1 in Eq. (5.37) and considering the curve y = f(x) through the points (x0, y0) and
(x1, y1) as a straight line (a polynomial of first degree so that the differences of order higher than
first become zero), we get
𝑥 1 ℎ 1 ℎ
𝐼1 = ∫𝑥 1 𝑦𝑑𝑥 = ℎ [𝑦0 + 2 ∆𝑦0 ] = 2 [𝑦0 + 2 (𝑦1 − 𝑦0 )] = 2 (𝑦0 + 𝑦1 ) (5.38)
0

𝑥 ℎ 𝑥 ℎ
Similarly, we have 𝐼2 = ∫𝑥 2 𝑦𝑑𝑥 = 2 (𝑦1 + 𝑦2 ) 𝐼3 = ∫𝑥 3 𝑦𝑑𝑥 = 2 (𝑦2 + 𝑦3 )
1 2

and so on. (See Fig.2.)


𝑥 ℎ
In general, we have 𝐼𝑛 = ∫𝑥 𝑛 𝑦𝑑𝑛 = 2 ( 𝑦𝑛−1 + 𝑦𝑛 ) (5.39)
0

Page 124
Numerical Method for Engineering

Fig.2

Adding all the integrals (Eq. (5.38), Eq. (5.39)) and using the interval additive property of the
definite integrals, we obtain
𝑥 ℎ ℎ
𝐼 = ∑𝑛𝑖=1 𝐼𝑖 = ∫𝑥 𝑛 𝑦𝑑𝑥 = 2 [𝑦0 + 2(𝑦1 + 𝑦3 + ⋯ 𝑦𝑛−1 ) + 𝑦𝑛 ] = 2 [𝑋 + 2𝐼] (5.40)
0

Where 𝑋 = sum of the end points


𝐼 = sum of the intermediate ordinates.
Equation (5.40) is known as the trapezoidal rule.

Summarizing, the trapezoidal rule signifies that the curve y = f (x) is replaced by n-straight lines
joining the points (𝑥𝑛 , 𝑦𝑛 ), 𝑖 = 0, 1, 2, 3, … , 𝑛. The area bounded by the curve y = f (x), the
ordinates 𝑥 = 𝑥0 , 𝑥 = 𝑥𝑛 and the x-axis is then approximately equivalent to the sum of the
areas of the n-trapezoids so obtained.
1.2
Example 5.16: Evaluate the integral ∫0 𝑒 𝑥 𝑑𝑥 taking six intervals by using trapezoidal rule
up to three significant figures
𝑏−𝑎 1.2−0
Solution: 𝑎 = 0 , 𝑏 = 1.2 , 𝑛 = 6 ℎ= = = 0.2
𝑛 6

𝑥 0 0.2 0.4 0.6 0.8 1.0 1.2


𝑦 = 𝑓(𝑥) 0 1.221 1.492 1.822 2.226 2.718 3.320
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6

The trapezoidal rule can be written as


𝐼= [(𝑦 + 𝑦6 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 )]
2 0
Page 125
Numerical Method for Engineering

0.2
𝐼= [(1 + 3.320) + 2(1.221 + 1.492 + 1.822 + 2.226 + 2.718)] = 2.3278 ≅ 2.328
2

1.2
The exact value is = ∫0 𝑒 𝑥 𝑑𝑥 = 2.320

12 1
Example 5.17: Evaluate ∫0 𝑑𝑥 by using trapezoidal rule, taking n = 6, correct to give
1+𝑥 2

significant figures

1 𝑏−𝑎 12−0
Solution: 𝑓(𝑥) = 𝑎 = 0 , 𝑏 = 12, 𝑛 = 6 ℎ= = =2
1+𝑥 2 𝑛 6

𝑥 0 2 4 6 8 10 12
𝑦 = 𝑓(𝑥) 1 1 1 1 1 1 1
5 17 37 65 101 145

𝑦 1.0000 0.20000 0.05882 0.02703 0.01538 0.0990 0.00690


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


𝐼= [(𝑦 + 𝑦6 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 + 𝑦5 )]
2 0

2
𝐼= [(1 + 0.00690) + 2(0.2 + 0.05882 + 0.02703 + 0.01538 + 0.00990)] = 1.62916
2

12 1
The exact value is ∫0 𝑑𝑥 = tan−1 (𝑥)|12 −1 −1
0 = tan (12) − tan (0) = 1.48766
1+𝑥 2

6
Example 5 .18: Evaluate ∫2 log10 𝑥 𝑑𝑥 by using trapezoidal rule, taking n = 8, correct to
five decimal places.

𝑏−𝑎 6−2
Solution: 𝑓(𝑥) = log10 𝑥 𝑎 = 2 , 𝑏 = 6, 𝑛 = 8 ℎ= = = 0.5
𝑛 8

𝑥 2 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0


𝑦 0.30103 0.39794 0.47712 0.54407 0.60206 0.65321 0.69897 0.74036 0.778155
= 𝑓(𝑥) 𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7 𝑦8

Page 126
Numerical Method for Engineering

The trapezoidal rule is 𝐼 = 2 [(𝑦0 + 𝑦8 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 + 𝑦5 + 𝑦6 + 𝑦7 )]

0.5
𝐼= [(0.30103 + 0.77815) + 2(0.39794 + 0.47712 + 0.54407 + 0.60206 + 0.65321
2
+ 0.69897 + 0.74036)] = 2.32666

6
The exact value is give by ∫2 log10 𝑥 𝑑𝑥 = [𝑥𝑙𝑜𝑔𝑥 − 𝑥]|62 = 6.06685

Exercise 5.8

2
1. Using trapezoidal rule evaluate ∫1 𝑓(𝑥)𝑑𝑥 with step size ℎ = 0.25 and with the tabulated
values of 𝑓 given below.

𝑥 1 1.25 1.5 1.75 2

𝑓(𝑥) −1 −0.9375 −0.75 −0.4375 0

4 2
2. Evaluate the integration of ∫0 𝑒 −𝑥 𝑑𝑥 using trapezoidal rule with 𝑛 = 4

𝟏
B) Simpson’s 𝟑 Rule

In Simpson’s rule, the function is approximated by a second degree polynomial between


successive points.
Since a second degree polynomial contains three constants, it is necessary to know three
consecutive function values forming two intervals as shown in Fig. 3.

Fig .3.

Consider three equally spaced points 𝑥0 , 𝑥1 𝑎𝑛𝑑 𝑥2 . Since the data are equally spaced,

Page 127
Numerical Method for Engineering

Let ℎ = 𝑥𝑛+1 – 𝑥𝑛 (see Fig.4).

Fig. 4.

Substituting n = 2 in Eq. (5.37) and taking the curve through the points (𝑥0 , 𝑦0 ), (𝑥1 , 𝑦1 ) and (𝑥2 , 𝑦2 )
as a polynomial of second degree (parabola) so that the differences of order higher than two vanish,
𝑥 1 𝑛
we obtain 𝐼1 = ∫𝑥 2 𝑦𝑑𝑥 = 2ℎ [𝑦0 + 4𝑦0 + 6 ∆2 𝑦0 ] = 3 [𝑦0 + 4𝑦1 + 𝑦2 ] ( 5.41)
0

𝑥 ℎ
Similarly 𝐼2 = ∫𝑥 4 𝑦𝑑𝑥 = 3 [𝑦2 + 4𝑦3 + 𝑦4 ]
2

𝑥 ℎ
𝐼3 = ∫𝑥 6 𝑦𝑑𝑥 = 3 [𝑦4 + 4𝑦5 + 𝑦6 ] (5.42)
4

and so on.

𝑥 ℎ
In general, we can write 𝐼𝑛 = ∫𝑥 2𝑛 𝑦𝑑𝑥 = 3 [𝑦2𝑛−1 + 𝑦2𝑛−2 + 𝑦2𝑛 ] (5.43)
2𝑛−2

Summing up all the above integrals, we obtain

𝑥 ℎ
𝐼 = ∫𝑥 𝑛 𝑦𝑑𝑥 = 3 [𝑦0 + 4(𝑦1 + 𝑦3 + 𝑦5 +. . 𝑦2𝑛−1 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + ⋯ 𝑦2𝑛−2 ) + 𝑦2𝑛 ]
0


= 3 [𝑋 + 4𝑃 + 𝐸] (5.44)

Where 𝑋 = sum of end ordinates


𝑃 = sum of odd ordinates
𝐸 = sum of even ordinates
Equation (5.44) is known as Simpson’s 1/3 rule. Simpson’s 1/3 rule requires the whole range (the
given interval) must be divided into even number of equal subintervals.
1.2
Example 5.19: Evaluate the integral ∫0 𝑒 𝑥 𝑑𝑥, taking n = 6 using Simpson’s 1/3 rule.

Page 128
Numerical Method for Engineering
𝑏−𝑎 1.2−0
Solution: 𝑓(𝑥) = 𝑒 𝑥 𝑎 = 0 , 𝑏 = 1.2 , 𝑛 = 6 ℎ= = = 0.2
𝑛 6

𝑥 0 0.2 0.4 0.6 0.8 1.0 1.2


𝑦 = 𝑓(𝑥) 1.0 1.22140 1.49182 1.82212 2.22554 2.71828 3.32012
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6


The Simpson’s rule is 𝐼 = 3 [(𝑦0 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]

0.2
𝐼= [(1 + 3.32012) + 4(1.22140 + 1.82212 + 2.71828) + 2(1.49182 + 2.22554)]
3

0.2
𝐼= [4.32012 + 4(5.7618) + 2(3.71736)] = 2.320136 ≈ 2.32014
3
1.2
The exact value is∫0 𝑒 𝑥 𝑑𝑥 = 2.3201
12 1
Example 5.20: Evaluate ∫0 𝑑𝑥te by using Simpson’s 1/3 rule, taking n = 6.
1+𝑥 2

1 𝑏−𝑎 12−0
Solution: 𝑓(𝑥) = 1+𝑥 2 𝑎 = 0 , 𝑏 = 12, 𝑛 = 6 ℎ= = =2
𝑛 6

𝑥 0 2 4 6 8 10 12
𝑦 = 𝑓(𝑥) 1.0 0.2 0.05882 0.02703 0.01538 0.0099 0.0069
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6


The Simpson’s rule is 𝐼 = 3 [(𝑦0 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
2
𝐼 = [(1 + 0.0069) + 4(0.2 + 0.02703 + 0.0099) + 2(0.05882 + 0.01538)] = 1.40201
3
6
Example 5.21: Evaluate∫2 log10 𝑥 𝑑𝑥 , by using Simpson’s 1/3 rule, taking n = 6.

𝑏−𝑎 6−2 2
Solution: 𝑓(𝑥) = log10 𝑥 𝑎 = 2 , 𝑏 = 6, 𝑛 = 6 ℎ= = =3
𝑛 6

Page 129
Numerical Method for Engineering

𝑥 2 8⁄ 10⁄ 4 14⁄ 16⁄ 6


3 3 3 3
𝑦 = 𝑓(𝑥) 0.30103 0.42597 0.52288 0.60206 0.66901 0.72700 0.77815
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6

The Simpson’s rule is 𝐼 = 3 [(𝑦0 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]

2⁄
𝐼 = 3 [(0.30103 + 0.77815) + 4(0.42597 + 0.60206 + 0.72700) + 2(0.52288
3
+ 0.66901)] = 2.32957

Exercise 5.9
2
1. Using Simpson’s 1/3 evaluate ∫1 𝑓(𝑥)𝑑𝑥 with step size ℎ = 0.25 and with the tabulated
values of 𝑓 given below.
𝑥 1 1.25 1.5 1.75 2

𝑓(𝑥) −1 −0.9375 −0.75 −0.4375 0

4 2
2. Evaluate the integration of ∫0 𝑒 −𝑥 𝑑𝑥 using Simpson’s 1/3with 𝑛 = 4

C) Simpson’s 3/8 Rule

Putting 𝑛 = 3 in Eq. (5.37) and taking the curve through (𝑥𝑛 , 𝑦𝑛 ), 𝑛 = 0, 1, 2, 3 as a polynomial
of degree three such that the differences higher than the third order vanish, we obtain

𝑥 3 3 1 3
𝐼1 = ∫𝑥 3 𝑦𝑑𝑥 = 3ℎ [𝑦0 + 2 ∆𝑦0 + 2 ∆2 𝑦0 + 8 ∆3 𝑦0 ] = 8 ℎ[𝑦0 + 3𝑦1 + 3𝑦2 + 𝑦3 ] (5.45)
0

𝑥 3
Similarly, we get 𝐼2 = ∫𝑥 6 𝑦𝑑𝑥 = 8 ℎ[𝑦3 + 3𝑦4 + 3𝑦5 + 𝑦6 ]
3

𝑥9 3
𝐼3 = ∫𝑥6 𝑦𝑑𝑥 = 8 ℎ[𝑦6 + 3𝑦7 + 3𝑦8 + 𝑦9 ] (5.46)

and so on.
𝑥 3
Finally, we have 𝐼𝑛 = ∫𝑥 3𝑛 𝑦𝑑𝑥 = 8 ℎ[𝑦3𝑛−3 + 3𝑦3𝑛−2 + 𝑦3𝑛−1 + 𝑦3𝑛 ] (5.47)
3𝑛−3

Page 130
Numerical Method for Engineering

Summing up all the expressions above, we obtain


𝑥 3
𝐼 = ∫𝑥 3𝑛 𝑦𝑑𝑥 = 8 ℎ[𝑦0 + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + +𝑦7 + 𝑦8 + ⋯ + 𝑦3𝑛−1 + 𝑦3𝑛−1 ) +
0

2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ +𝑦3𝑛−3 ) + 𝑦3𝑛 ] (5.48)

Equation (5.48) is called the Simpson’s 3/8 rule. Here, the number of subintervals should be
taken as multiples of 3. Simpson’s 3/8 rule is not as accurate as Simpson’s 1/3 rule.

1.2
Example 5 .22 Evaluate the integral∫0 𝑒 𝑥 𝑑𝑥, by using Simpson’s 3/8 rule and taking seven
ordinates.
Solution: n+1=7  n=6
1 1 1 2 5 1
The points of division are 0, 6 , 3 , ,2 , 3 , 6 , 1 ℎ=6

𝑥 0 1⁄ 2⁄ 3⁄ 4⁄ 5⁄ 1
6 6 6 6 6

𝑦 = 𝑓(𝑥) 1 1.18136 1.39561 1.64872 1.94773 2.30098 2.71828


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

The Simpson’s three-eighth’s rule is


3
𝐼 = ℎ[𝑦0 + 𝑦6 + 3(𝑦1 + 𝑦2 + 𝑦4 + +𝑦5 ) + 3𝑦3 ]
8
3(1⁄6)
𝐼= ℎ[1 + 2.71828 + 3(1.18136 + 1.39561 + 1.94773 + 2.30098) + 3(164872)]
8
𝐼 = 1.71830
12 1
Example 5.23 Evaluate∫0 𝑑𝑥, by using Simpson’s 3/8 rule and taking seven ordinates
1+𝑥 2

Solution: n+1=7  n = 6, h = 2
The points of division are 0, 2, 4, 6, 8, 10, and 12.
𝑥 0 2 4 6 8 10 12

Page 131
Numerical Method for Engineering

𝑦 = 𝑓(𝑥) 1.0 0.2 0.05882 0.02703 0.01538 0.00990 0.00690


𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6
The Simpson’s three-eighth's rule is
3
𝐼 = ℎ[𝑦0 + 𝑦6 + 3(𝑦1 + 𝑦2 + 𝑦4 + +𝑦5 ) + 3𝑦3 ]
8
3
𝐼= (2)[1.0 + 0.00690 + 3(0.2 + 0.05882 + 0.01538 + 0.00990) + 3(0.02703)]
8
𝐼 = 1.43495
6
Example 5.24: Evaluate ∫2 log10 𝑥 𝑑𝑥 , by using Simpson’s 3/8 rule, taking n = 6, correct to five
decimal places.
8 10 12 14 16 18
Solution: The points of division are 2, 3 , , , , ,
3 3 3 3 3

𝑥 2 8⁄ 10⁄ 4 14⁄ 16⁄ 6


3 3 3 3
𝑦 = 𝑓(𝑥) 0.30103 0.42597 0.52288 0.60206 0.66901 0.72700 0.77815
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6
3
𝐼 = ℎ[𝑦0 + 𝑦6 + 3(𝑦1 + 𝑦2 + 𝑦4 + +𝑦5 ) + 3𝑦3 ]
8
3
𝐼= ℎ[0.30203 + 0.77815 + 3(0.42597 + 0.52288 + 0.66901 + 0.72700) + 3(0.60206)]
8
𝐼 = 2.32947

Exercise 5.10

2
1. Using Simpson’s 3/8 Rule evaluate ∫1 𝑓(𝑥)𝑑𝑥 with step size ℎ = 0.25 and with the
tabulated values of 𝑓 given below.

𝑥 1 1.25 1.5 1.75 2

𝑓(𝑥) −1 −0.9375 −0.75 −0.4375 0

4 2
1. Evaluate the integration of ∫0 𝑒 −𝑥 𝑑𝑥 using Simpson’s 3/8 Rule with 𝑛 = 4

Page 132
Numerical Method for Engineering

Unit Summary
➢ Interpolation is the method of computing the value of the function y = f (x) for any given
value of the independent variable x when a set of values of y = f (x) for certain values of x
are given.
➢ The study of interpolation is based on the assumption that there is no sudden jump in the
values of the dependent variable for the period under consideration.
➢ In this chapter, the study of interpolation was presented based on the calculus of finite
differences. Some important interpolation formulae by means of forward and backward
differences of a function, which are frequently used in scientific and engineering
calculations, were also presented.

Page 133
Numerical Method for Engineering

➢ Numerical differentiation is not a particularly accurate process due to a conflict between


round off errors and errors inherent in interpolation. Hence, a derivative of a function can
never be computed with the same precision as the function itself.
➢ In this chapter we have presented the various techniques on numerical integration.
Integration methods such as the trapezoidal rule, Simpson’s one-third rule and Simpson’s
three-eight’s rule integration were presented with illustrative examples. These methods
use uniformly spaced based points.
Some important formula
➢ The Lagrange interpolation formula given by
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … (𝑥 − 𝑥𝑛 )
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑓(𝑥1 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 )
(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 )…(𝑥−𝑥𝑛−1 )
+⋯+ (𝑥𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )…(𝑥𝑛 −𝑥𝑛−1 )
𝑓(𝑥𝑛 )

or 𝑓(𝑥) = ∑𝑛𝑖=0 𝐿𝑖 (𝑥)𝑓𝑖


𝑥−𝑥
Where, 𝐿𝑖 (𝑥) = ∏𝑛𝑗=0 𝑥 −𝑥𝑗 , 𝑖 = 0,1,2, … , 𝑛.
𝑖 𝑗
𝑗≠𝑖
𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2)
➢ The formula given by 𝑝(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ⋯ +
2! 3!
𝑢(𝑢−1)(𝑢−2)…(𝑢−𝑛+1)
∆𝑛 𝑦0 ) is called the Newton’s forward interpolation formula.
𝑛!
v(v+1)
➢ The formula given by p(𝑥) = yn + v∇yn + ∇2 yn + ⋯ +
2!
v(v+1)(v+2)(v+3)…..(v+n−1)
∇𝑛 𝑦𝑛
n!

is called the Newton’s forward interpolation formula.


Derivatives Based on Newton’s forward Interpolation formula

𝑑𝑦 1 2 −6𝑢+2 3 −18𝑢2 +22𝑢−6


➢ = 𝑓 ′ (𝑥) = ℎ [∆𝑦0 + 2𝑢−1
2!
∆2 𝑦0 + 3𝑢 3!
∆3 𝑦0 + 4𝑢 4!
∆4 𝑦0 + ⋯ ]
𝑑𝑥

𝑑2 𝑦 1 2 −36𝑢+22 3 −120𝑢2 +210𝑢−100


➢ = 𝑓′′(𝑥) = ℎ2 [∆2 𝑦0 + 6𝑢−6 𝑦0 + 12𝑢 ∆4 𝑦0 + 20𝑢 ∆5 𝑦0 + ⋯ ]
𝑑𝑥 2 3! 4! 5!

When x = x0, u = 0

1
➢ 𝑓 ′ (𝑥0 ) = ℎ1[∆𝑦0 − 12∆2 𝑦0 + 13∆3 𝑦0 − 14∆4 𝑦0 + ∆5 𝑦0 − ⋯ ]
5

Page 134
Numerical Method for Engineering
′(𝑥0 ) 5
➢ 𝑓′ = ℎ12 [∆2 𝑦0 − ∆3 𝑦0 + 11
12
∆4 𝑦0 − ∆5 𝑦0 + ⋯ ]
6

Derivatives Based on Newton’s Backward Interpolation formula

1 2 +6𝑣+2 3 +18𝑣2 +22𝑣+6


➢ 𝑓 ′ (𝑥) = ℎ [∇𝑦𝑛 + 2𝑣+1
2!
∇2 𝑦𝑛 + 3𝑣 3!
∇3 𝑦𝑛 + 4𝑣 4!
∇4 𝑦𝑛 +. . . ]
1 2 +36𝑣+22 3 +120𝑢2 +210𝑣+100
➢ 𝑓′′(𝑥) = ℎ2 [∇2 𝑦𝑛 + 6𝑣+6
3!
∇3 𝑦𝑛 + 12𝑣 4!
∇4 𝑦𝑛 + 20𝑣 5!
∇5 𝑦𝑛 + ⋯ ]

When x = x0, v= 0

1
➢ 𝑓 ′ (𝑥0 ) = ℎ1[∇𝑦𝑛 + 12∇2 𝑦𝑛 + 13∇3 𝑦𝑛 + 14∇4 𝑦𝑛 + ∆5 𝑦𝑛 + ⋯ ]
5
5
➢ 𝑓 ′ ′(𝑥0 ) = ℎ12 [∇2 𝑦𝑛 + ∇3 𝑦𝑛 + 11
12
∇4 𝑦𝑛 + ∇5 𝑦𝑛 + ⋯ ]
6

Numerical Integration formula

𝑥
➢ Trapezoidal rule.= ∫𝑥 𝑛 𝑓(𝑥)𝑑𝑥 = [𝑦0 + 2(𝑦1 + 𝑦3 + ⋯ 𝑦𝑛−1 ) + 𝑦𝑛 ]
0

𝑥 ℎ
➢ Simpson’s 1/3 rule 𝐼 = ∫𝑥 𝑛 𝑦𝑑𝑥 = 3 [𝑦0 + 4(𝑦1 + 𝑦3 + 𝑦5 +. . 𝑦2𝑛−1 ) + 2(𝑦2 + 𝑦4 + 𝑦6 +
0

⋯ 𝑦2𝑛−2 ) + 𝑦2𝑛 ]
𝑥 3
➢ Simpson’s 3/8 rule 𝐼 = ∫𝑥 3𝑛 𝑦𝑑𝑥 = 8 ℎ[𝑦0 + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + +𝑦7 + 𝑦8 + ⋯ +
0

𝑦3𝑛−1 + 𝑦3𝑛−1 ) + 2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ +𝑦3𝑛−3 ) + 𝑦3𝑛 ]

Review Exercise
1. Find the polynomial of degree three relevant to the following data using Lagrange’s
interpolation formula

𝑥 1 2 3 5

𝑦 −12 −14 −20 −20

Page 135
Numerical Method for Engineering

2. Find the polynomial of the least degree which attains the prescribed values at the given
point using Lagrange’s interpolation formula.
𝑥 1 2 4 5

𝑓(𝑥) −27 −44 −84 −95

3. Using Lagrange’s interpolation formula, find the value of𝑦 corresponding to


𝑥 = 9 from the following table

𝑥 5 6 11 13

𝑓(𝑥) 380 −2 508 1020

4. Given that √12600 = 112.24972, √12610 = 112.29426, √12620 = 112.33877,


√12630 = 112.38327. Find the value o𝑓 √12616 .
5. Evaluate 𝑦 = 𝑒 2𝑥 for 𝑥 = 0.25 from the data in the following table.

𝑥 0.2 0.3 0.4 0.5 0.6

𝑦 = 𝑒 2𝑥 1.49182 1.82212 2.22554 2.71828 3.32012

6. A second degree polynomial passes through the points (2, – 1), (3, 1), (4, 5) 𝑎𝑛𝑑 (5, 11).
Find the polynomial.
7. In an examination the number of students who obtained marks between certain limits was
as follows.
Marks 30 − 40 40 − 50 50 − 60 60 − 70 70 − 80

No of students 18 40 64 50 20

Find the number of students whose scores lie between 70 𝑎𝑛𝑑 75.

8. The table below gives the values of 𝑓 (𝑥, ) 𝑓𝑜𝑟 0.10 ≤ 𝑥 ≤ 0.30. Find 𝑓 (0.12) and
𝑓 (0.26).

Page 136
Numerical Method for Engineering

𝑥 0.1 0.15 0.2 0.25 0.30

𝑓(𝑥) 0.0998 0.1494 0.1987 0.2474 0.2955

9. The population (in thousands) of a small town is given in the following table. Estimate the
population in the years 1965 and 1995.

𝑌𝑒𝑎𝑟 ∶ 𝑥 1961 1971 1981 1991 2001

𝑃𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑦 = 𝑓(𝑥) 46 66 81 93 103

10. From the following table of values, estimate y'(1.0) and y''(1.0).

X 1 2 3 4 5 6

Y 6 25 104 309 730 1481

11. A particle is moving along a straight line. The displacement 𝑥 at some time instance 𝑡 are
given below. Find the velocity and acceleration of the particle 𝑎𝑡 𝑡 = 4

𝑡 1 3 5 7 9 11

𝑥 0.1405 0.7676 3.5135 9.9351 21.5892 40.0329

12. Find the values of 𝑦′(2) and 𝑦′′(2) from the following table:

𝑥 1.5 1.6 1.7 1.8 1.9 2.0

𝑦 0.3328 0.5312 0.7651 1.0384 1.3552 1.7198

13. Find the values of y'(6.0) and y''(6.0) from the following table:
𝑥 1 2 3 4 5 6

Page 137
Numerical Method for Engineering

𝑦 −0.5530 −0.7740 −1.2490 −2.038 −3.1770 −4.6780

1
14. Evaluate ∫0 𝑐𝑜𝑠𝑥 2 𝑑𝑥 by taking eight subintervals using trapezoidal rule.
1
15. Compute the following integral numerically using the trapezoidal rule:𝐼 = ∫0 𝑒 𝑥 𝑑𝑥
Use (a) 𝑛 = 1, (b) 𝑛 = 2, (c) 𝑛 = 𝑘 and (d) 𝑛 = 8. The exact value of 𝐼 = 1.7183.
Compare your computed results in each case with the exact result.
16. Determine the area bounded by the curve 𝑓 (𝑥) = x𝑒 2𝑥 and the 𝑥-axis between 𝑥 = 0 and
𝑥 = 1 using the trapezoidal rule with an interval size of (a) ℎ = 0.5, (b) ℎ = 0.1
0.6
17. Evaluate ∫0 𝑒 𝑥 𝑑𝑥 , taking n = 6, correct to five significant figures by Simpson’s 1/3 rule.

5.2
18. Evaluate ∫4 log 𝑥 𝑑𝑥 by taking seven grid points and using the Simpson’s 1/3 rule.
1
19. Evaluate∫0 √𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 𝑑𝑥 correct to two decimal places using Simpson’s 3/8 rule
with 𝑛 = 6
6 1
20. Evaluate ∫2 𝑑𝑥 by using Simpson’s 3/8 rule.
log 𝑒 𝑥

Reference
➢ Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
➢ Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
➢ Allen, M. and Iaacson, E., Numerical Analysis for Applied Science, Wiley, New York,
1998.
➢ Atkinson, K.E., An Introduction to Numerical Analysis, 2nd ed., Wiley, New York, NY,
1993.
➢ Atkinson, K.E. and Han, W., Elementary Numerical Analysis, 3rd ed. Wiley, New York,
2004.
➢ Rao.V.Dukkipati , Numerical Methods ,New Age International Publisher, New Delhi, 2010

Page 138
Numerical Method for Engineering

Chapter six
First order initial value problems
UNIT OBJECTIVES

At the end of this unit each student should able to:


❖ Define DE, ODE and Initial value problems.
❖ Identifying homogenous, separable, exact, and non exact equations
❖ solving ODE problems using numerical methods
INTRODUCTION Numerical methods are becoming more and more important in engineering
applications, simply because of the difficulties encountered in finding exact analytical solutions
but also, because of the ease with which numerical techniques can be used in conjunction with
modern high-speed digital computers. Several numerical procedures for solving initial value
problems involving first-order ordinary differential equations are discussed in this chapter.

Page 139
Numerical Method for Engineering

In spite of the fact that the error analysis is an important part of any numerical procedure, the
discussion in this chapter is limited primarily to the use of the procedure itself.
An ordinary differential equation is one in which an ordinary derivative of a dependent variable
y with respect to an independent variable x is related in a prescribed manner to x, y and lower
derivatives
6.1 Definition of ODE and Examples
Definition 6.1: An equation involving one or more derivatives of a dependent variable with
respect to one or more independent variables is called a differential equation.
Example 6 1: Consider the following examples
1. 𝑦 ′ − 𝑥𝑦 = 3 is a differential equation with independent variable 𝑥 and dependent
variable 𝑦.
3
𝑑2 𝑢 𝑑𝑢
2. ( 𝑑𝑡 2 ) + 𝑑𝑡 = 𝑢 − 𝑒 𝑡 is a differential equation with independent variable 𝑡 and

dependent variable u.
𝜕2𝑢 𝜕𝑢
3. − 𝜕𝑦 = 𝑦 2 − 3𝑥 is a differential equation with independent variables 𝑥 and 𝑦 and
𝜕𝑥 2

dependent variable 𝑢.
Remark 1: A differential equation is divided into an ordinary differential equation and a partial
differential equation.
Definition 6.2: A differential equation involving one or more derivatives of a dependent variable
with respect to only one variable is called an ordinary differential equation (ODE). But, if the
number of independent variables is two or more then it is called a partial differential equation
(PDE).
Example 6. 2: Consider the following examples
𝑑𝑦
1. = 𝑥 − 5, 𝑦 ′′ − 𝑥𝑦 ′ + 𝑦 = 2 etc. are ordinary differential equations.
𝑑𝑥
𝜕𝑧 𝜕𝑧
2. − 𝜕𝑦 = 0, 𝑢𝑡𝑡 − 4𝑢𝑠𝑠 + 𝑢𝑡 = 𝑒 𝑡 , 𝑢𝑡 − 4𝑢𝑥𝑥 = 0 etc. are partial differential equations.
𝜕𝑥

Definition 6.3: The order of a differential equation is the order (number) of the highest
derivative appearing in the differential equation.
✓ An ordinary differential equation of 𝑛𝑡ℎ order is an equation of the form:
𝐹(𝑥, 𝑦, 𝑦 ′ , … , 𝑦 (𝑛) ) = 0
Where, 𝐹 is a continuous function of (𝑛 + 2) variables with 𝑦 = 𝑦(𝑥).

Page 140
Numerical Method for Engineering

✓ An ordinary differential equation of first order has the form:


𝐹(𝑥, 𝑦, 𝑦 ′ ) = 0
Where, 𝐹 is a continuous function of 3 variables with 𝑦 = 𝑦(𝑥).
6.2 Order of differential equations, Linear and non-linear ODE
Definition 6. 4: The degree of a differential equation (if it exists) is the highest exponent of the
highest order derivative that occurs in the differential equation after the differential equation is
expressed as a polynomial of the derivatives of the dependent variable.
Example 6 3: Assume the following examples
𝑑𝑦
1. − 𝑦 = 𝑥 2 + 1 is a differential equation of order 1 and degree 1.
𝑑𝑥

2. (𝑦 ′′′ )3 − 𝑥𝑦 ′ = 𝑥 3 is a differential equation of order 2 and degree 3.


5⁄
3. (𝑦 ′ ) 2 = 𝑦 ′′′ + 1 is a differential equation of order 3 and degree 2.
4. 𝑦 (4) = √𝑦 2 − 𝑥 is a differential equation of order 4 and degree 1.
Remark 2: If degree of the ordinary differential equation is one then it is called a linear
differential equation. Otherwise it is called a non – linear differential equation.
6.3 Nature of solution ODE: particular and general solutions

Definition 6 5: A relation that is free of derivatives and that satisfies identically an ordinary
differential equation on a region 𝐷 is called a solution of the ordinary differential equation.
✓ A solution of an 𝑛𝑡ℎ order differential equation with 𝑛 arbitrary constants is called the
general solution.
✓ A solution that is free of any arbitrary constant is called a particular solution.
Example 6. 4: Justify the following examples
1. 𝑦 ′ = −5 is an ordinary differential equation, then the function 𝑦 = −5𝑥 + 𝑐 is a solution
of the ODE on ℝ2 and it is a general solution. and again
𝑦 = −5𝑥 + 1, 𝑐 = 1
𝑦 = −5𝑥 + 2, 𝑐 = 2
} are also solutions and they are particular solutions.
𝑦 = −5𝑥 − 1, 𝑐 = −1
𝑒𝑡𝑐
2. 𝑦 ′ − 𝑦 = 0 is an ordinary differential equation, then 𝑦 = 𝑐𝑒 𝑥 is the general solution and
𝑦 = 𝑒𝑥, 𝑐 = 1
𝑦 = 2𝑒 𝑥 , 𝑐 = 2
} are particular solutions.
𝑦 = −2𝑒 𝑥 , 𝑐 = −2
𝑒𝑡𝑐

Page 141
Numerical Method for Engineering

3. Given 𝑦 ′′ = cos 𝑥, then 𝑦 = − cos 𝑥 + 𝑐1 𝑥 + 𝑐2 is the general solution and


𝑦 = − cos 𝑥 + 𝑥 + 10, 𝑐1 = 1, 𝑐2 = 10
𝑦 = − cos 𝑥 + 𝑥 − 6, 𝑐1 = 1, 𝑐2 = −6
} are particular solutions.
𝑦 = − cos 𝑥 + 2𝑥 + 4, 𝑐1 = 2, 𝑐2 = 4
𝑒𝑡𝑐

6.4. Initial value problems

Definition 6. 6: Solutions (particular) to differential equations may require satisfied certain


defined conditions and such conditions are called initial conditions if they are given at only one
point of the independent variable.
✓ Conditions given at more than one point of the independent variable are called boundary
conditions.
✓ The problem of solving an 𝑛𝑡ℎ order ordinary differential equation together with an
initial conditions is called an initial value problem(IVP).
✓ The problem of solving an 𝑛𝑡ℎ order ordinary differential equation together with a
boundary conditions is called a boundary value problem(BVP).
Example 6. 5: Consider the following examples
1. 𝑦 ′′ + 𝑥𝑦 ′ = cos 𝑥, 𝑦(0) = 1 and 𝑦 ′ (0) = −1 is an IVP.
2. 𝑦 ′′ + 𝑥𝑦 ′ = cos 𝑥, 𝑦(0) = 1 and 𝑦 ′ (1) = −1 is a BVP.
✓ The general first order ordinary differential equation can be written as:
𝑑𝑦
𝐹(𝑥, 𝑦, 𝑦 ′ ) = 0 𝑜𝑟 𝑦 ′ = 𝐹(𝑥, 𝑦) 𝑜𝑟 = 𝐹(𝑥, 𝑦)
𝑑𝑥

Another form of the ordinary differential equation is


𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 ⟺ 𝑁(𝑥, 𝑦)𝑑𝑦 = −𝑀(𝑥, 𝑦)𝑑𝑥
𝑑𝑦 𝑀(𝑥,𝑦)
⟹ = 𝑦′ = − , 𝑁(𝑥, 𝑦) ≠ 0
𝑑𝑥 𝑁(𝑥,𝑦)
𝑀(𝑥,𝑦)
That is 𝑦 ′ = 𝐹(𝑥, 𝑦) = − 𝑁(𝑥,𝑦)

6.5 Determination of solutions to first order differential equations


6.6.1. Separable differential equations
The general form of a separable differential equation is given by:
𝑦 ′ = 𝑓(𝑥)𝑔(𝑦) or 𝐹(𝑥, 𝑦) = 𝑓(𝑥)𝑔(𝑦)
Method of solving separable differential equations

Page 142
Numerical Method for Engineering
𝑑𝑦
= 𝑓(𝑥)𝑔(𝑦)
𝑑𝑥
𝑑𝑦
⟹ 𝑔(𝑦) = 𝑓(𝑥)𝑑𝑥, 𝑔(𝑦) ≠ 0
𝑑𝑦
⟹ ∫ 𝑔(𝑦) = ∫ 𝑓(𝑥)𝑑𝑥 + 𝑐, is the general solution.

Example 6. 6: Solve 𝑦 ′ = 3𝑥𝑦 − 𝑦.


Solution: 𝑦 ′ = 3𝑥𝑦 − 𝑦 = (3𝑥 − 1)𝑦
𝑑𝑦
⟹ 𝑑𝑥 = (3𝑥 − 1)𝑦
𝑑𝑦
⟹ = (3𝑥 − 1)𝑑𝑥
𝑦
𝑑𝑦
⟹∫ = ∫(3𝑥 − 1)𝑑𝑥
𝑦
3 2
3
⟹ ln|𝑦| = 2 𝑥 2 − 𝑥 + 𝑐1 ⟹ |𝑦| = 𝑒 2𝑥 −𝑥+𝑐1

3 2 3 2
⟹ 𝑦 = ±𝑒 2𝑥 −𝑥+𝑐1
= 𝑐𝑒 2𝑥 −𝑥

3 2
Therefore, 𝑦 = 𝑐𝑒 2𝑥 −𝑥
is the general solution of the differential equation.
Exercise 6.1: solve the following initial value problems
1. 𝑦 ′ = 𝑒 𝑥+𝑦 with 𝑦(0) = 0.
2. 𝑦 ′ = 𝑒 𝑥+𝑦 + 𝑥 2 𝑒 𝑦 with 𝑦(0) = 0.

6.5.2. Homogeneous differential equations


Definition 6. 7: The differential equation 𝐹 = 𝐹(𝑥, 𝑦) is said to be homogeneous of degree 𝑟 if
and only if 𝐹(𝑡𝑥, 𝑡𝑦) = 𝑡 𝑟 𝐹(𝑥, 𝑦).
Example 6.7: Justify the homogeneity of the following
1. 𝐹(𝑥, 𝑦) = 𝑥𝑦 − 3𝑥 2
Solution: 𝐹(𝑡𝑥, 𝑡𝑦) = (𝑡𝑥)(𝑡𝑦) − 3(𝑡𝑥)2
= 𝑡 2 𝑥𝑦 − 3𝑡 2 𝑥 2
= 𝑡 2 (𝑥𝑦 − 3𝑥 2 )
= 𝑡 2 𝐹(𝑥, 𝑦)
⟹ 𝐹(𝑡𝑥, 𝑡𝑦) = 𝑡 2 𝐹(𝑥, 𝑦)
Therefore, the differential equation is homogeneous of degree 2.
2. 𝐹(𝑥, 𝑦) = √𝑥 2 + 𝑦 2

Page 143
Numerical Method for Engineering

Solution: 𝐹(𝑡𝑥, 𝑡𝑦) = √(𝑡𝑥)2 + (𝑡𝑦)2

= √𝑡 2 𝑥 2 + 𝑡 2 𝑦 2

= √𝑡 2 (𝑥 2 + 𝑦 2 )

= 𝑡√𝑥 2 + 𝑦 2
= 𝑡𝐹(𝑥, 𝑦)
⟹ 𝐹(𝑡𝑥, 𝑡𝑦) = 𝑡 2 𝐹(𝑥, 𝑦)
Therefore, the differential equation is homogeneous of degree 1.
3. 𝐹(𝑥, 𝑦) = 𝑦 − 𝑥 2 𝑦
Solution: 𝐹(𝑡𝑥, 𝑡𝑦) = 𝑡𝑦 − (𝑡𝑥)2 (𝑡𝑦)
= 𝑡𝑦 − 𝑡 2 𝑥 2 𝑡𝑦
= 𝑡(𝑦 − 𝑡 2 𝑥 2 𝑦) ≠ 𝑡 𝑟 𝐹(𝑥, 𝑦)
⟹ 𝐹(𝑡𝑥, 𝑡𝑦) ≠ 𝑡 𝑟 𝐹(𝑥, 𝑦)
Therefore, the differential equation is not homogeneous.
Remark 3:
𝑥
1. 𝐹(𝑥, 𝑦) = 𝑓 (𝑦) is a homogeneous differential equation of degree 0.

2. Any homogeneous differential equation can be reduced to a separable differential


equation.
3. The differential equation 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is homogeneous if 𝑀 and 𝑁 are
homogeneous of the same degree.
Example 6.8: Solve (𝑥 + 𝑦)𝑑𝑥 + (𝑥 − 𝑦)𝑑𝑦 = 0.
Solution: Here, 𝑀(𝑥, 𝑦) = 𝑥 + 𝑦 and 𝑁(𝑥, 𝑦) = 𝑦 − 𝑥
𝑀(𝑥, 𝑦) = 𝑥 + 𝑦 and 𝑁(𝑥, 𝑦) = 𝑦 − 𝑥 are both homogeneous of degree 1.
Then, (𝑥 + 𝑦)𝑑𝑥 + (𝑥 − 𝑦)𝑑𝑦 = 0 is also homogeneous.
𝑦
𝑑𝑦 𝑥+𝑦 𝑥+𝑦 1+ ⁄𝑥
Now, 𝑑𝑥 = 𝑦 ′ = − 𝑦−𝑥 = 𝑥−𝑦 = 𝑦
1− ⁄𝑥
𝑦
Let 𝑣 = 𝑥 ⟹ 𝑦 = 𝑣𝑥 and 𝑦 ′ = 𝑣 + 𝑥𝑣 ′
1+𝑣
⟹ 𝑣 + 𝑥𝑣 ′ = 1−𝑣
1+𝑣 1+𝑣−𝑣+𝑣 2 1+𝑣 2
⟹ 𝑥𝑣 ′ = 1−𝑣 − 𝑣 = =
1−𝑣 1−𝑣
1+𝑣 2
⟹ 𝑥𝑣 ′ = 1−𝑣

Page 144
Numerical Method for Engineering
1−𝑣 𝑑𝑥
⟹ 1+𝑣2 𝑑𝑣 = and this shows the differential equation is separable.
𝑥
1−𝑣 𝑑𝑥
⟹ ∫ 1+𝑣2 𝑑𝑣 = ∫ 𝑥
1 𝑣
⟹ ∫ 1+𝑣2 𝑑𝑣 − ∫ 1+𝑣2 𝑑𝑣 = ln|𝑥| + 𝑐
1
⟹ tan−1 𝑣 − 2 ln(1 + 𝑣 2 ) = ln|𝑥| + 𝑐

𝑦 𝑦 2
⟹ tan−1 (𝑥 ) − ln √1 + (𝑥 ) − ln 𝑥 = 𝑐
𝑦
Therefore, tan−1 (𝑥 ) − ln √𝑥 2 + 𝑦 2 = 𝑐 is the general solution of the differential equation.
𝑦 2 −𝑥𝑦
Exercise 6.2: Solve 𝑦 ′ = 𝑥2

6.5.3. Exact differential equations


Definition 6. 8: A differential equation 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is said to be exact if and
only if there is a differentiable (partially) function 𝑢 = 𝑢(𝑥, 𝑦) such that
𝜕𝑢 𝜕𝑢
= 𝑀(𝑥, 𝑦) and = 𝑁(𝑥, 𝑦)
𝜕𝑥 𝜕𝑦

Theorem: Suppose 𝑀(𝑥, 𝑦) and 𝑁(𝑥, 𝑦) have continuous first order partial derivatives, then the
differential equation 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is exact if and only if
𝜕𝑀 𝜕𝑁
=
𝜕𝑦 𝜕𝑥

Example 6.9: Show the differential equation 2𝑥𝑦𝑑𝑥 + 𝑥 2 𝑑𝑦 = 0 with 𝑢(𝑥, 𝑦) = 𝑥 2 𝑦 is exact.
Solution: Here, 𝑀(𝑥, 𝑦) = 2𝑥𝑦 and 𝑁(𝑥, 𝑦) = 𝑥 2
𝜕𝑢 𝜕
= 𝜕𝑥 (𝑥 2 𝑦) = 2𝑥𝑦
𝜕𝑥
𝜕𝑢
⟹ 𝜕𝑥 = 𝑀(𝑥, 𝑦)
𝜕𝑢 𝜕
And = 𝜕𝑦 (𝑥 2 𝑦) = 𝑥 2
𝜕𝑦
𝜕𝑢
⟹ 𝜕𝑦 = 𝑁(𝑥, 𝑦)
𝜕𝑢 𝜕𝑢
Therefore, 𝜕𝑥 = 𝑀(𝑥, 𝑦) and = 𝑁(𝑥, 𝑦) implies the differential equation is exact.
𝜕𝑦
𝜕𝑀(𝑥,𝑦) 𝜕
Or = 𝜕𝑦 (2𝑥𝑦) = 2𝑥
𝜕𝑦
𝜕𝑁(𝑥,𝑦) 𝜕
= 𝜕𝑥 (𝑥 2 ) = 2𝑥
𝜕𝑥
𝜕𝑀 𝜕𝑁
⟹ =
𝜕𝑦 𝜕𝑥

Page 145
Numerical Method for Engineering

Therefore, the given differential equation is exact.


6.5.4. Steps to determine the function 𝒖(𝒙, 𝒚)
𝜕𝑢(𝑥,𝑦)
1. = 𝑀(𝑥, 𝑦) ⟹ 𝜕𝑢(𝑥, 𝑦) = 𝑀(𝑥, 𝑦)𝜕𝑥
𝜕𝑥

⟹ ∫ 𝜕𝑢(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑔(𝑦)


⟹ 𝑢(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑔(𝑦)
𝜕𝑢 𝜕
and = 𝜕𝑦 (∫ 𝑀(𝑥, 𝑦)𝑑𝑥) + 𝑔′ (𝑦) = 𝑁(𝑥, 𝑦)
𝜕𝑦
𝜕
⟹ 𝑔′ (𝑦) = 𝑁(𝑥, 𝑦) − 𝜕𝑦 (∫ 𝑀(𝑥, 𝑦)𝑑𝑥)

𝜕
⟹ 𝑔(𝑦) = ∫ (𝑁(𝑥, 𝑦) − 𝜕𝑦 (∫ 𝑀(𝑥, 𝑦)𝑑𝑥)) 𝑑𝑦

𝜕
Therefore, 𝑢(𝑥, 𝑦) = ∫ 𝑀(𝑥, 𝑦)𝑑𝑥 + ∫ (𝑁(𝑥, 𝑦) − 𝜕𝑦 (∫ 𝑀(𝑥, 𝑦)𝑑𝑥)) 𝑑𝑦

𝜕𝑢(𝑥,𝑦)
2. = 𝑁(𝑥, 𝑦) ⟹ 𝜕𝑢(𝑥, 𝑦) = 𝑁(𝑥, 𝑦)𝜕𝑦
𝜕𝑦

⟹ ∫ 𝜕𝑢(𝑥, 𝑦) = ∫ 𝑁(𝑥, 𝑦)𝑑𝑦 + 𝑔(𝑥)


⟹ 𝑢(𝑥, 𝑦) = ∫ 𝑁(𝑥, 𝑦)𝑑𝑦 + 𝑔(𝑥)
𝜕𝑢 𝜕
and = 𝜕𝑥 (∫ 𝑁(𝑥, 𝑦)𝑑𝑦) + 𝑔′ (𝑥) = 𝑀(𝑥, 𝑦)
𝜕𝑥
𝜕
⟹ 𝑔′ (𝑥) = 𝑀(𝑥, 𝑦) − 𝜕𝑥 (∫ 𝑁(𝑥, 𝑦)𝑑𝑦)
𝜕
⟹ 𝑔(𝑥) = ∫ (𝑀(𝑥, 𝑦) − 𝜕𝑥 (∫ 𝑁(𝑥, 𝑦)𝑑𝑦)) 𝑑𝑥

𝜕
Therefore, 𝑢(𝑥, 𝑦) = ∫ 𝑁(𝑥, 𝑦)𝑑𝑦 + ∫ (𝑀(𝑥, 𝑦) − 𝜕𝑥 (∫ 𝑁(𝑥, 𝑦)𝑑𝑦)) 𝑑𝑥

Remark 4: 𝑢(𝑥, 𝑦) = 𝑐 is the general solution of the differential equation.


Example 6.10: Solve (𝑥 2 − 𝑦 2 )𝑑𝑥 + (1 − 2𝑥𝑦)𝑑𝑦 = 0.
Solution: 𝑀(𝑥, 𝑦) = 𝑥 2 − 𝑦 2 and 𝑁(𝑥, 𝑦) = 1 − 2𝑥𝑦
𝜕𝑀 𝜕𝑁
Now, = −2𝑦 and = −2𝑦
𝜕𝑦 𝜕𝑥
𝜕𝑀 𝜕𝑁
⟹ =
𝜕𝑦 𝜕𝑥

⟹The differential equation is exact.


𝜕𝑢(𝑥,𝑦)
Now, = 𝑀(𝑥, 𝑦) = 𝑥 2 − 𝑦 2
𝜕𝑥

⟹ 𝑢(𝑥, 𝑦) = ∫(𝑥 2 − 𝑦 2 ) 𝑑𝑥 + 𝑔(𝑦)

Page 146
Numerical Method for Engineering
𝑥3
= − 𝑦 2 𝑥 + 𝑔(𝑦)
3
𝑥3
⟹ 𝑢(𝑥, 𝑦) = − 𝑦 2 𝑥 + 𝑔(𝑦)
3
𝜕𝑢 𝜕 𝑥3
And = 𝜕𝑦 ( 3 − 𝑦 2 𝑥 + 𝑔(𝑦))
𝜕𝑦

= −2𝑥𝑦 + 𝑔′ (𝑦) = 𝑁(𝑥, 𝑦) = 1 − 2𝑥𝑦


⟹ 𝑔′ (𝑦) = 1
⟹ 𝑔(𝑦) = ∫ 1𝑑𝑦 + 𝑐1 = 𝑦 + 𝑐1 , 𝑐1 = 0
𝑥3
Therefore, 𝑢(𝑥, 𝑦) = − 𝑦 2 𝑥 + 𝑦.
3
𝑥3
Hence, 𝑢(𝑥, 𝑦) = − 𝑦 2 𝑥 + 𝑦 = 𝑐 is the solution of the differential equation.
3
1
Example 6.11: Solve 𝑥𝑦𝑑𝑥 + (2 𝑥 2 − cos 3𝑦) 𝑑𝑦 = 0.
1
Solution: 𝑀(𝑥, 𝑦) = 𝑥𝑦 and 𝑁(𝑥, 𝑦) = 2 𝑥 2 − cos 3𝑦
𝜕𝑀 𝜕𝑁
Now, = 𝑥 and =𝑥
𝜕𝑦 𝜕𝑥
𝜕𝑀 𝜕𝑁
⟹ =
𝜕𝑦 𝜕𝑥

⟹The differential equation is exact.


𝜕𝑢(𝑥,𝑦)
Now, = 𝑀(𝑥, 𝑦) = 𝑥𝑦
𝜕𝑥

⟹ 𝑢(𝑥, 𝑦) = ∫(𝑥𝑦) 𝑑𝑥 + 𝑔(𝑦)


𝑥2𝑦
= + 𝑔(𝑦)
2
𝑥2𝑦
⟹ 𝑢(𝑥, 𝑦) = + 𝑔(𝑦)
2
𝜕𝑢 𝜕 𝑥3
and = 𝜕𝑦 ( 3 − 𝑦 2 𝑥 + 𝑔(𝑦))
𝜕𝑦

𝑥2 𝑥2
= + 𝑔′ (𝑦) = 𝑁(𝑥, 𝑦) = − cos 3𝑦
2 2

⟹ 𝑔′ (𝑦) = −cos 3𝑦
1
⟹ 𝑔(𝑦) = ∫ −cos 3𝑦 𝑑𝑦 + 𝑐1 = − 3 sin 3𝑦 + 𝑐1 , 𝑐1 = 0
𝑥2𝑦 1
Therefore, 𝑢(𝑥, 𝑦) = − 3 sin 3𝑦.
2
𝑥2𝑦 1
Hence, 𝑢(𝑥, 𝑦) = − − 3 sin 3𝑦 = 𝑐 is the solution of the differential equations.
2

Exercise 6.3: Solve the following differential equations

Page 147
Numerical Method for Engineering

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

Unit Summary
❖ Differential equations arise in scientific and engineering applications when a dependent
variable y varies with the independent variable either time t or position x.
❖ A differential equation involving one or more derivatives of a dependent variable with
respect to only one variable is called an ordinary differential equation (ODE).
❖ But, if the number of independent variables is two or more then it is called a partial
differential equation (PDE).
❖ The degree of a differential equation is the highest exponent of the differential equation is
expressed as a polynomial of the derivatives of the dependent variable.
❖ A differential equation 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is said to be exact if and only if there
𝜕𝑢 𝜕𝑢
is a differentiable (partially) function 𝑢 = 𝑢(𝑥, 𝑦) such that 𝜕𝑥 = 𝑀(𝑥, 𝑦) and 𝜕𝑦 = (𝑥, 𝑦)

❖ The differential equation 𝐹 = 𝐹(𝑥, 𝑦) is said to be homogeneous of degree 𝑟 if and only


if 𝐹(𝑡𝑥, 𝑡𝑦) = 𝑡 𝑟 𝐹(𝑥, 𝑦).

Page 148
Numerical Method for Engineering

Review Exercise

1. Define the following and give two example


A. Differential equation.
B. ordinary differential equation(ODE)
C. Initial value problems
D. Order and degree of differential equation.
2. Find the general solution of 𝑦 ′ = 3𝑥𝑦 − 𝑦.
3. Justify the homogeneity of(𝑥 + 𝑦)𝑑𝑥 + (𝑥 − 𝑦)𝑑𝑦 = 0. And then Solve it.
4. Show the differential equation 2𝑥𝑦𝑑𝑥 + 𝑥 2 𝑑𝑦 = 0 with 𝑢(𝑥, 𝑦) = 𝑥 2 𝑦 is exact.
5. Use Picard’s method of successive approximation to find the value of 𝑦 when 𝑥 = 0.1, given
𝑑𝑦
that 𝑦 = 1 when 𝑥 = 0 and 𝑑𝑥 = 3𝑥 + 𝑦 2

6. Find the general and the particular solution of 𝑦 ′′ = cos 𝑥

Reference
➢ Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
➢ Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
➢ Chui, C., An Introduction to Wavelets, Academic press, Burlington, MA, 1992.
➢ Collatz, L., Numerical Treatment of Differential Equations,3rd ed., Springer-Verlag, Berlin,
1966.
➢ Consatantinides, A., Applied Numerical Methods with Personal Computers, McGraw-Hill,
New York, 1987.
➢ Dukkipati, R.V., Numerical Methods through Solved Problems, New Age International
Publishers (P) Ltd., New Delhi, India, 2009.
➢ Rao.V.Dukkipati , Numerical Methods ,New Age International Publisher, New Delhi, 2010.

Page 149
Numerical Method for Engineering

Chapter seven
Numerical Methods for Initial value problems
UNIT OBJECTIVES

At the end of this unit each student should able to:


❖ Understand the concept of Initial value problems.
❖ Understand the Taylor’s method of order 𝑛 formula
❖ Understand the concept Euler’s method
❖ Understand the concepts of Modified Euler’s method

INTRODUCTION: Numerical methods are becoming more and more important in engineering
applications, simply because of the difficulties encountered in finding exact analytical solutions
but also, because of the ease with which numerical techniques can be used in conjunction with
modern high-speed digital computers. Several numerical procedures for solving initial value
problems involving first-order ordinary differential equations are discussed in this chapter.

Page 150
Numerical Method for Engineering

In spite of the fact that the error analysis is an important part of any numerical procedure, the
discussion in this chapter is limited primarily to the use of the procedure itself. The theory of
errors and error analysis is sometimes fairly complex and goes beyond the intended scope of this
chapter.
Definition: Solutions (particular) to differential equations may require satisfied certain defined
conditions and such conditions are called initial conditions if they are given at only one point of
the independent variable.
✓ Conditions given at more than one point of the independent variable are called boundary
conditions.
✓ The problem of solving an 𝑛𝑡ℎ order ordinary differential equation together with initial
conditions is called an initial value problem (IVP).
✓ The problem of solving an 𝑛𝑡ℎ order ordinary differential equation together with boundary
conditions is called a boundary value problem (BVP).
Given 𝑦 ′ (𝑥) = 𝑓(𝑥, 𝑦) with 𝑦(𝑥0 ) = 𝑦0 in the interval 𝑎 ≤ 𝑥 ≤ 𝑏 is called an initial value
problem (IVP).

7.1. Taylor’s method of order 𝒏


Given 𝑦 ′ (𝑥) = 𝑓(𝑥, 𝑦) with 𝑦(𝑥0 ) = 𝑦0 in [𝑎, 𝑏], if 𝑦(𝑥) is the exact solution of the IVP, then
using Taylor’s series expansion 𝑦(𝑥) is expanded about 𝑥0 as:
(𝑘) (𝑥−𝑥0 )𝑘
𝑦(𝑥) = ∑∞
𝑘=0 𝑦 (𝑥0 ) (7.1)
𝑘!
(𝑥−𝑥0 )2 (𝑥−𝑥0 )𝑛
Now,𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦 ′ (𝑥0 )(𝑥 − 𝑥0 ) + 𝑦 ′′ (𝑥0 ) + ⋯ + 𝑦 (𝑛) (𝑥0 ) (7.2)
2! 𝑛!

is called Taylor’s method of order 𝑛.

(𝑥−𝑥𝑛 )2 (𝑥−𝑥𝑛 )𝑛
𝑦(𝑥) ≈ 𝑦𝑛+1 = 𝑦𝑛 (𝑥𝑛 ) + 𝑦𝑛 ′ (𝑥𝑛 )(𝑥 − 𝑥𝑛 ) + 𝑦𝑛 ′′ (𝑥𝑛 ) + ⋯ + 𝑦𝑛 (𝑛) (𝑥𝑛 ) (7.3)
2! 𝑛!

𝑦𝑛 = 𝑦(𝑥𝑛 ), 𝑦𝑛 ′ = 𝑦 ′ (𝑥𝑛 ), 𝑦𝑛 (𝑛) = 𝑦 (𝑛) (𝑥𝑛 )

Now, substituting ℎ = 𝑥 − 𝑥0 in Esq.(6.2) we get

ℎ2 ℎ𝑛
𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦 ′ (𝑥0 )ℎ + 𝑦 ′′ (𝑥0 ) 2! + ⋯ + 𝑦 (𝑛) (𝑥0 ) 𝑛! ( 7.4)

Page 151
Numerical Method for Engineering

Similarly, if we substituting ℎ = 𝑥 − 𝑥𝑛 in Esq.(6.3) we get

ℎ2 ℎ𝑛
𝑦(𝑥) ≈ 𝑦𝑛+1 = 𝑦𝑛 (𝑥𝑛 ) + 𝑦𝑛 ′ (𝑥𝑛 )ℎ + 𝑦𝑛 ′′ (𝑥𝑛 ) 2! + ⋯ + 𝑦𝑛 (𝑛) (𝑥𝑛 ) 𝑛! (7.5)

Example 7.1: Given 𝑦 ′ = 𝑥 − 𝑦 2 and 𝑦(0) = 1. Then find the approximate solution by Taylor’s
method of order 3 at 𝑥 = 0.1.

Solution: The formula is given by

(𝑥−𝑥0 )2 (𝑥−𝑥0 )3
𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦 ′ (𝑥0 )(𝑥 − 𝑥0 ) + 𝑦 ′′ (𝑥0 ) + 𝑦 ′′′ (𝑥0 )
2! 3!

But, 𝑦 ′ (𝑥) = 𝑥 − 𝑦 2, then

𝑦0 ′ = 𝑦(𝑥0 ) = 0 − (1)2 = −1

𝑦0 ′′ = 𝑦 ′′ (𝑥0 ) = (1 − 2𝑦𝑦 ′ )(𝑥0 ) = 1 − 2(1)(−1) = 3

𝑦0 ′′′ = 𝑦 ′′ ′(𝑥0 ) = −2((𝑦 ′ )2 + 𝑦𝑦 ′′ 𝑦 ′ )(𝑥0 ) = −2(1 + 1(3)(−1)) = 4

(𝑥−0)2 (𝑥−0)3
⟹ 𝑦(𝑥) = 1 + (−1)(𝑥 − 0) + 3 +4
2! 3!
𝑥2 𝑥3
= 1 + (−1)𝑥 + 3 +4
2 6
𝑥0 2 𝑥0 3
Then, 𝑦(𝑥0 ) = 1 + (−1)𝑥0 + 3 +4
2 6
3 2
⟹ 𝑦(0.1) = 1 − 0.1 + 2 (0.1)2 + 3 (0.1)3

= 1 − 0.1 + 0.015 + 0.0006667 = 0.91567


Therefore, 𝑦(0.1) ≈ 0.9167.
𝑑𝑦
Example 7.2 Use the four order Taylor’s series method to solve the equation = 3𝑥+𝑦 2 to
𝑑𝑥

approximate 𝑦 when 𝑥 = 0.1, given that 𝑦 = 1 when 𝑥 = 0.


dy
Solution: (x0 , y0 ) = (0,1) y ′ = dx = 3𝑥 + 𝑦 2

Hence, the second-order Taylor’s series method [Eq.(6.4)] becomes


ℎ2 ℎ3 ℎ4
𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦 ′ (𝑥0 )ℎ + 𝑦 ′′ (𝑥0 ) + 𝑦 ′′′ (𝑥0 ) + 𝑦 (4) (𝑥0 )
2! 3! 4!
2
𝑦′ = 3𝑥 + 𝑦 at 𝑥0 𝑦 ′ (𝑥0 ) =𝑦 ′ (0)
=1=𝑦
𝑦 ′′ = 3 + 2𝑦𝑦′ at 𝑥0 𝑦 ′′ (𝑥0 ) = 𝑦 ′′ (0) = 3 + 2(1)(1) = 5

Page 152
Numerical Method for Engineering

𝑦 ′′′ = 2𝑦 ′ 𝑦 ′ + 2𝑦𝑦 ′′ at 𝑥0 𝑦 ′′ ′(𝑥0 ) = 𝑦 ′′′ (0) = 2(1)(1) + 2(1)(5) = 12


𝑦 (4) = 6𝑦 ′′ 𝑦 ′ + 2𝑦𝑦′′′ at 𝑥0 𝑦 (4) (𝑥0 ) = 𝑦 (4) (0) = 6(5) + 2(1)(12) = 54
Hence, the required Taylor series is
(𝑥−𝑥0 )2 (𝑥−𝑥0 )3 (𝑥−𝑥0 )4
𝑦(𝑥) = 𝑦(𝑥0 ) + 𝑦 ′ (𝑥0 )(𝑥 − 𝑥0 ) + 𝑦 ′′ (𝑥0 ) + 𝑦 ′′′ (𝑥0 ) + 𝑦 (4) (𝑥0 )
2! 3! 4!
5 12 54 5 9
= 1 + 𝑥 + 2! 𝑥 2 + 𝑥3 + 𝑥 4 =1 + 𝑥 + 2 𝑥 2 + 2𝑥 3 + 4 𝑥 4
3! 4!
5 9
When𝑥 = 0.1, we have 1 + 0.1 + 2 (0.1)2 + 2(0.1)3 + 4 (0.1)4 = 1.12722

Exercise 7.1:
1. Use the second-order Taylor series method on (2, 3) for the initial value
𝑑𝑦
problem = −𝑥𝑦 2 , 𝑦(2) = 1 Take h = 0.1.
𝑑𝑥

2. Use the fourth order Taylor series method with a single integration step to determine
𝑑𝑦
𝑦(0.2). Given that 𝑑𝑥 + 4𝑦 = 𝑥 2 𝑦(0) = 1

7.2. Euler’s Method

Euler’s explicit method (also called the forward Euler method) is a single-step, explicit method
for solving a first-order ordinary differential equation.
Let the differential equation is given by:

𝑑𝑦
𝑦 ′ = 𝑑𝑥 = 𝑓(𝑥, 𝑦), 𝑤𝑖𝑡ℎ 𝑦(𝑥0 ) = 𝑦0 (7.6)

To solve the equation given in (6.6) for the values of 𝑦 at 𝑥 = 𝑥𝑖 = 𝑥0 + 𝑖ℎ, 𝑖 = 1,2, … . 𝑛 integrate
𝑥
equation (6.6) with one step size. 𝑦1 = 𝑦0 + ∫𝑥 1 𝑓(𝑥, 𝑦)𝑑𝑥 (7.7)
0

Take 𝑓(𝑥, 𝑦) = 𝑓(𝑥0 , 𝑦0 ) in the range 𝑥0 to 𝑥1 , then we get

𝑦1 = 𝑦0 + (𝑥1 − 𝑥0 )𝑓(𝑥0 , 𝑦0 ) = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 )

Similarly, for the range 𝑥1 to 𝑥2 , 𝑓(𝑥, 𝑦) = 𝑓(𝑥1 , 𝑦1 ), then

Page 153
Numerical Method for Engineering

𝑦2 = 𝑦1 + (𝑥2 − 𝑥1 )𝑓(𝑥1 , 𝑦1 ) = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 )

In general form we have


𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ), 𝑤ℎ𝑒𝑟𝑒 𝑛 = 0,1,2, … ( 7.8)
This is called Euler’s method.
𝑑𝑦 𝑥−𝑦
Example 6.3: Using Euler’s method solve for 𝑥 = 0.1 of = 𝑥+𝑦 given that
𝑑𝑥

𝑥0 = 0, 𝑦0 = 1 and ℎ = 0.02.

Solution: The values of 𝑥 with the given step size ℎ are, 𝑥0 = 0, 𝑥1 = 0.02, 𝑥2 =
0.04, 𝑥3 = 0.06, 𝑥4 = 0.08 and 𝑥5 = 0.1. then,
0−1
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ), but 𝑓(𝑥0 , 𝑦0 ) = 𝑓(0,1) = 0+1 = −1

= 1 + 0.02(−1) = 1 − 0.02 = 0.98


0.02−0.98
𝑦2 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ), but 𝑓(𝑥1 , 𝑦1 ) = 𝑓(0.02,0.98) = 0.02+0.98 = −0.96

= 0.98 + 0.02(−0.96) = 0.9608


0.04−0.9608
𝑦3 = 𝑦2 + ℎ𝑓(𝑥2 , 𝑦2 ), but 𝑓(𝑥2 , 𝑦2 ) = 𝑓(0.04,0.9608) = 0.04+0.9608 = −0.92006

= 0.9608 + 0.02(−0.92006) = 0.942398.


0.06−0.942398
𝑦4 = 𝑦3 + ℎ𝑓(𝑥3 , 𝑦3 ), but 𝑓(𝑥3 , 𝑦3 ) = 𝑓(0.06,0.942398) = 0.06+0.942398 = −0.880287

= 0.942398 + 0.02(−0.880287) = 0.92479.


0.08−0.92479
𝑦5 = 𝑦4 + ℎ𝑓(𝑥4 , 𝑦4 ), but 𝑓(𝑥4 , 𝑦4 ) = 𝑓(0.08,0.92479) = 0.08+0.92479 = −0.84076

= 0.92479 + 0.02(−0.84076) = 0.907975.


0.1−0.907975
𝑦6 = 𝑦5 + ℎ𝑓(𝑥5 , 𝑦5 ), but 𝑓(𝑥5 , 𝑦5 ) = 𝑓(0.1,0.907975) = 0.1+0.907975 = −0.80158

= 0.907975 + 0.02(−0.80158) = 0.89194.


⟹ 𝑦(0.1) = 𝑦(𝑥5 ) = 𝑦6 = 0.89194.
Exercise 7.2
𝑑𝑦
1. Use Euler’s method to solve the differential equation𝑑𝑥 = −𝑥𝑦 2

𝑦(2) = 1 𝑎𝑛𝑑 2 < 𝑥 < 3 𝑤𝑖𝑡ℎ 𝑠𝑡𝑒𝑝 𝑖𝑠𝑒 ℎ = 0.1


𝑑𝑦 1
2. Use Euler’s method to solve the following differential equation 𝑑𝑥 = 2 𝑦 𝑦(0) = 1 and

0 < 𝑥 < 1 𝑤𝑖𝑡ℎ 𝑠𝑡𝑒𝑝 𝑖𝑠𝑒 ℎ = 0.1


7.3. Modified Euler’s method

Page 154
Numerical Method for Engineering

In case of Euler’s method we approximate 𝑓(𝑥, 𝑦) by 𝑓(𝑥0 , 𝑦0 ) in the range 𝑥0 to 𝑥1 , but in this
case we approximate 𝑓(𝑥, 𝑦) by means of Trapezoidal rule i.e.

𝑓(𝑥, 𝑦) = 2 (𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 0 )) (7.9)

Then, 𝑦1 = 𝑦0 + 2 (𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 0 )) (7.10)

Then, we get the iteration formula as:



𝑦1 𝑛+1 = 𝑦0 + 2 (𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 𝑛 )), 𝑛 = 0,1,2, … ( 7.11)

and 𝑦1 𝑛 is the 𝑛𝑡ℎ approximation of 𝑦1 .


The formula can be starting from 𝑦1 0 by Euler’s formula.
𝑦1 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ).
𝑑𝑦 𝑥−𝑦
Example 7.4: Using Modified Euler’s method solve for 𝑥 = 0.06 of = 𝑥+𝑦 given that 𝑥0 = 0,
𝑑𝑥

𝑦0 = 1 and ℎ = 0.02.
0−1
Solution: 𝑦1 0 = 𝑦0 + ℎ𝑓(𝑥0 , 𝑦0 ), but 𝑓(𝑥0 , 𝑦0 ) = 𝑓(0,1) = 0+1 = −1.

= 1 + 0.02(−1) = 0.98, then



𝑦1 = 𝑦0 + 2 ( 𝑓(𝑥0 , 𝑦0 ) + 𝑓(𝑥1 , 𝑦1 0 )),

but 𝑓(𝑥0 , 𝑦0 ) = −1 and 𝑓(𝑥1 , 𝑦1 0 ) = 𝑓(0.02,0.98) = −0.96


0.02
=1+ (−1 − 0.96) = 0.9804
2
0.02−0.9804
𝑦2 0 = 𝑦1 + ℎ𝑓(𝑥1 , 𝑦1 ), but 𝑓(𝑥1 , 𝑦1 ) = 𝑓(0.02,0.9804) = 0.02+0.9804 = −0.9600.

= 0.9804 + 0.02(−0.9600). = 0.9612.



𝑦2 = 𝑦1 + 2 ( 𝑓(𝑥1 , 𝑦1 ) + 𝑓(𝑥2 , 𝑦2 0 )), but 𝑓(𝑥1 , 𝑦1 ) = −0.9600 and

𝑓(𝑥2 , 𝑦2 0 ) = 𝑓(0.04,0.9612) = −0.9201


0.02
= 0.9804 + (−0.9600 − 0.9201) = 0.961599.
2
0.04−0.961599
𝑦3 0 = 𝑦2 + ℎ𝑓(𝑥2 , 𝑦2 ), but 𝑓(𝑥2 , 𝑦2 ) = 𝑓(0.04,0.961599) = 0.04+0.961599 = −0.9201.

= 0.961599 + 0.02(−0.9201) = 0.943197



𝑦3 = 𝑦2 + 2 ( 𝑓(𝑥2 , 𝑦2 ) + 𝑓(𝑥3 , 𝑦3 0 )), but 𝑓(𝑥2 , 𝑦2 ) = −0.9201 and

𝑓(𝑥3 , 𝑦3 0 ) = 𝑓(0.06,0.943197) = −0.88038


0.02
= 0.961599 + (−0.9201 − 0.88038) = 0.9435942
2

Page 155
Numerical Method for Engineering

⟹ 𝑦(0.06) = 𝑦3 = 0.9435942 i.e. the solution at 𝑥 = 0.06 is 0.9435942.

Exercise 7.3
1. Using Modified Euler’s method solve 𝑦 ′ = 𝑥 + 𝑦 with 𝑦(0) = 1 and ℎ = 0.02.
2. Using Modified Euler’s method to solve the following differential equation
𝑑𝑦 1
= 2𝑦 𝑦(0) = 1 and 0 < 𝑥 < 1 𝑤𝑖𝑡ℎ 𝑠𝑡𝑒𝑝 𝑖𝑠𝑒 ℎ = 0.1
𝑑𝑥

Unit Summary

➢ Differential equations arise in scientific and engineering applications when a dependent


variable y varies with the independent variable either time t or position x.
➢ In this chapter, the numerical techniques commonly used for solving ordinary differential
equations are presented.
➢ There are three methods to solve initial value problem for a ordinary differential
equations in this chapter :
❖ Taylor’s method of order 𝑛
❖ Euler’s Method .
❖ Modified Euler’s method

Review Exercise

1. Using Taylor’s series method for 𝑦(𝑥), find 𝑦(0.1) correct to four decimal places from the
initial value problem 𝑦′ = 𝑥𝑦 + 1, 𝑦(0) = 1.

Page 156
Numerical Method for Engineering

2. Find the value of y at 𝑥 = 0.1 and 𝑥 = 0.2 using the Taylor’s series method from
𝑑𝑦
= 𝑥 2 𝑦 − 1 𝑦(0) = 1 accurate to five decimal places.
𝑑𝑥

3. Using Taylor’s series method for y(x) given that 𝑦′ = 𝑦 2 – x, 𝑦(0) = 1, find
𝑦(0.1) 𝑎𝑛𝑑 𝑦(0.3) correct to four decimal places.
𝑑𝑦 1
4. Use Taylor’s series method to solve the differential equation𝑑𝑥 = 𝑥 2+𝑦 𝑦(4) = 4 to find

𝑦(4.1) and 𝑦(4.2).


𝑑𝑦
5. Use Euler’s method to find y(1) from the differential equation = 𝑥 + 𝑦, 𝑦(0) = 1.
𝑑𝑥
𝑑𝑦
6. Solve the differential equation using Euler’s method for x = 0 to 0.4 = 3𝑦𝑡 2 + 2𝑦𝑡 = 1
𝑑𝑡

with y(0)=1 and step size h=0.1


7. Use modified Euler’s method to find the value of y at 𝑥 = 0.1, given that 𝑦(0) = 1 and 𝑦 =
𝑥 2 + 𝑦.
8. Using modified Euler’s method to find the value of 𝑦(2) in steps of 0.1, given that
𝑑𝑦
= 2√𝑥𝑦, 𝑦(1) = 1
𝑑𝑥

9. Use the modified Euler’s method to approximate the solution to the following initial value
𝑑𝑦
problem.𝑑𝑥 = 1 + (𝑡 − 𝑦)2 2≤𝑡≤3 𝑦(2) = 1, with step size ℎ = 0.5
𝑑𝑦
10. Solve = √𝑥𝑦 + 1 with y(0) = 1 for finding 𝑦(0.075) by using modified Euler’s method
𝑑𝑥

taking ℎ = 0.025.

Page 157
Numerical Method for Engineering

Reference
➢ Akai, T.J., Applied Numerical Methods for Engineers, Wiley, New York, NY, 1993.
➢ Al-Khafaji, A.W. and Tooley, J.R., Numerical Methods in Engineering Practice, Holt,
Rinehart and Winston, New York, 1986.
➢ Chui, C., An Introduction to Wavelets, Academic press, Burlington, MA, 1992.
➢ Collatz, L., Numerical Treatment of Differential Equations,3rd ed., Springer-Verlag, Berlin,
1966.
➢ Consatantinides, A., Applied Numerical Methods with Personal Computers, McGraw-Hill,
New York, 1987.
➢ Dukkipati, R.V., Numerical Methods through Solved Problems, New Age International
Publishers (P) Ltd., New Delhi, India, 2009.
➢ Rao.V.Dukkipati , Numerical Methods ,New Age International Publisher, New Delhi, 2010.

Page 158
Numerical Method for Engineering

Page 159

You might also like