You are on page 1of 10

Numerical Analysis

and Computation
Lecture # 3
(Solution of Non-Linear Equations)
Bisection Method

Course Instructor:
IMTIAZ ALI Mr. Attiq Iqbal
SHAH Class: BSCS-F19
Office: IAA-404 Section: C
Non-linear Equations
𝒇(𝒙) = 𝟎
where 𝒇(𝒙) is non-linear

Non-Linear Algebraic Equations:


𝑥 3 − 3𝑥 2 + 5𝑥 + 1 = 0
𝑥 4 − 4𝑥 2 + 6𝑥 = 10
Non-Linear Transcendental Equations:
𝑒 𝑥 − 𝑠𝑖𝑛(𝑥) = 0
𝑒 𝑥 − 𝑠𝑖𝑛(𝑥 2 ) = 𝑡𝑎𝑛(𝑥)
𝑒 𝑥 = 𝑐𝑜𝑠(𝑥)
𝑠𝑖𝑛(𝑥) − 𝑙𝑜𝑔10 (2𝑥) = 4
Solution of Non-Linear Equations
Numerical Methods to solve non-linear equations 𝒇(𝒙) = 𝟎

• Bisection Method
• Newton-Raphson Method
• Secant Method
• Regula Falsi Method
• Fixed Point Method
Root Bracketing Criterion
Intermediate Value Theorem:
If 𝑓 is some continuous function on [𝑎, 𝑏] and if 𝑓(𝑎) < 0, 𝑓(𝑏) > 0 or
𝑓(𝑎) > 0 , 𝑓 (𝑏) < 0 which means
𝒇(𝒂). 𝒇(𝒃) < 𝟎 (Opposite signs)
Then there exists at least one point 𝑐 ∈ (𝑎, 𝑏) such that 𝑓 (𝑐 ) = 0
Bisection Method
Suppose 𝑓(𝑥 ) = 0 is a non-linear equation where 𝒇 is continuous function defined on
[𝑎, 𝑏]. Also 𝑓(𝑎) 𝑎𝑛𝑑 𝑓(𝑏) has different signs i.e. 𝒇(𝒂). 𝒇(𝒃) < 𝟎
Compute Mid-point
𝑎+𝑏
𝑃1 =
2

If 𝑓(𝑃1 ) = 0 or |𝑓(𝑃1 )| < 𝜀 then 𝑃1 is the root


If 𝑓(𝑃1 ) ≠ 0 or |𝑓(𝑃1 )| ≮ 𝜀 then find the region of opposite signs
To find region of opposite signs:
If 𝑓(𝑃1 ). 𝑓(𝑎) < 0 then it is region of opposite signs
𝑎 + 𝑃1
𝑃2 =
2
If 𝑓(𝑃1 ). 𝑓(𝑏) < 0 then it is region of opposite signs
𝑃1 + 𝑏
𝑃2 =
2
Now Again
If 𝑓(𝑃2 ) = 0 or |𝑓(𝑃2 )| < 𝜀 then 𝑃2 is the root
If 𝑓(𝑃2 ) ≠ 0 or |𝑓 (𝑃2 )| ≮ 𝜀 then find the region of opposite signs
Repeat this iterative process again and again.
Stopping Criterias
• |𝑓(𝑃𝑛 )| < 𝜖

• |𝑃𝑛+1 − 𝑃𝑛 | < 𝜖

|𝑃𝑛+1 −𝑃𝑛 |
• <𝜖
|𝑃𝑛+1 |
Question: Given a non-linear equation 2𝑥 − 5𝑥 + 2 = 0. Use Bisection Method to find
the root of this equation correct upto 4 decimal places (𝜀 = 10−4 )
Solution: First we must bracket the root. For this choose random consecutive integers
and compute function values at those integers.
𝑥 -2 -1 0 1 2
𝑓(𝑥) 12.5 7.5 3 -1 -4
Signs of
+ + + - -
𝑓(𝑥)

Now start Bisection Method


1st Iteration: (𝟎, 𝟏)
0+1
𝑃1 = = 𝟎. 𝟓𝟎𝟎𝟎
2
𝑓 (𝑃1 ) = 0.9142 = +𝑣𝑒
2nd Iteration: (𝟎. 𝟓, 𝟏)
0.5 + 1
𝑃2 = = 𝟎. 𝟕𝟓𝟎𝟎
2
𝑓 (𝑃2 ) = −0.0682 = −𝑣𝑒

3rd Iteration: (𝟎. 𝟓, 𝟎. 𝟕𝟓)


0.5 + 0.75
𝑃3 = = 𝟎. 𝟔𝟐𝟓𝟎
2
𝑓 (𝑃3 ) = 0.4172 = +𝑣𝑒

4th Iteration: (𝟎. 𝟔𝟐𝟓, 𝟎. 𝟕𝟓)


0.625 + 0.75
𝑃4 = = 𝟎. 𝟔𝟖𝟕𝟓
2
𝑓 (𝑃4 ) = 0.1730 = +𝑣𝑒
Moving in similar manner
14th Iteration: (𝟎. 𝟕𝟑𝟐𝟏, 𝟎. 𝟕𝟑𝟐𝟐)
𝑃14 = 𝟎. 𝟕𝟑𝟐𝟐
𝑓 (𝑃14 ) = 0.000021 < 𝜀 = 0.0001

15th Iteration: (𝟎. 𝟕𝟑𝟐𝟏, 𝟎. 𝟕𝟑𝟐𝟐)


𝑃15 = 𝟎. 𝟕𝟑𝟐𝟐

Since 𝑃14 = 𝑃15 up to 4 decimal places so 0.7322 is the root of given function correct up
to 4 decimal places.
Practice Question:
1. Given a non-linear equation
𝟑𝒙 − 𝟔𝒙 = −𝟐
a). Bracket the root of above equation between two consecutive integers.
b). Use bisection method to find the root of this equation correct upto 2
decimal places (𝜀 = 10−2 )
H.W- Page No. 54 book (Burden and Faires)

You might also like