0% found this document useful (0 votes)
4 views21 pages

Bisection Method

This document discusses methods for solving algebraic and transcendental equations, specifically focusing on numerical methods such as the Bisection method, Newton-Raphson method, and others. It explains the Intermediate Value Theorem and provides detailed steps for implementing the Bisection method, including examples of finding roots for specific equations. The document emphasizes the importance of ensuring that the function has opposite signs at the endpoints of the interval to guarantee the existence of a root.

Uploaded by

arafat52ky
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)
4 views21 pages

Bisection Method

This document discusses methods for solving algebraic and transcendental equations, specifically focusing on numerical methods such as the Bisection method, Newton-Raphson method, and others. It explains the Intermediate Value Theorem and provides detailed steps for implementing the Bisection method, including examples of finding roots for specific equations. The document emphasizes the importance of ensuring that the function has opposite signs at the endpoints of the interval to guarantee the existence of a root.

Uploaded by

arafat52ky
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

Chapter 02

Solution of Algebraic and


Transcendental Equations
Shirin Sultana
Assistant Professor
Department of CSE
Daffodil International University,
Ashulia, Dhaka, Bangladesh.
In this Lesson, we have discussed methods for solving equations,
f ( x) = 0
Where, 𝑓 𝑥 may be a linear, nonlinear, algebraic or transcendental
function.
The solutions of the equation 𝑓 (𝑥) = 0 can be found using several
numerical methods, including:
1. Bisection method,
2. Newton- Raphson method,
3. False position method,
4. Fixed point iteration method,
5. Secant method etc.
These methods are fundamentally based on the Intermediate Value Theorem.
2
Intermediate Value Theorem

If 𝑓(𝑥) is continuous on the interval 𝑎, 𝑏 and if 𝑓 (𝑎) and


𝑓(𝑏) have opposite signs, then the equation 𝑓(𝑥) = 0 has at
least one real root between 𝑎 and 𝑏.

𝑌 𝑓(𝑥) 𝑌
𝑏, 𝑓 𝑏
𝑏, 𝑓 𝑏
𝑓(𝑥)
𝑓(𝑏) 𝑓(𝑏)
𝑋′ 𝑎 𝑋 𝑋′ 𝑎 𝑋
𝑐 𝑏 𝑐 𝑏
𝑓(𝑎) 𝑓(𝑎)

𝑎, 𝑓 𝑎 𝑎, 𝑓 𝑎 𝑌′
𝑌′

3
❖Algebraic Equation:
An algebraic equation is an equation that includes one or more variables,
such as
2
𝑥 + 𝑥𝑦 − 𝑧 = 0,
and involves algebraic operations like addition, subtraction,
multiplication, division, and raising to a power.
❖Transcendental equation:
An equation that involves algebraic, trigonometric, exponential,
logarithmic, or other non-algebraic functions is called a transcendental
equation, such as
𝑥
𝑒 + 5 sin 𝑥 − 2𝑥 = 0
❖Solution/root:
A solution (or root) of an equation is the value of the variable or variables
that satisfies the equation. 4
Iteration

• Iteration is the repeated process of performing a


calculation until the desired result or an acceptable
approximation is obtained.
• Each repetition of the process is also called iteration
and the result of one iteration is used as the starting
point for the next iteration.

5
Bisection Method

6
Bisection method (1)
The Bisection method is one of the simplest methods to find a root of a
nonlinear function.
▪ To use the Bisection method, one needs an initial interval that is known
to contain a root of the function.
▪ The method systematically reduces the interval. It does this by dividing
the interval into two equal parts, performs a simple test and based on
the result of the test half of the interval is thrown away.
▪ The procedure is repeated until the desired interval size is obtained.
7
Bisection method (2)
It is also called the binary-search method or
interval-halving method.

The objective is to find solutions for 𝒇(𝒙) = 𝟎.

8
Implementation of the bisection method
▪ If 𝑓(𝑎) and 𝑓(𝑏) have the same sign,
the function may have an even number
a b
of real zeros or no real zeros in the
interval [𝑎, 𝑏]. The function has four real zeros

▪ Bisection method cannot be used in


these cases. a b

The function has no real zeros


9
Implementation of the bisection method
If 𝑓(𝑎) and 𝑓(𝑏) have opposite signs, then
𝑌
the function has at least one real root in the 𝑏, 𝑓 𝑏
𝑓(𝑥)

𝑓(𝑏)
interval 𝑎, 𝑏 . 𝑋′ 𝑎 𝑋
𝑐 𝑏
𝑓(𝑎)
Assumption 𝑎, 𝑓 𝑎
𝑌′
1. 𝑓 is continuous on the closed interval [𝑎, 𝑏].
𝑌
2. 𝑓(𝑎) · 𝑓(𝑏) < 0 (i.e., 𝑓(𝑎) and 𝑓(𝑏) have 𝑎, 𝑓 𝑎

opposite signs). 𝑓(𝑎)


𝑋′ 𝑏 𝑋
3. By the Intermediate Value Theorem (IVT), 𝑎 𝑐 𝑓(𝑏)
𝑓(𝑥)
there is at least one real root in the open 𝑌′
𝑏, 𝑓 𝑏

interval 𝑎, 𝑏 . 10
Algorithm
Step 1: Choose two approximations a and b 𝑏 > 𝑎 such that
𝑓 𝑎 × 𝑓 𝑏 < 0.
𝑎+𝑏
Step 2: Evaluate the midpoint 𝑐 of 𝑎, 𝑏 given by 𝑐 = .
2
Step 3: If 𝑓 𝑐 = 0, then 𝑐 is the root of the equation 𝑓 𝑥 = 0.
**If 𝑓 𝑐 ≠ 0, then the following two cases arise:
Case-1: If 𝑓 𝑎 × 𝑓 𝑐 < 0, we say that the root lies in the interval 𝑎, 𝑐 . We now
replace c by b for getting the new interval (𝑎, 𝑏).
Case-2: If 𝑓 c × 𝑓 b < 0, we say that the root lies in the interval 𝑐, 𝑏 . We now
replace c by a for getting the new interval (𝑎, 𝑏).
11
Algorithm (continue)
Step 3: If 𝑓 𝑐 = 0, then 𝑐 is the root of the equation 𝑓 𝑥 = 0.
**If 𝑓 𝑐 ≠ 0, then the following two cases arise: 𝑌
𝑏, 𝑓 𝑏
𝑓(𝑥)

Case-1: If 𝑓 𝑎 × 𝑓 𝑐 < 0, we say that the root lies in 𝑋′


𝑓(𝑏)
𝑋
𝑎
𝑐 𝑏
the interval 𝑎, 𝑐 . We now replace c by b for getting the 𝑓(𝑎)

𝑎, 𝑓 𝑎
new interval (𝑎, 𝑏). 𝑌′
Case-1
𝑌
Case-2: If 𝑓 c × 𝑓 b < 0, we say that the root lies in 𝑎, 𝑓 𝑎

𝑓(𝑎)
the interval 𝑐, 𝑏 . We now replace c by a for getting the
𝑋′ 𝑏 𝑋
𝑎 𝑐
new interval (𝑎, 𝑏). 𝑓(𝑏)
𝑓(𝑥)

Step 4: Continue Step 2 and Step 3 until 𝑓 𝑐 ≈ 0. 𝑌′


𝑏, 𝑓 𝑏
Case-2
Then 𝑐 is the root of the equation 𝑓 𝑥 = 0. 12
𝟑 𝟐
Find a root of the equation 𝒙 + 𝒙 − 𝟏 = 𝟎 using
bisection method.
3 2
Solution: Given that, 𝑥 + 𝑥 − 1 = 0
Let 𝑓 𝑥 = 𝑥 3 + 𝑥 2 −1
Step 1: For 𝑎 = 0,
3 2
𝑓 0 = 0 + 0 − 1 = −1 < 0

For 𝑏 = 1,
3 2
𝑓 1 =1 +1 −1=1>0

∴ 𝑓 𝑎 × 𝑓 𝑏 = 𝑓 0 × 𝑓 1 = −1 × 1 = −1 < 0
Since , 𝑓(𝑎) = 𝑓(0) is negative and 𝑓(𝑏) = 𝑓 (1) is positive, so at least
one real root lies between 0 and 1. 13
Step 2:
Find the mid point of 𝑎 and 𝑏 say, 𝑐
such that,
𝑎+𝑏 𝑎 = 0, 𝑏 = 1
𝑐= . 𝑎+𝑏 0+1 1
2 root, 𝑐 = = = = 0.5
2 2 2

c is the root of the given function if


𝑓 (𝑐) = 0; else follow the next step.

14
Step 3: Case I : If 𝒇 𝒂 × 𝒇 𝒄 < 𝟎 , then 𝒃 = 𝒄 3 2
Case II : If 𝒇 𝒄 × 𝒇 𝒃 < 𝟎 , then 𝒂 = 𝒄
𝑓 𝑥 =𝑥 +𝑥 −1
𝑎+𝑏
Iteration 𝑎 𝑏 𝑓(𝑎) 𝑓(𝑏) 𝑐= 𝑓(𝑐) 𝑓(𝑎) ∗ 𝑓(𝑐) 𝑓(𝑐) ∗ 𝑓(𝑏) Change
2
01 0 1 -1 1 0.5 -0.625 >0 <0 a=c
02 0.5 1 -0.625 1 0.75 -0.01563 >0 <0 a=c
03 0.75 1 -0.01563 1 0.875 0.43555 <0 >0 b=c
04 0.75 0.875 -0.01563 0.43555 0.8125 0.19653 <0 >0 b=c
05 0.75 0.8125 -0.01563 0.19653 0.78125 0.08719 <0 >0 b=c
06 0.75 0.78125 -0.01563 0.08719 0.76563 0.03498 <0 >0 b=c
07 0.75 0.76563 -0.01563 0.03498 0.75781 0.00948 <0 >0 b=c
08 0.75 0.75781 -0.01563 0.00948 0.75391 -0.00312 >0 <0 a=c
09 0.753906 0.75781 -0.00312 0.00948 0.75586 0.00316 <0 >0 b=c
10 0.753906 0.75586 -0.00312 0.00316 0.75488 0.00002
Here, 𝑓 𝑐 ≈ 0.00002 or near to zero, which is the accuracy condition for the solution exact.
16
So, the required root of the given equation up to the four decimal places is 0.7548
𝒙
Find the root of the equation 𝟒 𝐬𝐢𝐧 𝒙 − 𝒆 = 𝟎 by using
Bisection method correct up to four decimal places.
Given that, 4 sin 𝑥 − 𝑒 𝑥 =0
Solution:
Let 𝑓 𝑥 = 4 sin 𝑥 − 𝑒 𝑥

Step 1: For 𝑎 = 0,
0
𝑓 0 = 4 sin 0 − 𝑒 = −1 < 0

For 𝑏 = 1,
1
𝑓 1 = 4 sin 1 − 𝑒 = 0.64760 > 0

∴ 𝑓 𝑎 × 𝑓 𝑏 = 𝑓 0 × 𝑓 1 = −1 × 0.64760 = −0.64760 < 0


Since , 𝑓(𝑎) = 𝑓(0) is negative and 𝑓(𝑏) = 𝑓 (1) is positive, so at least
one real root lies between 0 and 1. 17
Step 2:
Find the mid point of 𝑎 and 𝑏 say, 𝑐
such that,
𝑎+𝑏 𝑎 = 0, 𝑏 = 1
𝑐= . 𝑎+𝑏 0+1 1
2 root, 𝑐 = = = = 0.5
2 2 2

c is the root of the given function if


𝑓 (𝑐) = 0; else follow the next step.

18
Step 3: Case I : If 𝒇 𝒂 × 𝒇 𝒄 < 𝟎 , then 𝒃 = 𝒄 𝑥
𝑓 𝑥 = 4 sin 𝑥 − 𝑒
Case II : If 𝒇 𝒄 × 𝒇 𝒃 < 𝟎 , then 𝒂 = 𝒄
𝑎+𝑏
Iteration 𝑎 𝑏 𝑓(𝑎) 𝑓(𝑏) 𝑐= 𝑓(𝑐) 𝑓(𝑎) ∗ 𝑓(𝑐) 𝑓(𝑐) ∗ 𝑓(𝑏) Change
2
01 0 1 -1 0.64760 0.5 0.26898 <0 >0 b=c
02 0 0.5 -1 0.26898 0.25 -0.29441 >0 <0 a=c
03 0.25 0.5 -0.29441 0.26898 0.375 0.01010 <0 >0 b=c
04 0.25 0.375 -0.29441 0.01010 0.3125 -0.13708 >0 <0 a=c
05 0.3125 0.375 -0.13708 0.01010 0.34375 -0.06215 >0 <0 a=c
06 0.34375 0.375 -0.06215 0.01010 0.35938 -0.02568 >0 <0 a=c
07 0.35938 0.375 -0.02568 0.01010 0.36719 -0.00770 >0 <0 a=c
08 0.36719 0.375 -0.0077 0.01010 0.37109 0.00122 <0 >0 b=c
09 0.36719 0.37109 -0.0077 0.00122 0.36914 -0.00323 >0 <0 a=c
10 0.36914 0.37109 -0.00323 0.00122 0.37012 -0.00101 >0 <0 a=c
11 0.37012 0.37109 -0.00101 0.00122 0.37061 0.00011 <0 >0 b=c
12 0.37012 0.37061 -0.00101 0.00011 0.37036 -0.00045 >0 <0 a=c
13 0.37036 0.37061 -0.00045 0.00011 0.37048 -0.00017 >0 <0 a=c
20
14 0.37048 0.37061 -0.00017 0.00011 0.37054 -0.00003
Step 4.
Here, 𝑓 𝑐 ≈ −0.00003 or near to zero, which is the accuracy condition for the solution exact.
So, the required root of the given equation up to the four decimal places is 0.3705.

21
Algorithm of Bisection Method

22
Homework
Find the root of the following equations using Bisection method by
your own choosing interval.
𝑥
1. 2 − 5𝑥 + 2 = 0
2𝑥 𝑥
2. 𝑒 − 𝑒 − 2 = 0
3 2
3. 𝑥 + 𝑥 − 1 = 0
4. 2𝑥 + cos 𝑥 − 3 = 0
5. cos 𝑥 − ln 𝑥 = 0
2
6. 𝑥 − 4𝑥 − 10 = 0
7. 2𝑥 = 1 + sin 𝑥
3 2
8. 𝑥 − 2𝑥 − 4 = 0
23

You might also like