Chapter 2: Numerical Solutions of Algebraic and Transcendental equations
1. Introduction
In this chapter, we shall consider the problem of numerical computation of real root of a given
equation f ( x) = 0 , which may be algebraic or trigonometric or transcendental. It will be assumed
that the function f (x) is continuously differentiable sufficient number of times.
All the methods for numerical solution of equations will consist of two stages. The first stage,
called location of root at which rough values of the root are obtained and the second stage which
consists in improvement of rough value of each root to any desired degree of accuracy.
In the second stage, a method of improvement of the rough value of a root will generate a
sequence of successive approximation or iterates {x n n ≥ 0} , starting with initial rough value x0 of
the root α obtained in the first stage, such that xn → α as n → ∞ .
2. Basic concepts and definitions
2.1 Sequence of successive approximations
Let, {xn } be a sequence of successive approximations for a desired root α of the equation
f ( x) = 0 .
The error ε n at the nth iteration is defined by
ε n = α − xn (2.1.1)
And we defined hn by
hn = xn+1 − xn = ε n − ε n+1 , (2.1.2)
1
which may be considered as an approximation of ε n .
The iteration process converges if and only if ε n → 0 as n → ∞ .
2.2 Order of convergence
Definition: If an iterative method converges and two constants p ≥ 1 and C > 0 exists such that
ε n+1
lim =C (2.2.1)
n →∞ ε p
n
Then p is called the order of convergence of the method and C is called asymptotic error
constant.
A sequence of iterates {x n n ≥ 0} is said to converge with order of convergence p ≥ 1 to a root α if
p
ε n +1 ≤ k ε n , n ≥ 0 (2.2.2)
for some k > 0 . If p = 1 , then the sequence of iterates {x n n ≥ 0} is said to be linearly convergent. If
p = 2 , then the iterative method is said to have quadratic convergence.
3. Initial approximation
3.1 Graphical method
In this method, we plot the graph of the curve y = f (x ) on the graph paper; the point at which the
curve crosses the x-axis, gives the root of the equation f ( x ) = 0 , any value in the neighbourhood
of this point may be taken as an initial approximation to the required root.
2
Fig 1 Graph of y = cos x − xe x
Sometimes the equation f ( x) = 0 can be written in the form g ( x) = h( x) where the graphs of
y = g (x) and y = h(x) may be conveniently drawn. In that case the abscissae of the point of
intersection of the two graphs gives the required root of the f ( x ) = 0 and therefore any value in
the neighbourhood of this point can be taken as initial approximation to the required root. Fig.1
cos x
shows the graph of y = cos x − xe x and Fig. 2 shows the graphs of y = x and y = . The abscissae
ex
of the point of intersection of these two graphs give the required root of the f ( x) = 0 .
cos x
Fig 2 Graphs of y = x and y =
ex
3
Another commonly used method is based upon the Intermediate mean value theorem, which
states that
Theorem 1: If f (x) be continuous function in the closed interval [ a, b] and c be any number such
that f (a) ≤ c ≤ f (b) , then there is at least one number α ∈ [a, b] such that f (α ) = c .
3.2 Incremental search method
The incremental search method is a numerical method that is used when it is needed to find an
interval of two values of x where the root is supposed to be existed. The incremental search
method starts with an initial value x0 and a sufficiently small interval ∆x . It is supposed that we
are going to search the location of the root in the x-axis from left to right.
We can find the value of x1 easily with this following equation
x1 = x0 + ∆x
If we convert that equation into an iterative one, we get
xn = xn −1 + ∆x
If f ( xn −1 ) f ( xn ) < 0 , we can assure that there exists a root between the interval [ xn −1, xn ] .
We construct a table of values of f (x) for various values of x and choose a suitable initial
approximation to the root. This method is also known as method of tabulation.
Example 1. In order to obtain an initial approximation to the root of the equation
f ( x) = cos x − xe x = 0 , we prepare a table of values of f (x) for known values of x, we get
x 0 0.5 1 1.5 2
4
f (x) 1 0.0532 -2.1780 -6.6518 -15.1942
From this table we find that the equation f ( x ) = 0 has at least one root in the interval (0.5,1).
Example 2. Find real root of the equation f ( x) = 10 x − x − 4 = 0 correct to 2 significant digits by
the method of tabulation.
Solution:
Let us tabulate the values of f(x) in [0, 1] with step size 0.1.
x f (x )
0 -3
0.1 -2.841
0.2 -2.615
0.3 -2.305
0.4 -1.888
0.5 -1.338
0.6 -0.6189
0.7 0.3119
0.8 1.510
0.9 3.043
1 5
So the root of the given equation lies in (0.6, 0.7). Since, there is only one change of sign
between 0.6 and 0.7, there is only one real root between 0.6 and 0.7.
5
We tabulate again between 0.6 and 0.7 with step length 0.01.
x f (x )
0.6 -0.6189
0.61 -0.5362
0.62 -0.4513
0.63 -0.3642
0.64 -0.2748
0.65 -0.1832
0.66 -0.0891
0.67 0.007351
0.68 0.1063
0.69 0.2078
0.7 0.3119
From the above table we can observe that the root lies between 0.66 and 0.67. Therefore, we may
conclude that the value of the required root is 0.67 correct to two significant figures.
4. Iterative methods
4.1 Method of Bisection
This is the simplest iterative method based on the repeated application of following Bolzano’s
theorem on continuity which is a particular case of Intermediate value theorem.
Theorem 2 (Bolzano’s theorem):
6
If f (x) be continuous in the closed interval [ a, b] and f (a ) , f (b) are of opposite signs, then there
exists a number α ∈ [a, b] such that f (α ) = 0 i.e. there exists a real root α of the equation f ( x ) = 0
. ■
We first find a sufficiently small interval [ a 0 , b0 ] containing α by the method of tabulation or
graphical method such that f (a 0 ) , f (b0 ) are of opposite signs.
Next, we proceed to generate the sequence {xn } of successive approximations as follows:
a 0 + b0
We set x 0 = a 0 or b0 and x1 = and compute f ( x1 ) .
2
Now, if f (a 0 ) , f ( x1 ) are of opposite signs, we set a1 = a0 and b1 = x1 or [ a1 , b1 ] = [a0 , x1 ] .
Otherwise, if f ( x1 ) , f (b0 ) are of opposite signs, we set a1 = x1 and b1 = b0 or [ a1 , b1 ] = [ x1 , b0 ] so
b0 − a 0
that in either case [a1 , b1 ] contains the root α and b1 − a1 = .
2
a1 + b1
We again set x2 = and repeat the above steps and so on.
2
In general, if the interval [ a n , bn ] containing α has been obtained so that f (a n ) f (bn ) < 0 , then we
a n + bn
set xn +1 =
2
If f ( an ) f ( x n+1 ) < 0 , we set an +1 = an , bn+1 = xn+1 .
Otherwise, if f ( x n+1 ) f (bn ) < 0 , we set an+1 = x n+1 , bn+1 = bn .
So in either case [ an+1 , bn+1 ] contains α i.e. f ( an+1 ) f (bn+1 ) < 0
7
bn − a n
Therefore, bn +1 − a n+1 =
2
bn −1 − a n −1
This implies, bn − a n =
2
bn−2 − an−2
=
22
b0 − a0
= (4.1.1)
2n
bn − a n
Since xn = a n or bn , approximation of ε n viz. hn = x n +1 − xn = .
2
Now error at n-th iteration ε n = α − xn ≤ bn − an
Therefore, we have
b0 − a0
ε n ≤ bn − an = (4.1.2)
2n
Consequently, ε n → 0 as n → ∞
Therefore, the iteration of bisection method invariably converges i.e. bisection method converges
unconditionally.
4.1.1 Order of convergence of Bisection method
We know
bn−1 − an−1 bn−2 − an− 2 b −a
bn − an = = 2
= ... = 0 n 0
2 2 2
8
Therefore,
b0 − a0
ε n = α − xn ≤ bn − an ≤ (4.1.1.1)
2n
This implies
b0 − a0
ε n −1 ≤
2n −1
Therefore,
ε n +1 1
≅ (4.1.1.2)
εn 2
Hence, the order of convergence for bisection method is 1.
Example 3:
Find the real root of the equation x log10 x − 1.2 = 0 correct to five significant figures using method
of bisection.
Solution:
We first apply method of tabulation in order to find the location of rough value of the root.
Table 1: location of the root
x f (x )
1 -1.2
2 -0.6
3 0.23
9
We note that f(2)<0 and f(3)>0. Thus the given equation changes its sign within the interval [2,
3]. Therefore, there exists at least one real root of the equation within [2, 3].
a n + bn
Now, for the bisection method, we compute xn+1 = .
2
If f (a n ) f ( xn+1 ) < 0 , then the root lies between [an , xn +1] i.e. we set an +1 = an and bn +1 = xn +1 .
Otherwise, if f ( xn+1 ) f (bn ) < 0 , then the root lies between [ xn+1 , bn ] i.e. we set an +1 = xn +1 and
bn +1 = bn . The successive iterations have been presented in Table 2.
Table 2: Table for finding real root
10
n an bn f (an ) f (bn ) a n + bn f (x n +1 )
xn+1 =
2
0 2 3 -0.59794 0.231364 2.5 -0.20515
1 2.5 3 -0.20515 0.231364 2.75 0.00816491
2 2.5 2.75 -0.20515 0.00816491 2.625 -0.0997856
3 2.625 2.75 -0.0997856 0.00816491 2.6875 -0.046126
4 2.6875 2.75 -0.046126 0.00816491 2.718750 -0.0190585
5 2.71875 2.75 -0.0190585 0.00816491 2.734375 -0.0054662
6 2.734375 2.75 -0.0054662 0.00816491 2.742188 0.00134452
7 2.734375 2.742188 -0.0054662 0.00134452 2.738281 -0.00206205
8 2.738281 2.742188 -0.00206205 0.00134452 2.740234 -0.000359068
9 2.740234 2.742188 -0.000359068 0.00134452 2.741211 0.00049265
10 2.740234 2.741211 -0.000359068 0.00049265 2.740723 0.0000667723
11 2.740234 2.740723 -0.000359068 0.0000667723 2.740479 -0.000146153
12 2.740479 2.740723 -0.000146153 0.0000667723 2.740601 -0.0000396913
13 2.740601 2.740723 -0.0000396913 0.0000667723 2.740662 0.0000135402
14 2.740601 2.740662 -0.0000396913 0.0000135402 2.740631 -0.0000130756
At the 14th step, the root lies between 2.740662 and 2.740631. Hence, the required real root is
2.7406 correct to five significant figures.
4.1.2 Advantage and disadvantage of bisection method
• Advantage
11
The bisection method is very simple because the iteration in each stage does not depend on the
function values f ( xn ) but only on their signs. Also the convergence of the method is
unconditional. This method converges invariably, so it is surely convergent.
• Disadvantage
The method is very slow since it converges linearly. Consequently, it requires a large number of
iteration to obtain moderate result upto certain degree of accuracy and thus this method is very
laborious.
4.1.3 Algorithm for Bisection method
Step 1: Start the program.
Step 2: Define the function f (x) .
Step 3: Enter the interval [a, b] in which the root lies.
Step 4: If f (a ) f (b ) < 0 . Then go to step 5 else step 9.
a+b
Step 5: Calculate x = .
2
Step 6: If f (a ) f ( x) < 0 , set b = x , otherwise if f ( x) f (b) < 0 set a = x .
Step 7: If a − b < ε , ε being the prescribed accuracy then go to step 8 else 5.
Step 8: Print the value of x which is required root.
Step 9: Stop the program. □
12