36
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
fa
()
fb
()
a
x
2
y f x
=()
x
3
x
1
b
X
Y
FIG. 2.1
Then, we bisect the interval and continue the process till the root is found to be desired
accuracy. In the above figure, f(x
1
) is positive; therefore, the root lies in between a and x
1
. The
second approximation to the root now is x
2
=
1
2
(a + x
1
). If f (x
2
) is negative as shown in the figure
then the root lies in between x
2
and x
1
, and the third approximation to the root is x
3
=(x
2
+ x
1
)/2
and so on.
This method is simple but slowly convergent. It is also called as Bolzano method or Interval
halving method.
2.4.1 Procedure for the Bisection Method to Find the Root of the Equation
f
(
x
) = 0
Step 1: Choose two initial guess values (approximation) a and b (where (a > b)) such that
f(a) . f(b) < 0.
Step 2: Evaluate the mid point x
1
of a and b given by x
1
=
1
2
(a + b) and also evaluate
f(x
1
).
Step 3: If f(a) . f(x
1
) < 0, then set b = x
1
else set a = x
1
. Then apply the formula of step 2.
Step 4: Stop evaluation when the difference of two successive values of x
1
obtained from
step 2, is numerically less than the prescribed accuracy.
2.4.2 Order of Convergence of Bisection Method
In Bisection Method, the original interval is divided into half interval in each iteration. If we take
mid points of successive intervals to be the approximations of the root, one half of the current
interval is the upper bound to the error.
In Bisection Method, e
i + 1
= 0.5e
i
or
1
0.5
i
i
e
e
+
=
ALGEBRAIC AND TRANSCENDENTAL EQUATION
37
Here e
i
and e
i + 1
are the errors in i
th
and (i + 1)
th
iterations respectively. Comparing the above
equation with
1
lim
i
k
i
i
e
A
e
+
→∞
≤
We get k = 1 and A = 0.5. Thus the Bisection Method is first order convergent or linearly
convergent.
Example 1. Find the root of the equation x
3
– x – 1 = 0 lying between 1 and 2 by bisection method.
Sol. Let f(x)= x
3
– x – 1 = 0
Since f(1) = 1
3
– 1 – 1 = – 1, which is negative
and f (2) = 2
3
– 2 – 1 = 5, which is positive
Therefore, f(1) is negative and f(2) is positive, so at least one real root will lie between
1 and 2.
First iteration: Now using Bisection Method, we can take first approximation
1
12
3
1.5
22
x
+
===
Then, f(1.5) = (1.5)
3
– 1.5 – 1
= 3. 375 – 1.5 – 1 = 0.875
∴
f (1.5) > 0 that is, positive
So root will now lie between 1 and 1.5.
Second iteration: The Second approximation is given by
+
===
2
11.5
2.5
1.25
22
x
.
Then, f(1.25) = (1.25)
3
– 1.25 – 1
= 1.953 – 2.25 = – 0.297 < 0
∴
f (1.25) is negative.
Therefore, f(1.5) is positive and f(1.25) is negative, so that root will lie between 1.25 and 1.5.
Third iteration: The third approximation is given by
3
1.25 1.5
1.375
2
x
+
==
x
3
= 1.375
Now f(1.375) = (1.375)
3
– 1.375 – 1
f(1.375) = 0.2246
∴
f(1.375) is positive.
∴
The required root lies between 1.25 and 1.375.
Fourth iteration: The fourth approximation is given by
4
1.25 1.375
1.313
2
x
+
==
Now f(1.313) = (1.313)
3
– 1.313 – 1
f(1.313) = – 0.0494
38
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
Therefore, f(1.313) is negative and f(1.375) is positive. Thus root lies between 1.313 and
1.375.
Fifth iteration: The fifth approximation is given by
5
1.313 1.375
1.344
2
x
+
==
∴
f(1.344) = (1.344)
3
– 1.344 – 1 = 0.0837
∴
f(1.313) > 0
∴
f(1.313) is negative and f(1.344) is positive, so root lies between 1.313 and 1.344.
Sixth iteration: The sixth approximation is given by
6
1.313 1.344
1.329
2
x
+
==
∴
f(1.329) = (1.329)
3
– 1.329 – 1 = 0.0183
∴
f(1.329) > 0
∴
f(1.313) is negative and f(1.329) is positive, so that the required root lies between 1.313 and
1.329.
Seventh iteration: The seventh approximation is given by
7
1.313 1.329
1.321
2
x
+
==
∴
f(1.321) = (1.321)
3
– 1.321 – 1 = – 0.0158
∴
f(1.321) < 0
∴
f(1.321) is negative and f(1.329) is positive, so that the required root lies between 1.321 and
1.329.
Eighth iteration: The eighth approximation is given by
8
1.321 1.329
1.325
2
x
+
==
From above iterations, the root of
3
() 1 0
fx x x=−−=
up to three places of decimals is 1.325,
which is of desired accuracy.
Example 2. Find the root of the equation x
3
– x – 4 = 0 between 1 and 2 to three places of decimal
by Bisection method.
Sol. Given
3
()
4
fx x x=−−
We want to find the root lie between 1 and 2.
At
0
1
x
=
⇒
3
0
()(1) 14 4
=−−=−fx
negative
At
1
2
x
=
⇒
3
1
()(2) 24
2
fx =−−=
positive
This implies that root lies between 1 and 2.
First iteration: Here,
+
== ===
01 2
12 3
1, 2, 1.5
22
xx x
Now, =− =
01
() 4,()2
fx fx
. Then,
=−−=−
3
2
( ) (1.5) 1.5 4 2.125
fx
.
ALGEBRAIC AND TRANSCENDENTAL EQUATION
39
Since f(1.5) is negative and f(2) is positive.
So root will now lie between 1.5 and 2.
Second iteration: Here,
012
1.5 2
1.5, 2, 1.
75
2
x
xx
+
====
Also, =− =
01
( ) 2.125, ( ) 2
fx fx
then,
=−−=−
3
2
( ) (1.75) 1.75 4 0.39062
fx
Since f(1.75) is negative and f(2) is positive, therefore the root lies between 1.75 and 2.
Third iteration: Here,
+
====
012
1.75 2
1.75, 2, 1.875
2
xxx
Also, =− =
01
( ) 0.39062, ( ) 2
fx fx
then,
=−−=
3
2
( ) (1.875) 1.875 4 0.71679
fx
Since f(1.75) is negative and f(1.875) is positive, therefore the root lies between 1.75 and
1.875.
Fourth iteration: Here,
01 2
1.75 1.875
1.75, 1.875, 1.8125
2
xx x
+
== = =
Also, =− =
01
( ) 0.39062, ( ) 0.71679
fx fx
then,
=−−=
3
2
( ) (1.8125) 1.8125 4 0.14184
fx
Since f(1.75) is negative and f(1.8125) is positive, therefore the root lies between 1.75 and
1.8125.
Fifth iteration: Here,
01 2
1.75 1.8125
1.75, 1.8125, 1.78125
2
xx x
+
== = =
Also, =− =
01
( ) 0.39062, ( ) 0.14184
fx fx
then,
=−−=−
3
2
( ) (1.78125) 1.78125 4 0.12960
fx
Since f(1.78125) is negative and f(1.8125) is positive, therefore the root lies between 1.78125
and 1.8125.
Repeating the process, the successive approximations are
x
6
= 1.79687, x
7
= 1.78906, x
8
= 1.79296, x
9
= 1.79491, x
10
= 1.79589, x
11
= 1.79638, x
12
= 1.79613
From the above discussion, the value of the root to three decimal places is 1.796.
Example 3. Using Bisection Method determine a real root of the equation
3
() 8 2 1 0.
fx x x=−−=
Sol. It is given that
3
() 8 2 1 0
fx x x=−−=
.
Then
3
(0) 8(0) 2(0) 1 1
f =−−=−
and
3
(1) 8(1) 2(1) 1 5
f =−−=
Therefore, f(0) is negative and f(1) is positive so that the root lies between 0 and 1.
First approximation: First approximation to the root is given by
1
01
0.5
2
x
+
==
∴
3
(0.5) 8(0.5) 2(0.5) 1 1
f =−−=−
, which is negative.
Thus f(0.5) is negative and f(1) is positive. Then the root lies between 0.5 and 1.
40
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
Second approximation: The second approximation to the root is given by
2
0.5 1
0.75
2
x
+
==
∴
3
(0.75) 8(0.75) 2(0.75) 1
f =−−
= 2.265 – 2.5 = 0.875, which is positive.
Since f(0.5) is negative, while f(0.75) is positive. Therefore, the root lies between 0.5 and 0.75.
Third approximation: The third approximation to the root is given by
3
0.5 0.75
0.625
2
x
+
==
∴
3
(0.625) 8(0.625) 2(0.625) 1
f =−−
=1.935 – 2.25 = – 0.297, which is negative.
Therefore f(0.75) is positive, while f(0.625) is obtained negative. Therefore, the root lies
between 0.625 and 0.75.
Fourth approximation: The fourth approximation to the root is given by
+
==
4
0.625 0.75
0.688
2
x
∴
3
(0.688) 8(0.688) 2(0.688) 1
f =−−
= 2.605 – 2.376 = 0.229, which is positive
Therefore f(0.688) is obtained positive, while f(0.625) is negative. Therefore, the root lies
between 0.625 and 0.688.
Fifth approximation: The fifth approximation to the root is given by
x
5
=
0.625 0.688
2
+
= 0.657
∴ f(0.673) = 8(0.657)
3
– 2(0.673) – 1
= 2.269 – 2.314 = – 0.045, which is negative.
Therefore f(0.657) is negative and f(0.688) is positive so the root lies between 0.657 and
0.688.
Sixth approximation: The sixth approximation to the root is given by
6
0.657 0.688
0.673
2
x
+
==
∴
3
(0.673) 8(0.673) 2(0.673) 1
f =−−
=
2.439 2.346 1.093,−=
which is positive.
Therefore f (0.673) is positive and f(0.657) is negative so the root lies between 0.657 and
0.673.
ALGEBRAIC AND TRANSCENDENTAL EQUATION
41
Seventh approximation: The seventh approximation to the root is given by
7
0.657 0.673
0.665
2
x
+
==
∴
=−−
3
(0.665) 8(0.665) 2(0.665) 1
f
= 2.353 – 2.33 = 0.023, which is positive.
Therefore f(0.665) is positive and f(0.657) is negative so that the root lies between 0.657
and 0.665.
Eighth approximation: The eighth approximation to the root is given by
8
0.657 0.665
0.661
2
x
+
==
From last two approximations, i.e.,
7
0.6
65
x
= and
8
0.6
61
x
= it is observed that the
approximate value of the root of f(x) = 0 up to two decimal places is 0.66.
Example 4. Perform five interactions of Bisection method to obtain the smallest positive root of
equation
3
() 5 1
0
fx x x=−+=
.
Sol. Let f(2.1) = –ve, f(2.15) = +ve.
Therefore the root lies between 2.1 and 2.15.
First approximation to the root is
1
2.1 2.15
2.1
25
2
x
+
==
Now,
(2.125) vef =−
Therefore the root lies between 2.215 and 2.15.
Second approximation to the root is
2
2.125 2.15
2.1375
2
x
+
==
Now,
(2.1375) vef =+
Therefore the root lies between 2.125 and 2.1375.
Third approximation to the root is
3
2.125 2.1375
2.13125
2
x
+
==
Now,
(2.13125) vef =+
Therefore the root lies between 2.125 and 2.13125.
Fourth approximation to the root is
4
2.125 2.13125
2.1281
2
x
+
==
Now,
(2.1281) vef =−
42
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
Therefore the root lies between 2.1281 and 2.13125.
Fifth approximation to the root is
5
2.1281 2.13125
2.1
29
2
x
+
==
Hence the required root is 2.129.
Example 5. Find the real root of equation =
10
xlog x 1.2
by Bisection Method.
Sol. Let
=−=
10
() log 1.2 0
fx x x
So that
=−=−<
10
(1) 1 log 1 1.2 1.2 0
f
and =−=−
10
(2) 2log 2 1.2 0.602 1.2
f
=− <0.598 0
and =−
10
(3) 3log 3 1.2
f
=−=>3(0.4771) 1.2 0.2313 0
Thus f (2) is negative and f (3) is positive, therefore, the root will lie between 2 and 3.
First approximation: The first approximation to the root is
1
23
2.5
2
x
+
==
Again,
10
(2.5) 2.5log 2.5 1.2
f =−
= 2.5 (0.3979) – 1.2 = 0.9948 – 1.2 = – 0.2052 < 0
Thus, f (2.5) is negative and f (3) is positive, therefore, the root lies between 2.5 and 3.
Second Approximation: The second approximation to the root is
2
2.5 3
2.75
2
x
+
==
Now,
10
(2.75) 2.75 log 2.75 1.2
f =−
=−=−=>2.75(0.4393) 1.2 1.2081 1.2 0.0081 0
Thus, f (2.75) is positive and f (2.5) is negative, therefore, the root lies between 2.5 and 2.75.
Third approximation: The third approximation to the root is
3
2.5 2.75
2.625
2
x
+
==
Again,
10
( 2.625) 2.625log 2.625 1
.2
f =−
=−=−=−<2.625(0.4191) 1.2 1.1001 1.2 0.0999 0
Thus, f(2.625) is found to be negative and f(2.75) is positive, therefore, the root lies between
2.625 and 2.75.
Fourth approximation: The fourth approximation to the root is
4
2.625 2.75
2.6875
2
x
+
==
Again, f(2.6875) = 2.6875 log
10
2.6875 – 1.2
= 2.6875(0.4293) – 1.2 = 1.1537 – 1.2 = – 0.0463 < 0
ALGEBRAIC AND TRANSCENDENTAL EQUATION
43
Thus, f(2.6875) is negative and f(2.75) is positive, therefore, the root lies between 2.6875 and
2.75.
Fifth approximation: The fifth approximation to the root is
5
2.6875 2.75
2.7188
2
x
+
==
Now, f(2.7188) = 2.7188 log
10
2.7188 – 1.2
= 2.7188 (0.4344) – 1.2 = 0.1810 – 1.2 = – 0.019 < 0
Thus, f(2.7188) is negative and f(2.75) is positive, therefore, the root lies between 2.7188 and
2.75
Sixth approximation: The sixth approximation to the root is
6
2.7188 2.75
2.7344
2
x
+
==
Again, f(2.734) = 2.734 log
10
2.734 – 1.2
= 2.734 (0.4368) – 1.2 = 1.1942 – 1.2 = – 0.0058 < 0
Thus, f(2.734) is negative and f(2.75) is positive, therefore, the root lies between 2.734 and
2.75
Seventh approximation: The seventh approximation to the root is
7
2.734 2.75
2.742
2
x
+
==
Again, f(2.742) = 2.742 log
10
2.742 – 1.2
= 2.742 (0.4381) – 1.2 = 1.2012 – 1.2 = 0.0012 > 0
Thus, f(2.742) is positive and f(2.734) is negative, therefore, the root lies between 2.734 and
2.742.
Eighth approximation: The eighth approximation to the root is
8
2.734 2.742
2.738
2
x
+
==
Hence, from the approximate value of the roots x
7
and x
8
, we observed that, up to two
places of decimal, the root is 2.74 approximately.
Example 6. Using Bisection Method, find the real root of the equation f(x) = 3x –
1sinx 0+=
Sol. The given equation
f(x)= 3x –
1sin 0x+=
is a transcendental equation.
Given f(x)= 3x –
1sin 0x+=
(1)
Then f(0) = 0 –
1sin0
1
+=−
and f(1) = 3 –
1sin13 1.84
14
+=−
= 3 – 1.3570 = 1.643 > 0
Thus f(0) is negative and f(1) is positive, therefore, a root lies between 0 and 1.
44
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
First approximation: The first approximation to the root is given by
1
01
0.5
2
x
+
==
Now, f(0.5) = 3(0.5) –
()
1sin0.5
+
= 1.5 –
1.4794
= 1.5 – 1.2163 = 0.2837 > 0
Thus, f(0.5) is positive, while f(0) is negative, therefore, a root lies between 0 and 0.5.
Second approximation: The second approximation to the root is given by
2
00.5
0.25
2
x
+
==
Again, f(0.25) = 3(0.25) –
()
1 sin 0.25
+
= 0.75 –
1.2474
= 0.75 – 1.1169 = – 0.3669 < 0
Thus, f(0.25) is obtained to be negative and f (0.5) is positive; therefore, a root lies between
0.25 and 0.5.
Third approximation: The third approximation to the root is given by
3
0.25 0.5
0.375
2
x
+
==
Now, f(0.375) = 3(0.375) –
()
1sin0.375
+
= 1.125 –
1.3663
= 1.125 – 1.1689 = – 0.0439 < 0
Thus, f(0.375) is negative and f(0.5) is positive, therefore, a root lies between 0.375 and 0.5.
Fourth approximation: The fourth approximation to the root is given by
4
0.375 0.5
0.4375
2
x
+
==
Now, f (0.4375) = 3(0.4375) –
()
1 sin 0.4375
+
= 1.3125 –
1.4237
= 1.3125 – 1.1932 = 0.1193 > 0
Thus, f(0.4375) is positive, while f(0.375) is negative, therefore, a root lies between 0.375 and
0.4375.
Fifth approximation: The fifth approximation to the root is given by
5
0.375 0.4375
0.4063
2
x
+
==
Again, f(0.4063) = 3(0.4063) –
()
1 sin 0.4063
+
= 1.2189 –
1.3952
= 1.2189 – 1.1812 – 0.0377 > 0
Thus, f(0.4063) is positive, while f(0.375) is negative, therefore, a root lies between 0.375 and
0.4063.
ALGEBRAIC AND TRANSCENDENTAL EQUATION
45
Sixth approximation: The sixth approximation to the root is given by
6
0.375 0.4063
0.39
07
2
x
+
==
Again, f(0.3907) = 3(0.3907) –
()
1 sin 0.390
7
+
= 1.1721 –
1.380
8
= 1.1721 – 1.1751 = – 0.003 < 0
Thus, f (0.3907) is negative, while f (0.4063) is positive, therefore, a root lies between 0.3907
and 0.4063.
Seventh approximation: The seventh approximation to the root is given by
7
0.3907 0.4063
0.3985
2
x
+
==
From the last two observations, that is, x
6
= 0.3907 and x
7
= 0.3985, the approximate value
of the root up to two places of decimal is given by 0.39. Hence the root is 0.39 approximately.
Example 7. Find a root of the equation f(x) = x
3
– 4x – 9 = 0, using the Bisection method in four
stages.
Sol. Given f(x) = x
3
– 4x – 9 = 0
Then f(2) = 2
3
– 4(2) – 9 = – 9
and f(3) = (3)
3
– 4 (3) – 9 = 6
Therefore, the root lies between 2 and 3.
First approximation: First approximation to the root is given by
1
23
2.5
2
x
+
==
Thus f(2.5) = (2.5)
3
– 4(2.5) – 9
= 15.625 – 19 = – 3.375
Therefore, the root lies between 2.5 and 3.
Second approximation: Second approximation to the root is given by
2
2.5 3
2.75
2
x
+
==
Thus f(2.75) = (2.75)
3
– 4 (2.75) – 9
= 20.797 – 20 = 0.797
Therefore, f(2.75) is positive and f(2.5) is negative. Thus the root lies between 2.5 and 2.75.
Third approximation: Third approximation to the root is given by
3
2.5 2.75
2.625
2
x
+
==
Now, f(2.625) = (2.625)
3
– 4 (2.625) – 9
= 18.088 – 19.5 = – 1.412
Therefore, f(2.625) is negative while f(2.75) is positive. Thus the root lies between 2.625 and
2.75.
Fourth approximation: Fourth approximation to the root is given by
4
2.625 2.75
2.6875
2
x
+
==
Hence, after the four steps the root is 2.6875 approximately.