Unit-I Roots of Equation 1. Zero’s of a Polynomial and Transcendental Equations: Given an equation...

33
Unit-I Roots of Equation 1

Transcript of Unit-I Roots of Equation 1. Zero’s of a Polynomial and Transcendental Equations: Given an equation...

Unit-IRoots of Equation

1

Zero’s of a Polynomial and Transcendental Equations:

Given an equation f(x) = 0, where f(x) can be of the forum

(i) f(x) = a0xn + a1xn-1 + …….. + an Algebraic Polynomial

(ii) or trigonometric, exponential or logarithmic function

f(x) = ax + b logx i.e. (Transcendental)

if f(ξ) = 0 for some ξ, than x= ξ is said to be a zero is a root of multiplicity p if f (x) = (x- ξ)p g(x) = 0 where g(ξ) ≠ 0.

We can define the root of an equation as the value of x that makes

f(x) = 0. The roots are some limites called the zeros of the equation. There are many functions for which the root cannot be determined so easily.

2

One method to obtain an approx. solution is to plot the function and determine where it crosses X-axis. Graphical methods provide rough estimates of roots and lack precision.

The standard methods for locating roots typically fall into some what related but primarily distinct problem areas

3

How to locate the real roots of pn(x) = 0, where

pn(x) = a0xn + a1xn-1 + …….+ an .

I.The Number of positive roots of pn(x) = 0, where the coefficients ‘a’s are real cannot exceed the number of changes in signs of the coefficients in the polynomial pn(x) and the number of negative roots of pn(x) cannot exceed the number of changes of the sign of the coefficients in pn(-x) = 0

II.Largest rot of pn(x) = 0 is approximately equal to the root of a0x+a1=0. The smallest roots of pn(x)=0 may be approximated by an-1x + an = 0III.If p(a) and p(b) have opposite signs, then there are odd number of real roots of pn(x) = 0 between (a,b). If p(a) + p(b) have the same sign than there are no or an even number of real roots between a and h.

4

The general technique to find the roots of an equation is to start with an initial appox. value and than find the better approximation successively by repeating the same method. The methods discussed here are (i) Bisection method (ii) Regula Falsi and (iii) Newton Raphson methods.

Bisection Method:

This method is based on the concept of incremental search methods by locating an interval where the function changes sign. Then the location of the sign change is identified more precisely by dividing the interval into a number of sub-intervals.

Each of these sub-intervals is searched to locate the sign change.

5

we know that if a function f(x) is continuous between (a,b) and f(a) and f(b) are of opposite sign than there exists at least one real root between (a,b)

In Bisection method we take the approx. values of root as

If f(x0) = 0, than is a root of f(x) = 0 if f(x0) ≠ 0 than the root either lies between a and x0 or x0 and b depending upon whether f(x0) is positive or negative.

Again Bisect the interval and repeat the process until the root is obtained to desired accuracy.

The following is the algorithm for Bisection Method:

Step I. Choose lower xl and upper xu estimates of the root which ensures f(xe) f(xu) < 0

Step II. A first estimate of the root xr is determined by

20

bax

2

ba

2

uer

xxx

6

Step III Make the following evaluations to determine in which sub-interval the root lies

(a) If f(xe) f(xr) < 0, root lies between xe and xr than set xu = xr and continue to step 4.

(b) If f(xe) f(xr) > 0, root lies in xr and xu set xe = xr and go to step 4.

(c) If f(xe) f(xr) = 0, than root lies in xr and Terminate the computation

Step IV. Calculate a new estimate of the root by

Step V. Decide if your new estimate is accurate enough to meet your requirement. If yes stop, If no goto step III.

2ue

r

xxx

7

Newton Raphson Method

Let a be the approximate root and h be the correction applied, then for a+h to be a root of f(a+h) = 0. then by

Taylor’s theorem

, If h is small

a2 = (a+h) + h1

in this method h is taken to be small quantity which will be small when is large. i.e. correct value of the root can be obtained more rapidly and with little labour when graph is nearly vertical where it crosses X-axis.

Computer Program for Newton-Raphson Method can be improved by incorporating a number of additional features.

1.If possible, a plotting routine should be included in the program.

0..)(!2

)()()( ''2

1 afh

ahfafhaf

)(

)(' af

afh

)(' xf

8

2. At the end of the computation, the final root estimate should always be substituted into the original function to compute whether the result is close to zero.

3. The program should always include an upper limit on the number of iterations

9

The False Position or Regula-Falsi Method

The method exploits the graphical insight by joining the points by a straight line. The intersection of this line with x-axis represents an improved estimate of the root. It is also called the linear interpolation method.

Here y=f(x) is taken as straight line between (x1,y1) and (x2,y2) where the two points are on the opposite sides of a-axis.

the x coordinate of the line joining the intersection of (x1,y1) and (x2,y2)gives the desired root. Here

Can be used to find h. The desired root then will be

|||||| 21

12

1 yy

xx

y

h

)1(01 xhx 10

Find If y1 and y(1) are of opposite sign then root lies between x1 and otherwise it lies between

The procedure is repeated until the root is estimated adequately.

)( )1()1( xfy )1(

0x 2)1(

0 & xx

11

Algorithm for Bisection Method

I. Take initial approx. for x1 and x2.

II. Compute f(x1) and f(x2)

III. If f(x1).f(x2)>0, then no root lies between x1 and x2 and goto step [V] otherwise goto step IV.

IV. Calculate

V. If f(x1) f(x0)<0 than take

x2=x0 otherwise set x1=x0

VI. Next approx

Repeat step IV

VII. Stop.

)(2 0

210 xfand

xxx

221 xx

12

Some Specific Comments:

I. f(x) is continuous in [a,b].

II.Bisection Method gives the real roots of f(x)=0 and is also known as BOLZANO METHOD OR

INTERVAL HALVING METHOD.

III. The Method always converges.

13

Algorithm for Regula Falsi Method:

I.Take Initial approx. x0 and x1 and find f(x0) and f(x1).

II. Next approx. Find f(x2)

III. Stop.

In iterative methods we start with some initial approx. solution and improve these solution step by step in such a manner that the revised value moves towards the true value in minimum number of steps.

The fastness of convergence in any method is represented by its rate of convergence.

)()(

)()(

01

0110

xfxf

xfxxfx

14

The iterative method is convergent if |g`(x)| < 1 If g`(x) is very small the number of iterations will be lesser. Let α denote the true value. If xi and xi+1 are the approx. at ith and i+1th iterations then error ei at ith iteration

ei = xi- α and ei+1=xi+1-a

or ei+1 ≤ eik where in(a,b)

Since unchange is 1, the rate of convergence of iterative method is linear.

Rate of convergence and Algorithm for Newton-Raphson Method:

Let xn = a + en, xn+1 = a+en+1

)('

)(1

n

nnn xf

xfxxNow

15

Hence rate of convergence of Newton Raphson Method is QUADRATIC

21

2

2

1

1

)('

)("

)('

)(

nn

n

nn

n

nnn

eeor

approxafe

afee

Similary

eaf

eafeaea

16

Algorithm:

I.Assign initial approx. for x say x=x0

II.Obtain f(x0) and

III.Find the next estimate of x0 by

IV.Replace x0 by x1

V.Repeat step - 3

)( 0' xf

)(

)(

0'

001 xf

xfxx

17

Flow chart

10

START

Define function f(x)

Define Function Bisect

Initialize itr

Call function bisect with x,a,b,itr B

A18

yes No

Is f(a)*f(x)

<0a=xb=x

c

A

Call function bisect with x,a,b,itr B

Is fabs(x1-x)<a err

20

19

No Yes

10

C

Is itr<maxitr

20

Print ‘Solution does not converge’

STOP

Print itr,x1

20

itr=itr+1

x = (a+b)/2.0

B

Print itr, x1

Return

21

TESTQ.1 Find f’(0.6) and f’’ (0.6) from the following table:

X: 0.4 0.5 0.6 0.7 0.8

F(x): 15836 17974 20442 23275 26510

 

Q.2 A curve passes through the points given by the following table:

X: 1 1.5 2.0 2.5 3 3.5 4

Y: 2 2.4 2.7 2.8 3 2.6 2.1

Find the area bounded by the curve, the x-axis and the lines at x=1 and x=4 using Trapezoid Rule, Simpsons 1/3 and 3/8 rules.

 

Q.3 Explain the terms Numerical Integration & Numerical Differentiation.

Regula Falsi Method

Regula falsi method is faster than an Bisection method. algebric and transcedental equation f(x)=0. Here we find an interval with in which the root lies. If it is (a,b) then the value of the function at the two points shall be of opposite sign. i.e. If f(a) > 0 than f(b)<0 and vice versa.

Now we try to find a line lying between [a,f(a)] and [b,f(b)] and find the point on this line which cuts the x-axis which can be considered to be a new approximation.

The equation of the line is given by

At the point x, y=023

Iaxab

afbfafy

)()()(

)(

Putting this value in I we get

In Regula Falsi method the successive approx. are achieved by using relation III.For converting x into simplified from we substitute the values of f(a) and f(b) in terms of a,b by finding f(a) and f(b) for the given function and substituting these in III

24

IIIafbf

afbbfax

gsimplifyinafafbf

ahaxor

afafbf

ahaxei

IIaxab

afbfaf

)()(

)()]([

)(.)()(

)(

)()()(

)(..

)()()(

)(0

Eg. For the equation

f(x) = x3 - 4x - 9 f(a) = a3 -4a -9

f(b) = b3 -4b -9

Putting these values in III, we get & simplifing

But successively putting next values of a & b. we can find the new approximations. Successively in a easy way and it save out time and then getting the new interval (a,b) successively until the two approximations are same upto n places of decimals for n decimal accuracy.

Here at each step like Bisection the value of a and b will change according to sign of f(x). 25

IVaabb

bbaaabx

44

9933

33

In Regula Falsi & Bisection method the difference is only in evolution of successive approximations.

The advantage is the Regula Falsi method will need lesser iteration to solve the problem than Bisection method.

26

Example : Find a real root of the equation x3 - 4x - 9 = 0 by Regula Falsi Method Correct to four decimal places.

Solution : Here f(x) = x3 - 4x - 9 = 0

f(2.70) = -0.117 and f(2.71) = +0.062511 which

are the opposite sign.

The root lies between 2.70 and 2.71 i.e. (a=2.70, b =2.71)

The approximation to the root by Regula-falsi metehod is determined by

27

94)(94)(

)1()()(

)()(

33

bbbfandaaaf

afbf

afbbfax

Putting these in (1) and after simplification we get

Now for the sake of simplicity we use equation (2) for the estimation of successive approximation for the latest interval (a,b) as follows. Now, the first approximation, using (2) for (a=2.7, b=2.71)

a will be changed by x1 i.e. a = 2.706571 and b will be unchanged

28

)2(44

9933

33

aabb

bbaaabx

0)(0)(

..0)706517.2()(706571.2

1

11

afxf

veeifxfandx

The new interval enclosing the root become (a=2.706517, b = 2.71)

The Second approximation,

x2 = 2.706527937

Since in the first and second approximation x1 and x2, the four decimal place is same, so the iterative process will stop. x = 2.7065 is root correct to four decimal place using Regula falsi method.Note: The above problem was solved by the Bisection method taking the same initial approximation i.e. the intervals. But in Bisection it takes six approximation where as in Regula falsi it takes only two approximation. Thus it is clead that in case of Regula falsi, it is not necessary to take very small interval.

29

Newton Raphson Method:

This method is faster than bisection and regula falsi method. But the convergence in raphson method depends on choice/ selector of initial approximation. i.e. this method is more sensitive towards the initial selection.

Here we use any value x0 which lies between a,b and then the point which lie on the curve x0,f(x0).

Now new approximation x1 is obtained by drawing a tangent at x0,f(x0) that cuts x-axis.

From the triangle PQR

3010

00

' )(tan)(

xx

xf

P

Rxf

Here we draw another tangent at x=x1 which cuts the x axis at x=x2 and this is the desired root.

Example : Find the real root of the equation x3 – 4x – 9 =0 using newton Raphson method.

Solution :

f(2) < 0 and f(3) > 0

Root lies between 2 & 3

31

)(

)(,

)(

)(..

)(

)(

1'1

0'

001

0'

010

xf

xfxx

xf

xfxxei

xf

xfxx

nn

43)( 2' xxf

5.220

ba

x

32706527.2

43

92

2

706749.243

92

1

728813.243

92

43

92

43

4)43(..

43

94

22

32

3

21

31

2

20

30

1

2

3

2

33

2

3

11

x

xx

i

x

xx

i

x

xx

x

x

x

xxxxei

x

xxxx

i

i

i

iiii

i

iii

Thus root correct upto 4 places of decimals x= 2.7065 33

706527.243

92

3

23

33

4

x

xx

i