0% found this document useful (0 votes)
15 views

Unit 2

Uploaded by

gkutube184
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Unit 2

Uploaded by

gkutube184
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Numerical

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

We often come across equations of the forms x4 − 3 x3 + x2 + 6 x − 5 =0 or


ex + x − 2 = 0 etc. Finding one or more values of x which satisfy these equations is
one of the important problems in Mathematics.

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.

Properties of polynomial equations:

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

After studying this unit, you should be able to :

• find an initial guess of a root;


• use bisection method;
• use Regula-falsi method;
• use Newton’s Method;
• use Secant Method, and
• use successive iterative method.

2.2 INITIAL APPROXIMATION TO A ROOT

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.

Intermediate Value Theorem

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.

Example 1: Find an initial guess to find a root of the equation, 2x – log10 x = 7.


Solution: Let f(x) = 2 x – log10 x – 7. The values of function f are as given in Table 1.
Table 1
X 1 2 3 4
f(x) −5 − 3.301 − 1.477 0.397

We find f(3)f(4) < 0. Hence, any values in (3, 4) can be taken as an initial guess.

Example 2: Estimate an initial guess to find a root of the equation,


2x – 3 sin x – 5 =0.
Solution: Let f(x) = 2x – 3 sin x – 5 . Note that f(−x) = − 2x + 3 sin x – 5 which is
always negative. Therefore, the function f(x) has no negative real roots. We tabulate
the values of the function for positive x, in Table 2.
Table 2
x 0 1 2 3
f(x) −5 − 5.5224 − 3.7278 0.5766

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.

The bisection method is defined as follows:


i) Find an interval (a, b) in which in root lies, using intermediate value theorem.
ii) Direction the interval (a, b). Let c = (a + b)/2. If f(c) = 0, then x = c is the root and
the root is determined. Otherwise, use the intermediate value theorem to decide
whether the root lies in (a, c) or (c, b).
iii) Repeat step using the interval (a, c).
iv) The procedure is repeated while an length the last interval is less than the desired
accuracy. The mid point of this last interval is taken as the root.

Example 3: Use bisection method to find a positive root of the equation


f(x) = 0.5 ex − 5x + 2
Solution: We find that f(0) = 2.5 and f(1) = −1.6408. Therefore, there is a root
between 0 and 1. We apply the bisection method with a=0 and b= 1. The mid point is
c = 0.5 and f(0.5) = 0.32436. The root now lies in (0.5, 1.0).

The tabulated values are shown in Table 3.

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

2.3.1 Error Analysis


The maximum error after the ith iteration using this process is given by
b−a
εi =
2i
Taking logarithms on both sides and simplfying, we get

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 .

Example 4 : Obtain the smallest positive root of x3 − 2x − 5 = 0, correct upto 2


decimal places.

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,

ε ≤ 0.5(10−2), from (1), we get

log 1 − log[0.5(10 −2 )] − log(0.005)


i≥ = ≈ 8.
log 2 log 2
This shows that 8 iterations are required to obtain the required accuracy. Bisection
method gives the iteratived values as x1 = 2.5, x2 = 2.25, …, x8 = 2.09. Then x ≈ 2.09
is the approximate root.

2.4 REGULA FALSI METHOD

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.

Figure 2.0: Regula Falsi method

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

Setting y = 0, we set the point of intersection with X-axis as givens


b−a
x = c=a− f(a)
f (b) − f (a )
af (b) − bf (a )
=
f (b) − f (a )

If we denote x0 = a, x1 = b, then the iteration formula can be written as


x n+1 f ( x n ) − x n f ( x n−1 )
x n +1 = , n = 1,2,...... (2)
f ( x n ) − f ( x n −1 )

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.

Then, using (2), we get


x 0 f (2) − x1 f (0) 0 − 2(−1)
x2 = = = 0.5, f (0.5) = −0.75
f ( 2) − f ( 0) 3 +1

The root lies in (0.5, 2.0), we get


0.5 f (2) − 2.0 f (0.5) 0.5(3) − 2.0(−0.75
x3 = = = 0.8
f (2) − f (0.5) 3 + 0.75

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

We obtain the next approximations as x5 = 0.9756, x6 = 0.9918, x7 = 0.9973,


x8 = 0.9990. Since, |x8 – x7| = 0.0017 < 0.005, the approximation x8 = 0.9990 is correct
to decimal places.

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.

2.5 NEWTON’S METHOD

This method is also called Newton-Raphsan method. We assume that f is a


differentiable function in some interval [a, b] containing the root.

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

Figure 2.1: Plor of y = f(x)

Let x0 be an initial approximation of r. Then, (x0, f(x0)) is a point as the curve


(Figure 3.2).

(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

Figure 2.3: Tangent at (x0, f(x0))

Now, x1 is a better approximation to r, than x0 . We now repeat this process, yielding


new points x2 , x3 , ... until we are “close enough” to r. Figure 3.4 shows one more
iteration of this process, determining x2 .

(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

y − f(x0) =f’(x0)(x − x0)


Where f’(x0) is the slope of the curve at (x0, f(x0)). Setting y = 0, we get the point of
intersection of the tangent with x-axis as
f ( x0 )
y − f(x0) =f’(x0)(x − x0), or x = x 0 −
f ' ( x0 )

But, this is our next approximation, that is


f ( x0 )
x1 = x0 −
f '( x0 )

Iterating this process, we get the Newton-Rephson as


f ( xn )
xn + 1 = xn − for n = 0, 1, 2,……. (3)
f '( xn )

Example 6: Find the smallest positive root of x7 + 9x5 − 13x − 17 = 0.

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

Starting with x0 = 1, we obtain the values given in Table 4.

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

After 6 iterations of Newton’s method, we have


x6 − x5 = 1.258092657 − 1.258092767 = 0.000000110.

Therefore, the root correct to 6 decimal places is r = 1.258092657.

Possible drawbacks:

Newton’s method may not work in the following cases:


i) The x-values may run away as in Figure 2.5(a). This might occur when the x-axis
is an asymptote.
ii) We might choose an x-value that when evaluated, the derivative gives us 0 as in
Figure 2.5(b). The problem here is that we want the tangent line to intersect the
x-axis so that we can approximate the root. If x has a horizontal tangent line, then
we can't do this.
32
Solution of
Algebraic and
iii) We might choose an x, that is the beginning of a cycle as in Figure 2.5(c). Again Transcendental
it is hoped that the picture will clarify this. Equations

(a) Runaway (b) Flat spot

(c) Cycle

Figure 2.5: Divergence of Newton’s method

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.

2.5.1 Error Analysis

Let the error at the nth step be defined as


en = xn − x

Then the error at the next step is


f ( x + en )
x + en +1 = x + en − .
f ' ( x + en )

Explaing in Taylor Series, we obtain


f ( x ) + en f '( x) + 12 en 2 f ''( x) + .....
en +1 = en − (4)
f '( x) + en f ''( x) + .....

Since, x is a root, we have f(x) = 0. Then,

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?

Solution: Let x = a , or x2 = a. Define f(x) = x2 − a. Here, we know the root exactly,


so that we can see how well the method converges.

We have the Newton’s method for finding a root of f(x) = 0 as

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.

Error at the nth step is en= xn − a . Substituting, we get

(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 )

If a = 0, this simplifies to en/2, as expected. Here, we are finding the root of x2 = 0,


which gives a double root x = 90.

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.

The method converges when,


en 2
| en +1 |= <| en | (9)
2( a + en )
or en < 2(en + a )
34
Solution of
Algebraic and
which is always true. Thus, the method converges to the square root, starting from any Transcendental
positive number, and it does so quadratically. Equations

We now discuss another method, which does not require the knowledge of the
derivative of a function.

2.6 SECANT METHOD

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)

Figure 2.6: Secant method

The method is given by (see Equation (21))


x n −1 f n − x n f n −1
x n +1 = (10)
f n − f n −1

We compute x2 using x0, x1; x3 using x1, x2; and so on.

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

xn-1 xn xn-1 xn xn+1


0 1 2.5 –1.640859086 0.60373945
1 0.603739453 –1.6408591 –0.104224624 0.57686246
0.603739453 0.576862465 –0.1042246 0.002909403 0.57830459
0.576862465 0.578304589 0.0029094 –1.68E-06 0.57830058
0.578304589 0.578300578 –1.65E-05 –2.57E-09 0.57830058
0.578300578 0.578300577 –2.57E-09 1.11E-15 0.57830058
0.578300577 0.578300577 1.11E-15 0 0.57830058

3 4 –2.9572315 9.299075017 3.24128244


4 3.241282439 9.29907502 –1.423168098 3.34198736
3.241282439 3.341987358 –1.4231681 –0.572304798 3.40972316
3.341987358 3.409723161 –0.5723048 0.079817605 3.40173252
3.409723161 3.401432525 0.07981761 –0.003635061 3.40179365
3.401432525 3.401793651 –0.0036351 –2.15E-09 3.4017958
3.401793651 3.401795804 –2.15E-05 5.87E-09 3.4017958
3.401795804 3.401795804 5.87E-09 –7.11E-15 3.4017958

The two roots are 0.57830058, 3.4017958 correct to all decimal places given.

2.7 METHOD OF SUCCESSIVE ITERATION

The first step in this method is to write the equation f(x) = 0 in the form

x = g(x). (11)

For example, consider the equation x2 – 4x + 2 =0 . We can write it as

x= 4x − 2 , (12)

or as x = (x2 + 2)/ 4, (13)


2
or as x = (14)
4−x

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.

If an initial approximation x0 to a root α is provided , a sequence x1 , x 2 ,….. may be


defined by the iteration scheme

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

Figure 2.7: Successive iteration method

The method converges if, for some constant M such that 0< M <1, the inequality

| g(x) – g(α) | ≤ M | x – α | (16)

holds true whenever |x − α | ≤ | x0 – α | . For, if (16) holds, we find that

| xn + 1 – α | = | g(xn ) – α | = | g(xn ) – g(α ) | ≤ M | xn – α | (17)

Using this relation recursively, we get

| xn+1 – α | ≤ M | xn – α | ≤ M 2 | xn-1 – α | ≤ M n | x0 – α | (18)

Since, 0 < M < 1, lim Mn = 0 and thus lim xn = α.

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

| xn + 1 – α | = | g(xn ) – g(α ) | ≤ g ′ (ξ ) | xn − α | (19)

for some ξ between x0 and α . Therefore, condition for convergence is

| g ′ (ξ ) | < 1, or | g ′ (x) | < 1. (20)

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

In this case, g ′ (x) = 3x2 + 2, and the convergence condition is


g ′( x) = 3 x 2 + 2 < 1, or 3 x 2 < −1.

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

In this case, the convergence condition becomes


1 −2 3
(2 − x n ) < 1, or ( 2 − x n ) − 2 < 33 , or x n − 2 > 27 .
3

Again, this range does not conain the root.

Another rearrangement is
2
xn +1 = 2
(21)
xn + 1

In this case, the convergence condition becomes


4| x|
< 1, 4 | x |< (1 + x 2 ) 2
(1 + x 2 )2

This inequality is satisfied when x > 1. Hence, if we start with such an x, the method
will converge to the root.

Let x0 = 1.2, Then, from (21), we obtain the sequence of approximations as


x1 = 0.8197, x2 = 1.1963, x3 = 0.8227, x4 = 1.1927, x5 = 0.8255, x6 = 1.1894, …….

The approximations oscillate about x = 1 and converge very slowly.

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.

2.10 SOLUTIONS TO EXERCISES

E1) (a) (0, 1), (1, 2), (3, 4) (b) (– 4, –3), (1, 2)
(c) (0, 1) (d) (0.5, 1.5)

E2) (a) 0.5, 1.2, 3.5 (b) – 3.5, 1.5


(c) 0.567143

E3) (a) Use xn+1 = xn – 0.05(4xn2 + 8xn – 21) with x0 = 1.4


(b) Write xn+1 = en–xn

E4) Write xn+1 = (xn3 – 1) / 6; x0 = –0.5, – 0.167449

39

You might also like