<<

UNIT 3 CHORD METHODS FOR FINDING ROOTS

Structure 3.1 Introduction Objectives 3.2 Regula-Falsi Method 3.3 Newton-Raphson Method 3.4 Convergence Criterion 3.5 Summary

3.1 INTRODUCTION

In the last unit we introduced you to two iteration methods for finding roots of an . f(x) = 0. There we have shown that a root of the equation f(x) = 0 can be obtained by writing the equation in the form x = g(x). Using this form we generate a sequence of approximations x, + , = g(xi) for i = 0. 1,2, . . . We had also mentioned there that the success of the iteration methods depends upon the form of g(x) and the initial approximation xo. In this unit, we shall discuss two iteration methods : regula-falsi and Newton-Raphson methods. These methods produce results faster than . The first two sections of this unit deal with derivations and the use of these two methods. You will be able to appreciate these iteration methods better if you can compare the efficiency of these methods. With this In view we introduce fhe concept of convergence criterion which helps us to check the efficiency of each method. Sec 3.4 is devoted to the study of rate of convergence of different iterative methods.

Objectives After studying the unit you should be able to : apply regula-falsi and secant methods for finding roots apply Newton-Raphson method for finding roots define 'order of convergence' of an iterative scheme 'obtain the order of convergence of the following four methods : i) bisection method ii) fixed point iteration mettiod iii) secant method iv) Newton-Raphson method

3.2 REGULA-FALSI METHOD (OR METHOD OF FALSE POSITION)

In this section we shaH discuss the 'regula-falsi metbod'. The Latin word 'Regula Falsi' means rule of falsehood. It does not mean that the nlie is a false statement. But it conveys that the'roots that we get according to the rule are approximate roots and nor necessarily exact roots. The method is also known as the method of false position. This method is similar to the bisection method you have learnt in Unit 3.

The bisection method for finding approximate roots has a drawback that it makes use of only the signs of f(a) and f(b). It does not use the values f(a), f(b) in the computations. For example. if f(a) = 700 and f(b) = 4.1, then by the bisection method the first approximate value of a root of f(x) is the mid value xo of the interval la, b[. But at xo. f(xo) is nowhere near 0. Therefore,in this case it makes more sense to take a value near to 4. I than the ChdMethods for Finding Roots middle value as the approximation to the root. This drawback is to some extent overcome by the regula-falsi method. We shall first describe the method geometrically. Suppose we want to find a root of the equation f(x) = 0 where f(x) is a . As in the bisection method, we first find an interval ]a. b[ such that f(a) f(b) < 0. Let us look at the graph of f(x) given in Fig. I.

(a. f(a) )

Fig. 1 :Reguia-Falsi Method

The condition f(a) f(b) < 0 means that the points (a, f(a)) and (b, f(b)) lie on the opposite sides of the x-axis. Let us consider the line joining (a, f(a)) and (b, f(b)). This line crosses the x-axis at some point (c, 0) [see Fig. I]. Then we take the x-coordinate of that point as the first approximation. If f(c) = 0, then x = c is the required root. If f(a) f(c) < 0, then the rat lies in ]a. c[ (see Fig. 1 (a)). In this case the graph of y = f(x) is concave near the root r). Otherwise, if f(a) f(c) > 0, the root lies in lc, b[ (see Fig. 1 (b)). In this case the graph of y = f(x) is convex near the root. Having fixed the interval in which the root lies. we repeat the above procedure. ktus now wjite the above procedure in the mathematical form. Recall the fonnula for the line joining two points in the Cartesian plane [see MTE-051. The line joining (a. f(a))and (b, f(b)) is given by f(b) f(a) y - f(a) = ---- (X- a) b-a We can rewrite this in the form y-f(a) x-a ... f(b) - f(a) - b-a ' Since the straight line intersects the x-axis at (c, O), the point (c, 0) lies on the straight line. Putting x = c, y = 0 in Eqn. (I), we get -f(a) c-a f(b) - f(a) - b - a

This expression for c gives an approximate value of a root of f(x). Simplifying (2). we can abwrite it as a f(b) - b f(a) C = f(b? - f(a) Now, examine the sign of f(c) and decide in which interval ]a, c[ or Ic, b[, the root lies. We thus obtain a new interval such that f(x) is of opposite signs at the end points of this interval. By repeating this process, we get a sequence of intervals ]a, b[, ]a, al[, ]a, %[, . . . as shown in Fig. 2. Solutions of Nun-linear in one Variable

Fig. 2

We stop the process when either of the following holds. i) The interval containing the zero of f(x) is of sufficiently small length or ii) The diffbrince between two successive approximations is negligible. In the iteration format, the method is usually written as

where ]x0, x1[ is the interval in which the root lies.

We now summarise this method in the form. This will enable you to solve problems easily.

Step 1 : Find numbers xo and xl such that fGO)f(.x,) < 0, using the tabulation method.

xo f(xJ - x1 f(xo) Step2:Setx2=- . This gives the first approximation. f(xl) - f(xO)

Step 3 :If f(x2) = 0 then x2 is the required root. If f(x2) f 0 and f(x& f(x2) < 0, then the next approximation lies in ]x0, x2[. Otherwise it lies in ]x2, xl[.

Step 4 :Repeat the process till the magnitude of the difference between two successive

iterated values xi and xi + is less than the accuracy required. (Note that I xi + I - xi I gives the error after ith iteration).

Let us now understand these steps through an example...... - Example 1: It is known that the equation x?.+ 7x2 + 9 = 0 has a root between -8 and -7. Use the regula-falsi method to obtain the root roundedoff to 3 decimal places. Stop the

iteration when 1 xi + I - xi I < lo4.

Solution : For convenience we rewrite the given function f(x) as

Since we are given that xo = -8 and xl = -7, we do not have to use step 1. Now to get the first approximation, we apply the formula in Step 2. Since, f(xo) = f(-8) = -55 and f(xl) = f(-7) = 9 we obtain Chord Metliads for Finding Roots (-8) 9 - (-7) (-5) = =- 2 9 + 55 Therefore our first approximation is -7.1406.

To find the next approximation we calculaie f(x2). We have

= 1.862856 Now we compare the sign of f(x2) with the signs of f(xo) and f(xl). We can see that f(xo) and f(x2) are of opposite signs. Therefore a root lies in the interval 1-8, -7.1406[. We apply the formula again by renaming the end points of the interval as xl = -8, x2 = -7.1406. Then we get the hecond approximalion as

-8 f(-7.1406) + 7.1406 f(-8) - . _-.- .

'We repeat this process using steps 2 and 3 given above. The iterated values are given in the :ollow~ng table. Table

I , Number of iterations 1 Interval I Iterated Values xi 1 The function value f(xi) 1 L- - - I

k From the table, we see that the absolute value of the difference between the 5th and 6th iterated values is 1 7.1748226 - 7.1747855 1 = .0000371. Therefore we stop the iteration here. Further, the values of f(x) at 6th iterated value is .00046978 = 4.6978 x lo4 which is close to zero. Hence we conclude that -7.175 is an approximate root of x3 + 7x2 + 9 = 0 rounded off to three decimal places. Here is an exercise for you.

------E 1) Obtain an approximate root for the following equations rounded off to three decimal places, using regula-falsi method

b) xsinx- I =O

I You note that in regula-falsi method, at each stage we find an interval ] xo, x, [ which contains a I root and then apply iteration formula (3). This procedure has a disadvantage. To overcome this, regula-falsi method is modified. The modified method is known as secant method. In this method we choose xo and x, as any two approximations of the root. The Interval ] xo, x I [ need

I not contain the root. Then we apply formula (3) with xo, xl, f(xO)and f(x,).

The iterations are now defined as :

xo f(xl) - XI f(xo) Y - Sdutions of kon-linear Equations in one Varlable

Note :Geometrically, in secant Method, we replace the graph ef f(x) in the interval

]x,, x,, ,[ by a straight line joining two points (x,, f(x, + ,), (x, + ,), f(xn+J)on the curve and take the point of intersection with x-axis as the approximate value of the root. Any line joining two points on the curve is called a . That is why this mehod is known as secant method. (see Fig. 3).

I

Fig. 3

Let us solve an example.

Example 2 :Determine an approximate root of the equation

using

i) secant method starting with the two initial approximations as xo = 1 and x I = 1 and ii) regula-falsi method. (This example was considered in the book 'Numerical methods for scientific and engineering computation' by M.K.Jain, S.R.K. Iyengar and R.K.Jain).

Solution :. Let f(x) = cos x - x ex. Then f(0) = 1 and f( I) = cos 1 - e = -2.177979523. Now we apply formula (4) with xo=Oand xl = 1. Then

Therefore the first iterated value is 0.3 146653378. To get the 2nd iterated value, we, apply Formula (4) with x, = 1, x2 = 0.3146653378. Now f(1) = -2.177979523 and f(0.3 146653378) = 0.5 1987 I 175. Therefore

1 We contime this process. The iterated values are tabulated in the following table.

Table 2 :Secant Method Number of iterations I Iterated values xi I f(xi)

From the table we find that the iterated values for 7th and 8th iterations are the same. Also the value of the function at the 8th iteration is close to zero. Therefore we conclude that 0.5 177573637 is an approximate root of the equation. ii) To apply regula-falsi method. let us first note that f(0) f(l)< 0. Therefore a root lies in the interval 10, 1 [. Now we apply Formula (3) with xg = 0 and x, = 1. Then the first approximation is

You may have noticed that we have already calculated the expression on the right hand side of the above equation in pan (il. Now f(x2)=0.51987 > 0. This shows that the root lies in the interval 10.3146653378. 11. To get the second approximation, we compute

which is same as x3 obtained in (i). We find f(x2)= 0.203545 > 0. Hence the root lies in 10.446728 1446. I[. To get the third approximation. we calculate

The above expression on the right hand side is different from the expression for x4 in part (i). This is because when we use regula-falsi method. at each stage, we have to check the condition f(xi) f(xi .. I)< 0. Solutions of Non-linear Equations The computed values of the rest of the approximations are given in Table 3. in one Variable Table 3 :Regula-Falsi Method No. Interval Iterated value xi -: f(xi) i

1 lo,] [ 0.3146653378 0.5 1987 1 2 1.04467281446.1 [ 0.446728 1446 0.203545 3 10.4940153366.1 [ 0.4940153366 0.708023 x lo-'

4 10.5099461404, 1 [ 0.5099461404 0.236077 x lo-'

5 10.5 1520 10099, 1 [ 0.5 152010099 0.77601 1 x

From the table, we observe that we have to perform 20 iterations using regula-falsi method to get the approximate value of the root 0.5 177573637 which we obtained by secant method after 8 iterations. Note that the end point 1 is fixed in all iteractions given in the table.

Here are some exercises for you.

E2) Use secant method to find an approximate root of the equation x2 - 2x + 1 = 0, rounded off to 5 decimal places, starting with xo = 2.6 and x, = 2.5. Compare the result with the exact root I +.\IT.

E3) Find an approximate root of the cubic equation x3 + x2 - 3x - 3 = 0 using a) i) regula-falsi method, correct to three decimal places. ii) secant method starting with a = 1, b = 2, rounded-off to three decimal plaJces. b) compare the results obtained by (i) and (ii) in part (a).

Next we shall discuss another iteration method. - 3.3 NEWTON-RAPHSON METHOD

This method is one of the most useful methods for finding roots of an algebraic equation.

Suppose that we want to find an 'approximate root of the equation f(x) = 0. If f(x) is continuous. then we can apply either bisection method or regula-falsi method ta find approximate roots. Now if f(x) and f (x) are continuous, then we can use a new iteratioh method called Newton-Raphson method. You will learn that this method gives the result hore faster than the bikction or regula-falsi methods. The underlying idea of the method is due to mathematician Isac Newton. But the method as now used is due to the mathematician Raphson.

Let us begin with an equation f(x) = 0 where f(x) and f(x) and are continuous. Let xo be an initial approximation and assume that xo is'close to the exact root a and f(xo) z 0. Let a = xO + h where h is a small quantity in magnitude. Hence f(a) = f(xo + h) = 0

,Now we expand f(xo + h) using Taylor's theorem, Note that f(x) satisfies all the requirements of Taylor's theorem. Therefote, wAget f(xo + h) ;f(xd) + hf (xo) +. . . = 0

Neglecting the terms containink' and higher powers we get . f(xo) + h f (x,) = 0. .This gives a new approximation to a as Chord Methods for Finding Rwts f(xO) xl=xO+h=x --

0 f (xd' 9

Now the iteration can be defined by

x =x -- * I f(xl)

Eqn. (5) is called the Newton-Raphson formula.. Before solving some examples we $hall explain this me&d geometsically.

Geometrical Interpretation df Newton-Raphson Method Let the graph of the function y F f(x) be as shown in Fig. 4.

e. Fig. 4 : Newton-Raphson Mthod

If xOis an initial approlimatian to the root, then the corresponding point on the graph is P(xv f(xO)).We draw a tangent to the curve at P. Let it intersect the x-axis at T (see Fig. 4). Let x, b~the x-coordinate of T.Let S(a,0) denote the point on the x-axis where the curve cuts the x-axis. We know that is a mot of the equation f(x) = 0. We take x, as the new approximation which may be closer to a than xg' Now let us find-the tangent at P(x,. f(x,,)). The of the tangent at P(xo, f(xo)) is given by f(xo).Therefox by the point-slope form of the expression for a tangent to a curve (recall the expression from MTE-OS), we can write

Y - fC%) = f(xo) (x, - xo) This tangent passes through the point T(x,, 0) (see Fig. 4). Therefore,we get

This ik the first iterated value. To get the sec~nditerated value we again consider a tangent at the point P(xl, f(xl)) on the curve(see Fig. 4) and repeat the process. Then we get a point Sdutiom of Non-Hmclr huntions TI(%, 0) on the x-axis. From the figure. we observe that T, is more closer to S(a. 0) than T. k aw Variable Therefore after each iteration the approximation is coming closer and closer to the actual - root. In practice we do not know the actual root of a given function.

Let us now take up some examples.

Example 3 :Find the smallest positive root of 2x-tanx=O by Newt-Raphson method, correct to 5 decimal places. Sdution :Let f(x) = 2x -tan x. Then f(x) is a continuous function and f(x) = 2 - sec2x is also a continuous function. Recall that the given equation has already appeared in an exercise in Unit 2 (see E2 in Unit 2). From that exercise we know that an initial approximation to the positive root of the equation is x = I.Now we apply the Newton-Raphson iterated formula. mi) . Xi=X.I- 1 --f(xi)' 1=l,2,3 ....

Here x,, = I. Then f(xd = f( I)= 2 - tan 1 = 0.4425922

f(xd=f(l)=2-~ec* 1 =2-(1 +tan21)

=I-tan21 = -1.425519 0.4425922 Therefore x, = I - - 1.4255 19 = 1.3 1048 For i = 2, we get 2 - tan(1.31048) X, = 1.31048 - I- tan2( 1.3 1048) = 1.22393 Similarly we get x, = 1.17605

x4 = 1.165926

x, = 1.165562

xn= 1.165561

Now x, and xn are correct to five decimal places. Haice we \top the iteration process here. The root correct to 5 decimal places is 1.16556.

Next we shall consider an application of Newton-Raphson formula. We know that finding the square mot of a number is not easy unless we use a calculator. Calculators use some algorithm to obtain this value. Now we shall illuhtrate how Newton-Raphson method enables us to obtain such an algorithm for calculating square roots. Let's consider an example.

Example 4 : Find an approximate value of fi using the Newton-Raphson formula.

Solution :Let x = 6.Then we have x2 = 2 i.e. x2 - 2 = 0. Hence we need to find the positive root of the equation x2 - 2 =O. Let f(x) = x2 - 2.

Then f(x) satisfies ail the conditions for applying Newton-Raphson method. We choose xo= I as the initial approximation to the root. This is because we know that 6lies between fi and and therefore we can assume that he root will be close to 1. Now we compute the iterated values. Chord McUloQ tor Fiading Rmts The iteration' fo??ula. is .

Putting i = 1.2.3,. . . . we get

Similarly

1 Thus the value of d?lco~ctto seven decimal places is 1.4 1.42 136. Now you can clicck this 1 value with the calculator.

Note I :The method used in the above example is applicable for finding square rm)t ol'i~ny positive dial number. For example suppose we want to find an approximate value of \'A where A is a positive real number. Then we consider the equation x2 - A = 0. The itrri~tcd formula in this case is

This formula involves only the basic'arithmetic operations +. -. x and +. Note 2 : From examples (3) and (4). we find that Newton-Raphson method gives the rcwt very fast. One reason for this is that the I f(x) I is large compared to If(x)l for any x = xi. The quantity 1%- I which is the difference between two iterated values is rmall in this case. In general we can say that if I f(xi) I is large compared to I f(xi) I, then wl. can obtain the desired root very fast by this method.

The Newton-Raphson method has some limitations. In the following remarks we mention some of the difficulties..

Remark 1 :Suppose f(xi) is zero in a neighbouthood of the root, then it gay happen that f(xi) = 0 for some xi. Inthis case we cannot apply Newton-Raphson formula, since division by zero is not allowed.

Remark 2 :Another difficulty is that it may happen that f(*)is zero only at the roots. This happens in either of the situations. i) f(x) has multiple root at a. Redlthat a polynomial function f(x) has a multipk root a of order N if we can write

, where h(x) is a function such that h(a) # 0. For a general function f(x), this means f(a) = 0 = f(a) = . . .= fY-'(a) and ?(a) # 0. ii) f(x).)las a stationary point (point of maximum of minimum) point at the root [recall fram your cd~luscourse (MTE-01) that iff(x) = 0 at some point x then x is called a

I stationary poinj). Solutions of Non-linear Equations In such cases some modifications to the Newton-Raphson method are necessary to get an in one Variable accurate result. We shall not discuss the modificatiolls here as they are beyond the scop: of this course.

You can try some exercises now. Wherever needed, you should c.-e a calpulator for computation.

E4) Starting with xo = 0 find an approximate root of the equation x3 - 4x + 1 = 0, rounded off to five decimal places using Newton-Raphson method. E5) The motion of a planet in the orbit is governed by an equatidh of the form 1 y = x - e sin x where e stands for the eccentricity. Let y = 1 and e = - Then fiird : 2 approximate root of 2x - 2 -sin x = 0 in the interval [O, n] with error less than Start with xo = 1.5.

E6) Using ~ewton-~a~hsons~uareroot algorithm, find the following roots within an accuracy of 1oP4. i) gl/', starting with xo = 3

ii) 91 I/', starting with xo = 10

E7) Can Newton-Raphson iteration method be used to solve the equation = O? Give reasons for your answer.

In the next section we shall discuss a criterion using which we can check the efficiency of an iteration process.

3.4-- CONVERGENCE--- CRITERION

In this section we shall introduce a new concept called 'convergence criterion' related to an iteration process. This criterion gives us an idea of how many successive iterations have to be carried out to obtain the root to the desired accuracy. We begin with a definition.

Definition 1 : Let xu, xI. . . . . x,. . . . be the successive approximations of an iteration

m process. We denote the sequence of these approximations as x 1 We say that 1 "In=o I lm converges to a root a with order p 2 1 if , xll,n =O

for some number h > 0. p is called the order of convergence and h is called the asymptotic error constant.

For each i. we denote by = xi -a. Then the above inequality be written as

This inequality shows the relationship between the error in successive approximations. For example. suppose p = 2 and 1 E~ 1 lo-' for some i, then we can expect that

1 &i + I 1 sh lo4. Thus if p is large, the iteration converges rapidly. When p takes the integer values 1. 2.3 then we say that the convergence i.s linear, quadratic and cubic respectively. In the case of linear convergence (i.e. p = I ). then we require that h < 1. In this case we can write (6) as

If this condition is satisfied for an ireratio; rocess then we say that the iteration process \!' \!' converges linearly. jetting n = 0 in the inequality (8), we get Chord Methods for Finding Roots I x,-a 111 I xo-a I Forn =.I, we get I~~-al

Similarly for n = 2, we get 1 xj-a1 1x1 x2-a) Ih21 x,-aI2h 3l x -a l

Using induction on n, we get that 1 xn-a I IP 1 xo-a I for n>O . . . (9)

If either of the inequalities (8) or (9) is satisfied, then we conclude that x 1- converges 1 "1.=0 to the root.

Now we shall find the order of convergence of the iteration methods which you have studied so far.

Let us first consider bisection method. . .

Convergence of bisection method Suppose that we apply the bisection method on the interval [ao, bo] for the equation f(x) = 0. In this method you have seen that we construct intervals [ao, bo] 2 [a,, b,] 2 [aZ,b2] 2 . . . . each of which contains the required root of the given equation. I Recall that in each step the interval width is reduced by - i.e. 2

"0 - a. and b, - a,, = - 2"

We know that the equation f(x) = 0 has a root in [ao, bo] Let a be the root of the equation.

an + bn Then a lies in all the intervals [ai, bi], i = 0, 1,2, . For any n, let C, = denote the . . . 2 middle point of the interval [a,,, b,]. Then coyc,, c2, . . . are taken as successive

m approximations to the root a. Let's check the inequality (8) for jc i nJn=o

For each n, a lies in the interval [a,, b,]. Therefore we have

m converges to the root a. Hence we can say that the bisection method always converges. Solutions of on-linear Equations For practical purposes, we should be able to decide at what stage we can stop the iteration to in one Variable have an acceptably good approximate value of a. The nufnber of iterations required to achieve a given accuracy for the bisection method can be obtained. Suppose that we want an approximate sobtion within an error bound of (Recall that you have studied error bounds in Unit 1, Sec 3.4). Taking logarithms on both sides of Eqn. (lo), we find that the number of iterations required, say n, is approximately given by [ln(bo 1a;, ;In lo-" n = int I where the symbol 'int' stands for the integral part of the number in the bracket and ]ao, bo[ is the initial interval in which a root lies.

Let us work out an example.

Example 5 : Suppose that the bisection method is used to find a zero of f(x) in the interval [O, I]. How many times this interval be bisected to guarantee that we have an approximate root with absolute error less than or equal to 10-5

Solution : Let n denote the required number. To calculate n, we apply the formula in Eqn. (II)withbo= 1,ao=OandM=5.

Then

Using a calculator, we find

= int [ 16.609640471 = 17 Similarly you can try the following exercise.

E8) For the problem given in Example 5. Unit 2. find the number n of bisections required to have an approximate root with absolute error less than or equal to lo-'.

The following table gives the minimum number of iterations required to find an approximate root in the interval 10, I [ for various acceptable errors.

This table shows that for getting an approximate value with an absolute error bounded by lo-'. we have to perform 17 iterations. Thus even though the bisection method is simple to use. it requ~resa large number of iterations to obtain a reasonably good approximate root. This is one of the disadvantages of the bisection method.

Note : The formula given in Eqn. (1 I) shows that. given an acceptable error, the number of iterations depends upon the initial interval and thereby depends upon the initial approximation of the root and not directly on the values of f(x) at these approximations.

Next we shall obtain the convergence criteria for the secant method.

Convergence criteria for Secant Method Let f(x) = 0 be the given equation. Let a denote a simple root of the equation f(x) = 0. Then we have f (a) # 0. The iteration scheme for the secant method is

For each i, set E~ = xi - a. Then xi = E~ +a. Substituting in Eqn. (12) we get Chord Methods for Finding Roots

Now we expand f(~~+a)and f(~~- a) using Taylor's theorem about the point x = a. tv(a) ff(a) We get f(~~+ a)= f(a)+ - E~ + --E~ + . 1 2

since f(a) = 0.

Similarly,

Therefore f(~!+ a) - f(~~- , + a) = ff(a)

Substituting Eqn. (14) and Eqn.(l6) in Eqn. (13). we get

By neglecting the terms involving E~ + E: E'~- I the above expression, we get

This relationship between the errors is called the error equation. Note that this relationship holds only if a is a simple root. Now using Eqn. (17) we will find a numbers p and h such that

Setting i = j - 1, we obtain P E.= AE. J J-1

Taking pth root on both sides, we get

Combining Eqns. (17) and (18), we get f '(a) h&P=&.E. - I 1 - 1 2tv(a) Solutions of Nan-linear Equations Substituting the expression for ei - , from Eqn: (19) in the above expression we get in one Variable hep-- ff(a) Ei h-l/p &,;/P 1 2f(a)

1.e. heiP =- h-vp &I + l/p ... 2f (a) Equating the powers of ei on both sides of Eqn. (20) we get

This is a quadratic equation in p. The roots are given by

Sir?ce p cannot be negative we ignore the negative value. Hence we have,

Now, to get the number h, we equate the constant terms on both sides of Eqn. (20). Then we get

Hence the order of convergence of the secant method is p = 1.62 and the asymptotic error

constant is [;;;;I'1-- +

Example 6 : The following are the five successive iterations obtained by secant method to find the root a = -2 of the equation x3 - 3x + 2 = 0.

xl =-2.6, x,=-2.4,L x3=-2.106598985,

x4 = - 2.022641412. and x5 =- 2.000022537.

3 Compute the asymptotic error constant and show that e5 = - E 3 -1'

Solution : Let f(x) = x3 - 3x + :!

Then

tv(x) = 3x2 - 3. tV(-2) = 9 tv'(x) = 6x. tv'(-2) = -12 Therefore 1. = I- [-irlr = - 0.77835 1205

Now

E~ = I x5 - a 1 = I - 2.000021537 + 2 = 0.000071537 and - E~=I-2.022641412+21=0.022641412. Hence we get that h E4 ,- E5 Chord Methods tor Findipg Roots

Convergence criterion for fixed point iteration method Recall that in this method we write the equation in the form x = g(x) Let a denote a root of the equation. Let xo be an initial approximation to the root. The iteration formula is xi+,=g(xi),i=O, 1,2,...... (21) We assume that gf(x) exists and is continuous and I gf(x) I < 1 in an intwal containing the root a. We also assume that xo, xl, . . . lie in this interval.

Since gf(x) is continuous near the root and I gf(x) I < 1, there exists an interval ]a - h, a + h[, where h > 0, such that I gf(x) 1 I k for some k, where 0 < k < 1. Since a is a root of the equation, we have 1 a = g(a). . . . (22) Subtracting (22) from (2 1) we get

xi + - a = g(xi) - g(a) Now the function g(x) is continuous in the interval ]xi, a[ and gf(x) exists in this interval. Hence g(x) satisfies all the conditions of the mean value theorem [see unit 11. Then, by the mean value theorem there exists a 5 between xi and a such that

Note that 5 lies in ]a - h, a + h[ and therefore I g'(5) I < k and hence

I I I I I xi-a I

I Setting i = 0, 1,2, . . ., n we get Ixl-al

This shows that the sequence of approximations {xi) converges to a provided that the initial approximation is close to the root.

We summarise the result obtained for this iteration process in the following Theorem.

Theorem :If g(x) and '(x) are continllous in an interval about a root a of the equation x = g(x), and if 1 g'(x) B < 1 for all x in the interval, then the successive approximations xl, x2, . . . given by

converges to the root a provided that the initial approximation xo is chosen in the above interval.

We shall now discuss the order of convergence of this method. From the previous discussions we have the result.

I xi + ,- a I I g'(5) I (xi - a) I Solutions of Non-linear Equations Note that 6 is dependent on each xi. Now we wish to determine the constants X and p in one Variable independent of xi such that P I xi+]-a I ~c I (xi-a) I Note that as the approximations xi get closer to the root a,g!(c) approaches a constant value

g'(a). Therefore, in the limiting case, as i + m, the approximations satisfy the relation , I xi+]-al

Therefore, we conclude that if g'(a) # 0, then the convergence of the method is linear. If g'(a) = 0, then we have 1 i+l-a=g(xi)-a

=g[(xi -a)+a] -a

By applying Taylor's theorem to the (xi - a12 function g(x) about a and neglecting = g(a) (xi - a)g'(a) 7-g"(6) - a higher powers. + +

since g(a) = a and g'(a) = 0 and 6 lies between xi and a.

Therefore, in the limiting case we have,

1 2 Ixi+,-a1 I- IgM(a)l lxi-a1 2

Hence, if g'(a) = 0 and g"(a) # 0, then this iteration method is of order 2.

Example 7 :Suppose a and P are the roots of the equation x2 +- ax + b = 0.Consider a rearrangement of this equation as

x=-- (ax + b) X (axi + b)

Show that the iteration xi + = - -will converge near x = a when a > , X. I 1 1 p I

Solution :The iterations are given by (axi + b)

xi + I = g(x.) = - -- , i=O, 1,2,...

By Theorem 1, these iterations converge- to a if I -gt(x) I < 1 near a i.e. if I gt(x)- 1 = I - 1 X'I c 1. Note that gt(x) is continuous near a. If the iterations converge to x = a, then we require

Now you recall from your elementary course (MTE-04) that if a and P are the roots, then a+p=-aandap=b Therefore 1 b 1 = 1 a 1 I P 1. Substituting in Eqn. (23), we get

, ~~I~>I~I=I~Ilpl 'Hence 1 al>l Dl. Similarly you can solve the following exercise. Chord Methods for Finding Roots

For the equation given in Example 7, show that the iteration xi + = ---- will ~9; , xi + a converge to the root x = a, when I a I < 1 p 1.

Finally we siall discuss the convergence of the Newton-Raphson method.

Convergence of Newton-Raphson Method Newton-Raphson iteration formula is given by

To obtain the order of the method we proceed as'in the secant method. We assume that a is a simple root of f(x) = 0. Let

Then we have

Now we expand f(~~+ a)and f (E~+ a), using Taylor's theorem. about the point a. We have

2 'i f (a) + E~ f '(a) + - f"(a) + . . . 2 I

- 'i+l- f (a) + E~f"(a) + ~f f"(a) + . . .

But f (a) = 0 and f (a) # 0. Therefore

Hence, by neglecting higher powers of Ei, We get

This shows that the errors satisfy Eqn. (6) with p = 2 and h = -'(a) Hence 2ff(a)' Newton-Raphson method is of order 2. That is at each step. the error is proportional to the square of the previous error.

Now, we shall discuss an alternate method for showing that the order is 2. Note that we can write (24) in the form x = g(x) where Sululions of Nun-linear Equations Then inone Variable

- f(x) f'(x) [f(x)12 Now, , f(a) f(a) g (a) = -- = 0, since f(a) = 0 and f (a) # 0. ff(a)12 Hence by the conclusion drawn just above Example 7, the method is of order 2. Note that this is true only if a is a simple root. If a is a multiple root i.e. iff(a) = 0, then the convergence is not quadratic, but only linear. We shall not prove this result, but we shall illustrate this with an example.

Let us consider an example.

Example 8 :Let f(x) = (x - 2)4 = 0. Starting with the initial approximation xo = 2.1, compute the iterations x,, x2, x3 and x4 using Newton-Raphson method. Is the sequence converging quadratically or linearly?

Solution :The given function hasinultiple roots at x = 2 and is of order 4.

Newton-Raphson iteration formula for the given equation is

1 = 4(3xi - 2)

Starting with xo = 2.1, the iterations are given by

Similarly x, = 2.05625

x3 = 2.042 1875

x4 = 2.03 1640625

Now~~=~~-2=0.l,E, =xl -2=0.075, ~,=0.05625, ~~=0.0421875, c4 = 0.03 1640625.

Then

and 3 Chord IWehds for Finding Roog Thus the convergence is linear in this case. The error is reduced by a factor of - with each 4 iteration. This result can also be obtained directly from Eqn. (25).

You can try this exercise now :

E 10) The quadratic equation x4 - 4x2 + 4 = 0 has a double root at x = 6.Starting with x, = 1.5, compute three successive approximations to the root by Newton-Raphson me [hod. Does the result converge quadratically or linearly ?

We now end this unit by giving a summary of it.

- 3.5 SUMMARY

In this unit we have described the following methods for finding a root of an equation f(x) = 0 i) Regula-falsi method : The formula is

where la, b[ is an interval such that f(a) f(b) < 0. ii) Secant method : The iteration formula is

where xo and x, are any two given approximations of the root.

iii) Newton-Raphson method : The iteration formula is

where xo is an initial approximation to the root. introduced the concept called convergence criterion of an iteration process discussed the convergence of the following iterative methods i) Bisection method ii) Fixed point iteration method iii) Secant method iv) Newton-Raphson method.

3.6 SOLUTIONSIANSWERS

El) i) Letf(x)=xloglox-1.2~0

We have to first find two numbeis a and b such that f(a) f(b) c0. Since the function loglo x is defined only for positive values of x, we consider on& positive numbers x. Let us take x = 1.2.3, . . .Then, using a calculator, f(l)= 1 (log1(,1)- 1.2=-1.2~0 C. Solutions of Non-linear Equations This shows that f(2) f(3) c 0 and therefore a root lies in 12,3[. NO; pui a = 2 in one Variable and b = 3. Then the first approximation of the root is

. Now f(2.72102) = 2.72102 (loglo2.72102) - 1.2 = 1.18291 - 1.2 < 0. Since f(2.72102) f(3) < 0, a root lies in the interval ]2.72102,3(. Hence the second ' approximation is

We find f(x2) = - 0.0004 < 0. Therefore the root lies in the interval ]2.7402,3[. The third approximation is obtained as

Since x2 and x3 rounded off to three decimal places are the same, we stop the process here. Hence the desired approximate value of the root rounded off to three decimal places is 2.740. ii) Let f(x) = x sin x - I Since f(0) = -1 and f(2) = 0.8 18594854, a root lies in the interval 10, 2[. The firs) approximation is

and f(x ,) = -0:0200 192 1 Since f(x < 0 and f(2) > 0, the root lies in ]-0.0200192 1,2[. The second approximation is obtained as x2 = 1.2 124074 and f(x2) = -0.00983461.

The root now lies in ] 1.2 124074,2[. Similarly we can calculate the third and fourth approximations as

and - x4= 1.1 1415714 Since x3 and x4 rounded off to three decimal places are the same, we stop the process here. Hence the desired root is 1.1 14.

E2) Let f(x) = x2 - 2x - 1. Starting with-%= 2.6 and x, = 2.5 the successive approximations are, = 2.4 1935484 Chord Methods for Finding Roots and f(x2) = 0.0 145682. To find the next approximation we compute

r ~imilarl~you can calculate that x4 = 2.4 142 1384 and x5 = 2.41421356 I Since x4 and x5 rounded off to 5 decimal places are the same, we stop the process I here. Therefore the required root rounded off to 5 decimal places is 2.4 1421. Now we compare this root with the exact root 1 + fi.Using a calculator we 1 + 6= 1 2.4 142 1. ro~ndedoff to five decimal places. Hence the computed root and exact root are the same when we round off to five decimal places.

E3) Let f(x) = x3 + x2 - 3x - 3 = 0 i) We first note that f(1) < 0 and f(2) > 0. Therefore a root lies in [I, 21. The first approximation x, is

and f(xl) =-1.36449 cO

Therefore the root lies in ] 1.57 142,2[. Proceeding similarly, we get the values as given in the following Table.

The table shows that x5 and x4 are correct to three decimal places. Therefore we stop the process here. Hence the root correct to three decimal places is 1.73 1. ii) In secant method we start with two approximatiops a = 1 and b = 2. Then the first approximation is the same as in part (i), namely

XI = 1.57142 To calculate the next approximation x2 we take b and x,. Here also we &getting the same value as in part (i), namely

Then we take x, = 1.57 142 and x2 = 1.70540 to get the third approximation xj. We have .wuthd Nm-1- Fyuh The rest of the values are given by

and xs = 1.73205 Since x4 and x5 rounded off to three decimal places are the same,we stop here. Hence the root is 1.732. rounded off to three decimal places.

Let us now compa~the two methods. We first note that 1 % + I - xi 1 gives the error after ith iteration. In regula-falsi method, the ermafter 5th iteration is I x5 - x4 I = 1 1.73194 - 1.73140 1

whereas in secant method, the error after 5th iteration is I x,-x, I = 1 1.73205- 1.73199 I

This shows that the error in the case of want method is smaller than that in regula-falsi method for the same number of iterations. m) The given function f(x) = x3 - 4x + 1 and its derivative f(x) = 3x2 - 4 are continuous everywhere. The initial approximation is xo = 0. The iteration formula is

The first approximation is

and f(x ,) = (0.25)3 - 4 (0.25) + 1 = 0.01 5625

The second approximation is given by '

Similarly we get x3 = 0.254101 Since x2 and x3 rounded off to four decimal places are the same. we slop the iteration here. Hence the root is 0.2541. E5) Let f(x) = 2x - 2 - sin x. The f(x) and f (x) are continuous everywhere. Starting with xo = 1.5, we compute the iterated values by the Newton-Raphson formula. The first iteration is + I

1 - sin (1.5) = 1.5 - 2 -cos(1.5) Chad Mctbob for FWhgRoots

Similarly, x2 = 1.498701

wefind I x2-x, I = 1 1.498701 - 1,498702 1 <

Therefore the required mot is 1.498701 E6) i) Newton-Raphm iterated formula for computing the 6 is

Starting with %, = 3, we obtain the iterated values as

= 2.82843 1 and xj = 2.828427

Since 1 x3 - x2 1 < lo4, we stop the iteration. Therefore the approximate mot is 2.8284. ii) Here the Newton-Raphson formula is

xi=+[xi-l+~]i=~,xi- I 1.2...

and xo = 10. The iterated values are

XI = 9.55

X, = 9.539398

X, = 9.539392

Since 1 x3 - x2 I < we get the approximate value as 9.5393.

E7) No, because f(x) = -is not continuous at the root x = 0. 3xu3 In(O.0l) - In l(r7] [I1.5 129251= E8) n = int = int [ .2 0.693 147 E9) Here g(x) = - -.The iteration x+a

converges to a if I g'(x) 1 = < I in an internal containing cr in particular we quire

i.e.(a+aY< 1 b 1. But we havea+f5=-aand&= b. Therefon we get p>lbl=lal 1st. i.e. l a1 < 1 Dl. Solutions of Nun-linear equations E10) The iterated formula is in one Variable xf -2 XI+, =xi- 4xi The three successive iterations are x, = 1.458333333

X, = 1.436667 143 x3 = 1.425497619

1 1 Then we get E~ = - E, and e2 = - E,. This shows that the sequence is not quadratically 2 2 convergent, it is linearly convergent.