Professional Documents
Culture Documents
Equations
Learning Objectives:
f (x) = 0 (1)
A root of this equation is also called a zero of the function. For example, the the two roots of a quadratic
equation of the form
ax2 + bx + c = 0 (2)
are given by √
−b ± b2 − 4ac
x= , (3)
2a
√
where a, b, c are real numbers. The quatitity b2 − 4ac is called the discriminant and is denoted by D.
The value of D determines the nature of root of the equation (2).
• If D = 0, then both the two roots are real and equal (repeated roots).
Although the quadratic equation (2) can be solved exactly there exist many functions for which the exact
solution does not exist. For an instance the function
cannot be solved analytically. For the solutions of those functions one has to resort to the approximate
numerical methods (called iterative methods) which provides an efficient means to obtain the answer.
Generically, an approximate solution of a function f (x) having any form can be obtained using the
iterative method. Hence based on the above two cases, there are two methods that can be used to find the
roots of the equation (1).
1. Direct methods: These methods provide the exact value of the roots without any round-off error)
in a finite number of steps. All the roots can be determined at the same time using these methods.
2. Iterative methods: Iterative methods, also known as trial and error, are based on the idea of
succesive approximations. These methods provide an approximate value of the roots. They start
with one or more initial approximations and obtain a sequence of approximations by repeating a
fixed sequence of steps till the result within a prescribed tolerance (or accuracy) is obtained.
In this chapter, numerical methods for finding the roots nonlinear equations using the methods of itera-
tions will be discussed.
3
where n is the order of the polynomial and ai ’s are constants (i = 0, 1, . . . , n) and are called the
coefficients of the polynomial.
Broadly, these two classes of equations fall into the category of nonlineear equations, since the functions
belonging to either of these classes are nonlinear in x. This chapter focusses on finding the roots of non-
linear equations applying the rules of numerical techniques. Numerical techniques for solving nonlinear
equations in one variable through iterative methods can be broadly classified into categories:
(i) Bracketing methods. Examples include the bisection method and the regula-falsi method.
(ii) open interval methods. Examples include Newton raphson method and the secant method.
In bracketing methods, two initial guesses for the roots are required which must bracket the root, i.e, they
should be on either side of the root. After each and every iteration, the width of the bracket which include
the root is reduced until it approximates the correct answer. The bracketing method usually guarantees
the convergence if the specified bracket contains the root. Brackting methods provide reliable soltions but
converge slowly. But in numerical computation, faster methods of convergence are ususllay preferred.
Open interval methods yield faster rate of converegence which explains their popularity. Nontheless,
open interval methods do not always guarantee a solution.
xk+1 = φ(xk ), k = 0, 1, 2 . . . .
will be a root of of f (x) = 0. Figure 3 shows the working of the fixed point iteration method.
5
Solution 1. The following theorem gives us a sufficient condition on φ(x) which ensures the convergence
of the sequence xk .
Theorem (1) (Fixed-Point Iteration Theorem). Let f (x) be written in the form
x = φ(x).
1. For all x in [a, b], φ(x) ∈ [a, b]; that is φ(x) takes every value between a and b.
′ ′
2. φ (x) exists on (a, b) with the property that there exists a positive constant r < 1 such that |φ (x)| ≤
r, for all x in (a, b).
Then
xk+1 = φ(xk ), k = 0, 1, 2 . . . .
converges to the fixed point x = p; that is to the root p of f (x) = 0. The proof of this Theorem
requires Mean Value Theorem of calculus:
Let f (x) be a continuous function in [a, b], and be differentiable on (a, b). Then there is number
c ∈ (a, b) such that
′ f (b) − f (a)
f (c) = .
b−a
6
Thus, we have
Therefore, by the Intermediate Value Theorem to f (x) in [a, b], we conclude that there is a root
of f (x) in [a, b]. This proves the existence.
Uniqueness (by contradiction):
To prove uniqueness, let us suppose that p1 and p2 are two fixed points in [a, b], and p1 6= p2 . Now,
let us apply the MVT to φ(x). We can find a number c in (p1 , p2 ) such that
′ φ(p2 ) − φ(p1 )
φ (c) = .
p2 − p1
Since φ(p1 ) = p1 , and φ(p2 ) = p2 , we have
′ p2 − p1
φ (c) = .
p2 − p1
′
That is φ (c) = 1, which is a contradiction to our assumption 2. Thus, p1 cannot be different from
p2 . Therefore, p1 = p2 .
Convergence:
Let p be the root of f (x) = 0. Then the absolute error at step (k + 1) is given by
ek+1 = |p − xk+1 |.
lim ek+1 = 0.
k→∞
That is
′ p − xk+1
φ (c) = (note that φ(p) = p and xk+1 = φ(x))
p − xk
Taking absolute values on both sides, we have
′ |p − xk+1|
|φ (c)| =
|p − xk |
or
′ ek+1
|φ (c)| =
ek
′
Since φ (c) ≤ r, we have ek+1 ≤ rek . Similarly, we have
ek ≤ rek−1 .
Thus, ek+1 ≤ r 2 ek−1 . Continuing in this way, we finally have ek+1 ≤ r k+1 e0 , where e0 is the
initial error (That is, e0 = |x0 − p|).
Since r < 1, we have r k+1 → 0 as k → ∞. Thus,
≤ lim r k+1e0
k→∞
=0.
This proves that the sequence xk converges to x = p and x = p is the only fixed point of φ(x).
Algorithm 1. The algorithm for the fixed point iteration is given below
Given f (x) = 0, ǫ and an initial point x0 ;
Given max=maximum number of iterations;
′
Find a suitable equation x = φ(x) from f (x) = 0 where −1 ≤ φ (x) ≤ 1;
For i = 0 to max
Compute xi+1 = φ(xi );
If |xi+1 − xi | < ǫ;
Solution=xi+1 ;
Stop the iterations;
Endif
Endfor
Example 2. Find the root of f (x) = x3 − x2 − 2 using the fixed-point iteration method, given the initial
value of x0 = 1 with iterations until |xi+1 − xi | < ǫ where, ǫ = 0.005.
8
Solution 2. Setting f (x) = 0 suggests several representations in the form of x = φ(x), including
p
x = ± (x3 − 2), x = x22−x and x = (x2 + 2)1/3 . The first two functions are not suitable as they are not
defined at x0 = 1.
′ 2x
Obviously φ(x) = (x2 + 2)1/3 is a good choice as φ (x) = 3(x2 +2) 2/3 is a monotonically increasing
function with values between 0 and 1. Hence xi+1 = φ(xi ) = (xi + 2)1/3 is a suitable choice here.
2
′
For i = 0, x1 = (x0 2 + 2)1/3 = (12 + 2)1/3 = 1.442250, with φ (x0 ) = 0.320500. The error is
|x1 − x0 | = |1.442250 − 1.000| = 0.442250 > ǫ.
′
For i = 1, x2 = (x1 2 + 2)1/3 = (1.4422502 + 2)1/3 = 1.597925, with φ (x1 ) = 0.376562. The error
is |x2 − x1 | = |1.597925 − 1.442250| = 0.155675 > ǫ.
Therefore, the process continues with the next iteration. The iterations stop at i = 5, where |x6 −x5 | =
0.003568 < ǫ. The final solution is x⋆ = x6 = 1.693311 . Table 27 shows the complete results from this
method.
Example 3. Find a real root of the following equation correct to three decimal places using the fixed
point iteration method:
cos x = 3x − 1.
where
1
φ(x) = (cos x + 1)
3
sin(x)
⇒ φ′ (x) = −
3
′
⇒ |φ (x)| ≤1.
Therefore, the fixed point interation method can be applied. Let us take the first approximation as x0 = 1.
Then the successive approximations of the root can be obtained as follows:
1
x1 =φ(x0 ) = [cos(1) + 1] = 0.51343
3
1
x2 =φ(x1 ) = [cos(0.51343) + 1] = 0.62369
3
1
x3 =φ(x2 ) = [cos(0.62369) + 1] = 0.60391
3
1
x4 =φ(x3 ) = [cos(0.60391) + 1] = 0.60771
3
1
x5 =φ(x4 ) = [cos(0.60771) + 1] = 0.60699
3
1
x6 =φ(x5 ) = [cos(0.60699) + 1] = 0.60712
3
In the fifth and the sixth iterations, the successive approximations of the roots are obtained as 0.60699
and 0.60712, respectively. Therefore, the required root of the equation correct to three decimal places is
0.607. Table 2 shows the complete results from this method.
Example 4. Find a real root of the following equation correct to two decimal places using the fixed point
iteration method:
xex = 1.
10
x =e−x
⇒ x =φ(x),
where
φ(x) =e−x
⇒ φ′ (x) = − e−x
⇒ |φ′ (x)| <1, ∀x < 1.
Therefore, the fixed point interation method can be applied. Let us take the first approximation as x0 =
0.5. Then the successive approximations of the root can be obtained as follows:
In the sixth and the seventh iterations, the successive approximations of the roots are obtained as 0.56486
and 0.56844, respectively. Therefore, the required root of the equation correct to three decimal places is
0.56. Table 4 shows the complete results from this method.
Example 5. Find a real root of the following equation correct to three decimal places using the fixed
point iteration method:
2x − log10 x − 7 = 0.
where
1
φ(x) = (log10 x + 7)
2
log e
⇒ φ′ (x) = 10
2x
′
⇒ |φ (x)| <1, ∀x < 1.
Therefore, the fixed point interation method can be applied. Let us take the first approximation as x0 = 1.
Then the successive approximations of the root can be obtained as follows:
1
x1 =φ(x0 ) = [log10 (1.00000) + 7] = 3.50000
2
1
x2 =φ(x1 ) = [log10 (3.50000) + 7] = 3.77203
2
1
x3 =φ(x2 ) = [log10 (3.77203) + 7] = 3.78829
2
1
x4 =φ(x3 ) = [log10 (3.78829) + 7] = 3.78922
2
1
x5 =φ(x4 ) = [log10 (3.78922) + 7] = 3.78927
2
In the fourth and the fifth iterations, the successive approximations of the roots are obtained as 3.78922
and 3.78927, respectively. Therefore, the required root of the equation correct to three decimal places is
3.789. Table 4 shows the complete results from this method.
Example 6. Find a real root of the follwing equation correctto three decimaal places:
sin x = 5x − 2.
Solution 6. Let us first express the given equation in the form x = φ(x) and then find out which of this
form will give a convergent solution of the given equation.
12
FormI :
sin x =5x − 2
⇒ x = sin−1 (5x − 2)
⇒ x = φ(x),
where
φ(x) = sin−1 (5x − 2)
5
⇒ φ′ (x) = p .
1 − (5x − 2)2
Now, |φ′ (x)| > 1 ∀x for which
(5x − 2)2 < 1
3
⇒x<
5
⇒ x < 0.6
Thus the method will not give a convergent solution.
FormII :
sin x =5x − 2
1
⇒ x = (sin x + 2)
5
⇒ x =φ(x),
where
1
φ(x) = (sin x + 2)
5
1
⇒ φ′ (x) = cos x
5
1
⇒ |φ′ (x) ≤ < 1, ∀x ∵ | cos x| ≤ 1.
5
13
Therefore, we find that the φ(x) obtained from Form II will give a convergent solution. Therefore,
we choose φ(x) = 15 (sin x + 2). Let us take the first approximation as x0 = 1. Then the successive
approximations of the root can be obtained as follows:
1
x1 =φ(x0 ) = [sin (1.00000) + 2] = 0.56829
5
1
x2 =φ(x1 ) = [sin (0.56829) + 2] = 0.50764
5
1
x3 =φ(x2 ) = [sin (0.50764) + 2] = 0.49722
5
1
x4 =φ(x3 ) = [sin (0.49722) + 2] = 0.49540
5
1
x5 =φ(x4 ) = [sin (0.49540) + 2] = 0.49508
5
In the fourth and the fifth iterations, the successive approximations of the roots are obtained as 0.49540
and 0.49508, respectively. Therefore, the required root of the equation correct to three decimal places is
0.495. Table 5 shows the complete results from this method.
//C++ program to find root by fixed point iteration method using for loop
//Written by Dr. Sukanta Deb, ANDC, University of Delhi
#include < iostream >
#include < cmath >
#include < iomanip >
#define iter 30
using namespace std;
double f(double x)
{double p, d;
d = pow(x, 2.0) + 2;
p = pow(d, 1./3);
14
return p;
}
double g(double x)
{
double r, s;
s = pow(x, 2.0) + 2;
r = (2 ∗ x)/(3 ∗ pow(s, 2./3));
return r;
}
int main()
{
int i, n;
double t, x = 1.0;
double eps = 0.005;
cout.precision(6);
cout.setf(ios :: fixed);
for(i = 0; i < iter; i + +)
{
t = x;
x = f(x);
if(fabs(x − t) < eps)
break;
}
cout << ”The solution is : ” << endl;
cout << setw(10) << x;
cout << endl;
return 0;
}
The same program is implemented below using the do-while loop.
//C++ program to find root by fixed point iteration method using do-while loop
//Written by Dr. Sukanta Deb, ANDC, University of Delhi
#include < iostream >
#include < cmath >
#include < iomanip >
using namespace std;
double f(double x)
{
double p, d;
15
d = pow(x, 2.0) + 2;
p = pow(d, 1./3);
return p;
}
int main()
{
double t, x = 1.0;
double eps = 0.005;
cout.precision(6);
cout.setf(ios :: fixed);
do
{
t = x;
x = f(x);
}while(fabs(t − x) > eps);
cout << ”x = ” << x;
cout << endl;
return 0;
}
Theorem (2) (Intermediate Mean-Value Theorem). Let f (x) be continuous on [a, b] and let k be any
number between f (a) and f (b). Then there exists a number x ∈ [a, b] such that k = f (x).
Theorem (3) (Mean-Value Theorem). Let f (x) be a continuous function defined on [a, b], such that
f (a)f (b) < 0 (i.e., f (a) and f (b) are of opposite sign). Then there exists at least one root c ∈ [a, b] of
f (x) = 0.
′ f (b) − f (a)
f (c) = , where c ∈ (a, b).
b−a
Bisection method is one of the simplest iterative methods for nonlienar root finding. This method
is based on the mean value theorem 3 which states that if a function f (x) is continuous in [xl , xu ] and
f (xl )f (xu ) < 0 (i.e., f (xl ) and f (xu ) are of opposite sign). Then there exists at least one root xm ∈
[xl , xu ] of f (x) = 0.
As the title suggests, the method is based on repeated bisections of an interval containing the root.
Let us suppose that f (xl ) and f (xu ) are such that f (xl ) × f (xu ) < 0. This ensures that the root lies
between xl and xu .
Then bisect the interval [xl , xu ] and let xm = xl +x
2
u
be the middle point of [xl , xu ]. Then, there are
three possibilities that can aries
(ii) If f (xl ) × f (xm ) < 0, then the root lies in the interval (xl , xm ). Then xl = xl ; xu = xm . Therefore,
the new interval now becomes [xl , xm ] which is half of the current interval is again bisected.
(iii) If f (xl )×f (xm ) > 0, then the root lies in the interval (xm , xu ). Then xl = xm ; xu = xu . Therefore,
the new interval now becomes [xm , xu ] which is again bisected.
Therfore, by repeating this interval bisection procedure, we keep on enclosing the root in a new search
interval, which is halved in each iteration. This iterative cycle is terminated when the search interval
becomes smaller that the prescribed tolerance or the value of the function nearly vanishes at the new
x−value. Let ǫ be the prescribed tolerance in the required root. Then, the iterative cycle terminates when
the absolute error becomes less than or equal to the prescribed tolerance, i.e.,
|xu − xl | ≤ ǫ
Example 7. How many iterations are needed in order that the length interval is less than ǫ in bisection
method?
Solution 7. Let L0 = xu − xl be the initial search interval that contains the root. After bisecting the
interval n times, the search interval is reduced to the length given by
L0
Ln = .
2n
17
Bisection method
40
30
f(xu)
20
f(x)
10
xl xm
0
xu
f(xm)
-10
f(xl)
-20
1.0 1.5 2.0 2.5 3.0 3.5 4.0
x
We require
L0 (xu − xl )
Ln ≤ ǫ ⇒ ≤ ǫ ⇒ ≤ǫ
2n 2n
h i
(xu −xl )
loge ǫ
⇒n≥ loge 2
Example 8. What is the minimum number of iterations needed in the bisection algorithm, given xl = 2.5,
xu = 3.5 and ǫ = 10−3.
Solution 8. We know that the minimum number of iterations needed to obtain a root of desired accuracy
is given by h i
(xu −xl )
loge ǫ
⇒n≥ = 10
loge 2
18
Let us assume that the root lies in the interval (1, 2), then the minimum number of iterations required to
find the root within the prescribed tolerance ǫ are listed in Table 6.
Example 9. Find a real root of the following equation correct upto two decimal places:
x3 − 2x − 5 = 0.
Solution 9. Let f (x) = x3 − 2x − 5 = 0. Let us try to calculate f (x) for the values of x given in
Table (16). It can be seen from the table that the interval [2, 3] gives the accurate and precise location of
the root among the other two intervals such as [0, 3], [1, 3]. Therfore, we choose xl = 2 and xu = 3 as the
initial two guesses for bracketing the root.
First Iteration : The interval [xl , xu ] = [2, 3] and f (xl ) = f (2) = −1 < 0, f (xu ) = f (3) =
16 > 0. |xu − xl | = |3 − 2| = 1. Therefore,
(xl + xu ) (2 + 3)
xm = = = 2.50
2 2
⇒ f (xm ) = f (2.50) = 5.6250 > 0.
⇒ f (2) ∗ f (2.5) < 0
⇒ Root lies between [2, 2.50].
19
Table 7: This table shows how to select the bracketing interval [a, b] so as to include the root of the
equation x3 − 2x − 5 = 0. It can be seen that the interval [2, 3] gives the accurate and precise location
of the root among the other two intervals such as [0, 3], [1, 3]. Therfore, we choose xl = 2 and xu = 3 as
the initial two guesses for bracketing the root.
x f (x) = x3 − 2x − 5 sign[f (x)]
0 −5 <0
1 −6 <0
2 −1 <0
3 16 >0
Second Iteration : The interval [xl , xu ] = [2, 50] and f (xl ) = f (2) = −1 < 0, f (xu ) =
f (2.50) = 5.6250 > 0. |xu − xl | = |2.5 − 2| = 0.5. Therefore, Now
(xl + xu ) (2 + 2.5)
xm = = = 2.25
2 2
⇒ f (xm ) = f (2.25) = 1.8906 > 0.
⇒ f (2) ∗ f (2.25) < 0
⇒ Root lies between [2, 2.25].
Third Iteration : The interval [xl , xu ] = [2, 2.25] and f (xl ) = f (2) = −1 < 0, f (xu ) =
f (2.25) = 1.8906 > 0. |xu − xl | = |2.25 − 2| = 0.25 Now,
(xl + xu ) (2 + 2.25)
xm = = = 2.125
2 2
⇒ f (xm ) = f (2.125) = 0.3457 > 0.
⇒ f (2) ∗ f (2.125) < 0
⇒ Root lies between [2, 2.1250].
Fourth Iteration : The interval [xl , xu ] = [2, 2.1250] and f (xl ) = f (2) = −1 < 0, f (xu ) =
f (2.1250) = 0.3457 > 0. |xu − xl | = |2.1250 − 2| = 0.1250 Now,
(xl + xu ) (2 + 2.1250)
xm = = = 2.0625
2 2
⇒ f (xm ) = f (2.0625) = −0.3513 < 0.
⇒ f (2.0625) ∗ f (2.125) < 0
⇒ Root lies between [2.0625, 2.1250].
Fifth Iteration : The interval [xl , xu ] = [2.0625, 2.1250] and f (xl ) = f (2) = −1 < 0, f (xu ) =
20
Sixth Iteration : The interval [xl , xu ] = [2.0938, 2.1250] and f (xl ) = f (2.0938) = −0.0089 <
0, f (xu ) = f (2.1250) = 0.3457 > 0. |xu − xl | = |2.1250 − 2.0938| = 0.0312 Now,
(xl + xu ) (2.0938 + 2.1250)
xm = = = 2.1094
2 2
⇒ f (xm ) = f (2.1094) = 0.1668 > 0.
⇒ f (2.0938) ∗ f (2.1094) < 0
⇒ Root lies between [2.0938, 2.1094].
Seventh Iteration : The interval [xl , xu ] = [2.0938, 2.1094] and f (xl ) = f (2.0938) = −0.0089 <
0, f (xu ) = f (2.1094) = 0.1668 > 0. |xu − xl | = |2.1094 − 2.0938| = 0.0156 Now,
(xl + xu ) (2.1094 + 2.0938)
xm = = = 2.1016
2 2
⇒ f (xm ) = f (2.1016) = 0.0786 > 0.
⇒ f (2.0938) ∗ f (2.1016) < 0
⇒ Root lies between [2.0938, 2.1016].
Eighth Iteration : The interval [xl , xu ] = [2.0938, 2.1016] and f (xl ) = f (2.0938) = −0.0089 <
0, f (xu ) = f (2.1016) = 0.0786 > 0. |xu − xl | = |2.1016 − 2.0938| = 0.0078 Now,
(xl + xu ) (2.1016 + 2.0938)
xm = = = 2.0977
2 2
⇒ f (xm ) = f (2.0977) = 0.0347 > 0.
⇒ f (2.0938) ∗ f (2.0977) < 0
⇒ Root lies between [2.0938, 2.0977].
Ninth Iteration : The interval [xl , xu ] = [2.0938, 2.0977] and f (xl ) = f (2.0938) = −0.0089 <
0, f (xu ) = f (2.0977) = 0.0347 > 0. |xu − xl | = |2.0977 − 2.0938| = 0.0039 Now,
(xl + xu ) (2.0977 + 2.0938)
xm = = = 2.0957
2 2
⇒ f (xm ) = f (2.0957) = 0.0129 > 0.
⇒ f (2.0938) ∗ f (2.0957) < 0
⇒ Root lies between [2.0938, 2.0957].
21
Tenth Iteration : The interval [xl , xu ] = [2.0938, 2.0957] and f (xl ) = f (2.0938) = −0.0089 <
0, f (xu ) = f (2.0957) = 0.0129 > 0. |xu − xl | = |2.0957 − 2.0938| = 0.0020 Now,
(xl + xu ) (2.0957 + 2.0938)
xm = = = 2.0947
2 2
Example 10. Find a real root of the following equation correct using ǫ = 0.001 if the root lies in the
interval [0, 1]:
x = cos x.
Solution 10. Let f (x) = x − cos x. Here f (0) = −1.0000 and f (b) = 0.4597.
First Iteration : The interval [xl , xu ] = [0, 1] and f (xl ) = f (0) = −1.0000 < 0, f (xu ) = f (1) =
0.4597 > 0. |xu − xl | = |1 − 0| = 1. Therefore,
(xl + xu ) (0 + 1)
xm = = = 0.5000
2 2
⇒ f (xm ) = f (0.5000) = −0.3776 < 0.
⇒ f (0.5000) ∗ f (1.0000) < 0
⇒ Root lies between [0.5000, 1.0000].
Second Iteration : The interval [xl , xu ] = [0.5000, 1.0000] and f (xl ) = f (0.5000) = −0.3776 <
0, f (xu ) = f (1.0000) = 0.4597 > 0. |xu − xl | = |1.0000 − 0.5000| = 0.5000. Therefore, Now
(xl + xu ) (0.5000 + 1.0000)
xm = = = 0.7500
2 2
⇒ f (xm ) = f (0.7500) = 0.0183 > 0.
⇒ f (0.5000) ∗ f (0.7500) < 0
⇒ Root lies between [0.5000, 0.7500].
22
Third Iteration : The interval [xl , xu ] = [0.5000, 0.7500] and f (xl ) = f (0.5000) = −0.3776 <
0, f (xu ) = f (0.7500) = 0.0183 > 0. |xu − xl | = |0.7500 − 0.5000| = 0.25 Now,
Fourth Iteration : The interval [xl , xu ] = [0.6250, 0.7500] and f (xl ) = f (0.6250) = −0.1860 <
0, f (xu ) = f (0.0183) => 0. |xu − xl | = |0.7500 − 0.6250| = 0.1250 Now,
Fifth Iteration : The interval [xl , xu ] = [0.6875, 0.7500] and f (xl ) = f (0.6875) = −0.0853 <
0, f (xu ) = f (0.7500) = 0.0183 > 0. |xu − xl | = |0.7500 − 0.6875| = 0.0625 Now,
Sixth Iteration : The interval [xl , xu ] = [0.7188, 0.7500] and f (xl ) = f (0.7188) = −0.0339 <
0, f (xu ) = f (0.7500) = 0.0183 > 0. |xu − xl | = |0.7500 − 0.7188| = 0.0312 Now,
Seventh Iteration : The interval [xl , xu ] = [0.7344, 0.7500] and f (xl ) = f (0.7344) = −0.0079 <
23
Eighth Iteration : The interval [xl , xu ] = [0.7344, 0.7422] and f (xl ) = f (0.7344) = −0.0079 <
0, f (xu ) = f (0.7422) = 0.0052 > 0. |xu − xl | = |0.7422 − 0.7344| = 0.0078 Now,
(xl + xu ) (0.7344 + 0.7422)
xm = = = 0.7383
2 2
⇒ f (xm ) = f (0.7383) = −0.0013 < 0.
⇒ f (0.7383) ∗ f (0.7422) < 0
⇒ Root lies between [0.7383, 0.7422].
Ninth Iteration : The interval [xl , xu ] = [0.7383, 0.7422] and f (xl ) = f (0.7383) = −0.0013 <
0, f (xu ) = f (0.7422) = 0.0052 > 0. |xu − xl | = |0.7422 − 0.7383| = 0.0039 Now,
(xl + xu ) (0.7383 + 0.7422)
xm = = = 0.7402
2 2
⇒ f (xm ) = f (0.7402) = 0.0019 > 0.
⇒ f (0.7383) ∗ f (0.7422) < 0
⇒ Root lies between [0.7383, 0.7402].
Tenth Iteration : The interval [xl , xu ] = [0.7383, 0.7402] and f (xl ) = f (0.7383) = −0.0013 <
0, f (xu ) = f (0.7402) = 0.0019 > 0. |xu − xl | = |0.7402 − 0.7383| = 0.0020 Now,
(xl + xu ) (0.7383 + 0.7402)
xm = = = 0.7393
2 2
Newton-Raphson Method
The Newton-Raphson method is one of the most powerful and well-known numerical methods for solving
a root-finding problem. Let x0 be an initial approximation of the root to f (x) = 0, whose real root is
α(say). Then α = x0 + h, where h is the small correction to be applied to x0 to give the exact value of
the root. Therefore,
f (α) = 0
⇒ f (x0 + h) = 0
h2
⇒ f (x0 ) + hf ′ (x0 ) + + . . . = 0 (By Taylor series expansion)
2!
24
Since h is quite small, the higher powers of h, i.e., h2 , h3 ,etc., can be neglected. Therefore
f (x0 ) + hf ′ (x0 ) ≈ 0
f (x0 )
⇒h=− .
f ′ (x0 )
f (x0 )
x1 = x0 − .
f ′ (x0 )
f (x1 )
x2 = x1 −
f ′ (x1 )
f (x3 )
x3 = x3 − ′
f (x3 )
...
f (xn )
xn+1 = xn −
f ′ (xn )
The same step is repeated for i = 3, 4 . . . until the error e = |xi+1 − xi | is smaller then a preset value ǫ.
The final value of x obtained at the last iteration where e < ǫ becomes the final root of the equation. The
computational steps in the Newton-raphson method are summarized as follows. The algorithm requires
calculations of both f (x) and f ′ (x).
Newton-Raphson method
20
10
f(x)
0 (x2,f(x2)) (x1,f(x1))
-10 (x0,f(x0))
-20
1.5 2.0 2.5 3.0 3.5
x
Example 11. Find a real root of the following equation using the Newton-Raphson method for ǫ =
0.0005 using the initial approximation of the root as x0 = 2.
3x − cos x − 1 = 0 (7)
First Iteration : x0 = 2.00000, f (x0 ) = 5.41615, f ′ (x0 ) = 3.90930 We know from the Newton-
Raphson method that
f (x0 )
x =x0 −
f ′ (x0 )
5.41615
⇒ x =2.00000 −
3.90930
⇒ x =0.61455
f (x0 )
x =x0 −
f ′ (x0 )
0.02661
⇒ x =0.61455 −
3.57659
⇒ x =0.60711
f (x0 )
x =x0 −
f ′ (x0 )
0.00002
⇒ x =0.60711 −
3.57049
⇒ x =0.60710
From the second and the third iteration, we find that the successive approximations of the root are 0.60711
and 0.60710. Hence the required root of the given equation correct to four decimal places is 0.6071.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
Example 12. Find a real root of the following equation correct upto five decimal places
ln(x) = cos(x).
1
Solution 12. Here f (x) = ln(x) − cos(x). Therefore, f ′ (x) = x
+ sin(x).
27
First Iteration : x0 = 2.0, f (x0 ) = −2.00000, f ′ (x0 ) = 12.00000 We know from the Newton-
Raphson method that
f (x0 )
x =x0 −
f ′ (x0 )
−2.00000
⇒ x =2.00000 −
12.00000
⇒ x =2.16667
From the third and the fourth iteration, we find that the successive approximations of the root are 2.15443
and 2.15443. Hence the required root of the given equation correct to four decimal places is 2.1544.
28
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
√
Example 13. Find the cubic root of 10, i.e., 3 10 correct to four decimal places.
√
Solution 13. Let x = 3 10. Then x3 − 10 = 0. Let f (x) = x3 − 10 ⇒ f ′ (x) = 3x2 .
First Iteration : x0 = 2.0, f (x0 ) = −2.00000, f ′ (x0 ) = 12.00000 We know from the Newton-
Raphson method that
f (x0 )
x =x0 −
f ′ (x0 )
−2.00000
⇒ x =2.00000 −
12.00000
⇒ x =2.16667
f (x0 )
x =x0 −
f ′ (x0 )
0.17130
⇒ x =2.16667 −
14.08333
⇒ x =2.15450
f (x0 )
x =x0 −
f ′ (x0 )
0.00096
⇒ x =2.15450 −
13.92566
⇒ x =2.15443
f (x0 )
x =x0 −
f ′ (x0 )
0.00000
⇒ x =2.15443 −
13.92477
⇒ x =2.15443
From the third and the fourth iteration, we find that the successive approximations of the root are 2.15443
and 2.15443. Hence the required root of the given equation correct to four decimal places is 2.1544.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
29
Example 14. Find a real root of the following equation correct to three decimal places using the Newton-
Rephson method taking the initial approximation to the root as x0 = 2:
x3 − 2x − 5 = 0.
From the second and the third iteration, we find that the successive approximations of the root are 2.09457
and 2.09455. Hence the required root of the given equation correct to three decimal places is 2.094.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
Example 15. Find a real root of the following equation correct to three decimal places using the Newton-
Rephson method taking the initial approximation to the root as x0 = 2:
xx + 2x − 6 = 0.
From the third and the fourth iteration, we find that the successive approximations of the root are 1.72310
and 1.72310. Hence the required root of the given equation correct to three decimal places is 1.723.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
Secant Method
One of the important difficulties with the Newton Raphson method is that it requires the computation of
the derivative of f (x) at the iterated points. This requirement causes hardship to the computer by causing
computational cost in solving the problem. The secant method helps eliminating the calculation of the
derivative by replacing it with a secant line. The term “secant” denotes a straight line that intersects a
curve in two or more parts.
In secant method, two initial guesses say, x1 and x2 are provided, where f (x1 ) 6= f (x2 ). These two
points can be any points which are reliably close to the solution and they do not necessarily have to be on
the opposite sides of the x-axis. A good choice for the two initial points x1 and x2 will be f (x1 f (x2 ) < 0
abiding by the mean value theorem. The first iteration with i = 1 produces an approximation at x = x2
which is the x-intercept of the chord that passes through the points (x1 , f (x1 )) and (x2 , f (x2 )). The next
approximated value x = x3 is obtained from the x-intercept of the chord that passes through the points
(x2 , f (x2 )) and (x3 , f (x3 )). The same step is repeated until the convergence to the solution is obtained
through the stopping criteria e = |xi+1 − xi | < ǫ. The secant method is derived as follows: The gradient
of the line from (x1 , f (x1 )) to (x3 , 0) is
f (x1 − 0)
m1 = .
x1 − x3
32
which is equal to the the gradient of the line from (x2 , f (x2 ) to (x3 , 0) given by
f (x1 − 0)
m2 =
x1 − x3
f (x2 ) − 0
⇒ m2 = .
x2 − x3
Therefore,
Replacing x1 with xi , x2 with xi+1 and x3 with xi+2 the iterative formula for the secant method can be
written as:
xi f (xi+1 ) − xi+1 f (xi )
xi+2 = .
f (xi+1 ) − f (xi )
Algorithm 1. The algorithm for the secant method is given below
Given f (x) = 0, ǫ and the initial points [x1 , x2 ];
Given max=maximum number of iterations;
For i = 0 to max
Compute xi+2 = xi f f(x(xi+1 )−xi+1 f (xi )
i+1 )−f (xi )
;
If |xi+2 − xi+1 | < ǫ
Solution = xi+2 ;
Stop the iterations;
Endif
Endfor
Example 16. Find the root of the following equation using the secant method with the initial values
x1 = 1 and x2 and accuracy ǫ = 0.0005.
x3 − x2 − 2 = 0.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
2.000000 ∗ 2.000000 − 1.500000 ∗ (−0.875000)
⇒ x3 =
−0.875000 − (2.000000)
⇒ x3 =1.652174.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.500000 ∗ (−0.219775) − 1.652174 ∗ (−0.875000)
⇒x=
−0.219775 − (−0.875000)
⇒ x3 =1.703216.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.652174 ∗ (0.039990) − 1.703216 ∗ (−0.219775)
⇒x=
0.039990 − (−0.219775)
⇒ x3 =1.695358
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.703216 ∗ (−0.001375) − 1.695358 ∗ (0.039990)
⇒x=
−0.001375 − (0.039990)
⇒ x3 =1.695619
From the fourth and the fifth iteration, we find that the successive approximations of the root are 1.695358
and 1.695619. Hence the required root of the given equation correct to three decimal places is 1.695.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
34
Secant method
3
f(xu)
2
1
xl xm
f(x)
0 xu
-1 f(xm)
-2
f(xl)
-3
0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2
x
Example 17. Compute the root of the following equation in the interval [0, 2] using the secant method
correct upto three decimal places:
x
x2 e− 2 − 1 = 0.
x
Solution 17. Let f (x) = x2 e− 2 − 1. Given x1 = 0 and x2 = 2.
From the third and the fourth iteration, we find that the successive approximations of the root are 1.429648
and 1.429612. Hence the required root of the given equation correct to three decimal places is 1.430 (after
rounding off). The successive approximations of the root as computed above using the secant method are
displayed in the following table:
Example 18. Compute the root of the following equation in the interval [2, 3] using the secant method
correct upto three decimal places:
x3 − 2x − 5 = 0.
36
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
3.000000 ∗ (−0.390800) − 2.058824 ∗ (16.000000)
⇒ x3 =
(−0.390800) − (16.000000)
⇒ x3 =2.081264.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
2.058824 ∗ (−0.147204) − 2.081264 ∗ (−0.390800)
⇒x=
−0.147204 − (−0.390800)
⇒ x3 =2.094824.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
2.081264 ∗ (0.003044) − 2.094824 ∗ (−0.147204)
⇒x=
0.003044 − (−0.147204)
⇒ x3 =2.094549
From the third and the fourth iteration, we find that the successive approximations of the root are 2.094824
and 2.094549. Hence the required root of the given equation correct to three decimal places is 2.094. The
successive approximations of the root as computed above using the secant method are displayed in the
following table:
Example 19. Compute the root of the following equation in the interval [1, 2] using the secant method
correct upto three decimal places:
x4 − x − 10 = 0.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
2.000000 ∗ (−3.077884) − 1.714286 ∗ (4.000000)
⇒ x3 =
(−3.077884) − (4.000000)
⇒ x3 =1.838531.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.714286 ∗ (−0.412799) − 1.838531 ∗ (−3.077884)
⇒x=
−0.412799 − (−3.077884)
⇒ x3 =1.857776.
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.838531 ∗ (0.053909) − 1.857776 ∗ (−0.412799)
⇒x=
0.053909 − (−0.412799)
⇒ x3 =1.855553
x1 f (x2 ) − x2 ∗ f (x1 )
x3 =
f (x2 ) − f (x1 )
1.857776 ∗ (−0.000778) − 1.855553 ∗ (0.053909)
⇒x=
−0.000778 − (0.053909)
⇒ x3 =1.855584
From the fourth and the fifth iteration, we find that the successive approximations of the root are 1.855553
and 1.855584. Hence the required root of the given equation correct to three decimal places is 1.855. The
successive approximations of the root as computed above using the secant method are displayed in the
following table:
39
ǫn+1 =0.5ǫn
Comparing with ǫn+1 = kǫpn , we have k = 0.5 and p = 1. p = 1 indicates that the bisection method is
linearly convergent.
2
ǫ2n f ′′ (α) ǫ3n f ′′ (α)
⇒ ǫn+1 = − + ...
2 f ′(α) 2 f ′ (α)
2
1 f ′′ (α) ǫn f ′′ (α)
ǫn+1
⇒ = ′ −
ǫ2n 2 f (α) 2 f ′(α)
ǫn+1 1 f ′′ (α)
⇒ 2 ≈ ′ Neglecting terms containing powers of ǫn
ǫn 2 f (α)
ǫn+1
⇒ 2 ≈k,
ǫn
1 f ′′ (α)
where k = 2 f ′ (α)
is the asymptotic error constant. Therefore,
ǫn+1 = kǫ2n
Comparing with
ǫn+1 = kǫpn ,
we have p = 2 which indicates that the order of convergence of Newton-Raphson method is 2, i.e.,
Newton-Raphson method is quadratic convergent. This means that the successive error at each step is
proportional to the square of the previous error indicating that the number of correct decimal places
almost doubles after every iteration. However, the Newton-Raphson method suffers from certain draw-
backs:
41
• With non-zero slope, the solution may diverge or reach a diffferent root.
f (α) =0
⇒ α =φ(α)
Let xn−1 and xn be the two successive approxiations to the actual root α. The absolute error at step (n)
is given by
ǫn = |xn − α| .
Also, we have
xn =φ(xn−1 ) (8)
xn − α =φ(xn−1 ) − φ(α)
|xn − α| ≤k |xn−1 − α|
⇒ ǫn ≤ kǫn−1
⇒ ǫn+1 ≤ kǫn
Comparing with
ǫn+1 ≤ kǫpn ,
we have p = 1 which indicates that the fixed point iteration is linearly convergent.
42
In order to determine the order of convergence, let us now suppose an asymptotic relation of the form
ǫn+1 =kǫpn
ǫn ǫn−1 f ′′ (α)
⇒ =kǫpn (9)
2! f ′(α)
This relation also requires
ǫn =kǫpn−1
1/p
⇒ ǫn−1 = k −1 ǫn
0 =1 − p + 1/p
⇒ p2 − p − 1 =0
√
1± 5
⇒p=
2√ √
1+ 5 1− 5
⇒ p1 = , p2 =
2 2
⇒ p1 =1.618, p2 = −0.618
Since we must have p ≥ 1, the rate of convergence is 1.618. Thus we find that the rate of covergence
√
of secant method is superlinear (1 < p < 2). The ratio 1+2 5 is called the golden ratio. The rate of
convergence of the secant method is more than the bisection method but less than the Newton-Raphson
method. The secant method involves one function evaluation per iteration, whereas the Newton-Raphson
method requires two function evaluations f (x) and its derivative f ′ (x). For this reason, the secant method
is often faster in time despite more oiterations are required as compared to the Newton-Raphson method
to attain a similar accuracy. However, there exist certain disadvantages of secant method as well. Since
the secant method does not require the root remain bracketed, it may not always converge. The method
is likely to have difficulty of f ′ (α) = 0, i.e., the x-axis is tangent to the graph of y = f (x) at x = α. The
secant method cannot be used in the generalisation of new methods for solving simultaneous system of
equations, whereas the Newton-Raphson method can be easily used for such purpose.
44
m1 =m2
0 − f (x0 ) f (x1 ) − 0
⇒ =
x2 − x0 x1 − x2
x0 f (x1 ) − x1 f (x0 )
⇒ x2 = .
f (x1 ) − f (x0 )
The illustration of Regula Falsi method is depicted in Fig.(). Let [x0 , x1 ] be the interval containing the
root, where f (x0 )f (x1 ) < 0. A secant line is drawn from (x0 , f (x0 )) to (x1 , f (x1 )). The line intersects
the x-axis at (x2 , 0). The interval [x0 , x1 ] is now subdivided into [x0 , x2 ] and [x2 , x1 ]. If f (x0 )f (x2 ) < 0,
the root lies in the interval [x0 , x2 ]. In this case, an update is performed with x1 = x2 . On the other
hand, if f (x0 )f (x2 ) > 0, the root lies within [x2 , x1 ]. In this case, an update is performed with x0 = x2 .
These two steps are repeated until we get a convergent solution of the root is obtained. The criteria of
convergence may be be obtained in either of the following two ways or both:
One of the important disadvantages of the Regula Falsi method is that if the root lies initially in the
interval [x0 , x1 ], then one of the end points is fixed for all iterations and the other end point moves
towards the required root. The shifting of only one end point while the other remaining fixed causes slow
convergence and hence many iterartions are required to reach a solution within tolerable error. However,
the method guarantees the convergence of the solution as the subsequent estimates of the root moves
closer and closer to the actual root.
45
Table 16: This table shows how to select the bracketing interval [a, b] so as to include the root of the
equation 3x − cos x − 1 = 0. It can be seen that the root lies in the interval [0, 1] as f (x) changes sign
within this interval.
x f (x) = 3x − cos x − 1 sign[f (x)]
0 −2.00000 <0
1 1.45970 >0
Example 20. Find a real root of the equation 3x − cos x − 1 = 0 using Regula Falsi method correct to
three decimal places.
First Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
0 ∗ 1.45970 − 1 ∗ (−2.00000)
⇒ x2 =
1.45970 − (−2.00000)
⇒ x2 =0.57809.
Now
Now, we take x0 = x2 = 0.57809 and x1 = 1.00000. Also, f (x0 ) = −0.10325, f (x1 ) = 1.45970.
Second Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
0.57809 ∗ 1.45970 − 1.00000 ∗ (−0.10325)
⇒ x2 =
1.45970 − (−0.10325)
⇒ x2 =0.60596.
Now
Now, we take x0 = x2 = 0.60596 and x1 = 1.00000. Also f (x0 ) = −0.00408, f (x1 ) = 1.45970.
46
Third Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
0.60596 ∗ 1.45970 − 1.00000 ∗ (−0.00408)
⇒ x2 =
1.45970 − (−0.00408)
⇒ x2 =0.60706.
Now
Now, we take x0 = x2 = 0.60706 and x1 = 1.00000. Also f (x0 ) = −0.00016, f (x1 ) = 1.45970.
Fourth Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
0.60706 ∗ 1.45970 − 1.00000 ∗ (−0.00016)
⇒ x2 =
1.45970 − (−0.00016)
⇒ x2 =0.60710.
Therefore, from the third and fourth iteration, we have the values of x2 as 0.60706 and 0.60710, re-
spectively which are correct to three decimal places. Hence, the required root of the given equation
correct to three decimal places is 0.607. The successive approximations of the root as computed
above using the Regula Falsi method are displayed in the following table:
Example 21. Find a real root of the equation 2x − log x − 7 = 0 using Regula Falsi method correct to
three decimal places.
47
Table 18: This table shows how to select the bracketing interval [a, b] so as to include the root of the
equation 2x − log x − 7 = 0. It can be seen that the interval [3, 4] gives the accurate and precise location
of the root among the other two intervals such as [1, 2], [2, 3]. Therfore, we choose x0 = 2 and x1 = 3 as
the initial two guesses for bracketing the root.
x f (x) = 2x − log x − 7 sign[f (x)]
1 −5.00000 <0
2 −3.30103 <0
3 −1.47712 <0
4 0.397940 >0
Solution 21. Let f (x) = 2x − log x − 7. Let us take x0 = 3 and x1 = 4. Also f (x0 ) = −1.47712 and
f (x1 ) = 0.39794.
First Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
3 ∗ 0.39794 − 4 ∗ (−3.30103)
⇒ x2 =
0.39794 − (−3.30103)
⇒ x2 =3.78484.
Now
Now, we take x0 = x2 = 3.78484 and x1 = 4.00000. Also, f (x0 ) = −0.00837, f (x1 ) = 0.39794.
Second Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
3.78484 ∗ 0.39794 − 4.00000 ∗ (−0.00837)
⇒ x2 =
0.39794 − (−0.00837)
⇒ x2 =3.78927.
Now
Now, we take x0 = x2 = 3.78927 and x1 = 4.00000. Also f (x0 ) = −0.00001, f (x1 ) = 0.39794.
Third Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
3.78927 ∗ 0.39794 − 4.00000 ∗ (−0.00001)
⇒ x2 =
0.39794 − (−0.00001)
⇒ x2 =3.78928.
Therefore, from the second and third iterations, we have the values of x2 as 3.78927 and 3.78928,
respectively which are correct to three decimal places. Hence, the required root of the given equa-
tion correct to three decimal places is 3.789. The successive approximations of the root as computed
above using the Regula Falsi method are displayed in the following table:
Example 22. Find a real root of the equation xx + 2x − 6 = 0 using Regula Falsi method correct to two
decimal places.
Solution 22. Let f (x) = xx + 2x − 6. Let us take x0 = 1 and x1 = 2. Also f (x0 ) = −3.00000 and
f (x1 ) = 2.00000.
Table 20: This table shows how to select the bracketing interval [a, b] so as to include the root of the
equation xx + 2x − 6 = 0. It can be seen that the interval [1, 2] gives the accurate and precise location
of the root among the other two intervals such as [0, 1], [2, 3]. Therfore, we choose x0 = 1 and x1 = 2 as
the initial two guesses for bracketing the root.
x f (x) = xx + 2x − 6 sign[f (x)]
0 −5.00000 <0
1 −3.00000 <0
2 2.00000 >0
3 27.0000 >0
49
First Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
1 ∗ 2.00000 − 2 ∗ (−3.00000)
⇒ x2 =
2.00000 − (−3.00000)
⇒ x2 =1.60000.
Now
f (x2) = − 0.67875 < 0
⇒ f (x2) × f (x1) = < 0
⇒ The root lies between [x2 , x1 ] = [1.60000, 2.00000]
Now, we take x0 = x2 = 1.60000 and x1 = 2.00000. Also, f (x0 ) = −0.67875, f (x1 ) = 2.00000.
Second Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
1.60000 ∗ 2.00000 − 2.00000 ∗ (−0.67875)
⇒ x2 =
2.00000 − (−0.67875)
⇒ x2 =1.70135.
Now
f (x2) = − 0.12749 < 0
⇒ f (x2) × f (x1) = < 0
⇒ The root lies between [x2 , x1 ] = [1.70135, 2.00000]
Now, we take x0 = x2 = 1.70135 and x1 = 2.00000. Also f (x0 ) = −0.12749, f (x1 ) = 2.00000.
Third Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
1.70135 ∗ 2.00000 − 2.00000 ∗ (−0.12749)
⇒ x2 =
2.00000 − (−0.12749)
⇒ x2 =1.71925.
Fourth Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
1.71925 ∗ 2.00000 − 2.00000 ∗ (−0.02283)
⇒ x2 =
2.00000 − (−0.02283)
⇒ x2 =1.72242.
50
Therefore, from the third and fourth iterations, we have the values of x2 as 1.71925 and 1.72242,
respectively which are correct to two decimal places. Hence, the required root of the given equation
correct to three decimal places is 1.72. The successive approximations of the root as computed
above using the Regula Falsi method are displayed in the following table:
Example 23. Find a real root of the equation x3 − 2x − 5 = 0 using Regula Falsi method correct to three
decimal places.
Solution 23. Let f (x) = x3 − 2x − 5. Let us take x0 = 2 and x1 = 3. Also f (x0 ) = −1.00000 and
f (x1 ) = 16.00000.
First Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2 ∗ 16.00000 − 3 ∗ (−1.00000)
⇒ x2 =
16.00000 − (−1.00000)
⇒ x2 =2.058824.
Table 22: This table shows how to select the bracketing interval [a, b] so as to include the root of the
equation x3 − 2x − 5 = 0. It can be seen that the interval [2, 3] gives the accurate and precise location
of the root among the other two intervals such as [0, 3], [1, 3]. Therfore, we choose x0 = 2 and x1 = 3 as
the initial two guesses for bracketing the root.
x f (x) = x3 − 2x − 5 sign[f (x)]
0 −5 <0
1 −6 <0
2 −1 <0
3 16 >0
51
Now
Second Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2.05882 ∗ 16.00000 − 3.00000 ∗ (−0.39080)
⇒ x2 =
16.00000 − (−0.39080)
⇒ x2 =2.08126.
Now
Now, we take x0 = x2 = 2.08126 and x1 = 3.00000. Also f (x0 ) = −0.14721, f (x1 ) = 16.00000.
Third Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2.08126 ∗ 16.00000 − 3.00000 ∗ (−0.14721)
⇒ x2 =
16.00000 − (−0.14721)
⇒ x2 =2.08964.
Now
Now, we take x0 = x2 = 2.08964 and x1 = 3.00000. Also f (x0 ) = −0.05468, f (x1 ) = 16.00000.
52
Fourth Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2.08964 ∗ 16.00000 − 3.00000 ∗ (−0.05468)
⇒ x2 =
16.00000 − (−0.05468)
⇒ x2 =2.09274.
Now
Now, we take x0 = x2 = 2.09274 and x1 = 3.00000. Also f (x0 ) = −0.00745, f (x1 ) = 16.00000.
Fifth Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2.09274 ∗ 16.00000 − 3.00000 ∗ (−0.02020)
⇒ x2 =
16.00000 − (−0.02020)
⇒ x2 =2.09388.
Now
Now, we take x0 = x2 = 2.09388 and x1 = 3.00000. Also f (x0 ) = −0.00745, f (x1 ) = 16.00000.
Sixth Iteration :
x0 f (x1 ) − x1 f (x0 )
x2 =
f (x1 ) − f (x0 )
2.09388 ∗ 16.00000 − 3.00000 ∗ (−0.00745)
⇒ x2 =
16.00000 − (−0.00745)
⇒ x2 =2.09431.
Therefore, from the fifth and sixth iterations, we have the values of x2 as 2.09388 and 2.09431, re-
spectively which are correct to three decimal places. Hence, the required root of the given equation
correct to three decimal places is 2.094. The successive approximations of the root as computed
above using the Regula Falsi method are displayed in the following table:
53
the multiplicity of the root. The other way of handling the problem of mutiple roots of a function f (x) is
to define
f (x)
u(x) = ′ .
f (x)
It can be shown that this function yields the same roots as that of f (x). Also,we have
f ′ (x)f ′ (x) − f (x)f ′′ (x)
u′ (x) = .
[f ′ (x)]2
Since Newton’s method can be applied to u(x), we have
u(x)
xn+1 =xn −
u′ (x)
f (xn )f ′ (x)
⇒ xn+1 =xn −
[f ′ (xn )]2 − f (xn )f ′′ (xn )
Example 24. Find the multiple root of the following equation with an initial guess of x0 = 0:
x3 − 5x2 + 7x − 3.
Solution 24. Let f (x) = x3 − 5x2 + 7x − 3. Therefore, f ′ (x) = 3x2 − 10x + 7. Given x0 = 2. The
function f (x) can be factorized as follows:
f (x0 )
x =x0 − 2
f ′ (x0 )
(−0.00004)
⇒ x =0.99539 − 2
(0.01850)
⇒ x =0.99999
f (x0 )
x =x0 − 2
f ′ (x0 )
(−0.00004)
⇒ x =0.99539 − 2
(0.01850)
⇒ x =1.00000
From the third and the fourth iteration, we find that the successive approximations of the root are 0.99999
and 1.00000. Hence the required root of the given equation correct to three decimal places is 1.000.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
Example 25. Find the multiple root of the following equation with an initial guess of x0 = 0:
x3 − x2 − x + 1.
Solution 25. Let f (x) = x3 − x2 − x + 1. Therefore, f ′ (x) = 3x2 − 2x − 1. Given x0 = 2. The function
f (x) can be factorized as follows:
f (x) =x3 − x2 − x + 1
⇒ f (x) =(x + 1)(x − 1)(x − 1)
First Iteration : x0 = 2.00000, f (x0 ) = 3.00000, f ′ (x0 ) = 7.00000 We know from the modified
Newton-Raphson method that
f (x0 )
x =x0 − m
f ′ (x0 )
f (x0 )
x =x0 − 2 ′
f (x0 )
(3.00000)
⇒ x =2.00000 − 2
(7.00000)
⇒ x =1.14286
From the third and the fourth iteration, we find that the successive approximations of the root are 1.00001
and 1.00001. Hence the required root of the given equation correct to three decimal places is 1.000.
The successive approximations of the root as computed above using the Newton-Raphson method are
displayed in the following table:
Example 26. Find the multiple root of the follwing equation using x0 without use of the knowledge of
multiplicity of the root:
f (x) = x3 − 5x2 + 7x − 3
57
Solution 26. From the third and the fourth iteration, we find that the successive approximations of the
root are 1.00001 and 1.00001. Hence the required root of the given equation correct to three decimal
places is 1.000. The successive approximations of the root as computed above using the Newton-Raphson
method are displayed in the following table: