Module 2 Bisection Method
Module 2 Bisection Method
Module 2 Bisection Method
TRY THIS!
DIRECTION: Solve the following as your self assessment or practice problem for this
module. Since this is a formative exam, this will not be graded and not required to be
submitted.
2. Use the Bisection method to find solutions accurate to within 10−2 for x 4 − 2x3 −
4x2 + 4x + 4 = 0 on each interval.
(a) [-2,-1]
(b) [0,2]
(c) [2,3]
(d) [-1,0]
3. For each of the functions listed below, do a calculation by hand (i.e., with a
calculator) to find the root to an accuracy of 0.1. This process will take at most
five iterations for all of these, and fewer for several of them.
2
(a) f(x) = x - 𝑒 −𝑥 , [a,b] = [0,1]
1
(b) f(x) = ln x + x , [a,b] = [ ,1]
10
(c) f(x) = x3 – 3, [a,b] = [0,3]
(d) f(x) = x6 – x - 1, [a,b] = [0,2]
(e) f(x) = 3 – 2x , [a,b] = [0,2]
LET’S LEARN!
Examples:
x 4 – x 2 + 5 = 0, 4x 2 – x + 7 = 0; 2x3 – x 2 + 5x + 7 = 0
Examples:
c
Figure 1
1. A number c is a simple root of f(x) = 0 if f(c) = 0 and f’(c) ≠ 0, then we can write
f(x) = (x-c) g(x), where g(c) ≠ 0
2. A number c is a multiple root of f(x) = 0 if f(c) = f 1(c)= ….. = fm-1(c) = 0 and f m(c) =
0 then we can write f(x) = (x-c)m g(x), where g(c) ≠ 0
1. Direct Methods
Direct methods give the exact values of all the roots in a finite number of
steps.
2. Numerical Methods.
Numerical methods are based on the idea of successive approximations.
Suppose f(x) is a continuous function defined on the interval [a, b], with f (a) and f
(b) of opposite sign. The Intermediate Value Theorem implies that a number c exists in
(a, b) with f (c) = 0. The procedure will also work when there is more than one root in the
interval (a, b) and we will assume for simplicity that the root in this interval is unique.
This method calls for a repeated halving (or bisecting) of subintervals of [a, b] and, at
each step, locating the half containing c.
ADVANTAGE:
▪ A global method: it always converges no matter how far you start from the
actual root.
DISADVANTAGE:
▪ It cannot be used to find roots when the function is tangent is the axis and
does not pass through the axis.
1. Identify two points x = a and x = b such that f (a) and f (b) are having opposite
signs. Let f (a) be negative and f (b) be positive. Then there will be a root of f (x) =
0 in between a and b.
𝒂+𝒃
𝒙𝟏 =
𝟐
Note: The interval width is reduced by a factor of one–half at each step and at
|𝑏−𝑎|
the end of the nth step, the new interval will be [a n, bn] of length . The number
2𝑛
of iterations n required to achieve accuracy ∈ is given by
|𝒃 − 𝒂|
𝐥𝐨𝐠 𝒆
𝒏 ≥ 𝜺
𝐥𝐨𝐠 𝒆 𝟐
EXAMPLE 1.1.
SOLUTION:
STEP 1: Identify two points x = a and x = b such that f (a) and f (b) are having opposite
signs.
➢ To find the interval in which the root lies, use trial and error method
If x = a = 1
f(1) = (1) 3 – 2(1) – 1 = - 2 , f(1) is negative
If x = b = 2
f(2) = (2) 3 – 2(2) – 1 = 3, f(2) is positive
➢ Since f (a) is negative and f (b) is positive. Then there will be a root of f (x) = 0 in
between the interval a and b.
➢ Thus, a root of f(x) = x 3 – 2x – 1 = 0 lies between 1 and 2
STEP 2: Let the first approximation be the midpoint of the interval (a, b) → (1,2)
𝒂+𝒃 𝟏+𝟐
𝒙𝟏 = =
𝟐 𝟐
𝒙𝟏 = 𝟏. 𝟓
STEP 3 : Test or check if f(x1) = 0, then x 1 is a root, otherwise root lies between a and x 1
or x1 and b according as f (x 1) is positive or negative.
Note: if f(x1) = + (a, x1) is the interval for the next approximation
Note: if f(x1) = + ⇒ (a, x1) is the new interval for the next approximation
1.5 + 2
𝑥2 =
2
𝒙𝟐 = 𝟏. 𝟕𝟓
f(𝒙𝟐 ) = 𝟎. 𝟖𝟓𝟗𝟑𝟕𝟓
f(𝒙𝟑 ) = 𝟎. 𝟎𝟒𝟏𝟎𝟐
Since there is no given accuracy, the question is when we are going to stop the
approximation? It is important to analyze the value of f(x) at every corresponding
approximation. In this case, you are going to stop the approximation if the value of
f(𝒙𝒏 ) = 𝟎 or f(𝒙𝒏 ) ≈ 𝟎
In this example, after the seventh (7th) iteration, f(𝒙𝟕 ) is closest to zero.
Therefore, we can conclude that the real root of the given function is
𝒙 = 𝟏. 𝟔𝟏𝟕𝟏𝟖𝟕𝟓
NOTE: The given non linear function is in third degree so it can be solved using your
scientific calculator. You can check this problem if it is approximately equal using your
calculator
EXAMPLE 1.2.
SOLUTION:
STEP 1: Identify two points x = a and x = b such that f (a) and f (b) are having
opposite signs
➢ To find the interval in which the root lies, use trial and error method
If x = a = 1
|𝒃 − 𝒂| |𝟐 − 𝟏|
𝐥𝐨𝐠 𝐥𝐨𝐠
𝒏 ≥ ∈ ≥ 𝟎. 𝟎𝟎𝟏
𝐥𝐨𝐠 𝟐 𝐥𝐨𝐠 𝟐
𝒏 ≥ 𝟗. 𝟗𝟔𝟓𝟕𝟖
STEP 3: Let the first approximation be the midpoint of the interval (a, b) → (1,2)
𝐚+𝐛 𝟏+𝟐
𝐱𝟏 = =
𝟐 𝟐
➢ 𝐱𝟏 = 𝟏. 𝟓
STEP 4: Test or check if f(x 1) = 0, then x1 is a root, otherwise root lies between a and x 1
or x1 and b according as f (x 1) is positive or negative.
1 + 1.5
𝑥2 =
2
𝒙𝟐 = 𝟏. 𝟐𝟓
f(𝒙𝟐 ) = 𝟏. 𝟓𝟔𝟒𝟔𝟗𝟕𝟑
f(𝒙𝟒 ) = 𝟎. 𝟔𝟏𝟔𝟔𝟓𝟑
f(𝒙𝟓 ) = 𝟎. 𝟐𝟑𝟑𝟐𝟔𝟗
➢ Since f(x5) is positive, then the new interval is (1.125, 1.15625)
➢ Then find the sixth approximation
1.125 + 1.15625
𝑥6 =
2
𝒙𝟔 = 𝟏. 𝟏𝟒𝟎𝟔𝟐𝟓
f(𝒙𝟔 ) = 𝟎. 𝟎𝟔𝟏𝟓𝟕𝟕𝟖
➢ Since f(x6) is positive , then the new interval is (1.125, 1.140625)
Then find the seventh approximation
1.125 + 1.140625
𝑥7 =
2
𝒙𝟕 = 𝟏. 𝟏𝟑𝟐𝟖𝟏𝟐𝟓
f(𝒙𝟖 ) = 𝟎. 𝟎𝟐𝟎𝟔𝟏𝟖
➢ Since f(x8) is positive , then the new interval is (1.1328125,1.13671875)
f(𝒙𝟗 ) = 𝟎. 𝟎𝟎𝟎𝟒𝟐𝟔𝟖𝟒
f(𝒙𝟏𝟎 ) = − 𝟎. 𝟎𝟎𝟗𝟓𝟕𝟗𝟗𝟑
The table below shows the summary of results after 10th iteration.
No. of
Approximati 𝒂+𝒃
a b [a,b] 𝒙𝒏 = 𝒃𝒏 - 𝒙𝒏 f(𝒙𝒏 )
on 𝟐
(Iteration)
1 1 2 [1,2] 1.5 0.5 8.890625
2 1 1.5 [1, 1.5] 1.25 0.25 1.5646973
3 1 1.25 [1,1.25] 1.125 0.125 -0.0977135
4 1.125 1.25 [1.125, 1.25] 1.1875 0.0625 0.616653
5 1.125 1.1875 [1.125, 1.1875] 1.15625 0.03125 0.233269
6 1.125 1.15625 [1.125, 1.15625] 1.140625 0.015625 0.0615778
7 1.125 1.140625 [1.125, 1.140625] 1.1328125 0.0078125 −0.0195756
8 1.1328125 1.140625 [.1328125, 1.13671875 0.0039025 0.020618
1.140625]
9 1.1328125 1.13671875 [1.1328125, 1.134765625 0.002021875 0.00042684
1.13671875]
10 1.1328125 1.134765625 [1.1328125, 1.133789063 0.000976562 − 0.00957993
[1.134765625]
In this example, after the tenth (10th) iteration, f(𝒙𝟏𝟎 ) is closest to zero.
Therefore, we can conclude that the largest real root of the given function is
𝒙 = 𝟏. 𝟏𝟑𝟒𝟕𝟔𝟓𝟔𝟐𝟓
Prepared by: s
EE Faculty
References: