Unit 2
Unit 2
Computing -I
UNIT 2 SOLUTION OF ALGEBRAIC AND
TRANSCENDENTAL
EQUATIONS
Structure Page Nos.
2.0 Introduction 26
2.1 Objectives 27
2.2 Initial Approximation to a Root 27
2.3 Bisection Method 28
2.3.1 Error Analysis 29
2.4 Regula Falsi Method 29
2.5 Newton’s Method 30
2.5.1 Error Analysis 33
2.6 Secant Method 35
2.7 Method of Successive Iteration 36
2.8 Summary 38
2.9 Exercises 39
2.10 Solutions to Exercises 39
2.0 INTRODUCTION
An equation of the type f(x) = 0 is algebraic if it contains power of x, that is, f(x) is a
polynomial. The equation is called transcendental, if it contains powers of x,
exponential functions, logarithm functions etc.
Example of algebraic equatoins:
2 x = 5, x 2 + x = 1, x 7 = x(1 + 2 x) .
Example of transcendental equations
x
x + sin x = 0, e = x, tan x = x.
As we know, direct methods can be used to solve the polynomial equations of fourth
or lower orders. We do not have any direct methods for finding the solution of higher
order polynomial equations or transcendental equation. In these cases, we use
numerical methods to solve them.
In this unit , we shall discuss some numerical methods which give approximate
solutions of an equation f(x) = 0. These methods are iterative in nature. An iterative
method gives an approximate solution by repeated application of a numerical process.
In an iterative method, we start with an initial solution and the method improves this
solution until it is improved to acceptable accuracy.
i) The total number of roots of an algebraic equation is the same as its degree.
ii) An algebraic equation can have at most as many positive roots as the number of
changes of sign in the coefficients of f(x).
26
Solution of
Algebraic and
iii) An algebraic equation can have at most as many negative roots as the number of Transcendental
changes of sign in the coefficient of f( − x). Equations
iv) If f(x) = a0xn + a1xn − 1 + a2xn − 2 + ... + an − 1x + an have roots α1,α2,...,αn, then the
following hold good:
− a1 a2 an
∑αi
i =
a0
, ∑α α
i< j
i j =
a0
, ∏αi
i = (−1) n
a0
.
2.1 OBJECTIVES
All the numerical methods have in common the requirement that we need to make an
initial guess for the root. Graphically, we can plot the equation and make a rough
estimate of the solution. However, graphic method is not possible to use in most cases.
We with to determine analytically an approximation to the root.
This theorem states that if f is a continous function on [a, b] and the sign of f(a) is
different from the sign of f(b), that is f(a)f(b) < 0, then there exists a point c, in the
interval (a, b) such that f(c) = 0. Hence, any value c ε (a, b) can be taken as an initial
approximation to the root.
We find f(3)f(4) < 0. Hence, any values in (3, 4) can be taken as an initial guess.
Since f(2) and f(3) are of opposite signs, a root lies between 2 and 3. The initial guess
can be taken as any value in (2, 3).
27
Numerical
Computing -I
2.3 BISECTION METHOD
This is one of the simplest methods and is based on the repeated application of the
intermediate value theorem.
Table 3
After 24 iterations we see that the smaller root can be found in the interval
[.578300476, .578300595]. Therefore, we can estimate one root to be 0 .5783005. One
of the first things to be noticed about this method is that it takes a lot of iterations to
28
Solution of
Algebraic and
get a high degree of precision. In the following error analysis, we shall see method as Transcendental
to why the method is taking so many directions. Equations
i≥
[log(b − a) − log ε i ] (1)
log 2
As the interval at each iteration is halved, we have (ε i +1 / ε i ) = (1 / 2) . Thus, this
method converges linearly .
Solution : We have f(x) = x3 − 2x − 5 , f(2) = −1 and f(3) = 16. The smallest positive
root lies in (2, 3). Therefore, a = 2, b = 3, b − a = 1, we need solution correct to two
decimal places, that is,
Let the root lie in the interval (a, b). Then, P(a, f(a)), Q(b, f(b)) are points as the curve.
Join the points P and Q. The point of intersection of this, with the X-axis, c, line is
taken as the next approximation to the root. We deermine by the intermediate value
theorem, whether the root now lies in (a, c) or (c, b) we repeat the procedure. If x0, x1,
x2,…… are the sequence of approximations, then we stop the iteration when
| xk+1 − xk| < given error tolerance.
29
Numerical
Computing -I The equation of line chord joining (a, f(a)), (b, f(b)) is
f (b) − f (a )
y – f(a) = (x − a).
b−a
The rate of convergence is still linear but faster than that of the bisection method.
Both these methods will fail if f has a double root.
Example 5: Obtain the positive root of the equation x2 −1 = 0 by Regua Falsi method.
Solution: Let f(x)=x2 −1. Since f(0) = −1, f(2) = 3, Let us take that the root lies in
(0, 2). We have x0 = 0, x1 = 2.
f(0.8) = -0.36. The root lies in (0.8, 2). The next approximation
0.8(3) − 2.0(−0.36)
x4 = = 0.9286, f (0.9286) = −0.1377.
3 + 0.36
Note that in this problem, the lower end of the interval tends to the root, and the
minimum error tends to zero, but the upper limit and maximum error remain fixed. In
other problems, the opposite may happen. This is the property to the regula falsi
method.
We first look at a “pictorial” view of how Newton's method works. The graph of
y = f(x) is plotted in Figure 3.1. The point of intersection x = r, is the required root.
30
Solution of
Algebraic and
Transcendental
Equations
x0 r
(x0 , f(x0 ))
x0 r
Figure 2.2: Point on the centre
Draw the tangent line to the curve at the point (x0 , f(x0 )) . This line intersects the
x-axis at a new point, say x1 (Figure 3.3).
(x0 , f(x0 ))
x0 x1 r
(x0 , f(x0 ))
x0 x1 x2 r
Figure 2.4: Newton’s method
31
Numerical
Computing -I Now, we derive this method algebraically. The equation of the tangent at (x0, f(x0)) is
given by
Solution : Let f(x) = x7 + 9x5 − 13x − 17, we have f(0) < 0, f(1) < 0 and f(1)f(2) < 0.
Hence, the smallest positive root lies in (1, 2). We can take any value in (1, 2) or one
of the end points as the initial approximation. Let x0 = 1, we have,
f’(x) =7x6 +45x4 − 13. The Newton-Raphson method becomes
x n7 + 9 x n5 − 13 x n − 17
x n +1 = xn − , n = 0,1,2.........
7 x n6 + 45 x n4 − 13
Table 4
n xn f(xn ) f'(xn ) xn+1
0 1 −20 39 1.512820513
1 1.512820513 52.78287188 306.6130739 1.340672368
2 1.340672368 12.33751268 173.0270062 1.269368397
3 1.269368397 1.46911353 133.1159618 1.258332053
4 1.258332053 0.03053547 127.6107243 1.258092767
5 1.258092767 0.00001407 127.4932403 1.258092657
Possible drawbacks:
(c) Cycle
However, the dificulties posed have one artifical. Normally, we do not encounter such
problems in practice. Newton-Raphson methods is one of the powerful methods
available for obtaning a simple root of f(x) = 0.
1 f " ( x)
en f ' ( x)[1 + en + .......]
2 f ' ( x)
en +1 = en −
f " ( x)
f ' ( x)[1 + en + ..........]
f ' ( x)
1 f " ( x) f " ( x)
= en − en [1 + en + ........][1 + en + ........]−1
2 f ' ( x) f ' ( x)
1 f " ( x) f " ( x)
= en − en [1 + en + ........][1 − en + ........]
2 f ' ( x) f ' ( x)
1 f " ( x)
= en − en [1 − en + ........]
2 f ' ( x)
1 f " ( x) 2
= en en + ........] (5)
2 f ' ( x)
We can neglect the centric and higher powers of en, as they are much smallest than en2,
(en is itself a small number).
33
Numerical
Computing -I Notice that the error is squared at each step. This means that the number of correct
decimal places doubles with each step, much faster than linear convergence. We call it
quadratic convergence.
This sequence will converge if
f " ( x) 2 f " ( x)
en < en , en < 2 (6)
f ' ( x) f ' ( x)
If f’ is not zero at the root (simple root), then there will always be a range round the
root where this method converges.
If f’ is zero at the root (double root), then the convergence becomes linear.
Example 7: Compute the square root of a, using Newton’s method. How does the
error behave?
f ( xn ) x 2 − a xn 2 + a 1 a
xn +1 = xn − = xn − n = = xn + (7)
f '( xn ) 2 xn 2 xn 2 xn
Starting with any suitable initial approximation to a , we find x1, x2, ….., which
convege to the required value.
(en + a ) 2
en +1 = − a
2( a + en )
2a + 2en + a + en 2
= − a
2( a + en )
2( a + en ) a + en 2
= − a
2( a + en )
en 2
= (8)
2( a + en )
Since a>0, en+1 will be positive, provided en is greater than −√a, i.e provided xn is
positive. Thus, starting from any positive number, all the errors, except perhaps the
first, will be positive.
We now discuss another method, which does not require the knowledge of the
derivative of a function.
Let x0, x1 be two initial approximations to the root. We do not require that the root lie
in (x0, x1) as in Regula Falsi method. Therefore, the approximations x0, x1 may lie on
the same side of the root. Further, we obtain the sequence of approximations as
x2, x3…… At any stage, we do not require or check that the not lies in the interval
(xk, xk –1). The derivation of the method is same as in the Regula Falsi method.
(Figure 2.6)
The rate of convergence of the method is super linear (1.618), that is, it works better
than the Regula Falsi method.
Example 8: Use secant method to find the roots of the equation f(x) = 0.5ex − 5x + 2.
Solution: We have f(−x) =0.5e−x + 5x +2 > 0 for all x. Hence, there is no negative
root.
We obtain,
f(0) = 2.5, f(1) = − 1.6408, f(2) = − 4.3055, f(3)= −2.9572,
f(4) = 902990, f(x) > 0 for x > 4.
Therefore, the given function has two roots, one root in (0, 1) and the second root in
(3, 4).
For finding the first not, we take x0 = 0, x1 = 1, and compute the sequence of
approximations x2, x3,…..
For finding the second root, we take x0 = 3 , x1 = 4 and compute the sequence of
approximations x2, x3,……
35
Numerical
Computing -I The results are given in Table 5.
Table 5
The two roots are 0.57830058, 3.4017958 correct to all decimal places given.
The first step in this method is to write the equation f(x) = 0 in the form
x = g(x). (11)
x= 4x − 2 , (12)
Thus, we can choose from (11) in several ways. Since, f(x) = 0 is the same as x =
g(x), finding a root of f(x) = 0 is the same as finding a root of x = g(x), i.e. finding a
fixed point α of g(x) such that α = g(α) . The function g(x) is called an iteration
function for solving f(x) = 0.
x n+1 = g( xn ) (15)
with the hope that the sequence will converge to α. The successive iterations for
solving x = e−x/3, by the method xn + 1 = e−xn/3 is given in Figure 2.7.
36
Solution of
Algebraic and
Transcendental
Equations
The method converges if, for some constant M such that 0< M <1, the inequality
Condition (16) is satisfied if the function g(x) possesses a derivative g ′ (x) such that
| g ′ (x) | < 1 for | x − α | < | x0 – α| If xn is close to α , then we have
Example 9 : Let us consider the equation f(x) = x3 + x − 2. It has only one real root at
x = 1. There are several ways in which f(x)=0 can be written in the desired
form, x = g(x).
For example, we may write x = x + f(x) = g(x) and write the method as
xn+1 = xn + f ( xn ) = xn3 + 2 xn − 2
Since, this is never true, this arrangement doesn't converge to the root.
An alternate rearrangement is
xn+1 = 2 − xn3
37
Numerical
Computing -I This method converges when
1 1
g ′( x) = − 3 x 2 < 1, or x2 < , or x < .
3 3
Since this range [−1 3 ,1 3 ] does not include the root x = 1, this method will not
converge either.
Another rearrangement is
xn+1 = 3 2 − xn
Another rearrangement is
2
xn +1 = 2
(21)
xn + 1
This inequality is satisfied when x > 1. Hence, if we start with such an x, the method
will converge to the root.
2.8 SUMMARY
In this unit, we have discussed the acutal meaning of root. In general, root
determination of an equation is a tedious exercise. So, to handle such tasks, we have
discussed some basic, simple, but still powerful methods of root determination. The
methods discussed in this unit are Bisection method, Regular falsi method, Newton’s
method, Secan method and Successive iteration method.
2.9 EXERCISES
E1) In the following problems, find the intervals of length 1 unit, in which the roots
lie
(a) 12x3 – 76x2 + 131x – 42 = 0; (b) 4x2 + 8x – 21 = 0
(c) x – e–x = 0 (d) x = 2 cos x
E2) Find all the roots in Problems 1(a), (b), (c) by ergular falth method, secant
method and Newton-Raghson method.
38
Solution of
Algebraic and
E3) Find the smaller roots in Problems 1(b) and the root in 1(c), by successive Transcendental
iteration method. Equations
E4) Show that the equation x3 – 6x – 1 = 0, has a root in the internal (–1, 0). Obtain
this root using the successive iteration method.
E1) (a) (0, 1), (1, 2), (3, 4) (b) (– 4, –3), (1, 2)
(c) (0, 1) (d) (0.5, 1.5)
39