0% found this document useful (0 votes)
27 views22 pages

Session 1

The document outlines the course 'Numerical Methods for Engineers' offered at the College of Science and Technology for the academic year 2024-2025. It details the course content, learning outcomes, assessment methods, and references, focusing on numerical analysis techniques applicable to engineering problems. The course includes topics such as transcendental equations, matrix algebra, differential equations, and optimization methods.

Uploaded by

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

Session 1

The document outlines the course 'Numerical Methods for Engineers' offered at the College of Science and Technology for the academic year 2024-2025. It details the course content, learning outcomes, assessment methods, and references, focusing on numerical analysis techniques applicable to engineering problems. The course includes topics such as transcendental equations, matrix algebra, differential equations, and optimization methods.

Uploaded by

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

COLLEGE OF SCIENCE

AND TECHNOLOGY

SCHOOL OF SCIENCES
DEPARTMENTS OF
MATHEMATICS
(Nyarugenge
SECOND Campus
YEARS: MEE)

ACADEMIC YEAR: 2024-2025

SCHOOL OF PURE AND APPLIED SCIENCES


(Nyarugenge Campus)
SCHOOL OF PURE AND APPLIED SCIENCES
(Nyarugenge Campus)
COURSE: NUMERICAL METHODS FOR ENGINEERS
COURSE CODE: MAT 2263

Lectured by Mr. NDAYAMBAJE Félix

Nyarugenge, January, 2025

Email: [email protected] P.O Box 390 Kigali, Rwanda


www.ur.ac.rw

Page 1 of 22
COURSE OUTLINE

Module Title: NUMERICAL METHODS FOR ENGINEERS.


Level: 2 Semester: 2 Credits: 10.
Pre-requisite or co-requisite modules, excluded combinations. Pre-requisite:
Mathematics for Engineers I, II and III
Brief description of aims and content
The Module aims to introduce students to the various techniques of numerical analysis
applied to transcendental equations, mathematical functions, matrix algebra and differential
equations. The module will deal with these topics at a basic level, leaving more
advanced techniques to the specialist courses in Engineering.

LEARNING OUTCOMES
Knowledge and Understanding
Having successfully completed the module, students should be able to demonstrate
knowledge and understanding of:
 Numerical analysis as applied to simple mathematical topics.
 The implications of basic numerical analysis.
Cognitive/Intellectual skills/Applications of Knowledge
 Present simple arguments and conclusions using numerical analysis.
 Analyze and evaluate problems in mathematics and engineering.
Communication /ICT/Numeracy/Analytic Techniques/Practical Skills.
Having successfully completed the module, students should be able to:
 Apply the mathematical knowledge to solve problems in range of Engineering
situations.
 Carry out mathematical and numerical manipulation with confidence and
accuracy.
General transferable skills
Having successfully completed the module, students should be able to:
 Assimilate Abstract Ideas;
 Communicate information having a mathematical content.

INDICATIVE CONTENT
Chapter I: Transcendental, Polynomial Equations and Curve Fitting.
I.1. Bisection and Newton-Raphson method.
I.2. Method of least squares - Fitting a straight line - Fitting a Parabola.
I.3. Solution of a system of linear ordinary differential equations.
I.4. Iterative methods for linear equations.
Chapter II. Approximation of Functions.
II.1. First and higher differences: - forward differences and backward differences and
central differences - differences of a polynomial.
II.2. Interpolation: - Newton Gregory Forward and Backward Interpolation formula -
Inverse Interpolation.
II.3. Numerical Differentiation : Newton forward and backward differences formula to
compute first and higher order derivatives.

Page 2 of 22
II.4. Numerical Integration: - The Trapezoidal Rule - Simpson’s one and third rule and
three eighth rule.
Chapter III. Numerical Solutions of Differential Equations.
III.1. Solution of ode’s by Taylor series, Euler’s method, Runge - Kutta methods.
III.2. Introduction to solution of PDEs: Classification of Partial differential equations
of the second order.
III.3. Laplace’s equation and its solution.
Chapter VI. Matrix Algebra
IV.1. Solution of simultaneous linear equations.
IV.2. Iterative methods for linear equations.
Chapter V. Optimization
V.1. Linear Programming Problems formulation
V.2. Techniques for solving LPP.
ASSESSMENT:
Assignments (Two): 15%
Quiz (Two): 10%
Examinations: CATS (Two): 25%, FINAL 50%

REFERENCES:
1. Advanced Engineering Mathematics by E. Kreysig.
2. Farlow, S.J., 1982. Partial Differential Equations for Scientists and Engineers. New
York, United States: Dover Publications Inc.. Available at:
https://www.pdfdrive.com/partial-differential-equations-for-scientists-and-engineers-
dover-books-on-mathematics-e175344303.html. )
3. Chapra, S.C. & Canale, R.P., 2015. Numerical Methods for Engineers. 7th ed. New
York, New York, United States: McGraw-Hill Education. Available at:
https://gdcboysang.ac.in/About/Droid/uploads/Numerical%20Methods.pdf .
4. Background Texts (include number in library or URL) (inc ISBN)
5. Chapra, S. & Canale, R., 2021. Numerical Methods for Engineers. New York, New York,
United States: McGraw Hill. Available at:
https://www.mheducation.com/highered/product/numerical-methods-engineers-
chapra-canale/M9781260232073.html .
6. Chasnov, J.R., 2020. Numerical Methods for Engineers. Hong Kong: The Hong Kong
University of Science and Technology. Available at:
https://www.math.hkust.edu.hk/~machas/numerical-methods-for-engineers.pdf

Page 3 of 22
Chapter 0. Errors in numerical computation
0.1. Mathematical preliminaries
In this section we state without proof certain mathematical results which will be useful in the
sequel.
Theorem1: If 𝑓(𝑥) is a continuous function in 𝑎 ≤ 𝑥 ≤ 𝑏 and if 𝑓(𝑎) and 𝑓(𝑏) are of the opposite
sings, then there exist at least a point 𝑐 ∈ ]𝑎, 𝑏[ such that 𝑓(𝑐) = 0.
Theorem2: Rolle ’s Theorem
If (a) 𝑓(𝑥) is a continuous function in 𝑎 ≤ 𝑥 ≤ 𝑏
a. 𝑓 ′ (𝑥) exists in 𝑎 < 𝑥 < 𝑏
b. 𝑓(𝑎) = 𝑓(𝑏) = 0, then there is at least one value𝑥, say 𝑐 such that 𝑓 ′ (𝑐 ) = 0, ∀ 𝑐 ∈ ]𝑎, 𝑏[ .
Theorem3: Intermediate value theorem
Let 𝑓(𝑥) be a continuous function in 𝑎 ≤ 𝑥 ≤ 𝑏 and 𝑘 be any number between 𝑓(𝑎) and 𝑓(𝑏).
Then there exist 𝑐 ∈ ]𝑎, 𝑏[ such that𝑓(𝑐) = 𝑘.
Theorem4: Mean-value theorem for derivatives
If (i) 𝑓(𝑥) is a continuous function in 𝑎 ≤ 𝑥 ≤ 𝑏
(ii) 𝑓 ′ (𝑥) exists in 𝑎 < 𝑥 < 𝑏, then there is at least one value𝑥, say
𝑓(𝑏)−𝑓(𝑎)
𝑐 ∈ ]𝑎, 𝑏[ such that 𝑓 ′ (𝑐) = 𝑏−𝑎

Theorem5: Taylor’s series for a function of one variable


If 𝑓(𝑥) is continuous and possesses continuous derivatives of order n in an interval that
(𝑥−𝑎)
includes 𝑥 = 𝑎, then in that interval that includes at 𝑥 = 𝑎, then 𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎) +
1!
(𝑥−𝑎)2 (𝑥−𝑎)3 (𝑥−𝑎)𝑛−1
𝑓 ′′ (𝑎) + 𝑓 ′′′ (𝑎) + ⋯ + (𝑛−1)!
𝑓 (𝑛−1) (𝑎) + 𝑅𝑛 (𝑥)
2! 3!
(𝑥−𝑎)𝑛
Where 𝑅𝑛 (𝑥)a Lagrange’s remainder is be written as 𝑅𝑛 (𝑥) = 𝑓 (𝑛) (𝜉),
𝑛!

𝑎 < 𝜉 < 𝑏.
In practical applications, we mostly employ the first two derivatives only:
(𝑥−𝑎)
𝑓(𝑥) ≅ 𝑓(𝑎) + 𝑓 ′ (𝑎)
1!

or
(𝑥 − 𝑎) ′ (𝑥 − 𝑎)2 ′′
𝑓(𝑥) ≅ 𝑓(𝑎) + 𝑓 (𝑎) + 𝑓 (𝑎)
1! 2!
The first equation is a linear extrapolation and the second, quadratic extrapolation.
Theorem6: Maclaurin’s expansion
𝑥 ′ 𝑥2 𝑥3 𝑥𝑛
𝑓(𝑥) = 𝑓(0) + 𝑓 (0) + 𝑓 ′′ (0) + 𝑓 ′′′ (0) + ⋯ + 𝑓 (𝑛) (0) + 𝑅𝑛 (𝑥)
1! 2! 3! 𝑛!
Example: Expand 𝑓(𝑥) = sin 𝑥 by Taylor’s series about a point 𝑥 = 0 and evaluate sin 200 ?
Solution: 𝑓(𝑥) = sin 𝑥 , 𝑓(0) = 0

Page 4 of 22
𝑓 ′ (𝑥) = cos 𝑥 , 𝑓 ′ (0) = 1
𝑓 ′′ (𝑥) = − sin 𝑥 , 𝑓 ′′ (0) = 0
𝑓 ′′′ (𝑥) = − cos 𝑥 , 𝑓 ′′′ (0) = −1
and so on
𝑥 𝑥3 𝑥5
sin 𝑥 = − + + ⋯ , −∞ < 𝑥 < ∞
1! 3! 5!
𝜋 𝜋 1 𝜋 3
sin 200 = sin ≅ − ( ) = 0.342
9 9 6 9
The remainder term is:
𝜋 4 1 𝜋 4 1
|𝑅3 | = |( ) . 𝑠𝑖𝑛(𝜃 + 2𝜋)| ≤ |( 9 ) | ≅ 0.000062.
9 4! 4!

The error in the approximation is therefore less than 0.0001, then


sin 200 ≅ 0.342.
Comments: Though Taylor series is always available for most functions, we shall suggest
better methods which provide higher accuracy with less computational effort.
Do not rush to use Taylor series.
Theorem7: Taylor series expansion of a function with two independent variables.
Taylor series expansion is easily extended to a function 𝑍 = 𝑓(𝑥, 𝑦)about the
point (𝑥0 , 𝑦0 ).
Let us use the following notation for partial derivatives:
𝜕𝑍 𝜕𝑍 𝜕 2𝑍 𝜕 2𝑍 𝜕 2𝑍
𝑓𝑥 = , 𝑓𝑦 = , 𝑓𝑥𝑥 = 2 , 𝑓𝑦𝑦 = 2 , 𝑓𝑥𝑦 =
𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑥𝜕𝑦
and so on
1
Then,𝑓(𝑥 + 𝑥0 , 𝑦 + 𝑦0 ) = 𝑓(𝑥0 , 𝑦0 ) + [𝑓𝑥 (𝑥0 , 𝑦0 )𝑥 + 𝑓𝑦 (𝑥0 , 𝑦0 )𝑦] + 2 [𝑓𝑥𝑥 (𝑥0 , 𝑦0 )𝑥 2 + 2𝑓𝑥𝑦 (𝑥0 , 𝑦0 )𝑥𝑦 +
1
𝑓𝑦𝑦 (𝑥0 , 𝑦0 )𝑦 2 ] + 3 [𝑓𝑥𝑥𝑥 (𝑥0 , 𝑦0 )𝑥 3 + 3𝑓𝑥𝑥𝑦 (𝑥0 , 𝑦0 )𝑥 2 𝑦 + 3𝑓𝑥𝑦 2 (𝑥0 , 𝑦0 )𝑥𝑦 2 + 𝑓𝑦𝑦𝑦 (𝑥0 , 𝑦0 )𝑦 3 ] + ⋯

In particular cases, we may use only up to the second order term.


Example: Expand 𝑍 = 𝑥 2 − 𝑦 2 about 𝑥0 = 0, 𝑦0 = 0 up to the second order terms. Evaluate the
expression at 𝑥0 = 0.3, 𝑦0 = 0.2.
Solution: 𝑓𝑥 = 2𝑥, 𝑓𝑦 = −2𝑦
𝑓𝑥𝑥 = 2, 𝑓𝑦𝑦 = −2
𝑓(𝑥0 , 𝑦0 ) = 0.0
1
𝑓(0.3,0.2, ) = 2 [(0.3)2 − 2(0.2)2 ] = 0.09 − 0.04 = 0.05

Page 5 of 22
0.2. Errors and their computation
Most numerical computation are in exact either due to the given data
being approximation or due to limitations of computing aids or tools such
as mathematical tables, desk calculators or the digital computer.
Due to these limitation numbers have to be rounded off causing rounding
errors.
These errors can be classified into several types:
a. Absolute and Relative Errors
 Absolute Error: The difference between the exact value (𝑥) and the approximated value
(𝒙𝒂 )
𝑬𝒂 = |𝒙 − 𝒙𝒂 |
 Relative Error: The ratio of absolute error to the exact value.

𝑬𝒂
𝑬𝒓 =
|𝒙|
Example: Suppose the true value of a quantity is 𝑥 = 3.141592 and the approximate value
is 𝑥𝑎 = 3.14.

 Absolute error:
𝐸𝑎 = |3.141592 − 3.14| = 0.001592
 Relative error:
0.001592
𝐸𝑟 = ≈ 0.0005067
3.141592
 Percentage Relative error:

𝐸𝑟 × 100 = 0.05067%
b. Truncation errors
These errors are caused by using approximate formulae in computations.
Here arise by using a finite number of terms of a formulae.
Examples:
1. Truncation error in Taylor series approximation
The function 𝑒 𝑥 is approximated using the first three terms of its Taylor series expansion:
𝑥
𝑥2
𝑒 ≈ 1+𝑥+
2
Find the truncation error when approximating 𝑒 0.2 , given that the true value is 1.2214.
Solution:
𝑥2 𝑥3 𝑥4
The Taylor series expansion 𝑒 𝑥 = 1 + 𝑥 + + + +⋯
2! 3! 4!
Using only the first three terms:
(0.2)2
𝑒 0.2 ≈ 1 + 0.2 + = 1.22
2
Truncation error is:
𝑬𝒕 = |𝑻𝒓𝒖𝒆 𝑽𝒂𝒍𝒖𝒆 − 𝑨𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒆 𝑽𝒂𝒍𝒖𝒆|
Page 6 of 22
𝐸𝑡 = |1.2214 − 1.22| = 0.0014
Answer: 0.0014
2. Truncation error in numerical differentiation (Discretization error)
Occurs when a continuous function is represented in a discrete manner.

The derivative of 𝑓(𝑥) is approximated using the forward difference formula:


𝑓(𝑥 + ℎ) − 𝑓(𝑥)
𝑓 ′ (𝑥) ≈

For 𝑓(𝑥) = 𝑥 3 , compute the truncation error at 𝑥 = 1 with ℎ = 0.1.
Solution:
The exact derivative is:
𝑑(𝑥 3 )
𝑓 ′ (𝑥) = = 3𝑥 2
𝑑𝑥
At 𝑥 = 1, 𝑓 ′ (1) = 3(12 ) = 3
Using the forward difference formula:
𝑓(1 + 0.1) − 𝑓(1) 1.331 − 1 0.331
𝑓 ′ (1) ≈ = = = 3.31
0.1 0.1 0.1
Truncation error is:
𝐸𝑡 = |3 − 3.31| = 0.31
Answer: 0.31

c. Round-off errors
The round-off error caused by the finite precision of floating- point
arithmetic.
Examples:
1. Round-off error in decimal representation
A number 𝑥 = 0.33333 is stored in a computer with only three decimal places
a. What is the stored value?
b. Computer the absolute and relative round-off error.
Solution:
 The actual number is 𝑥 = 0.33333.
 Stored value (rounded to three decimal places) is 𝑥𝑎 = 0.333.
Step1: Compute Absolute error
𝑬𝒂 = |𝒙 − 𝒙𝒂 | = |0.33333 − 0.333| = 0.00033
Step1: Compute relative error
𝑬𝒂 0.00033
𝑬𝒓 = = ≈ 0.00099
|𝒙| 0.33333
Answer:
 Stored value:0.333
 Absolute error: 0.00033
 Relative error: 0.00099 = 0.09

Page 7 of 22
2. Round-off Error in Floating-Point Arithmetic
A computer uses four decimal places to store numbers. Compute the round-off error when
storing 𝜋 ≈ 3.14159265
Solution:
Stored value with four decimal places: 𝑥𝑎 = 3.1416
Step1: Compute absolute error:

𝑬𝒂 = |𝒙 − 𝒙𝒂 | = |3.14159265 − 3.1416| = 0.00000735


Step 2: Compute relative error:

𝑬𝒂 0.00000735
𝑬𝒓 = = ≈ 2.34 × 10−6 = 0.000234%
|𝒙| 3.14159265
Round-off Error in Addition
Consider adding the numbers 10000.1and 0.00001234on a machine that stores only five
significant digits. Compute the round-off error.
Solution:
Step 1: True Sum
𝑆 = 10000.1 + 0.00001234 = 10000.10001234
Step2: Stored value (Rounded to five significant digits)
10000.10001234 is rounded to 10000.
Step3: Compute Round-off error

𝑬𝒂 = |𝑺 − 𝑺𝒂 | = |10000.10001234 − 10000| = 0.10001234


𝑬𝒂 0.10001234
𝑬𝒓 = = ≈ 0.00001 = 0.001%
|𝑺| 10000.10001234

d. Algorithmic Errors
Occur when numerical methods fail due to stability issues.

Example: Solving 𝑥 = cos 𝑥 using the iterative method with an initial guess 𝑥0 = 0.5

𝑥𝑛 = cos(𝑥𝑛 )
Iterations:
1. 𝑥1 = cos(0.5) = 0.8776
2. 𝑥2 = cos(0.8776) = 0.6390
3. 𝑥3 = cos(0.6390) = 0.8026
4. 𝑥4 = cos(0.8026) = 0.6948
This method converges, but if the function were highly oscillatory could
arise.
Remark: An approximation is said to be accurate to d decimal places (d.p) if the magnitude
𝟏𝟎−𝒅
of error is less than to the round-off error which is 𝜺𝒑 = 𝟐

where 𝒅 is the number of significant digits in the computation.

Page 8 of 22
Description Magnitude of the error is less than
1 decimal place accuracy 0.005 = 0.5 × 10−1
2 decimal place accuracy 0.0005 = 0.5 × 10−2
3 decimal place accuracy 0.00005 = 0.5 × 10−3
⋮ ⋮

Examples:
1. Round-off in a 4-digit system:
Approximating 𝜋 = 3.14159265 in a 4-digit system, the round-off error is:
10−4
∆𝑥 = 𝜺𝒑 = = 0.00005
2
𝜋 ≈ 3.1416G
∆𝑥 0.005
2. If 𝑥 = 0.51 and is correct to 2-decimal places, then ∆𝑥 = 0.005, and 𝐸𝑅 = = =
𝑥 0.51

0.98%
General error formula
Let 𝑦 = 𝑓(𝑥) the error in 𝑦 denoted by 𝛿𝑦 is given by 𝛿𝑦 = 𝑓 ′ (𝑥)𝛿𝑥 , where 𝛿𝑥 is the error in 𝑥.
Example:
Given 𝑦 = (1 + 𝑥)3 find the error in 𝑦 if 𝑥 = 2.3 ± 0.05
Solution:
If 𝑦 = (1 + 𝑥)3 , then 𝑦 ′ = 3(1 + 𝑥)2
𝛿𝑦 = 𝑓 ′ (𝑥)𝛿𝑥 = 3(1 + 𝑥2.3)2 × 0.05 = 1.63
1.63
𝐸𝑃 = = 4.53%
(1 + 𝑥2.3)3
Errors in a series approximation
(𝑥−𝑎) (𝑥−𝑎)2 (𝑥−𝑎)3
The Taylor’s series of 𝑓(𝑥) at 𝑥 = 𝑎 is 𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎) + 𝑓 ′′ (𝑎) + 𝑓 ′′′ (𝑎) +
1! 2! 3!
(𝑥−𝑎)𝑛−1
⋯+ (𝑛−1)!
𝑓 (𝑛−1) (𝑎) + 𝑅𝑛 (𝑥)
(𝑥−𝑎)𝑛
Where 𝑅𝑛 (𝑥)a Lagrange’s remainder is be written as 𝑅𝑛 (𝑥) = 𝑓 (𝑛) (𝜉),
𝑛!

𝑎 < 𝜉 < 𝑏.
If the series converges then lim 𝑅𝑛 (𝑥) = 0.
𝑛→∞

Thus if we approximate 𝑓(𝑥) by the first n terms of series, then the maximum error committed
is 𝑅𝑛 (𝑥).
Conversely if the accuracy required is specified in advance, then it would be possible to find
n the number of terms such that the finite series yield the required accuracy.

Page 9 of 22
Example:
The Maclaurrin expansion of 𝑒 𝑥 is
𝑥2 𝑥3 𝑥 𝑛−1 𝑥𝑛
𝑒𝑥 = 1 + 𝑥 + + + ⋯ + (𝑛−1)! + 𝑒 𝜉 , 0 < 𝜉 < 𝑥. Find 𝑛 such that their sum yield the value of
2! 3! 𝑛!

𝑒 𝑥 correct to 8 decimal places (8dp) at 𝑥 = 1.

Solution:
𝑥𝑛
Here 𝑅𝑛 (𝑥) = 𝑒 𝜉 , 0 < 𝜉 < 𝑥, so that𝑥 = 𝜉 which gives the maximum error.
𝑛!

𝑥𝑛 𝜉
𝑅𝑛 (𝑥) 𝑛! 𝑒 𝑥𝑛
(𝐸𝑅 )𝑚𝑎𝑥 = = 𝜉 =
𝑓(𝑥) 𝑒 𝑛!
1 10−8
For 8dp accuracy at 𝑥 = 1, we get: 𝑛! < 2 ⟹ 𝑛! > 2 × 108 ⟹ 𝑛 = 12. Thus, we need to take
12 terms of the exponential series in order that its sum is correct to 8 decimal places.

Page 10 of 22
Page 11 of 22
CHAPTER I: Transcendental, Polynomial Equations and Curve
Fitting.
Introduction: Numerical solutions of non-linear equations
A frequently occurring problem is to find one or more roots of the equations
𝑓(𝑥) = 0. (1)
If 𝑓(𝑥) is a quadratic, cubic, or a bi-quadratic expression, the roots may be evaluated by
using the available algebraic formula. On the other hand, when 𝑓(𝑥)is a polynomial of
higher degree or an expression involving transcendental functions, for example:
1 + cos(𝑥) − 5𝑥, 𝑥 tan(𝑥) − cosh(𝑥), etc.
Algebraic methods are not available, and this course must e taken to find the roots by
approximate method. In this section, we describe some numerical methods for the
solution of the equation (1), where f (x) may be algebraic, transcendental or combination
of both.
I.1. The Bisection Method
This method is based on an important property of continuous functions, that is:
If a function f (x) is continuous in the closed interval (a, b) and if f (a) and f (b) are of
opposite signs, then there exists at least one root between a and b.
For definition, let f (a) be negative and f (b) be positive. Then the root lies between a
and b
and let its approximate value be given by
𝑎+𝑏
𝑥1 =
2
Now if f (x1) = 0, we conclude that x1 is a root of the equation f (x) = 0. Otherwise, the
root lies either between x1 and b, or between a and x1 depending on whether f (x1) is
negative or positive. Them we bisect the interval and repeat the process until the root is
known to the desired accuracy.
If f (x1) is positive the root lies in between a and x1. The second approximation to the
root is
𝑎 + 𝑥1
𝑥2 =
2
If f (x2) is negative, the root lies in between x2 and x1, and the third approximation to the
root is:

𝑥1 + 𝑥2
𝑥3 =
2

Page 12 of 22
and so on. This method is simple but slowly convergent.
We repeat this process until the last interval (which contains the root) is as small as desired,
say 𝜀. It is clear that the interval width is reduced by a factor of one-half at each step and at
the end of the 𝑛𝑡ℎ step, the new interval will be
|𝑎−𝑏|
|𝑎𝑛 − 𝑏𝑛 | of length 𝑛 . We then have
2
|𝑎 − 𝑏|
≤ 𝜀,
2𝑛
Which gives on simplification
|𝑎
ln ( − 𝑏|⁄𝜀 )
𝑛≥
ln 2
This relationship gives the number of iterations required to achieve an accuracy 𝜀. For
example, if |𝑎 − 𝑏| = 1 and
𝜀 = 0.001, then it can be seen that
1 ln 1000
𝑛
≤ 0.001 ⟹ 2𝑛 ≥ 1000 ⟺ 𝑛 ln 2 ≥ ln 1000 ⟹ 𝑛 ≥ ≈ 9.97 ⟹ 𝑛 = 10
2 ln 2

Geometrically, the bisection method can be illustrated as follows:

Example 1: Find a real root of the equation𝑥 3 − 𝑥 − 1 = 0 with 4dp.


Solution: Let 𝑓(𝑥) = 𝑥 3 − 𝑥 − 1. Since 𝒇(𝟏) = −𝟏 < 𝟎 and 𝒇(𝟐) = 𝟓 > 𝟎, a root lies in
between 1 and 2.
ln 10000
For this case 𝑎 = 1, 𝑏 = 2 𝑎𝑛𝑑 𝜀 = 0.0001, then 𝑛 ≥ ≈ 13.28 ⟹ 𝑛 = 14 steps.
ln 2

Therefore, we taken
1+2 3
𝑥1 = =
2 2
𝟑 𝟑 𝟑 𝟕 3
Then 𝒇(𝒙𝟏 ) = (𝟐) − 𝟐 − 𝟏 = 𝟐 > 𝟎. Hence, the root lies between 1 and = 1.500 and we obtain
2

1 + 1.5 5
𝑥2 = = 1.2500 =
2 4
𝟓 𝟑 𝟓 𝟏𝟗
Now 𝒇(𝒙𝟐 ) = (𝟒) − 𝟒 − 𝟏 = − 𝟔𝟒 < 𝟎
3 5
Hence, the root lies between and and we obtain
2 4

Page 13 of 22
3 5
+ 11
𝑥3 = 2 4 = = 1.3750
2 8
Now 𝑓(𝑥3 ) = (1.3750)3 − 1.3750 − 1 = 0.224609375 > 0
5 11
Hence, the root lies between and and we obtain
4 8

5 11
+ 21
𝑥4 = 4 8 = = 1.3125
2 16
Now 𝑓(𝑥4 ) = (1.3125)3 − 1.3125 − 1 = −0.0515136719 < 0
21 11
Hence, the root lies between16 and and we obtain
8

21 11
+ 43
𝑥5 = 16 8 = = 1.34375
2 32
Now 𝑓(𝑥5 ) = (1.34375)3 − 1.34375 − 1 > 0
21 43
Hence, the root lies between16 and and we obtain
32

21 43
+ 85
𝑥6 = 16 32 = = 1.328125
2 64
Now 𝑓(𝑥6 ) = (1.328125)3 − 1.328125 − 1 > 0
21 85
Hence, the root lies between16 and and we obtain
64

21 85
+ 169
𝑥7 = 16 64 = = 1.3203125
2 128
Now 𝑓(𝑥7 ) = (1.3203125)3 − 1.3203125 − 1 < 0
169 85
Hence, the root lies between128 and and we obtain
64

169 85
+ 339
𝑥8 = 128 64 = = 1.32421875
2 256
Now 𝑓(𝑥8 ) = (1.32421875)3 − 1.32421875 − 1 < 0
339 85
Hence, the root lies between256 and and we obtain
64

339 85
+ 679
𝑥9 = 256 64 = = 1.326171875
2 512
Now 𝑓(𝑥9 ) = (1.326171875)3 − 1.326171875 − 1 > 0
339 679
Hence, the root lies between256 and and we obtain
512

339 679
+ 1357
𝑥10 = 256 512 = = 1.3251953125
2 1024
Now 𝑓(𝑥10 ) = (1.3251953125)3 − 1.3251953125 − 1 > 0
339 1357
Hence, the root lies between256 and and we obtain
1024

Page 14 of 22
339 1357
+ 2713
𝑥11 = 256 1024 = = 1.3247070313
2 2048
Now 𝑓(𝑥11 ) = (1.3251953125)3 − 1.3251953125 − 1 < 0
2713 1357
Hence, the root lies between2048 and and we obtain
1024

2713 1357
+ 5427
𝑥12 = 2048 1024 = = 1.3249511919
2 4096
Now 𝑓(𝑥12 ) = (1.3249511919)3 − 1.3249511919 − 1 > 0
2713 1357
Hence, the root lies between2048 and and we obtain
1024

2713 5427
+ 10853
𝑥13 = 2048 4096 = = 1.3248291016
2 8192
Now 𝑓(𝑥13 ) = (1.3248291016)3 − 1.3248291016 − 1 > 0
2713 1357
Hence, the root lies between2048 and and we obtain
1024

2713 10853
+ 21705
𝑥14 = 2048 8192 = = 1.3247680664
2 16384
The approximated solution is 1.3248
It should be noted that this method always succeeds. If there are more roots than on in the
interval, bisection method finds one of the roots. It can be easily programmed using the
following computational steps:
1. Choose two real numbers 𝑎 and 𝑏 such that 𝑓(𝑎)𝑓(𝑏) < 0.
𝑎+𝑏
2. Set 𝑥𝑟 = .
2

3. (a) If 𝑓(𝑎)𝑓(𝑥𝑟 ) < 0, the root lies in the interval (𝑎, 𝑥𝑟 ). Then , set 𝑏 = 𝑥𝑟 and go to step 2
above.
(b) If 𝑓(𝑎)𝑓(𝑥𝑟 ) > 0, the root lies in the interval (𝑥𝑟 , 𝑏). Then , set 𝑎 = 𝑥𝑟 and go to step 2
above.
(c) If 𝑓(𝑎)𝑓(𝑥𝑟 ) = 0, it means that 𝑥𝑟 is a root of the equation 𝑓(𝑥) = 0 and the computation
may be terminated.
In practical problems, the computation may not be exact so that condition (c) above is never
satisfied. In such a case, we need to adopt a criterion for deciding when to terminate the
computations.
A convenient criterion is to compute the percentage error 𝜀𝑟 defined by
𝒙′ 𝒓 − 𝒙𝒓
𝜺𝒓 = | | × 𝟏𝟎𝟎% (𝟏)
𝒙′ 𝒓
Where 𝒙′ 𝒓 is the new value of 𝑥𝑟 . The computations can be terminated when 𝜺𝒓

Page 15 of 22
Becomes less than a prescribed tolerance, say 𝜺𝒑 . In addition, the maximum number of
iterations may also be specified in advance.
Example: Find a real root of the equation 𝑥 3 − 2𝑥 − 5 = 0.
Solution:
Let 𝑓(𝑥) = 𝑥 3 − 2𝑥 − 5. Then 𝑓(2) = −1 and 𝑓(3) = 16.
Hence a root lies between 2 and 3 and we take
2+3
𝑥1 = = 2.5
2
Now, 𝑓(𝑥1 ) = 𝑓(2.5) = 5.6250, the root lies between 2 and 2.5.
Hence
2 + 2.5
𝑥2 = = 2.25
2
Now, 𝑓(𝑥2 ) = 𝑓(2.25) = 1.890625, the root lies between 2 and 2.25.
Therefore,
2 + 2.25
𝑥3 = = 2.125
2
Since 𝑓(𝑥3 ) = 𝑓(2.125) = 0.3457, the root lies between 2 and 2.125.
Therefore,
2 + 2.125
𝑥4 = = 2.0625
2
Proceeding in this way, we obtain the successive approximations:
𝑥5 = 2.09375, 𝑥6 = 2.10938, 𝑥7 = 2.10156,
𝑥8 = 2.09766, 𝑥9 = 2.09570, 𝑥10 = 2.09473, 𝑥11 = 2.09424, ⋯
We find 𝑥11 − 𝑥10 = −0.0005, and
𝑥11 − 𝑥10 −0.0005
| | × 100% = | | × 100% = 0.02%
𝑥11 𝑥11 = 2.09424
Hence a root, correct to three decimal places is 2.094.

EXERCISES 1
1. Perform 5 iterations of the bisection method to obtain the smallest positive root of the
following equations:
a. 𝑓(𝑥) = 𝑥 3 − 5𝑥 + 1 = 0
b. 𝑓(𝑥) = 𝑥 5 − 5𝑥 3 + 1 = 0

2. Find a positive root of the equation 𝑥𝑒 𝑥 = 1 lies between 0 and 1.


3. Find a real root of the equation𝑥 3 − 𝑥 − 11 = 0 with 4dp.
4. Obtain a root of the following equations correct to the 3dp using bisection
method
a. 𝑥 3 − 18 = 0
b. 𝑥 3 − 𝑥 − 4 = 0
Page 16 of 22
c. 𝑥 3 − 4𝑥 − 9 = 0
d. 𝑥 3 + 𝑥 2 + 𝑥 + 7 = 0
5. Find a positive root, between 0 and 1, of the equation 𝑥 = 𝑒 −𝑥 to a tolerance of 0.05%.
6. Find a root, correct to three decimal places and lying between 0 and 0.5, of the
equation

4𝑒 −𝑥 sin(𝑥) − 1 = 0

I.2. The Regular-Falsi Method or Method of False Position


The method of false position is also known as Regular-Falsi Method, is the oldest method of
finding the real root of an equation f (x) = 0 and is somewhat similar to the bisection
method.
In this method, we choose two points a and b ( a < b) such that f (a) and f (b) are of
opposite signs. Since the graph of y = f (x) crosses the x-axis between these two points,
a root must lies between these points chosen.
The equation of the chord joining the points (a, f (a)) and(b, f (b)) is given as

𝑦 − 𝑓(𝑎) 𝑓(𝑏) − 𝑓(𝑎)


= (𝑥 − 𝑎) (∗)
𝑥−𝑎 𝑏−𝑎
The method consists in replacing the part of the curve between the points [a, f (a)] and
[b, f (b)] by means of the chord joining these points, and taking the point of intersection of
the chord with the x-axis as an approximation to the root. The point of intersection in the
present case is obtained by putting

Page 17 of 22
𝑦 = 0 in Eq. (∗). Thus, we obtain
𝑓(𝑎) 𝑎𝑓(𝑏) − 𝑏𝑓(𝑎)
𝑥1 = 𝑎 − (𝑏 − 𝑎) = (∗∗)
𝑓(𝑏) − 𝑓(𝑎) 𝑓(𝑏) − 𝑓(𝑎)

Which is the first approximation to the root of 𝑓(𝑥) = 0. If now 𝑓(𝑥1 ) and 𝑓(𝑎) are of
opposite signs, then the root lies between 𝑎 and 𝑥1 , and we replace 𝑏 by 𝑥1 in Eq(∗∗),and
obtain the next approximation. Otherwise, we replace a by x1 and generate the next
approximation. The procedure is repeated till the root is obtained to the desired accuracy.
The following Figure gives a graphical representation of the method. The error
criterion Eq. (1) can be used in this case also.

Method of false position.

Example: Find a real root of


𝑓(𝑥) = 𝑥 3 − 2𝑥 − 5 = 0

Solution: We find 𝑓(2) = −1 and f (3) = 16. Hence a = 2, b = 3, and a root lies between 2 and 3. Equation (**) gives

3.0. Using formula (**), we obtain

Example: Given that the equation 𝑥 2.2 = 69 has a root between 5 and 8.
Use the method of regula-falsi to determine it.
Solution:

Page 18 of 22
Page 19 of 22
EXERCISES 2
1. Find the real root of xex = 3 by regular-falsi method correct to three
decimal places.
2. Find the root correct to the five places of decimal of the equation
2x-log(x) = 7 lies between 3.5 and 4.0, using Regula-falsi —method.
3. Show that x -2x-17 = 0 has only one real root and find its value
3

correct to −two −
decimal places.
4. Find a root of the following equations correct to four decimal places,
using the method of false position.
a) x3 − 4x − 9 = 0 b) x3 + 2x2 + 10x − 20 = 0 c) ex sin(x) = 1
d) x = cos(x)

Page 20 of 22
Page 21 of 22
Page 22 of 22

You might also like