Unit-1:: The Definition of Roots of An Equation Can Be Given in Two Different Ways
Unit-1:: The Definition of Roots of An Equation Can Be Given in Two Different Ways
1
Most of the numerical methods, used to solve an equation are based on iterative techniques.
Different numerical methods are available to solve the equation f(x) = 0. But, each method has
some advantages and disadvantages over another method.
Generally, the following aspects are considered to compare the methods:
(i) convergence or divergence,
(ii) rate of convergence,
(iii) applicability of the method,
(iv) Amount of pre-calculation needed before application of the method, etc.
The process of finding the approximate values of the roots of an equation can be divided into
two stages:
(i) location of the roots,
(ii) computation of the values of the roots with the specified degree of accuracy
If f(x) a polynomial of the form anxn+an-1xn-1+an-2xn-2+……..+a0, the following results from the
theory of equation would be useful in locating its roots.
1. Every polynomial equation of the nth degree has n and only n roots.
2. If n is odd, the polynomial equation has atleast one real root whose sign is opposite
to that of the last term.
e.g. x3+7x2+10x=0, x=0,-2,-5
3. If n is even and the constant term is negative, then the equation has atleast one positive
root and atleast one negative root.
e.g. x2+3x-10=0, x=-5, 2
4. If the polynomial equation has (a) real coefficient then imaginary roots occurin pairs and
(b) rational coefficient then irrational roots occur in pairs.
5. Descartes’ Rule of sign
a. A polynomial equation f(x) =0 cannot have more number of positive real roots than the
number of change of sign in the coefficient of f(x).
8x3 −20x2 −2x+5 = 0,
x -2 -1 0 1 2 3
Sign of f(x) - - + - - +
No. of change of sign=3 and no. of +ve roots=2.
b. In (a) above, f(x) =0 cannot have more number of negative roots than the number of
2
change of change of sign in the co-efficient of f(-x).
Location of Roots
An interval [a, b] is said to be the location of a real root c if f(c) = 0 for a < c < b. Mainly, two
methods are used to locate the real roots of an equation, one is graphical method and other is an
analytic method known as method of tabulation.
Graphical method
First method:
In this method, the graph of y = f(x) is drawn in a rectangular co-ordinates system. It is obvious
that the abscissas of the points where the graph intersects the x-axis are the roots of the equation
f(x) = 0. But, practically, it is most difficult to determine the exact value of x where the graph
intersects the x-axis. For example, if x = 1.27831 is a root of an equation f(x) = 0 then we cannot
determine 1.2783 (four digits after decimal point) from the graph. We can measure the value of x
up to one or two decimal places. But, the approximate value of the root can be determined using
this method.
Second method:
Sometimes, the approximate roots of f(x) = 0 can be determined by dividing all the terms of the
equation into groups, one of them is written on the left-hand side of the equation and the other on
the right hand side, i.e., the equation is represented as g(x) = h(x). Then the graph of two
functions y = g(x) and y = h(x), are drawn. The abscissas of the points of intersection of these
graphs are the roots of the equation. The graphical method to locate the roots is not very useful,
because, the drawing of the function y = f(x) is itself a complicated problem. But, it makes
possible to roughly determine the intervals to locate the roots. Then an analytic method is used to
locate the root.
Example 1: Use graphical method to locate the roots of the equation x3−4x−2 = 0.
Solution: First method:
The graph of the function y = x3 − 4x − 2 is drawn in Figure 1(a). The curve cuts the x-axis at
three points and, consequently, the equation has three real roots. From figure, it is observed that
the roots belong to the intervals [−2,−1], [−1, 0] and [2, 3].
3
Second method:
The given equation can be written as x3 = 4x+2. The graph of the functions y = x3 and y = 4x+2
are drawn (Figure 1(b)). The abscissas of the points of intersection of the graphs of these
functions are roots of the equations. The intervals of the roots are [−2,−1], [−1, 0] and [2, 3].
Method of tabulation
This method depends on the continuity of the function f(x). Before applying the tabulation
method, following result should be noted.
(i) If f(x) is continuous in the interval (a, b) and if f(a) and f(b) have the opposite signs,
then at least one real root of the equation f(x) = 0 lies within the interval (a, b).
(ii) If f(a) and f(b) have same signs then f(x) = 0 has no real roots or has an even number
of real roots.
(iii) If the curve y = f(x) touches the x-axis at some point, say, x = c then c is a root of f(x)
= 0 though f(a) and f(b), a < c < b may have same sign.
For example, f(x) = (x − 2)2 touches the x-axis at x = 2, also f(1.5) > 0 and f(2.5) > 0, but, x = 2
is the root of the equation f(x) = (x − 2)2 = 0.
A trial method for tabulation is as follows:
Form a table of signs of f(x) setting x = 0,±1,±2, . . .. If the function f(x) changes it signs for two
consecutive values of x then at least one root lies between these two values, i.e., if f(a) and f(b)
have opposite signs then a root lies between a and b.
Example 2: Find the location of roots of the equation 8x3 −20x2 −2x+5 = 0 by tabulation
method.
Solution: We form a table of sign of f(x), taken x = 0,−1, 1,−2, 2, . . . as follows:
4
x 0 -1 1 -2 2 3
Sign of f(x) + - - - - +
The equation has three real roots as its degree is 3. The locations of the roots of the given
equation are (−1, 0), (0, 1) and (2, 3).
A systematic process for tabulation: The following sequence of steps to be performed to locate
the roots of an equation f(x) = 0 by tabulation method:
1. Find the first derivative f’(x),
2. Prepare a table of signs of the function f(x) by setting x equal to
(a) the roots of f’(x) = 0 or the values close to them,
(b) The boundary values (preceding from the domain of permissible values of the variable),
3. Determine the intervals at the endpoints of which the function assumes values of opposite
signs. These intervals contain one and only one root each in its interior.
Bisection Method
Let ξ be a root of the equation f(x) = 0 lies in the interval [a, b], i.e., f(a).f (b) < 0, and (b−a) is
not sufficiently small. The interval [a, b] is divided into two equal intervals [a, c] and [c, b], each
b−a a+b
of length and c = (Figure 2). If f(c) = 0, then c is an exact root.
2 2
Now, if f(c) ≠ 0, then the root lies either in the interval [a, c] or in the interval [c, b].
If f(a).f (c) < 0 then the interval [a, c] is taken as new interval, otherwise [c, b] is taken as
the next interval.
Let the new interval be [a1, b1] and use the same process to select the next new interval.
In the next step, let the new interval be [a2, b2].
The process of bisection is continued until either the midpoint of the interval is a root, or
the length (bn − an) of the interval [an, bn] (at nth step) is sufficiently small.
The number an and bn are the approximate roots of the equation f(x) = 0. Finally,
a n +b n
xn = is taken as the approximate value of the root ξ.
2
5
b−a
It may be noted that when the reduced interval be [a1, b1] then the length of the interval is ,
2
b−a
when the interval be [a2, b2] then the length is . At the nth step the length of the interval
22
b−a a n +b n
being . In the final step, when ξ = is chosen as a root then the length of the interval
2n 2
b−a b−a
being 2n +1 and hence the error does not exceed 2n +1 . Thus, if ε be the error at the nth step then the
For example, if the length of the interval is |b−a| = 1 and ε = 0.0001, then n is given
by n ≥ 14.
The minimum number of iterations required to achieved the accuracy ε for |b−a| = 1 are shown in
Table 1.
Theorem: Assume that f(x) is a continuous function on [a, b] and that there exists a number ξ ∈
[a, b] such that f(ξ) = 0. If f(a) and f(b) have opposite signs, and {xn} represents the sequence of
midpoints generated by the bisection method, then
b –a
|ξ − xn | ≤ for n = 0, 1, 2, . . (5)
2n +1
and therefore the sequence {xn} converges to the root ξ i.e., lim n→∞ xn = ξ.
6
Proof: The root ξ and the midpoint xn both lie in the interval [an, bn], the distance between xn and
ξ cannot be greater than half the width of the interval [an, bn]. Thus
|b n − a n |
|ξ − xn | ≤ for all n. (6)
2
From the bisection method, it is observed that the successive interval widths form the following
pattern.
|b 0 − a 0 |
|b1 − a1 | = , where b0 = b and a0 = a,
21
|b 1 − a 1 | |b 0 − a 0 |
b2 − a 2 = =
2 22
|b 2 − a 2 | |b 0 − a 0 |
b3 − a 3 = =
2 23
|b 0 − a 0 |
In this way, bn − an = 2n
Hence
|b 0 − a 0 |
|ξ − xn | ≤ [using (6)].
2n +1
Note 2: This method is very slow, but it is very simple and will converge surely to the exact root.
So the method is applicable for any function only if the function is continuous within the interval
[a, b], where the root lies. In this method derivative of the function f(x) and pre-manipulation of
function are not required.
7
Note 3: This method is also called bracketing method since the method successively reduces the
two endpoints (brackets) of the interval containing the real root.
Example: Find a root of the equation x2 + x − 7 = 0 by bisection method, correct up to two
decimal places.
Solution. Let f(x) = x2 + x − 7.
f(2) = −1 < 0 and f(3) = 5 > 0. So, a root lies between 2 and 3.
n Left end point Right end point midpoint F(xn+1)
an bn xn+1
0 2 3 2.5 1.750
1 2 2.5 2.250 0.313
2 2 2.250 2.125 -0.359
3 2.125 2.250 2.188 -0.027
4 2.188 2.250 2.219 0.143
5 2.188 2.219 2.204 0.062
6 2.188 2.204 2.196 0.018
7 2.188 2.196 2.192 -0.003
8 2.192 2.196 2.194 0.008
9 2.192 2.194 2.193 0.002
10 2.192 2.193 2.193 0.002
Algorithm 1 (Bisection method): This algorithm finds a real root of the equation f(x) = 0 which
lies in [a, b] by bisection method.
Algorithm Bisection
Input function f(x);
// Assume that f(x) is continuous within [a, b] and a root lies on [a, b].//
Read ε; //tolerance for width of the interval//
Read a, b; //input of the interval//
Compute fa = f(a); fb = f(b); //compute the function values//
if sign(fa) = sign(fb) then
//sign(fa) gives the sign of the value of fa.//
Print ‘f(a) · f(b) > 0, so there is no guarantee for a root within [a, b]’;
8
Stop;
endif;
do
Compute c = (a + b)/2;
Compute fc = f(c);
if fc = 0 or |fc| < ε then
a = c and b = c;
else if sign(fb) = sign(fc) then
b = c; fb = fc;
else
a = c; fa = fc;
endif;
while (|b − a| > ε);
Print ‘the desired root is’ c;
end Bisection