Sie sind auf Seite 1von 37

296

APPLICATIONS OF P.D.E

ANSWERS

1 U (X t) = ~ [sm' 6 11: X cos 6 11: ct _ sin 4 11: x cos 4 11: C t J

• r 2 I I I I

2. u ( x r t )

4 1 1111:. .

~ 2" sin "2 sin 11 x cos 211t

11: n = 1 11

31 11: X 11: C t 1 3 11: X 3 11: C t

3 u (x t) = -- sin - sin----- sin -- sin--

• r 4 c 11: I I 12 c 11: I I

(-1 )n + 1 2 2

-11 C I

_O__----' __ g_ .

113

5. u ( x , t ) 12 ~

11 = 1

sin 11 x

6. u ( x r t) = 3 ~

n = 1

2 2

e - 11 IT I sin ( 11 11: X )

7. u (x, t) = ~ + 1~ ~ ~ { ( -1 )11 - 1 }

2 11: n=1 11 '

2 2 0

e - 11 IT c: 1/25

I111:X cos -S-

8. u (x, t )

~

11 = 1

40 r • 2 2 2 1/1600 . 11 11: X

-·~.l-S(-l)n; e-11 IT C

n11: l J sm---;w-

9. u (x, y)

11: 11=1,3,5,.

1. _y

- sm 11 x e

11

10. u (x, y)

~

11 = 1

sin ( 11 11:/2 ) . 11 11: X . ~

sin h 11 11: sin 10 sin h 10

Chapter - 5

,I Part - B

Unit- V

Numerical Methods (Part - /)

tt 5.1 Introduction

Numerical Methods provides various techniques to find approximate 'solution to difficult problems using simple operations. Numerical methods are easily adoptable to solve problems using computers as they involve sequential steps.

We discuss (i) numerical solution of algebraic and non algebraic equations.

(ii) exact and numerical solution of a system of linear

algebraic equations.

We also define eigen values and eigen vectors of a square matrix and discuss a numerical method to find the largest eigen value and the corresponding eigen vector.

tt 5.2 Numerical Solution of Algebraic and Transcendental

Equations

Given an equation f ( x) = 0, it is generally not possible to find roots x such that f ( x) becomes zero exactly. This topic deals with various numerical methods of obtaining approximate roots of the given equation.

2 3

Equations involving algebraic quantities like x, x ,x etc are called as

algebraic equations.

Example: (i) x3 - 4x - 9 = 0

Equations that involves non algebraic quantities like eX, log x, sin x, tan x etc. are called as transcendental equations.

Example:

(i) xi' - 2 = 0 (iii) tan x = 2x

(ii) x loge x - 12 = 0

298

NUMERICAL METHODS - I

NEWTON-RAPHSON METHOD

299

~--------------'-----'----

Numerical methods of finding approximate roots of the given equation is a repetitive type of process known as iteration process, In each step the result of the previous step is used and the process is carried out till we get the result to the desired accuracy, All the numerical methods are only approximate techniques for the solution of any problem and computers playa great role in various numerical methods for obtaining the result to the highest degree of accuracy,

If I ( x) = 0 is a real valued continuous function of the real variable x we have the following fundamental property:

If there exists two values a, b such that I (x) has opposite signs, say f( a) < 0, I( b) > ° equivalently I( a) , I( b) < ° then there always exist atleast one real root in the interval (a, b )

Geometrically the property means that the graph of y = I( x) intersects the x-axis atleast at one point Xo that Lies between a and b

which is a real root of f ( x) = 0

y

f(b)

~x '0 1M

x=b

This property is useful in locating an initial approximation for a real root of I( x) = 0

It is important to note that if the values a, b of x are nearer enough then the numerical iterative methods will give the real root to the desired accuracy quickly, In some methods we have to locate an approximate root x = Xo for st,:rting the iterative process, In which case, if the

magnitude say I (a) is nearer to zero compared to f ( b ), we prefer to take x = Xo = a as the initial approximation, We discuss two

numerical iterative methods.

1. Newton-Raphson method 2. Regula-falsi method

-$- 5.21 Newton - Raphson method

In this method we locate an approximate real root of the given equation and Improve Its accuracy by an iterative process.

Let f(x) = 0 bethegivenequationandlet Xo beanapproximateroot ~f the equation, If 11 is a small correction applied to the root then Xo + h IS the exact root and we try to find 11 such that f ( Xo + 11) =0

Using_Taylor's expansion of f( Xo + h) we have,

h2

f(x6) + h/,(xo) + 2! fff (xo) + '" = 0

Since 11 is a small quantity, Ii, 113, .. , being still smaller can be neglected, Hence we have

f( xo)

=----

or h

/' ( xo)

The first approximation to the root Xo is given by Xl = Xo + h. f( xo)

i.e. Xl = Xo - /' ( xo) provided I' ( xo) cf. 0

The second approximation is obtained by replacing Xo by Xl in the RH.S of this expression,

f( xl)

x2 = Xl ~ --- and so on.

/' (xl)

i.e.,

IngeneraJ we can write,

f( x )

X '= X _ n

n+l n /'(x)

n

This is called Newton-Raphson iterative formula.

-------

_______ ~~~~~~)VOR1iEiD-EXA~PLES--------------

~ ------------------------------

1. Use Newton - Raphson method to find a real root of the equation

x3 - 2x - 5 = 0 correct to three decimal places.

J» We shall find an interval ( a, b) where a real root of the equation ies and then locate the approximate root. '

300

NUMERICAL METHODS - I

Let f ( x) =' x3 - 2x - 5

f (0) = - 5 < 0, f ( 1) = - 6 < 0, f (2) = -1 < 0, f ( 3) = 16 > 0

A real root lies in (2, 3). It will be in the neighbourhood of 2 and let the approximate root Xo = 2.

The first approximation is given by

_ f(xo) _ .fJlJ_

Xl - Xo - I' ( xo) - 2 - f' ( 2 )

We have f (x) = x3 - 2x - 5, f' (x) == 3x2 - 2

x =2- (-1) =2+_l=2.1

1 3 (22) - 2 10

,_ f ( xl) _ f ( 2.1 )

Again, x2 - Xl - t' (xl)- 2.1 - t' ( 2.1 )

3

X = 2.1 _ [( 2.1) - 2 ( 2.1 ) - 5] = 2.0946

2 [ 3 ( 2.1 )2 - 2]

3 .

Similarl X = 2.0946 _ [( 2.0946) - 2 (2.0.946) - 5] = 2.0946

y 3 [ 3 ( 2.0946)2 - 2]

i.e.,

Thus the required approximate root correct to 3 decimal places is 2.095

--------------------------------------------

rff' 2. Show that a root of the equation x3 + 5x - 11 = 0 lies between 1 and 2. Find the root by Newton - Raphson method (carry out 3 iterations)

> > Let f ( x) = x3 + 5x - 11

f ( 1) = - 5 < 0, f (2) = 7> 0

a real root lies in (1, 2) and let Xo = 1

We have f ( x) = x3 + 5x - 11, f' ( x) = 3x2 + 5 f( xo)

I iteration: X = x - ---

I 0 t' (xo )

NEWTON-RAPHSON METHOD

301

X· -_ 1 - 1i_l_l_ -_ 1 - ( - 5 ) 1 5 1 62

I I' ( 1 ) [ 3 ( 1 )2 + 5] = + 8 = . 5

II iteration: x = 1.625 _ f ( 1.625 )

2 I' ( 1.625 )

i.e.,

i.e.,

[ ( 1.625)3 + 5 ( 1.625) - 11]

x2 = 1.625 - = 1.5154

[ 3 ( 1.625)2 + 5]

III iteration:

[(1.5154)3 + 5(1.5154) -11]

x3 = 1.5154 - = 1.5106

[ 3 ( 1.5154)2 + 5]

Thus the required root is 1.5106

CiT' 3. Use Newton - Raphson method to find a real root of

x sin x + cos x = 0 near x = rt. Carry out the iterations upto four decimal places of accuracy.

Let

f ( x) = x sin x + cos x

f' ( x) = x cos x + sin x - sin x = x cos x

Also Xo = rt (In radian measure)

x = x _ f ( xo) = n _ fl.!!J_ = _ (n sin n + cos n )

I 0 I' ( Xo ) f' ( n ) rt t: cos rt

1

.. Xl = n - - = 2.8233

n

Now, x = 2.8233 _ [2.8233 sin ( 2.8233) + cos ( 2.8233 ) ]

2 2.8233 cos ( 2.8233 )

.. x2 = 2.7986

Now, x = 2.7986 _ [2.7986 sin (2.7986) + cos ( 2.7986 ) ]

3 2.7986 cos (2.7986 )

X3 = 2.7984

Again replacing 2.7984 in place of 2.7986 as earlier we obtain x4 = 2.7984.

Thus the required real root is 2.7984

302

NUMERICAL METHODS· I

(iff" 4. Find a real root of the equation x3 + x2 + 3x + 4 == 0 applying Newton - Raphson method. Carruoui two iterations.

> > Let f ( x) == x3 + x2 + 3x + 4

f ( 0) == 4, f ( -1) == 1, f ( - 2) == - 6 < 0 a real root lies in (- 2, - 1) and let Xo == - 1

We also have r ( x) == 3x2 + 2x + 3 f (xo )

I iteration: Xl == Xo - n Xo )

i.e.,

_ f ( - 1) == _ 1 __ (ll__ == - 1.25

Xl == - 1 r ( - 1 ) 3 - 2 + 3

. . f ( - 1.25 )

II iteration : x2 == - 1.25 - r ( - 1.25 )

[ ( _ 1.25)3 + (- 1.25)2 + 3 ( - 1.25) + 4 J

i.e., x2 == -.1.25 - [ 3 ( _ 1.25)2 + 2 ( -1.25) + 3 J

x2 == - 1.2229

Thus the required real root is - 1.2229 '" - 1.223

--------------------------------------------

Cff" 5. Use Newton - Raphson method to find m correct to 3 decimal places. » Let x == :v37:. x3 == 37 or x3 - 37 == 0

Taking f(x) == x3 - 37 we have f(3) == -10 0, f(4) == 27> 0

:. a real root lies in (3,4) and let Xo == 3 be the initial approximation. Also r ( x) == 3x2

f( xo) The first approximation Xl == Xo - r ( Xo )

i.e.,

x == 3 _ f ( 3) == 3 _ (- 10 ). == 3.3704

- 1 I' ( 3 ) 3 ( 32 )

i: 3.3704 ) [ ( 3.3704)3 - 37 J

N 3 3704 == 3.3704 - 'c.2...___:__-'---;::-----'-

lOW, x2 ==. - r ( 3.3704 ) 3 ( 33704 )2

NEWTON·RAPHSON METHOD

303

5

x2 == 3.3327

[ ( 3.3327)3 - 37 J

== 3.3327 - 2 == 3.3322

3 (3.3327)

Again replacing 3.3322 in place of 3.3327 as earlier we obtain

--0

x4 == 3.3322

Now,

Thus the required m correct to 3 decimal places is 3.332

(iff" 6. Find a real root of the equation x eX - 2 == 0 correct to three decimal places using Newton - Raphson method.

> > Let f ( x) == x eX - Q

f ( 0) ==- 2 < 0, f ( 1) == 0.7183 > 0 .'. a real root lies in (0, 1) and let Xo == 1

Also r (x) == x eX + eX == eX (x + 1 )

f ( Xo ) l_(JJ_

Xl == Xo - r ( Xo) == 1 I' ( 1 )

0.1783

Xl == 1 - __ == 0.8679

el ( 2 )

, _ 08679 _ f ( 0.8679) _ 08679 [0.8679 eO 8679 - 2 J

x? - . r -. - == 0 8528

- f (0.8679) eO.8679 ( 0.8679 + 1 ) .

_ _ r- [ 0.8528 eO 8528 - 2 1

x3 - 0.8::128 - 0 ns == 0.8526

e _:J (1.8528)

Again replacing 0.8526 in place of 0.8528 as earlier, we obtain x , == 0.8526.



Thus the required real root correct to three decimal places is 0.853

,if' 7. In calculating the height of a oeriical column which will buckle under its own weight, it is necessary to solve the equation

x3 x2 x

12960 - 180 + "6 - 1 == O. Find one of the root near x == 8 upt.o 3

decimal places using Newton - Raphson method.

304

NUMERICAL METHODS - I

x3 X2 X

» Let f ( x) == 12960 - 180 + "6 - 1 and Xo == 8 by data.

x2 x 1

f' ( x) == 4320 - 90 + "6

f ( Xo ) u»:

xl == Xo - r ( xo) == 8 - l' ( 8 )

[ 83 82 8 'J

12960 - 180 + "6 - 1

== 8 - 2 == 7.8133

881 ----+-

4320 90 6

Now replacing 7.8133 in place of 8 as above we obtain the second approximation x2 == 7.8147 and on similar lines we obtain

x3 == 7.8147.

Thus the required root near x == 8 is 7.815

--------------------------------------------

Use Newton - Raphson method to derive the following and hence compute as mentioned. [8 to 12 ]

(ff' 8. An iterative formula to find {N and hence find ill

(ff' 9. An iterative formula for the reciprocal of the square root of a positive number and hence find (15 r 112 correct to four decimal places

(ff' 10. An interative formula for finding cube root of N and hence find cube root of10.

(ff' 11. An iterative formula for finding the reciprocal of a number and hence find 1/18.

(ff' 12. An iterative formula for finding the kilt root of a positive number and hence find fourth root of22

> > 8. Let x == {N

x2 == N or x2 - N==. 0

Taking f ( x ) == x2 - N, we have j' ( x) == 2x

NEWTON-RAPHSON METHOD

305

Newton Raphson iterative formula is given by

]

I

I' ( »; ) (x2 - N)

n

ie.,

X =x-----

11+ 1 11 2x

11

2x

/1

2x

11

1 [ N'

Thus xn + 1 ::: 2" XI1 + ;- I

11 J

This is the required iterative formula for finding {N.

To find ill we have to take N == 12 and the initial approximation can be located as follows.

... (i)

~ == 3, ill == 4 and ill is closer to ~ == 3.

Let Xo == 3 and the successive approximations xl' x2' x3"" are extracted from (i) by putting n == 0, 1, 2, ...

== l ,I x ... 12l == l I[ 3 ... 12l == " r.;

Xl '): 0 ' 2" 3 i ,~.v

~ L Xo J t_ J

1 I" 12l 1 r 12 -t

x == - It... - .- - I 3 5 + ._- I - 3 L!.643

'2 "l'l '. J-?'" 3'iJ-c,~"c

L Xl - L .c

1 I" 12 ] 1 r 12 ]

x3 == "2l x2 + x2 == "2l3.4643 + 3.4643 ::: 3.4641

1 I ' 12 I 1 [ 12 l

x4 ::: "2l x3 + x3 J =="2 3.4641 + 3.4641.J == 3.4641

Thus ill ::: 3.4641.

, 1

» 9. Let x ::: {N ..

2 1 x == N

2 1

or x - - ::: 0 N

2 1

Taking i: x ) == x - N' we have j' (x) ::: 2x and substitution in

the Newton-Raphson iterative formula yields

306

NUMERICAL METHODS - I

X2 + liN 11

2x

11

Thus xn+l = ~ [Xn + N~1t]

This is the required iterative formula for finding ]/.vN

To find (15 r 1/2 == 11m we have to take N == 15 and the initial approximation is located as follows.

... (ii)

Since 11m is close to 1/116 == 1/4 == 0.25, we shall take Xo == 0.25 and the successive approximations are obtained from (ii) by

putting n = 0,1,2,. .. .

Xl == -21 [XO + -=--51 l == -21 [0.25 + 1 ~J == 0.2583

1 Xo 15 x 0.25

_j

x2 == ~ l' xl + 1; l == ~ [0.2583 + 1 l == 0.2582

xl J 15 x 0.2583 J

x3 == -21 [X2 + -1.51 l == -21 [0.2582 + 1 l == 0.2582

x2 J 15 x 0.2582 J

Thus (15 )-1/2 == 0.2582

--------------------------------------------

» 10. Let X = N .'. x3 == N or x3 - N = O.

Taking f ( x) = x3 - N we have f' ( x) = 3x2 and substitution in the Newton - Raphson iterative formula yields.

x == X - ---::--

11+ 1 11 3i

n

Thus x == ! ,I 2x + N 1,

11 + 1 3 II 2

LX'I J

... (iii)

.

This is the required iterative formula for finding :vFr.

To find ~10 , we have to take N == 10 and m is close to rs = 2 and hence we shall take Xo = 2.

NEWTON·RAPHSON METHOD

307

;5

Also from (iii) we obtain

1 [" 101 1 'l 10 J

xl == 3"l2Xo + 2 , = 3" 2 x 2 + 2 == 2.1667

. Xo J 2

1 [" 10 1 1 r 10 ]

x2 == 3" I 2xI + 2 I == 3" i 2 x 2.1667 + 2 == 2.1545

L xl J L (2.1667)

. 1 [" 10 1 1 lr 10 l

x == - ! 2x + - I = ~ 2 x 2.1545 + --- = 2.1544

3 3 l 2 x; J J ( 2.1545 )2 J

1 [" lQ 1 _ l_ r 10 1 _

x4 == 3" I 2x3 + 2 I - 3 l2 x 2.1544 + ? J -.2.1544

L x3 J ( 2.1544 r

Thus -f1:O = 2.1544

1 » 11. Let x == N

1 1

. . - == N or - - N == 0

x x

(It may be noted that if we take f ( x) == x - l_ , f' (x) == 1 N

X I becomes liN it se/f\

11 + ) J

. 1 1

Taking f (x) == -x - N we have f' ( x) == -:2 and substitution in

~ x

the Newton - Raphson iterative formula will give us

x == x -

11+1 . 11

(11x - N)

11 2

2 == X + X (llx - N)

-llx 11 11 11

11

i.e.,

x 'I == X + X - Ni == 2 x - Nx2

I1T 11 11 /1 n n

... (iv)

Thus xn +.1 = xn (2 - Nxn) This is the required iterative formula for finding liN

To find 1/18 we have to take N == 18 and we observe that 1/18 is close to 1/20 = 0.05 and hence we shall take Xo == 0.05 .

Also we obtain from (iv),

308

NUMERICAL METHODS - I

Xl = Xo (2 - 18xO) = 0.05 ( 2 - 18 x 0.05) = 0.055

(

x2 = Xl ( 2 - 18x1) = 0.055 ( 2 - 18 x 0.055 ) = 0.05555

x3 = x2 (2 - 18x2) = 0.05555 (2 - 18 x 0.05555) = 0.0555555.

Thus 1/18 = 0.05555

» 12. Let X = ~ = N1/k

i = N or i - N = 0

Taking f(x) = i - N, 1'(x) = kxk-l.

Substituting in the Newton - Raphson iterative formula we have,

«-N) kx~ - x~ + N

X - v -

n+l - An - kxk-1- ki-1

11 n

... (v)

Thus xl1 +1 =

k~ This is the required iterative formula for finding 'iN

To find m we have to take N = 22 and k = 4.

We obtain from (v),

3x4 + 22

x = _____:.11:..___ = .l II 3x + 22 II

11 + 1 4x3 4 11 3

·11 L xn J

m=2and~

... (vi)

Further, we know that

= 3.

To find m we shall take Xo = 2 and we have from (vi),

11 22l I! 22l

Xl =0 4 I 3xo + 3" I = 41 3 x 2 + 3" I = 2.1875

L Xo J L 2 J

1 I 22 l 1 I " 22 l

x2 = 4l3X1 + xi J = 4lJ x 2.1875 + (2.1875 )3 J = 2.1661

NEWTON-RAPHSON METHOD

309

11 22l1[

X3 = 4 I 3x2 + -:3 I = 4 3 x 2.1661 +

L x2 J

22 1

= 2.1657

( 2.1661 )3

~ I

_j

I i

.-----------------------------~-------~-----

r:tf' 13. Derive Newton - Raphson iterative formula to find the real root of the equation x 10g10 x = 1.2 and hence find the root correct to four decimal

places.

» We have Newton - Raphson formula,

... (i)

Let f ( x) = X log10 X - 1.2

I' d 1 1 .,

( x) = x -d- ( ogF x) + og., 0 x . 1

X· LU L

d ( '\

= x "d--; \ loge x . 10g10 e ) + 10g10 x.

But 10g10 e = 0.4343

l' (x) = 0.4343 x ~ + 10g10 X = 0.4343 + 10g10 X

Hence (i) becomes

X == X -

n+ 1 11

( Xl1 log10 Xn - 1.2 ) 0.4343 + 10g10 XI1

0.4343 X + 1.2

11

Thus x" + 1 = ----"---- 0.4343 + lo~o xl1

... (ii)

This is the required iterative formula.

N xt 1 t u locate an approximate root of the equationf (x) = 0, where f ( x) = ,'10g10 x ~ 1.2

f(1) = -1.2 < 0,f(2) = -0.6 < 0,f(3) = 0.23 > 0

310

NUMERICAL METHODS - I

- We expect the root in the neighbourhood of 3 and hence let us take Xo = 3 as the initial approximation.

We have from (ii) when n = 0,

0.4343 Xo + 1.2

0.4343 x 3 + 1.2 = 2.74615 0.4343 + 10glO 3

x =

I 0.4343 + 10glO Xo

0.4343 xl + 1.2

x2 = . = 2.74065

0.4343 + 10glO Xl

0.4343 x2 + 1.2

x3 = = 2.74065

0.4343 + 10glO x2

Thus the required approximate root correct to four decimal places is 2.7407

«- 5.22 Regula Falsi Method or Method of False Position This is a geometrical method for finding an approximate real root of the given equation.

o

y

y =f(x) B [b,.f(b)]

a

b

x

Let the given equation f ( x) = 0 possess only one real root in the interval (a, b) and let j(a) < 0, f( b) > 0 say. The graph of y =.1 ( x) in (a, b) crosses the x-axis at only one point P as in the figure.

Solving f ( x) = Ois equivalent to, finding x such that y = 0 since y = f( x)

REGULA FALSI METHOD

311

That is to find the point where the graph of Y = f ( x) crosses the x-axis which is nothing but finding the distance OP.

Let A [a,j(a)], B[b,j(b)] be any two points on the curve Y = f ( x). We know that the equation of the line joining two points A ( Xl' YI), B ( x2' Y2) is given by

Y - Yj Y2 - YI

x - Xl X2 -- Xl

The equation of the chord AB as in the figure is

y - f ( a) '" f (}}_LJ ( a )

x-a b-a

At the point P' where the chord AB crosses the x-axis we must have Y = o. If a, b are close enough the point P' tends to P.

... (i)

Now putting y = 0 in (i) we have,

-f(a) _feb) -f(a)

x-a - b-a

i.e., (x-a) [feb) - fea)] = -(b-a)f(a)

t.e., x [f ( b) - f ( a ) J - a f ( b) + a f ( a) = - b f ( a) + a f (a)

t.e., x[f(b) - f(a)] = af(b) - bf(a)

Thus x = af(b) - bf(a)

f(b)-f(a)

Remark : If a, b are close enough we can obtain the approximate toot to the desired accuracy quickly. The problems are worked out by finding a and b at a difference of 0.1 to terminate the iterative process quickly.

- - - - - - - - - - - - - - - - ... - - - - - - - - - - - - - - - - - - _ ..... - - - - ---

WORKED EXAMPLES

--------------------------------------------

CJff'" 14. Use the regula falsi method to find a real root of the equation x3 - 2x - 5 = 0 correct to three decimal places.

» Let f( x) = x3 - 2x - 5

f(O) = -5,f(l) = -6,f(2) = -1 < 0 f(3) = 16> 0 A real root lies in (2, 3 )

\

312

NUMERICAL METHODS - I

It may be observed that the value of f ( x), at x = 2 being - 1 is nearer to zero compared to f ( 3) = 16 and we expect the root in the neighbourhood of 2. We shall have the interval (a, b) for applying the method such that b - a is small enough.

Nowf(2.1) =, (2.1)3 - 2(2.1) - 5 = +0.061> 0

the root lies in (2,2.1)

I Step: a == 2, f ( a) = f ( 2) = - 1

b == 2.1 feb) = f(2.1) =+ 0.061

st .. af(b)-bf(a)

1 approximation x, = f f

1 J(b)-.(a)

i.e., Xl = ~ (O·Q§2.L- (2.1) (-1) = 2.0942

0.061 - (- 1 )

... (i)

II Step:

f ( 2.0942) == (2.0942)3 - 2 ( 2.0942) - 5 = - 0.00392 < 0

the root lies in (2.0942,2.1)'

Now, a = 2.0942 f ( a) = - 0.00392

b = 2.1 f( b) = OD?!

Substituting in the RH.s of (i) we obtain the second approximation.

x = -( 2.0942 ) ( 0.061) - (2,1 ) ( - 0.00392) = 2.09455

2 0.061 - (- 0.00392 )

Comparing Xl and x2 we observe that the values are same upto the place of third decimal and hence the approximate root can be taken as 2.094

-------- -----------------------------------

QF 15. Cc uie the real root of x loglO x - 1.2 = 0 by the method false position. Carry out three iterations.

» Let f(r) == x loglO x - 1.2

f(1)." -1.2, f(2) = -0.6 < 0, f(3) = 0.23> 0

r-

The real root lies in (2,3) and from the values of f ( x) at x = 2, 3 we expect the root in the neighbourhood of 3 and let us find (a, b) for applying the method such that (b - a) is small enough.

I

(

J

I

, !

, I

f

)

l

I

'{

/'

J

('

'J

.J

REGULA FALSI METHOD

313

f ( 2.7) = 2.7 log10 2.7 - 1.2 = - 0.0353l

'. The root lies in ( 2.7, 2.8 )

f ( 2.8) = 2.8 loglO 2.8 - 1.2 = + 0.052

I iteration: a == 2.7 f (a) == - 0.0353

b == 2.8 feb) = + 0.052

X - EL( b) - b f ( a ) ... (i)

1- f(b)-f(a)

(2.7) (0.052) - (2.8) (- 0.0353) = 2.7404

Xl = 0.052 + 0.0353

II iteration: f( 2.7404) = - 0.00021 < 0

.. the root lies in (2.7404,2.8)

Now a = 2.7404 f (a) = - 0.00021

b ""' 2.8

f( b) = 0.052

Substituting in (i) we have

( 2.7404 ) ( 0.052) + (2.8) (0.00021) = 2.7406 0.052 + 0.00021

X =

2

III iteration: f ( 2.7406) == - 0.00004 < 0 the root lies in (2.7406,2.8) Now a = 2.7406 f (a) = - 0.00004

b = 2.8 f ( b) = 0.052

Again substituting in (i) we have,

., (2.7406) ( 0.052) + (2.8) (0.00004) = 2.740646

x3 '0.052 + 0.00004

Comparing x2 and x3 we have the same value upto the place of fourth decimal.

Thus the required approximate root is 2.7406

C]fF 16. Use the regula falsi method to find the fourth root of 12 correct to three decimal places.

» Let X = m

X4 = 12 or x4 - 12 = 0

Taking f ( x) = x4 - 12

we have,

314

NUMERICAL Me:'I'I'ODS· I

REGULA FALSI METHOD

315

f(0)=-12<0, f(1)=-11<0, f(2)=4>0 .. a real root of f( x) = 0 lies in (1,2) and will be i.n the neighbourhood of 2.

(i? 17. Show that a real root of the equation tan x + tan h x = 0 lies between 2 and 3. Then apply the regula falsi method to find the third approximation.

Now f(1.7) = -3.6479, f(1.8) = -1.5024 < 0 f( 1.9) = 1.0321 > 0

sin h x > > Let f ( x) = tan x + tan h x = tan x + --hcos x

the root in the neighbourhood of 2 lies in (1.8, 1.9 )

i.e.,

I Step: Let a = 1.8 f ( a) = - 1.5024 b = 1.9 f ( b) = 1.0321 af(b) - bj(a) f(b)-f(a)

[ This step is not required if the calculator has hyperbolic (hyp) function 1 In radian measure,

... (i)

i - ( II i ) e4 - 1

f (2) = tan 2 + 2 2 == tan 2 + -4-- = -1.221 < 0

e +(lle) e+l

e3 -11e3 i-I

f ( 3) == tan 3 + 3 3 == tan 3 + -6-- = 0.8525 > 0

e + 1/e e + 1

This shows that a real root of f ( x) == 0 lies in (2,3).

I approximation: Let a == 2 f (a) = -1.221

b = 3 f ( b) = 0.8525

ar(b) - bf(a)

x =

1 feb) -f(a)

x = 2 ( 0.8525) + 3 ( 1.221) == 2.59

1 0.8525 + 1.221

x 1

( 1.8 ) ( 1.0321 ) + (1.9) (1.5024)

Xl = . = 1.8593

1.0321 T 1.5024

II Step: f ( 1.8593) == - 0.0492 < 0

the root lies in (1.8593,1.9)

Now a = 1.8593 f ( a) == - 0.0492

b = 1.9 f ( b) == 1.0321

Substituting in (i) we obtain x2 == 1.8612

III Step: f( x2) = f( 1.8612) = - 0.00025 < 0

the root lies in (1.8612, 1.9 )

II approximation: f (xl) = f (2.59) = 0.3735 > 0

Now a = 1.8612 f (a) = - 0.00025

The root lies in (2, 2.59 )

b = 1.9

f( b) = 1.0321

Now a = 2

f (a) = - 1.221

Substituting in (i) we obtain x3 == 1.86121 '" 1.861

b = 2.59 f( b) = 0.3735

= 2 ( 0.3735) + 2.59 ( 1.221) = 24518

x2 0.3735 + 1.221 ..

III approximation: f ( x2) = f ( 2.4518) = 0.1603 > 0

Comparing x2 and x3 we can take the real root corr ct to 3 d it 1al places as 1.861

Thus the required fourth root of 12 is 1.861

-----------------------------.-.- .. -.----~--

The root lies in (2,2.4518)

316

NUMERICAL METHODS - I

Now a = 2 f ( a) = - 1.221

b = 2.4518 feb) = 0.1603

2 (0.1603) + (2.4518) (1.221) .-

x3 = 0.1603 + 1.221 = 2.3994

Thus the required third approximation is 2.3994

en=- 18. Find the approximate value of the real root of the equation x3 - 3x + 4 = 0 using the method of false position (Carry out 3 iterations)

» Let f ( x) = x3 - 3x + 4

f ( 0) = 4 > O. f ( x) continues to be positive for x = 1, 2, 3, . .. and hence we shall put x = - I, - 2, - 3, ...

f(-1)=6>O, f(-2)=2>O, f(-3)=-14<0

A real root lies in (- 3,·- 2) and we expect the approximation to be in the neighbourhood of - 2.

Now,f(-2.1) = 1.039, f(--2.2)= -0.048

. . the root lies in (- 2.2, - 2.1 )

I iteration: a = - 2.2 f ( a) =; - 0.048 b = - 2.1 f ( b) = 1.039

x = af(b)- bf(a)

I f(b)- f(a)

( - 2.2 ) ( 1.039 ) - (2.1 ) ( 0.048 )

xl = 1.039 + 0.048 = - 2.196

II iteration: f(xl) =f(-2.196) = -0.002 < 0 The root lies in (- 2.196, -2.1 )

Now a =-2.196 f(a)=-0.002

b=-2.1 f(b) = 1.039

(-2.196) (1.039) - (2.1) (0.002)

1.039 + 0.002 = - 2.1958

X = 2

IIIiteration: f(x2) =f(-2.1958) = -0.00027 < 0 The root lies in (- 2.1958, - 2.1 )

REGULA FALSI METHOD

317

a=;- 2.1958 f( a) = - 0.00027

b = - 2.1 f ( b) = 1.039

(- 2.1958) (1.039) - (2.1) (0.00027)

x3 = 1.039 + 0.00027 . = - 2.1958

Thus the approximate value of the real root is - 2.1958

en=- 19. Find the real root of the equation cos x = 3x - 1 correct to three decimals using regula falsi method.

» Let f ( x) = cos x + 1 - 3x.

In radians f ( 0) = 2 > 0, f ( 1 ) = - 1.46 < 0

A real root lies in (0,1) and we expect the root in the neighbourhood of 1.

Consider f ( 0.6) = 0.0253 > 0, f ( 0.7) = - 0.3352 < 0

the root lies in (0.6, 0.7 )

I iteration: a = 0.6 f ( a) = 0.0253

b = 0.7 f ( b) = - 0.3352 x = af(b) - bf(a)

I feb) -f(a)

. . xl = 0.607 (on substitution and simplification)

II iteration: f ( xl) = f ( 0.607) = 0.00036 > 0

the root lies in (0.607,0.7)

Now a = 0.607 f ( a) = 0.00036

b=0.7 f(b) =-0.3352

x2 = 0.607 (on substitution and eimplification ).

Hence the real root correct to 3 decimals is 0.607

318

NUMERICAL METHODS - I

Vi'" 20. Use the regula falsi method to obtain a root of the equation 2x - loglO x = 7 which lies between 3.5 and 4.

» Let f(x) = 2x - loglOx - 7

f ( 3.5) = 2 ( 3.5) - loglo 3.5 - 7 = - 0.5441

f ( 4) = 2 ( 4) - loglO 4 - 7 = + 0.3979

Taking a = 3.5 f ( a) = - 0.5441

b = 4 f ( b) = 0.3979

We have the first approximation

x _af(b)-bf(a) '1- feb) -f(a)

Xl = 3.79 (on substitution and simplification)

Also, f( xl) = f( 3.79) = 0.00136 > 0 .'. root lies in (3.5,3.79)

Now a = 3.5 f (a) = - 0.5441 b = 3.79 f( b) = 0.00136

, = (3.5) (0.00136) + (3.79) (0.5441) = 3.7893 "" 3.79

x2 0.00136 + 0.5441

Thus the approximate root correct to two decimal places is 3.79

EXERCISES

--------------------------------------------

Use Newton - Raphson method to find a real root of the following equations correct to three decimal places [ Problems 1 to 41

1. x4 + x3 - 7x2 - X + 5 = 0 in (2, 3)

2. x3 - 3x - 5 = 0

3. x eX - cos x = 0 near x = 0.5

4. log x - cos x = 0 near x "" 1.5

With the help of an appropriate iterative formulae originating from the Newton Raphson method compute the following correct to four decimal places [ Problems 5 to 10 1

5 . (12 )- 1/2 8. :w2

7. 1/~

10. ~200

6. ill

9. 1/e

BASIC MATRIX THEORY

319

Use Regula-Falsi method to find a real root of the following equations correct to three decimal places [ Problems 11 to 151

11. x3 - 5x - 7 = 0

12. x5 - x4 - x3 - lOin (1.4, 1.5)

13. x - 3 e - x = 0

14. x3 - 9x + 1 = 0 in (2.5,3)

15. x3 + x2 + X + 7 == 0

··ANSWERS

1. 2.061 2. 2.279 3. 0.518
4. 1.303 5. 0.2887 6. 4.1231
7. 0.6065 8. 2.8020 9. 0.3679
10. 2.8854 11. 2.747 12. 1.404
13. 1.050 14. 2.741 15. - 2.105 tf 5.3 Recapitulation of the basic matrix theory

A set of m 11 elements written in an array of m rows and n columns is called a matrix of order m x 11 (m by n).

If m = n the matrix is called a square matrix of order n.

The matrix of order 1 x n is called a row matrix and a matrix of order n x 1 is called a column matrix.

Consider a square matrix of order n.

I all al2 aln

A

I a a a

L 111 112 1111

In A the elements all' a22, ... aim constitute principal diagonal of the square matrix.

A square matrix is said to be a diagonal matrix if every element other than the principal diagonal elements are zero.

350 NUMERICAL METHODS· I
25 1 2 1
AX(2) 1 3 0 0.04
2 0 -4 0.07
25.18 1
1.12 25.18 0.04 = ),(3) X(3)
1.72 0.07 We observe that X(2) = X(3)

Thus the numerically largest eigen value of A is 25.18 and the corresponding eigen vector is [1, 0.04, 0.07 1 '

EXERCISES

Use Rayleigh's power method to determine the largest eigen value and the corresponding eigen vector of the following matrices

1.

[l 6 1
2 0
0 2
5 0 1 l
0 -2 0'
1 0 5 J
10 2 1 I
2 10 1 I
2 1 10 I
J 2.

3.

ANSWERS

1. Ie = 4: [1, 0.5, 0]'

2. Ie = 6; l 1, 0, 1 1 '

3. Ie = 13; [1, 1, 1 J '

Chapter - 6

Part - B

Unit - VI

Numerical Methods (Part - 1/)

1-E 6.1 Introduction

We come across with situations, while solving an engineering / physical problem or in the course of an experiment, having a data comprising a set of discrete values of the dependent variable corresponding to various values (equidistant or otherwise) of the independent variable.

We discuss various numerical methods for

(i) Estimating to a desired degree of accuracy the value of the dependent variable corresponding to a value of the independent variable

(ii) Knowing the form of function which satisfy all the conditions / data on hand

(iii) Obtaining the derivatives of the unknown function at some specified points of the independent variable

(iv) Obtaining the definite integral of the unknown function or the

value of the definite integral without the actual integration.

The numerical methods are highly useful when the analytical / theoretical approach to the problems are either unavailable or highly difficult.

We discuss Interpolation, Numerical Differentiation and Numerical Integration with the background of finite differences.

1-E 6.2 Finite differences

Consider a function y = f ( x). Let XO' Xl = Xo + h , x2 = Xl + h , ... ,

= XI1 _ 1 + It be a set of points at a common interval h. Let the corresponding values of y = f( x) be Yo = f( xo), Yl = f( Xl) , Y2 = f ( X2 ) ,., Y/1 = f ( XI1 ). The value of the independent variable X is called the argument and the corresponding functional value is known as entry. We define forward, backward and central differences concerning these values.

352

NUMERICAL METHODS - II

* 6.21 Forward Differences

The first forward difference of f ( x) denoted by Ci f ( x) is defined as follows.

Cif(;<) =f(x+h)-f(x)

Ci is called tl1e forward difference operator.

Thus we have for the values Xo ' xl' x2 , ... , X,1

Ci f ( ;(0) = f ( Xo + h ) - f ( Xo ) t.e., 6YO""YI-YO
Ci f ( Xl) = f ( Xl + h ) - f ( Xl ) i.e., 6 Y1 '" Y2 - Y1
Ci f (X2) = f ( x2 + h ) - f ( x2 ) i.e., l'). Y2 '" Y3 - Y2 etc., and lastly we have,

Ci f (xl1-1) == f ( Xn -1 + h) - f ( x}1 -1) i.e., Ci Yn - 1 == Yn - Yn - 1

The difference of the first forward differences are called second forward

differences. They are as follows. .

Ci2yo == CiY1 - CiYo ' Ci2Yl = CiY2 - CiYl r

Ci2Y2 == CiY3-CiY2 f' _. Ci2Yn_2 = CiYn_l-CiYn-2

Similarly the other higher order differences namely the thi.rd, fourth, etc., are obtained and tabulated. Such a tabular arrangement IS called a forWard difference table:

~-------.-,---~--,---,--. -,--~-

~X I Y I lty 62~_ .. _-+---=6=-112Y_'

I, X'o Yo II I I -Iii,

6yo ! I

[' Xl Y, I ~Yl ,,2 YO I ,,3yo I

I I I, I I

X'2 Y2 /::,.2 Y, I

· I ~'Yo !

I 1~3Y'3i

ICi2yl1_ 2 I

I I i

L____j__ __ ~----_j___

X, -l I Y, J

I I

I I

I I

L!~-YI1

FINITE DIFFERENCES

353

The first entries in the table namely ;';,.Yo' ;';,.2 Yo , ;';,.3 Yo , ... ;';,.!i }i;) are called the leading forward differences.

* 6.22 Backward differences

The first backward difference of f ( x) denoted by V f ( x) is defined as follows.

V f(x) =f(x)-f(x-h)

V is called the backward difference operator.

If X == x11: V f ( xl1) == f ( X11 ) -- f ( Xn - h ) or V Y,Z == Y" - Yn -1 X11 - h == X11 -1 and f ( xl1 - 1) == Yn-1

X == Xn _ 1 : V f ( X11 _ 1) == f ( X71 _ 1 ) =! ( XII _ 1 - 11 )

If

VYn_l == Yn-1- Yn-2 etc.

V Y2 == Y2 - Y1' V Y1 == Y1 - Yo

The difference of the first backward differences are known as second

or

backward differences. They are as follows.

V2 1/ = V Y - V Y V2 Y == V 1/ - VI}

. n n 11 - l' /I -1 . 11 - 1 . Y - 2

2

V Y2 = V Y2 - V Yl

Similarly the other higher order backward differences namely the third, fourth etc., are formed and tabulated. Such a tabular arrangement is called a backward difference table:

y Yo

V3y

n

Vlf

I

l~x",-,_._I __ .L__Y_:-"'.,_l--'L___V_Y_l1 __ _j__ V' Y~__i

354

NUMERICAL METHODS - II

The last entries in the table namely V Yn' V2 Yn' V3 Yn' ... VI1 YI1 are called the leading backward differences.

--------------~V(jRKEDE)(AMPLE~~~~~~~~~~~~~~~

----------------------------- 3'

("p.= 1. Construct a finite difference table for the function f ( x) = x ,+ x + 1 'where x takes the values 0, 1, 2, 3, 4, 5, 6. Identify the leading forward and backward differences.

» f ( x) = x3 + x + 1 by data. From this we obtain

f(O) = 1,/(1) = 3,/(2) = 11,/(3) = 31,/(4) = 69, f(5) = 131, f( 6) = 223.

The finite difference table is as follows.
x f( x) = y First Second Third Fourth
difference difference difference difference
0 1 I
2 I
1 3 6
8 6
2 11 12 0
20 6
3 31 18 0
38 6
4 69 24 0
62 6
5 131 30
I 92
L 6 223
Taking Xo = 0, Yo = 1, the first value in every column are the leading
forward differences. They are as follows: 1'1 Yo == 2 ,

4

1'1 Yo = 0

Also by taking x = 6 yl = 223, the last value in every column are the

11 I 1'1

leading backward differences. They are as follows:

V y = 92, V2 Y = 30, \73 1f = 6, \74 Y,. = 0

n 11 • n .

FINITE DIFFERENCES

355

QF 2. Construct the table of differences for the following data.

~1-f~(:~-)~t-~~~-i---;~.~~-~--~;~~--4-~:~.~~~~:.~

EvaluateI'12f(20), 1'13f(10) and t;.4f(0)

» We shall construct the forward difference table.

I x f(x) = Y t;.y 1',.2 V L'l31/ -,-_._--
I +
S 11
Xo = 0 I Yo == 1 I
I t;.yo == 0.5 , I
I
Xl == 10 Yl = 1.5 2 I
I L'lYo == 0.2 i
I
t;.Yl == 0.7 t;.3yo = 0 I
x2 = 20 Y2 == 2.2 2
t;. Yl == 0.2 1L'l4yo ==
IL'lY2 == 0.9 3 x: 0.4/
t;. Yl
L.:~; Y3 == 3.1 i 2 I
- L'l Y2 == 0.61
L'lY3 == 1.5 / I
0 Y4 = 4.6
I ----j

'-I

0.4/

I i

Thus we have from the table,
t;.2 f( 20 ) = L'l2f(x2) == t;.2Y2 == 0.6
t;.3f(10) == L'l3j(xl) = t;.3Y1 = 0.4
t;.4f(0) 4 == L'l4yo
= L'l f (xo ) == 0.4 --------------------------------------------

("iT 3. Starting from the definition of the finite differences obtain expressions

fi 2 3 7 . 3

or t;. YO' t;. YO' V- Yn and V YI1 in terms of the values of Y

» We have by the definition L'lf( x) = f( x + h) - f( x) L'lf(xo)==f(xo+h)-f(xo) or L'lYo=Y1-YO

Similarly L'l Yl == Y2 - Yj

Now L'l2 Yo = .L'l (t;. Yo) == L\!/I - L'lYo == (Y2 - Yl ) - ( YI - l/(] r

. )

I •

31

W

T 2.

T g

356

NUMERICJl,~ MS

~THODS -II

Thus /:i2 Yo = Y2 - 2Y1 + Yo

3 ?

Now /:i Yo = /:i (/:i- yo) = /:i (Y2 - 2Yl + yo)

= (Y3 - Y2) - 2 (Y2 - Yl) + (Yl - yo) "

We have by the definition V Yn = YI1 - YI1-1

V2 (Yn) = VYn - VYn_1

= iv, - Y11 - 1 ) - ( YI1 - 1 - Y n - 2 )

Thus V2 y = Y - 2y + Y

11 11 11-1 11-2

Next V3 Y = V ( V2 Y ) = V (Y - 2y + Y )

11 'n n 11-1 n-2

= (y n - Yn - 1) - 2 ( Y 11 - 1 - YI1 - 2) + (YI1 - ~ -" y

11 )

3 -3

Thus V Yll = Yn - 3Y,1 ~ 1 + 3ylI_ 2 + YI1 - 3

<:iF 4. Prove the [ollotoing results.

(a)

(b)

» (a) Consider R.H.s = Y2 + /:i Y1 + /:i2 Yo + /:i3 Yo

i.e., = Y2 + (Y2 - Y1 ) + (Y2 - 2Yl + yo) + (Y3 - 3Y2 + 3Yl - 10 )

= Y3 Thus R.H.S = L.H.S

(b)

VYs = Ys - Y7

V(VYs) = VYs - VY7 = (YS-Y7J-(Y7-Y6)

Th n2 - _ ')

us v Ys - Ys -Y7 + Y6

----------------------------------·-l_,

\,.. - - ---

FINITE DIFFERENCES

357

Evaluate the following:

<:iF 5. t. (x + cos x )

<:iF 6. t.11 (ix + 3 )

CF' 8. t.2 Ill- 1 I where h = 1 - + 5x + 6 J

<:iF 9. /:i I tan - 1 (il - 1 ') where h = l.

L "n)

» 5. I::,. (x + cos x) = j ( x + h ) + cos ( x + h ) )- ( x + cos x )

= h + i cos ( x + It ) - cos x 1

. ( 2x + h ') . (h '\ = n- 2 sm I --- I sin I - I

-, 2 ) ~2)

cos C - cos D = - 2 sin ( C ; D ) sin ( C ; D J

h . (l h). (h1

/:i (x + cos x) = - 2 sm x + "2 sm "2)

Thus

» 6. /:i (e2x + 3) = e3 I::,. (ix) = e3 t i (x + h) _ e2x :

= e3ix (e2h_l)

.. /:i (ix+3) = ix+3 (e2h_1)

Now /:i (/:i e2t+ 3) = (e2h _ 1 ) /:i (ix + 3 )

i.e., /:i2 (e2t+3) = (e2h_1) {iX+3 (e2h_l):

or t.2 (e2H3) = (ih -1 )2 e2x+3 and so on.

Thus we get, /:ill (ix + 3) = (ih - 1)11 i .. -.: + 3

» 7. I::,. (a bX) = a bX + h - a bX = a bX (bh - 1 ) Also /:i I::,. (a bX) = (bh - 1 ) /:i (a bX )

i.e., t. 2 (a bY) = (b" - 1) a bX (bh - 1 ) ~

or /:i2 (a bY) = (bh - 1 )2 a bX and so on.

Thus we get, 1::,.11 (a if) = (1i - 1 t a 11'

I 3

358

NUMERICAL METHODS - II

1

»8. Let f(x) = = ~

x2 + 5x + 6 ( x + :( )( x + 3 )

t,. f ( x) = f ( x + h ) - f ( x) by thE' d fi --

e imtion.

Since h = 1, t,. f ( x) = f ( x + 1 ) - f ( x )

Now, t,. jt,.fex») = t,.f(x+1)-t,.f(x)

2 = if(x+2)-f(x+l) }-jJ(x+l)-f(X)I-

t,. f(x) =f(X+2)-2f(x+lh-f(X)

1 '") 1

-~ 1

(x+4)(x+5) (x+3) +

(x+4) (x+2)(x+3)

= (x+2)(X+3)-2(x+~(x+5)+(x+4)(x+5) (x + 2 ) ( x + 3 ) ( x + 4 ) ( x + 5 )

= (x2 + 5x + 6 ) - ( 2x2 + 14~--r-- 20 ) + ( x2 + 9x + 20 ) (X+2)(x+3)(:t+4)(x+5)

Thus't,.2 [ 1 ] = {)

x2 + 5x + 6 (x + 2 )( x + 3 )( x + 4 )( x + 5) where h = 1

-------------------------

»9. Letf(") = tan' (":1) = ta,'~;-[~~~T----------

t,.f(n) =f(n+l)-f(n)sinceh = 1 by data.

= tan - 1 (1 - _1_ j'. - tan> 1 (1 1. ')

n+l -nj

tan - 1 x _ tan - 1 Y = tan - 1 ( x - Y j\

~ 1 +xy

t,. f( n) = tan-1 l (~ -Alj

1+ I---j'( 1J 11+1 \1--;:;-

i 1

-11 n(n+1) j

= tan l

111

2-----+-~

n n+1 n(l1+l)

But

ie.,

INTERPOLATION

359

-11 1 ] _1(1,

= tan , = tan 'l-' i

L 2n ( n + 1 ) - ( n + 1 ) - n + 1 2n2 j

Thus L\ tan- 1 (11: 1 J = tan-1 (2~2 J where h = 1

f t,.f(x\]

~ 10. Show that t,. log f ( x) = log I 1 + I ~

l f(x) J

» LH5 = t,. log f ( x) = log f ( x + h ) -log f ( x )

_ 10 i f ( x + 11 ) l _ 10 r f ( x ) + f ( x + h ) - j ( x ) l - gl f(x) J- gl f(x) J

= 10 I f ( x ) + t,. f ( x ) l = 10 l' 1 + t,. f ( x ) ] = RH.S

g L. f(x) J g f(x)

ie.

ie.,

Thus R.H.S = L.H.S

tt 6.3 Interpolation

If Yo' Y1' Y2, ". Yn be a set of values of an unknown function Y = f ( x ) corresponding to the values of x: xO' Xl' x2' ' , . xn' the process of finding (estimating) the value of Y for any given value of x between Xo and xn is called interpolation. Also the process of finding

(estimating) the value of Y outside the given range of x is called

. extrapolation. In general the concept of interpolation includes extrapolation also.

Thus we can say that interpolation is a technique of estimating the value of an unknown function for any intermediate value of the independent variable,

For example, if we have the data:

o 4 5 8 10 15 =J

6 15 17 29 40 87 _j

the process of estimating f(3),f(7),f(12.5),f(14) etc.is interpolation and estimating f( - 0.5), f( 18), f( 25) etc. is extra pola tion.

360

NUMERICAL METHODS - II

We first discuss interpolation for equal intervals which will be followed with interpolation for unequal intervals.

~ 6.4 Interpolation formulae for equal intervals/equidistant

arguments ..

We discuss interpolation formulae for equal intervals based on forward and backward differences.

These formulae are established by approximating the unknown function to a polynomial in x whose values coincide with the value of f ( x ) at

the specified points of x : xQ' xl' x2' ... xl1'

Forward difference interpolation formula and Backward difference interpolation formula

L t 11' •• y be the values of an unknown function Y == f ( x )

e Yo' Yl' :;2' 11 •

corresponding to equidistant values of x: xO' xl == Xo T 11,

X = X + 211 .. , x == Xo + nh.

2 "0 ' 11

Then we have the following two interpolation formulae.

'$- 6.41 Newton-Gregory forward interpolation formula

The value of y == f ( x) at x == Xo + rn , that is Y r == f ( Xo + 1'11) is approximately given by

r ( r - 1) ') r ( r -1 )( r - 2) ;:..3 Y +

;:.. YO+--2-!- ;:"-Yo + 3! 0

r ( r -1) ( r - 2 ) .. ( r - n - n ;:..11

+ I Yo

n.

where r is any real number.

'$- 6.42 Newton-Gregory backward interpolation formula Thevalueofy ==f(x)at x == xl1+rh, thatis Yr ==f(xn+rh)

is approximately given by

r ( r + 1) y2 + l' ( r + 1 ) ( r + 2) y3 y +'"

Y,. == Yn+r \7Yn+ 2!' Yn' 3\ 11

r(r+l.)(r+2)···(r+n=1) yny

+ n! 11

where r is any real number.

INTERPOLATION

361

Appropriate interpolation formula

To estimate the value of y at a desired value of x near the beginning of the table (first half, x is close to xo) forward formula is appropriate.

Similarly to estimate the value of y at a desired value of x near the end of the table (second half x is close to x) backward formula is appropriate.

The polynomial y =0 f ( x ) satisfying the data can also be found from these formulae and it is called an interpolating polynomial.

Note: The word appropriate is used in the sense that the computation, a computational work will be relatively simpler.

Working procedure for problems

* We construct the difference table in accordance with the interpolation formula.

~ We compute the value of r where x-xo

(c ) r == -,-, - in the case of forward interpolation formula, Xo being

the first value of x and 11 is the step length.

x-x

(b) r == T in the case of backward interpolation formula, xn being

the last value of x and h is the step length.

lOt The value of r along with the value of the finite differences are substituted in the interpolation formula which results in the value of Y at the desired value of x.

Note: Newton-Gregory forward / backward interpolation formula are also called Newton's forward / backward interpolation formula. We use the abbreviations N.F.I.F /1111,/ N.B.I.F respectvely.

WORKED EXAMPLES

.~------------------------------------------

. .

I~ 11. Find y ( 1.4 ) given the data
x 1 2 I 3 4 1:4 I
~ 10 26 L 58 112
H re we have to find y at x == 1.4 I II \I~' the value x == 1.4 is in the first half of the table near x == 1, N,'wCon's forward interpolation formula (N.F.LF) is appropriate and we Ilidl onstruct the forward difference table:

362

NUMERICAL METHODS - II

I I
X Y I',.y 1',.2y 1',.3 lj 1',.4 Y I
Xo = 1 Yo = 10
16
2 26 16 I
32 6
3 L:l. 22 0 (
54 6 J
4 I 28
I 82 I I
5 4 r(r-l) 2

WehaveN.F.I.F: Yr = Yo + rt,.yo + 2! I',. YO

+ r ( r - 1 ) ( r - 2) 1',.3 YO + ... 3!

x-xo where r =: -h-

x = point at which y is required = 1.4 Xo = initial point (first value of x )= 1

h = common interval length = 1

1.4 -1

. r=--=04

.. 1 .

From the table I',. Yo = 16, 1',.2yo = 16, 1',.3yo = 6, 1',.4 Yo = 0 (0.4)(0.4-1) 16)

y ( 1.4) = f ( 1.4) = 10 + ( 0.4 ) 16 + 2 (

+ (0.4) ( 0.4 -61 ) (0.4 - 2) (6)

= 10 + 6.4 + ( 0.4 ) ( - 0.6) 8 + ( 0.4 ) ( -0.6 ) ( - 1.6) = 14.864 Thus Y ( 1.4) = 14.864

--------------------------------------------

,? 12. Find uO.5 from the data:

110 = 225, HI = 238, ": =: 320, ": = 340

» The value x = 0.5 is near to x = 0 and hence N.F.I.F is

appropriate.

We shall first construct the forward difference table.

INTERPOLATION

363

I I --
x !Ix = y I',.y t,.2 Y 1',.3y
I Xo = 0 Yo = 225 I
I I t,.Yo = 13 i
I 1 238 t,.2Yo=691
I
82 fl3 Yo = -131
I 2 I 320
I -62
I 20 I
I 3 I 340 !
i r(r-l) ?

We have N.F.I.F: Yr = Yo + r I',. Yo + 2! 1',.- Yo

r(r-1)(r-2) 3

+ 3! I',. Yo+"

x - Xo 05 0

h r = _. 1- = 0.5

were r = -- .

h '

f ( 0.5) = 225 + 0.5 ( 13) + (0.5) (~.5 -1) (69)

+ (0.5) ( 0.5 -61) (0.5 - 2) (-131) = 214.6875

Thus uO.5 = 214.6875

r.i? 13. The area of a circle (A) corresponding to diameter (D) is given below.

0 80 I 85 I 90 95 100
I
A 5026 i 5674 I 6362 7088 7854 Find the area corresponding to diameter 105 using an appropriate interpolation formula.

» Here we have to find A when D = 105

As this value 105 is near to the end value 100, N.B.I.F is appropriate. D and A correspond to x and y. The difference table is formed first.

364

NUMERICAL METHODS - II

INTERPOLATION

365

I~(; I

I

I

85

DI y=A \1y r \12y \1311 \14y I
1 5026 I 1
I
648 1 i
I I
! 5674 I 40 1
i T \1Y i \12y_+ \13y 4 ,I
rax If(x)=y '!_jj_ I
-j
0.10 0.1003 i
I 0.15 0.1511 0050S1
0.0008 I
I 0.0516 I 0.0002
0.20 0.2027 0.0010 I 0.0002
I 0.0526 I 0.0004 I I
I 0.25 0.2553 0.0014
0.0540 L __ L
x = 0.30 IYI1 = 0.3093
11 90

6362

688 -- 2 1
I
1
38 I 4
726 2 I'
40 I
766 I
I I

95 , 7088 I

I I

xn = 100 IYI1 = 7854 1

.L- L- _J

1'(1'+1) ~

WehaveN.B.I.F: l! = Y +r\1y + \1"-y

v r 11 11 2! " 11

+ r(r+1)(r+2) \131/ +r(r+1)(r+2)(r+3) \14y + ...

3! "11 4!' 11

r(r+1) 2

We have N.B.I.F: Yr = Yn + r \1 lin + 2! \1 1111

r(r+1)(r+2) 3 r(r+1)(r+2)(r+3) n4

+ 3! \1 Yn + 4! v lin + ...

x-x where r = __ 11

h

x-x

where r = __ 11 •

h '

= 0.26 - 0.30 = _ 0 8

r 0.05 ..

105 -100

r = = 1

5

From the table \1 y = 766 I \12 Y = 40 I \13 Y = 2 \14 yt = 4

n n n' 11

From the table,

2 3

\1 YI1 = 0.0540, \1 Yn = 0.0014 I \1 11/1 = 0.0004 I

\14 ty = 0.0002

11

f(105) = 7854+1(766) + (1)2(2) (40)

+ (1) ( ~ ) ( 3) (2) + (1) ( 2 ~~ 3 ) ( 4 ) ( 4 )

f (0.26) = 0.3093 + ( .. 0.8) (0.054) + ( - 0.8) (; 0.8 + 1) (0.0014 ) + (- 0.8 )j - 0.8 ~ 1 ) ( - 0.8 + 2) (0.0004)

-'- (- 0.8 ) ( - 0.8 + 1 ) ( - 0.8 + 2 ) ( - 0.8 + 3) (0.0002)

. 24

f ( 0.26) = 0.26602

Thus tan ( 0.26) = 0.2660

= 7854 + 766 + 40 + 2 + 4 :: 8666

Thus the area ( A) corresponding to diameter (D):: 105 is 8666

w 14. The following table give the values of tan x for

0.10 ~ x ~ 0.30. Find tan (0.26) l xl 0.10 I 0.15 ~~_10.1003 I 0.1511

» Here the value x = 0.26 is near the end value 0.30

w 15. Extrapolate for 25.4 given the data

L~ 19 + 2~+_~_1-=-~~ 22 ~23_--i

U_____j __ ~_l__~0.25 I 110 I 12_0_.2_5__j 1_3_1 __ J

0.20 0.2027

0.25 0.2553

0.30 0.3093

Hence N.B.I.F is appropriate. The difference table is as follows.

3

366

NUMERICAL METHODS - II

INTERPOLATION

367

2

-I

i

» We shall first construct the backward difference table.

x I f( x) = y I difference II difference III difference
40 I 184
I 20
I
50 204 1 2
22 I 0
60 226 2
I
24 0
70 250 2
26 0
80 276 2
28
90 304 x 1 y \/y \/2y \/3 lj I
19 91 I I
9.25 , I
20 100.25 0.5 I
9.75 0
I
21 no 0.5 " I
10.25 \/:>1/ =01
22 120.25 I \/2 YI1 = 0.5 -11 1
I
v Y = 10.751 I
11 !
x = 23 Y/7 = 131
11
> To find f (38) : We have from the table

xo=40, yo=184, L1Yo=20, L12Yo=2, L13yO=0 We have N.F.I.F,

r(r+l) 2

We have by N.B.I.F: Y = Y + r V y + \/ Y

r 11 11 2! 11

r(r+l)(7"+2) .,3

+ v y + ...

3! 11

r(r-l) 2

Y =y +rL1y +---L1 y + ...

rOO 2! - 0

where r = x - xl1 • r = 25.4 - 23 = 2 4

h' 1 .

x - Xo where r =--

11

r = 38 - 40 = _ 0.2 10

r- ( 2.4 ) ( 2.4 + 1 ) r-

f( 25.4) = 131 + (2.4) 10.7.:1 -'- 2 (0.5) = b8.84

( - 0.2 ) ( - 0.2 - 1 ) ·180 24

f ( 38) = 184 + ( - 0.2 ) ( 20 ) + 2 ( 2) = .

Thus f ( 25.4) = 158_84

Thus I ( 38) = 180.24

To find f ( 85 ): We have from the table

x = 90, Y = 304, \/y = 28, =»: = 2, \/3y = a

11 /7 /7 /7 n

--------------------------------------------

("f? 16. Given f ( 40) = 184,1 ( 50) = 204,1 ( 60) = 226,

f ( 70) = 250 ,I ( 80) = 276 ,I ( 90) = 304 .find f ( 38) and f ( 85) using suitable interpolation formulae.

r(r+1) 2

We have N.B.I.F, y = Y + r V y + 2' V Yn + ...

r n i1 ;

.» Here we shall find f( 38) using N.F.I.F and find f( 85) using N.B.I.F. The finite difference table applicable to both the interpol a tion formulae is as follows.

x - xn 85 - 90 _

where r = -h - ; r = ----w-- = - O.::J.

( - 0.5 ) ( - 0.5 + 1 ) 2897-

f ( 85) = 304 + ( - 0.5 ) ( 28) + 2 ( 2) = . ::J

Thus I( 85) = 289.75

368

INTERPOLATION

369

NUMERICAL METHODS· II

rff' 17. Given sin 45° = 0.7071, sin 50° = 0.7660, sin 55° = 0.8192, sin 60° = 0.8660, find sin 57° using an appropriate interpolation formula.

cit" 18. Find the interpolating polynomial f ( x) satisfying

f(O)=O f(2)=4 f(4)=56 f(6)=204 f(8)=496 f(10)o~980 and hence find f ( 3), f ( 5) and f ( 7 )

» The interpolating polynomial can be found from either of the two interpolation formulae. We shall use N.F.I.F. The difference table is as follows.

» We have to find the value of f ( x) = sin x at x = 57° which is near the end value x = 60° and hence N.B.I.F is appropriate. The difference table is as follows.

I--- -.~···-·----··---I~·---:----·-T----···-I----; ,

~-~t~~yl_= ~~~- I). .y __ +~~. I 1).3_~._ .. +_.0:'.1/ 1

I Xo = 0 I Yo = 01 . 'I I i

I b.Yo=4.11 ! i

i 2 4 /.;.2 Yo = 48 I I I

I 52 b.3 Yo = 48 i !

I 4 56 96 I 1).4 Yo = 0

0.0468

148 48
6 204 144
292 48
8 496 192
484 I
10 980 L __ ..1 _j

xn = 60 Yn = 0.8660

o

r(r+l) 2

We have N.B.I.F: Yr = Yn + r \7 Yn + 2! 'V Yll

r(r+1)(r+2) 3

\7 YI1 + ... 3!

We have N.FI.F :

. 1'(1'-1) 2

Yr = Yo +1' I). Yo + 2! I). Yo

1'(1'-1)(1'-2) ,3

+ - . '-' Yo + .. "

3!

x-x

where r = 11

h

57 - 60

r = --~- = -0.6. :J

" 3

From the table, \7 y' = 0.0468, \7- Y = - 0.0064, \7 Y = - 0.0007

n 11 11

x - Xo x ~ 0 x

where r = -- Here y = -. - or l' = -

h 2 2

x (x J

2 2-1

x

Y=f(x)=0-1:~(4)+ 2 (48)

. ~(~-1)(~-2

+ --

(48 )

f ( 57) = 0.8660 + ( - 0.6 ) ( 0.0468 )

+ (- 0.6 ) (; 0.6 + 1) (_ 0.0064 )

+ (- 0.6) ( - 0.6 ; 1) ( - 0.6 + 2) (_ 0.0007) = 0.8387

Thus sin 57° = 0.8387

6

x (.r-- 2 J x (x - 2 '\ (x - 4 i ,

= 2x + ~ l-2--' (24) + '2 -2-J l ~ j (8)

= 2x+~(x~2)(6)+x(x-2)(x-4)

... ~

3

370

NUMERICAL METHODS" II

INTERPOLATION

371

r 2 '

= X l 2 + 6 ( X - 2 ) + (x - 2x - 4x + 8 ) J

,= X I 2 + 6x - 12 + x2 '- 6x + 8 ] = x3 - 2x

. L

Thus the interpolating polynomial is y = /( x) = x3 - 2x

Now putting x = 3, 5, 7 we obtain

f(3) = 21, /(5) = 115, /(7) = 329

Note : It may be observed thai if we substitute the given values of x namely 0,2,4,6,8,10 in the polynomial, the values of f ( x) coincide with the values given in the data.

C7r 19. From the following table find the number of students who obtained less than 45 marks

~-'-~\1~-F_:-40 I 40-50 -~ 50-60 I 60~70T70=SO-J

I N0:5 students ;>_!___ 42 _j_____2l__U5 I 31 J » We shall reconstitute the given table with f (x) representing the number of students less than x marks. That is,

less than 40 marks 31 students,

less than 50 marks 31 + 42 = 73 students, less than 60 marks 73 + 51 = 124 students, less than 70 marks 124 + 35 = 159 students, less than 80 marks 159 + 31 = 190 students.

We have the new table along with the forward differences, We need to findf( 45)

u,- If_~~=, Y-f-~~-+-~f,---41 Tr-L\4-~

!xo = 40 Yo = 31 I " I I

I I L\ Yo == 42! I

I 50 I 73 51 III' Yo = 91 3 I 1

I i I I L\ Yo = - 25 I

I 60 Ii ~ 124 35 I -16 I '12 ",,4 Yo = 37

1 70 159 I - 4 I

l __ ___§Q___ 190 31 I I"

..... , .. ,.'

We shall find f ( 45) by applying N_F.I.F : r(r-1) 2

v, =yo+r""yo + 2: ""Yo

1'(1'-1)(1'-2) ?

+ ----"""---- """ Yo + .. - .).

x-\) where I' =--

h

45 -40

I' = -w- = 0.5

I 0.5 ) ( 0.5 - 1 . f(45) = 31+(0.5)42 + -~ ---2--1 (9)

( 0.5 )( 0.5 - 1 ) ( 0.5 - 2) '1~

-i- ---' ---6---------- (-- LJ )

+ t 0.5~L 0.5 -1 2i~5 - 2_) __ (_Q:5 - 3J (37) 24

f ( 45) = 47.86 '" 408

Thus the number of students obtaining less than 45 marks is 48.

!j;I' 20. A survey conducted in a slum locality reveals the [ollouiing information as classified below.

------·.,-----T-~--------T--,-------;

_Income per dm; (Rs.) Ll!~!_q_er l_CW_lQ:~Q. __ .L.1_Q::~Q ~ 30-40 _j_'!_0-5g __ ~

Number oj persons I 20 j 45 1 11~_j_ 210 I ~

. --------------~-----~-- _,._-_. --~-----

Estimate the probable number of persons in the income group 20 to 25,

» The given data is reconstituted with f( x) representing the

number of persons less than income of Rs. x. That is,

Less than Rs. 10 =:: 20,

less than Rs. 20 = 20 c_ 45 = 65, less than Rs. 30 = 65 -+- 115 = 180, less than Rs. 40 '" 180 + 210 = 390, less than Rs. 50 = 390 + 115 = 505.

We have to find f ( 25) and f ( 20) which estima tes the number of persons having income less than 1\.s.2? and less than Rs.20 so that their difference, that is f( 25 )-f( 20) will give us the number of persons having income between Rs.20 and 25. The new table along with the

forward. differences is as follows. .

3

372

NUMERICAL METHODS - II

~C'_-_-'-_-_~-_-'-'----t---::-I f_(~_x~)===-;y~' f--_--_~__':y:____If___=6-2 .2_l!----1'--- __ =6 3__.z_V -_- I A 4 V 1

Xo == 10 i YO == 20 1

II 65 175 70 25 I II

180 95 - 215

! 210 - 190

I 390 - 95 i

I

20

30

40

50 505

_ . r(r-l) 2

We have N.F.I.F: Yr == Yo + r 6 Yo -r- 21 6 Yo

,r(r-1)(r-2) 3 ,r(r-l)(r-2)(r--,3) 4

T 31 A Yo T . 41 6 Yo + ...

x -xo where r ==-h

x-l0

r==--

10

,. . _ 25-10

Case (1): To find f( 20) we have r == -1-0- == 1.5

From the table 6 Yo == 45, 62 Yo == 70, 2,3 Yo = 25, 64 Yo == - 215

Now,f(25) == 20+1.5(45) + (1.5)(;.5-1) (70) + (1.5) ( 1.5 - 1 ) ( 1.5 - 2) (25)

6

+ (1.5) ( 1.5 -1 ) ~~.5 - 2) ( 1.5 - 3) (_ 215 )

f (25) ~ 107

.. 20 - 10

Case (ii}: To find f ( 20 ) we have r == -1-0 - == 1

Now f ( 20) == 20 + 1 ( 4S ) + 0 + 0 .;. 0

.. f( 20) == 65

Hence f( 25) =l ': 20) == 107 - 65 co 42

Thus the number of persons in the income group of Rs.20 to 25 is 42.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --

INTERPOLATION

373

w 21. Compute U14.2 from the following table by applying Newton's backward interpolation formula.

f--,--_:_:x_-+--_:_:I:_::__O _ ~21

-, 0.240 L=81 I

14 0.318

16 0.352

18-----] 0.384 __ J

x

u = Y x

\ly

» We shall apply NBIF and the difference table is as follows.

:.'

14 I 0.318 I

±O'352 I

x = 18 Y = 0.384 i \lYn = 0.032

1'1 1'1 I

___ _L_~~ __ ~ L_ ~ ~

10 0.240

0.041

12 0.281

-0.004

0.037

-0.003

0.034

2

" Yrz = - 0.002

We have N.B.I.F,

0.001

,,3 = 0.001 ,,4 If = U

"« <n

r ( r + 1) V2

2! s;

r(r+l)(r+2)

+ 3!

x-x where r == __ 1'1

h

r ==

14.2 -18 = _ 1 9

2 .

3

V Yn + ...

( - 1.9) (- 0.9 ) 000"

u14.2 = 0.384 + ( - 1.9) (0.032) + 2 (- . 2)

+ (-1.9) (-,t9) (0.1) (O.OOl)

Thus u14.2 == 0.3215

374

NUMERICAL METHODS - Ii

INTE8POLATION

375

Iff" 22. Use Newton's forward interpolation formula to find .11_ siuen

)' 35 o

.1120 = 512, .1130 = 439, .1140 = 346, .1150 = 243.

» The difference table is.as follows.

We have N.F.I.F

r(r-l) 2

.111" '" Yo + r~ Yo + ---:zr-- ~ Yo

. r(r-l)(r-2) 3

T ---31-- ~ .110+"

X-Xo where r = -_-

h

,liT 23. Find f (2.5) by using Newton's backward interpolation [ormuia given that f( 0) = 7.4720 f( 1 ) = 7.5854 f( 2) = 7.6922

f( 3) = 7.8119 f( 4) = 7.9252

» The backward difference table is as follows.

-:-1-:::-- -=~.~~-- ---=v"m 1- ;,~ r-;;; l

7.5854 0.1134 I I I

76922 0.1068 II - 0.0066 I

0.0195

0.1197 0.0129 V.3 1/ v4 I'

. n Yn

I = - 0.0193 = - 00388

,i !In = - 0.0064

. I \7yl1=0.1133 1 I i

x17 = 41 s; = 7.9252_'-- -'- _L L. .. _

.1135 = y(35) = 512+(1.5) (-73)+Q.5)2(0!5) (-20)

( 1.5) (0.5) (- 0.5 )

+ -------- ( 10 ) 6

Thus Y35 = 394.375

--------------------------------------------

2

7.8119

3

We have N.B.I.F

r(r+1) 2

.11 == Y +rVyl + ----. V' 1/

I" 11 11 2! . n

r(r+l)(r+2) 3 r(r+1)(r+2)(r+3)

+ ---31----- V' Yn + 4'

x-x where r = __ 11

h

2.5 - 4

r = -1- =-1.5

(-15) (-05) .

.'. /(2.5) = 7.9252+(-1.5) (0.1133) + . 2 . (-0.0064)

"" .\..:_!.2) (- 0.5) (0.5) (_ 0.(193) + cIS l_(_ - O~)j_05 ..LU_:.'5..2 ( _ 0.0388 )

6 ~

l'hus f(2.5) = 7.7507

376

INTERPOLATION

377

NUMERICAL METHODS

lif' 24 .. Compute f( 1.22) with 'the help of forward difference table for the following data.

Gt" 25. Apply Newton's backuiard [ormula to find the cubic polynomial satisfying f ( - 4) = - 25, f ( - 2) = 1, f ( 0) = 3, f ( 2) = 29

f ( 4) = 127 and hence find f ( 3) and f ( 5 )

» The backward difference table is as follows.

,_' x __ -+_-=Ic.:.::.O:.___-+- _ _c:..1.~I_t --1-.2--+--..:...1..'-.3--1-1-' ' __ 1...:::4_-11

l f(x) 0.841 0.8910.932 0.963 0.985

~ \ - 4 I

(x) = Y Vy I ') V3y V4y
I V-V
-25 I
26 ,
1 -24
2 48
3 26 24 V' Y = 48 4 =0
11 '\7 Yn
29 ')
'\7-!l11 = 72
'\7 Yn = 98
= 127
11 » The forward difference table is as follows.

I X_' -4 y __ --1 ~..:...y ~..:::~~22V-~I-=~..:...3Llj~

"0 .= 1.0 Yo = 0.841 I II \1

6yo = 0.05 I

1.1 0.891 0.041 2 I,

/::, Yo i

= - 0.009 i II

63 Y

o

6.4 II

YO

I = 0.002

i 1.3 0.963 I 0.001 I

l __ ~i L__0.9_8._5 _ _...l._._._0_._02_2. __ ___'___-_0_.0_0_9 ~I j_l j

We have N.B.I.F:

-2

2

1.2

0.932

x = 41y

1'/

= - 0.001

1'(1'+1) 2

Y = Y + r V y + 2' V Y

r 11 /1 • 11

1'(1'+1)(1'+2) '113 .

+ 3! Y/1+'"

0.031

- 0.01

x-x where r = __ It h

x-4

1'= --

. 2

r(r-1) 2

We have N.F.I.F: Yr = Yo + r ~ Yo + 2! ~ yo

1'(1'-1)(1'-2) 3 .r(1'-l)(r-2)(r-3) 4

3! ~ Yo + 4! ~ Yo + ...

y = f ( x) = 127 + ( x ; 4 ) 98 + ( x ; 4 ) ( x ; 2) . 722

+ (X;4) (X;2) (~). ~~

= 127 + ( x - 4) [49 + 9x - 18 + x2 - 2x ] = 127+(x-4) [x2+7x+31]

Thus f(,X) = x3 + 3x2 + 3,X + 3 is required polynomial. N w, f ( 3) = 33 + 3 ( 32 ) + 3 ( 3 ) + 3 = 66

f ( 5) = 53 + 3 ( 52 ) + 3 ( 5 ) + 3 = 218

Thus f(3)=66 andf(5) =218

x - Xo 1.22 - 1.0

where r = -11 - ; r = 0.1 = 2.2

. . f ( 1.22) = 0.841 + ( 2.2) (0.05) + ( 2.2 )2 ( 1.2) (- 0.009 ) . (2.2) (1.2) (0.2) ( 0001 . (2.2) (1.2) (0.2) (- 0.8 )

-t- 6 -.) T 24 ( 0.002 )

Thus f ( 1.22) = 0.939

-~------------------------------------------

378

379

NUMERICAL METHODS· II

INTERPOLAT!ON

EXERCISES

15. From the following data estimate the number of students who have

scored less than 70 marks.

~'b I_Jlc20_::P0-4o_t--'Q-.60 i 60-80 +80 10°_1 ~~den~~~1 __ 62 I 65 _ 50 .L_~ __ j

16. From the following data estimate the numbers of students scoring marks more than 40 but less than 45

~~:::ffi of 303~PO-:~ - j- 5~5~60 +~:~f~;~~

17. Apply Newton's forward interpolation formula to find y (0.66 )

given y ( 0) = 0, y (0.4) = 0.073, Y ( 0.6) = 0.102,

Y (0.8) == 0.128, Y ( 1.0) == 0.151

18. Given that m == 3.464il4 := 3.742 K6' = 4, -{18 == 4.243, -{fo = 4.472, compute ~16.5 by using Newton's forward interpolation formula.

19. Use Newton's backward interpolation formula to compute u25

given u = 0.3420, u: == 0.4067, u?8:= 0.4695, u3? == 0.5299

20 ,,4 - -

Find the following. [Problems 1 to 5]

1. L'l (tan- 1 x ) 2. t. 2 ( cos 2 x ) 3. L'l11 ( eX )

'J I 5x + 12 I

4. K I 2---- ! where h = 1 5. L'l ( tan ax ) where h == 1

LX' + 5x + 6 J

Prove the following. [Problems 6 to 8]

6. Y4 == yo+4L'lYo+6t.2YO+4t.3Yo+L'l4yo 6

7. L'l Yo == Y6 _. 6Y5 + 15Y4 - 20Y3 + 15Y2 - 6Yl + Yo

8 1:,.3 y. := y - 311 -l--311 - Y

. ,. n 11+3 ·11+2' '-'11-1 J1

Use an appropriate interpolation formula to estimate y == f( x) for the given value of x [Problems 9 to 12]

f'~,-"-~--1.~1~711.§ I -=-1._9 --+- 2:0]---;.-1 -1- 2.2-~

r (x) 5.47'1 I 6.050 I 6.686 7.389 I 8.166r 9,025 J

9.

10.

G--=f 1.Q_Q0 .~ . [__i____ 3._l 3

Y ( 218) == ?

~

Y ( 1044) '" ? -3-- 4-=r=L]

0,4771 j_Q:~Q3~.L2:§_~QJ y (5.2) =?

--------------------------------------------

20. Given the data:

11.

1010 1020 1030 I 1040 10
.0043 3.0086 3.0128 I 3.0170 3.0 D::_' _+--=3..:::._10,---+--3_2._0_._L330 1340 , 350 1--'60 ~

L~lO x 2.4914 2.5052 I 2.5185 '::53:5 I 2.5441 I 2.5563 i

o~~ute loglO 335 by applying Newton's backward interpolation formula.

12.

13. Given sin 20°. == 0.3420, sin 25° == 0.4226,

sin 30° = 0.5000, sin 35° == 0.5736, sin 40° == 0.6428

Find sin 24° and sin 42° using appropriate interpolation formulae

14. Fit an interpolating polynomial », satisfying

!I-4 == ·-3, u.2 == 5, "o = 13, ": = 69, Li4 = 221 Hence find "s and u6

- - - - - - - - - - - - - - - - - - AN'S WERS - - - - - - - - - - - - - - - - --

--------------------------------------------

1. tan -1 I h 2 l

L1+hx+x J

2. - 4 sin2 h cos ( 2x + 2h )

2 (5x +!6)

4. (x+2)(x+3)(x+4)(x+5)

NUMERICAL METHODS - II

INTERPOLATION

381

380

5.

sin a

9. 6.354

Cos a x cos a ( x + 1 )

10. IS.99 12. 0.716

14. x3 + 6x2 + 12x + 13 ;

15. 196

11. 3.0186

13. 0.4068,0.6693

517

130/ t7

16. 0.4226 19.

~------------------------

____ - I

lL 6 5 - - - - - - - - - - - - - olae for unequal intervals

1\ , Interpolation fornt

* 651 D' id d di les and Newton's divided difference

". IVI e differen+

formula

Let I ( ..) I. .' I ( xl1) be the values of an unknown

Xo ' ( xl ), I (x )" .

f . 2 c.1mg to the values of x: x ,x ,x , ... x

unchc.m y = I ( x) correspor" 0 1 2 n

at unequal intervals.

Th r:: C& are defined as follows .

.e ) trst order divided d~fferenC

I ('co) I ( x2 ) - f ( xl )

J (x1)-I·~, l(x1,x2)

f(xo' xl) = ~

Xl -xO

f t x )_1('~2) I( . _/(x/1)-/(xn_1)

J ~ "" J - } c ~ • • X I' X ) -

f(x ,x ) = ~ n- n X -x

2 3 x -x /1 11-1

3 ''J

Th CCS are defined as follows.

e second order divided d#ereJ1

f.2 ) -I ( xO' xl)

=~2-XO . f ( XO' Xl' X2)

17. 0.1101

20. 2.525

18, 4.062

!

. !j( Xo Xl -'2 .

i f 'I I

!

. x,,)

"

"

',., -1

ot : The notation for divided diffl'l'cnces should not be confused with the notation /rJI' "mctions of two or more variables. f (xl' x2) does not stand for a [unction of two

f'"l'iab/es Xl and x2. Similarly f (xi' X2, x3) is not a function of Xl' x2' x3 and

II em. Here Xl' x2' .. are called 'arguments'.

Newton's divided difference formula

or

Nowtcn's general interpolation formula

f') ) - f ( Xl r x2) I(x?, ~ etc., f (xl' X2' X3) = ______::___,/ .x3 - Xl

(XX ) =l '. x X )

j '11-1' '11 11-2' 'J1-!

f t x X X )-I_/' x-x

• 11 - 2' . /1 - l' '11 - '11 • 11 - 2

,. . ef divided differences are defined. The

sllbmllarly the other higher ord ._falues is called the divided difference ta u ar arrangement of these

table and is as follows.

.Iot ment : If I(xo)' f(x]), l(x2),··· l(xl1) oe e set oj oalues oj :1""

1111 '112known junction I( x) correspond.ing to the oalues 01

\ : X() / Xl' x2' "', Xl1 at unequal intervals'; then

+ ( x - Xo ) ( x - Xl ) ... ( x - x/1-1 ) I ( Xc)' Xl ' x2' ... xl1 )

382

NUMERICAL METHODS - II

WORKED EXAMPLES

--------------------------------------------

(£J' 26. Use Neuiton' 5 divided difference formula to [ind f ( 4) gioenthe data :

1--x-----l---O~---2-_____r_-3--_r_--6~

t f _£}---==_ =~_ --I _2_ _ _j___ILi___l _ _l~_iL __ _j

» We shall first form the table of divided difference.

'0: ob, ~~~l~ 41 ~ol o-';-f-- ~___t' "D_~ i

I ! I ' j

i I (xO' xl) I 1 '

I i 2-( -4) 1 '

i 1-2~O=31 I

Xl = 2 I f( xl) = 2 I ' I( Xl' x2) I

I! 12 - 3 = 3 I

' I f (xl' x2) 3 - 0 1 f ( xO' x2' x3)

i 2.4 - 2 = 12 1 9 - 3 = 1

3-2 ' 6-0

I

x2 = 3 I I ( x2) '" 14

I I 11'2' '3)

I ] 158-14

1 1-6'=3 = 48

!

I x3 =_~_ r~x 3 ) _~ __ =~~_

f(

48 -12 ---=9 6-2

_j__----

Wf; have Newton's divided difference formula,

f ( x) == f ( Xo ) + ( x - Xo ) f ( XO' Xl) + ( x - Xo )( x - Xl ) f (XO' Xl' X2) + ( X - Xo ) ( x - Xl ) ( X - X2 ) f (XO' Xl' X2' X3) + ...

f(4) = -4+(4-0)3+(4-0)(4-2)3 +(4-0)(4-2)(4-3)1

= -4 + 12 + 24 -+- 8 == 40 Thus f( 4) == 40

~--------------------------------~-7--------

INTERPOLATION

383

cw, 27. Construct the interpolation polynomial/c)f the data gluen below using Newton's general inierpotationjormula for divided differences

E~ I 12rl--9~ =tli6 -f 3~if--8~8 ,-E!~~

» The divided difference table is as follows,

~ 1- y = ~~ __ 1: D.D~ ~ ?~~J?_:Q __ f=_ 3r~p.D ~

1(0 = 2 I « Yo) = 10 I '! I I

II, II I(xo' Xl) II II II

96 -10 = 43

Xl = 4 ' f ( Xl ) = 96 I 4 - 2 i f e Xl' x2) I 1

I il I !:2l_-24:3. = 19 I

Ie -', x2) / (xO' xl' x2' x3) i

I 196-_J_§_ = '100 p-19 _ ') I

I 5-4 6-2 - - I

1\'2 = 5 /(x2) = 1961 /ex1' x2, x3) I

t J5:~~~00=27 I

I', f( x')_, -'3) /( Xl' x')' x3, X4) I

. ~ ....., i

!

I

f( . ) - "_cn i ,X3 - v:)U I

!

35 -- 27 ---- = 2 8-4

I (X2' x3, X 4' X5) i

!

_868- 350 = 259~~ 35 = 2 i

i 8 - 6 10 _. 5 Ii

l(x4) = 8681 /(X3, x4, XS)

1 439 -- 25~ = 45 ' II

i /(x4, x5) 10-6 ,

1 1

I, 1746 - 868_ = 4391 I 'I

i 10 - 8

1 ' I

/ ~_=__2~~L ~--~J----------j

384

NUMERICAL METHODS - II

INTERPOLATION

385

The fourth order differences are zero as third order differences are same.

We have Newton's general interpolation formula,

f ( x) = f ( Xo ) + ( x - xo ) f ( XO' Xl)

Now, f ( x) = 10.,- ( x - 2) 43 + ( x - 2 ) ( x - 4) 19 T(x-2)(x-4)(x-5)2

10 + ( x - 2) : 43 + ( 19 x - 76 ) + ( x2 - 9 x + 20 ) 2 : = 10 -'- ( x - 2 ) ( 2 x2 + x -I- 7) = 2 x3 - 3 x2 + 5 x - 4.

Thus the required interpolating polynomial is given by

----------------------------~---------------

("iF 28. Fit an interpolating polvnomialjor the data

"io = 355, "o = - 5 , Us = - 21, HI = - 14, u,~ = - 125 by using Newlon's general interpolation formula and hence find 112

» We shall arrange the data taking the values of x in the ascending order along with the corresponding values of u just for convenience. x

(However this arrangement is not necessary)

The divided difference table is formed first.

\
x ux=l(x) 1st 0.0 2nd 0.0 3rd 0.0
Xo = 0 I( xo) 1
= -5
l(xo' Xl)
-14-(-5) = -9
1-0
Xl = 1 ( Xl ) 1 (xO' Xl' x2)
::: -14 -37 - (-9) =-7
4-0 I
l(x}, x2) \ 1 (xcr "r x2' x3) I
-125-(-14) 9-(-7) =2
=-37
4-1 S-O
X2 = 41 (X2) l(x1, x2' x3)
= -125 26 - (- 37) 9
8-1
l(x2, x3) l(x1, x2' x3' x4)
- 21 + 125 21 -9
=26 --=2
8-4 10 -1
"3 = 8 I( x3) ( (x2' x3' X 4 )
= -21 I 188 - 26 = 27
10-4
1( x3' x4)
355 - ( - 21 ) = 188
10 - 8
v = 10 l(x4)
I\-
o,s.s 'I h fourth order differences are zero since the third order differences are snme.

W ihave Newton's general interpolation formula,

x ) = f ( Xo ) + ( x - Xo ) f ( XO' Xl )

+ ( x - Xo ) ( x - Xl ) j (XO' Xl' X2)

+ ( x - Xo ) ( x - Xl ) ( x - X2 ) j (XO' xl' X2' X3) + ...

Now,j(x) = _S+(x)(-9)+(x)(x-1)(-7) +(x)(x-1 )(x-4)(2)

386

NUMERICAL METHODS - II

INTERPOLATION

387

= - 5 + x [ - 9 + ( - 7 x + 7 ) + ( X2 - 5 x + 4 ) ~ ] = - 5 + x [ 2, x2 - 17 x + 6 J.

Thus f ( x) = u = 2 x3 - 17 x2 + 6 x - 5

x

Now f( 2) = u2 = 2 (2)3 - 17 ( 2 )2 + 6 (2) - 5 = - 45

----------------------1---------------------

w 29_ Given u20 = 24.37, un( = 49.28, u29 = 162.86 and

u32 = 240.5 find u28 by Newton's divided difference formula.

» Thedivided difference table is as follows.

x I ux=f(x) 1st 0.0 2nd 0.0 i:ao.o
Xo = 20 f( xo) = 24.37
f(xo' xl)
4928 - 24.37
22 -20
= 12.455
Xl = 22 f( xl) = 49.28 f( "c. "r x2 )
16.226 - 12.455 I
29- 20
= 0.419
f( "r x2) t=« "r x2' ."(3)
162.86 - 49.28 0.965 - 0.419
29 -22 32- 20
= 16.226 = 0.0455
."(2 = 29 f( x2) 0= 162.86 I(_.,\ x2' x3)
25.88 - 16.226
32- 22
0= 0.965
f( x2' x3) I
240.5 - 162.86
1"3 ~ ,,If('3) ~ 240.5 32 - 29 I I
= 2588 W have Newton's divided difference formula,

.t ( x) = f ( Xo ) + ( x - Xo ) f ( XO' Xl )

+ ( x - Xo ) ( x -. Xl ) f ( XO' Xl' h)'·

.i, ( X - Xo ) ( X - Xl ) ( X - x2 ) f ( XO' Xl' X2' X3) + ...

, f(28) = 24.37+(28-20)12.455+(28-20)(28-22)0.419

+ ( 28 - 20 ) ( 28 - 22 ) ( 28 - 29 ) ( 0.0455 )

Thus f(28) = 1128 = 141.938 "" 141.94

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---

I It 30. Find the cubic polynomial which passes through the points

(2,4)(4,56)(9,711)(10,980) and hence estimate the dependent variable corresponding to the values ofthemdependent uariable 3,5,7,11 Also express the interpolating polynomzal in powers of ( x-I ) end hence estimate the value of f ( X) at X = 1·1 and 1·5

> We have to find f( x) where we have by data f( 2) = 4, 1(4) = 56 r f ( 9) = 711 ,f ( 10) = 980. The divided difference table is 1\ f llows.

x /(x) 1st 0.0 2nd 0.0 3ra 0.0
.. 2 I( xo) = 4 I
I(xo' Xl)
56 - 4 = 26
4-2
.4 I( Xl ) = 56 I(xo' Xl' x2)
131- 26 = 15 I
9-2
l(x1, '2) /(Xo' Xl' .1'2' .1:3)
I
711 - 56 = 131 23 -15 = ] I
9-4 I 10- 2
• f(.1:2) 0= 711 I( Xl' x2, .1:3)
269 -131 = 23
10-4
1('2' xc)
;) I
980 - 711 = 269 \
10 - 9
10 I( x",) = 980 \ I

388

NUMERICAL METHODS - II

389

INTERPOLATION

We have Newton's divided difference formula,

------

------------------E)CERCISES------------

f ( x) == f ( Xo ) + ( x -;: Xo ) f ( XO' Xl)

+ ( x - Xo ) ( x - xl ) f ( XO' xl' X2)

+ ( x - Xo ) ( x - xl ) ( x - X2 ) f ( XO' xl' X2' X3) + , , , Now,j (X) == 4 + ( x - 2) 26 + ( x - 2) ( x - 4 ) 15 +(x-2)(x-4)(x-9)1

== 4 + ( x - 2) [ 26 + ( 15 x - 60 ) + ( x2 - 13 x + 36 ) ]

== 4 + ( x - 2) [ x2 + 2 x + 2 ]

Thus f( x) == x3 - 2 x is the required polynomial.

Now f( 3) == 33 - 2 ( 3) == 21 ; f( 5) = 53 - 2 ( 5) == 115

f(7) == 73-2(7) == 329 ; f(l1) = 113-2(11) = 1309, We shall now express the polynomial x3 - 2x in powers of (x - 1 ) Consider f ( x) == x3 - 2 x

== , ( x-I )3 + 3 x2 - 3 x + 1 - 2 x

3 -?

= (x-I) +3x--5x+l

32'

== (x-I) +3 ~(x-l) +2x-l,'-5x+l

== (x - 1 )3 + 3 ( x-I )2 + X - 2

== (x - 1 )3 + 3 ( x-I )2 + h x-I) + 1 )- 2 Thus f( x) == (x -1 )3 + 3 (x - 1 )2 + (x - 1 ) - 1 Putting x == 1.1,

f ( 1.1 ) == (1.1 - 1 )3 + 3 ( 1.1 - 1 )2 + ( 1.1 - 1 ) - 1 == - 0,869 Putting x == 1.5,

f ( 1.5) == (1.5 - 1 )3 + 3 ( 1.5 - 1 )2 + ( 1.5 - 1 ) - 1 == 0.375

IJRC Newton's divided difference formula to findf(x) at the given vnlue of x [Problems 1 to 5]

l.

x 40 42 44 45
f(x) 43833 46568 49431 50912 f(43)=7
2. x 0 2 3 4 7 I 9 I
L(x) 4 26 58 112 466 922
f( 5) = 7 x 300 304 305 307
f(x) 2.4771 2.4829 2.4843 2.4871 f(301) = 7
4. x 0 2 3 5 1:6 j
L(x) 0 6 21 105
f (0.5) = 7
x 1 2 4 7 12 I
U 576 168 -30 48 378
x
Us == 7 LJ • Newton's general interpolation formula to fit an interpolating polynomial for the following data [Problems ,6 to 9]

7.

U4 = 48, Us == 100, "e == 180, Us == 448, uIO = 900, "u = 1210
I x -1 0 3 6 I 7 I
y 3 -6 39 822 1611

I x 0 1 2 1H
L(x) 2 3 12 H.

------------------------------------------

'J. /(-1) = -8,1(0) = 3,1(2) = 1,1(3) = 12

390

NUMERICAL METHODS - II

10. Use Newton's oeneral interpolation formula to find f (x) as a

b

polynomial in powers of (x-I) when f(x) §atisfies

f ( 0) = 4, f (2) = 26, f ( 3) = 58, f ( 4) = 112, f ( 7) = 466, f( 9) = 922

--------------~---ANS\VERS------------------

--------------~-----------------------------

1. 47983.2 2. 194
3. 2.4786 4. 0.375
5. 30 6. x2(x-l)
7. x4 - 3 x3 + 5 x2-6 8. x3 + x2 - x + 2 9. 2 x3 - 6 x2 + 3 x + 3

10. (x - 1 )3 + 5 (x - 1/ + 10 (x - 1 ) + 10

---------- J-------------- _

7/{ 6.52 Lagrange's {onmda for interpolation and inverse

interpolation

Statement: I{yo =f(:to), :!II =t=.» Y2 =f(x2)""Yn =L!

be a set of values of an unknown function Y = f ( x ) corresponding to the values

0+ x . X X X x not necessarily at equal intervals then

') . 0' - 1 ' 2' ... n

( x - xl) ( x - x2 ) ... ( x - X,1 ) Yo

y=f(x)= .

( Xo ./ xl ) ( Xo - x2 ) ... ( Xo -

( x - Xo ) ( x - X2 ) ( x - x3 ) ... ( x - xn ) Yl

+

. (xl -- Xo ) ( xl - x2 ) ( xl - x3 ) ... ( xl - )

( x - Xo ) ( x - Xl ) ( x - x3 ) ... ( x - xn ) Y2

+ + ...

. (x2 - Xo ) ( x2 - xl ) ( x2 - x3 ) ... ( x2 - Xn )

(x - xo) (x - xl ) ... ( x - Xn-l) Yn

+ (xn - Xo ) ( xn - xl ) ... ( - xn -1 )

Remarks

1. The special feature of this formula is that the terms of the formula involve only the values in the variables x and y.

2. The values of x also need not be equally spaced, nor need they be in any order.

IN II r l~()L;A;TIOi'j

391

I. We can interchange the role of x arid y in the formula and the same is called III.I/I',mge's inverse interpolation formula which helps to find x for a gwen 1/ '/ '/i(' !cJr1'11.ula is as follows.

(Y - Yl ) (y - Y2 ) ... ( Y - Yn ) Xo (Y - Yo) (Y - Y2 ) ... ( Y - Yn ) Xl

--~~--~~~----~ +

(,~6;-yl)(YO-Y2r .. (YO-Yn) (Y1-YO)(Y1-Y2):··(YI-Yn)

(Y -Yo) (y - Y1 ) (Y - Y3 ) ... ( Y- Yn) x2

+ +

(Y2 - yo) (Y2 - Y1 ) ... ( Y2 - Y3 ) ... ( Y2 - Yn )

(Y - yo) (Y - Yl ) ... ( Y - Yn-l ) xn . .. +

(Yn-YO)(Yn-Yl)"'(Yn-Yn-l)

."

.1

M~ ~ _

. WORKED EXAMPLES

-.---~------------------------------------

'fl l'. Use Lagrange's interpolation formula to find f ( 4 ) given
X 0 2 3 I 6
f( r ) -4 2 14 158 Xo = 0 Yo = - 4

X3 = 6 ) x = 4

Y3 = 158 Y = ?

x2 = 3 Y2 = 14

WI'" IV' Lagrange's interpolation formula for four given values,

( x - xl ) ( x - x2 ) ( x - x3 ) Yo ( x - Xo ) ( x - x2 ) ( x - x3 ) Yl

1/ I(x,- +

, - ( Xo - xl ) ( Xo - x2 ) ( Xo - x3 ) ( xl - Xo ) ( xl - x2 ) ( xl - x3 )

( ,I' - Xo ) ( x - xl ) ( x - x3 ) Y2 ( x - Xo ) ( x - xl ) ( x - x2 ) Y3

,. +

( \'2 - Xo ) ( x2 - xl ) ( x2 - x3 ) ( x3 - Xo ) ( x3 -'- xl ) ( X3 - X2 )

IIItNilUHting the values we have,

I ( I)

f 4 - 2) (4 - 3) (4 - 6) (~4) + (4 - 0)( 4 - 3) (4 - 6 )2

(0-2)(0-3)(0-6) (2-0)(2-3)(2-6)

( 4 - 0 ) ( 4 - 2 ) ( 4 - 6 )14 ( 4 - 0 ) ( 4 - 2 ) ( 4 ~ 3 ) 158

I (3-0)(3-2)(3-6) + (6-0)(6-2)(6-3)

(2)(1)("':2)(-4) (4)(1)(-2)2

. . +

( - 2 ) ('- 3 ) ( - 6 ) ( 2 ) ( - 1 ) ( - 4 )

~ 4 ) ( 2 ) ( - 2 ) 14 ( 4 ) ( 2 ) ( 1 ) 158

,. +

(3)(1)(-3) (6)(4)(3)

31

W

2

392

NUMERICAL METHODS - II

IN II IIIIOI.A1UION

393

== - 4 _ 2 -'- 224 158 _ 382 22 360

9 '9 + 9 - 9 - 9 = -9- = 40

Thus f( 4) = 40

1/ I (

(X-X1)(X-X2)(X-X3)YO (x-xO)(x-x2)(x- )YI

. ) = + _~c___ ___:__

( Xo - xl ) ( Xo -- x2 ) ( Xo - x3 ) ( Xl - Xo ) (xl - X2 ) ( Xl - X3 )

( X - Xo ) ( X - Xl ) ( X - X3 ) Y2 ( X - Xo ) ( X - Xl ) ( X - X2 ) Y3

---------------------

-----------------------

(? 32. Use Lagrange's interpolation formula to find Y at x = 10 gioen
I x I 5 6 9 11 NIIW
I y_ 12 13 14 16 » Let,

( x2 - Xo ) ( x2 - xl ) ( x2 - x3 ) ( x3 - Xo ) ( x3 - Xl ) ( x3 - x2 )

f ( x-I) ( x - 3 ) ( x - 4 ) ( - 12 )

Y = (x) = (-1)(-3)(-4)+ 0

X ( x-I ) ( x - 4 ) 6 x ( x-I ) ( x - 3 ) 12

+ +

(3)(2)(-1) (4)(3)(1)

I ( \ ~ ( X-' 1 ) ( x - 3 ) ( X - 4 ) - X ( x-I ) ( x - 4 ) + x ( x-I) ( x - 3 )

~ x-I) [( x2 - 7x + 12 ) - ( x2 - 4x ) + ( x2 - 3x ) J

( x-I) [x2_ 6x + 12 1 = x3 - 7x2 + 18x - 12.

1111111 th required polynomial is f( x) = x3 -7x2 + 18x -12 Nuw, f(2) = 23_7(2)2+18(2)-12 = 4

Ihll /(2)=4

xo = 5 xl = 6 X 9 11

2 = x3 =

Yo = 12 YI = 13 Y2 = 14 Y3 = 16

We have Lagrange's interpolation formula,

X = 10 Y = ?

_ ( X - xl ) ( X - x2 ) ( X - x3 ) Yo ( x - Xo ) ( x - x ) ( X - X ) Y

y-f(x)=. + 2 3 I

( Xo - xl ) ( Xo - x2 ) ( Xo - x3 ) ( Xl - Xo ) ( x1- x2 ) ( xl - x3 )

( x - Xo ) ( x - xl ) ( x - x3 ) Y7 ( X - Xo ) (X - X ) ( X - X ) Y

+ . -, I 23

( X2 - Xo ) ( X2 - Xl ) ( X2 - X3) -r- (x3 - Xo ) ( X3 - Xl ) ( X3 - X2 )

f ( 10) = (4) ( 1 ) ( - 1 ) 12 -r- (5) ( 1 )( - 1 ) 13

(-1)(-4)(-6) (1)(-3)(-5)

.i, (5) ( 4 ) ( - 1 )14 . (5) ( 4 ) ( 1 ) ( 16)

, (4)(3)(-2) T (6)(5)(2)

.'\4. The following table gives the normal weights of babies during first f'lg/~t months of life

I/I~'J (I IVt'/SIrI I·lil/wi'r the weight of the baby at the age of seven months using Lagrange's 111/"/ /lollJll'ion formula.

:n months) 0 I 2 5 8
(ineounds) 6 I 10 12 16 f(10) = 2 - Q +35 -'- l.§_ = 44 = 14666 "" 1467

3 3 3 3 . ... .

Thus y at x = 10 is 14.67

Xo = 0 xl == 2 x2 =5 x3 = 8 } x = 7 Yo = 6 YI = 10 Y2 = 12 Y3 = 16 Y = ?

WI' 1~11V Lagrange's interpolation formula,

--------------------------------------------

(? 33. Use Lagrange's interpolationformula to fit a polynomial for the data

~-----,,-~----:------"--I ~-----,~=2 _ __j_I_.,---. ~~ ' _ __L__'__:-'! _ _L_~1~~' ~.j

( x - Xl ) ( X - x2 ) ( x - x3 ) Yo ( x - Xo ) ( x - x2 ) ( x - x3 ) YI

1/ j (.') = . + .. .

( Xo - Xl ) ( Xo - x2 ) ( Xo - x3 ) ( Xl - Xo ) ( Xl - x2 ) ( Xl - x3 )

( X - xo) ( X - Xl ) (x - x3 ) Y2 ( X - xo) (x - Xl ) ( X - ) Y3

+ +

( x2 - Xo ) ( x2 - Xl ) ( x2 - x3 ) ( x3 - Xo ) ( x3 - Xl ) ( x3 - x2 )

Hence estimate y at X = 2 » Let

We have Lagrange's interpolation formula,

394

NUMERICAL METHODS - II

f(7) = (5)(2)(~1)6 + (7)(2)(~1)10

(-2)(-5)(-8) (2)(-3)(-6)

(7)(5)(-1)12 (7)(5)(2)16

+ +

(5)(3)(-3) (8)(6)(3)

3 35 28 70

f ( 7) = 4- 9 + 3 + 9 = 13.97 '" 14.

Thus the approx. wt. of the baby at the age of 7 months is 14 pounds.

r:;,r 35. If Y ( 1) = 3 r Y (3 )1= 9 , Y ( 4) = 30 , Y ( 6) = 132 r find.

Lagrange's interpolation polynomial that takes on these values.

Xo = 1 xl = 3 » Let Yo = 3 Yl = 9

X2 = 4 x3 = 6

y=.f(x)=?

Y2 = 30 Y3 = 132

We have Lagrange's interpolation formula,

(X - xl) (X - X2 ) (X - X3 ) Yo ( x - Xo ) ( x - X2 ) ( x - X3 ) Yl

y=f(x)= +--~~--~----~~

( Xo - Xl ) ( Xo - X2 ) ( Xo - X3 ) (Xl - Xo ) (Xl - X2 ) ( Xl - X3 )

( X - Xo ) ( X - Xl ) ( X - X3 ) Y2 ( X - Xo ) ( X - Xl ) ( X - X2 ) Y3

+ + -_.::..__---''--- _ ___::___.:::.

( X2 - Xo) (X2 - Xl) ( X2 - X3 ) (X3 - Xo ) ( X3 -:- Xl) (X3 - X2 )

f(X) = (x-3)(x-4)(x-6)3 + (x-1)(x-4)(x-6)9

(-2)(-3)(-5) (2)(-1)(-3)

.i, (x - 1 ) ( X - 3 ) ( X - 6 ) 30 -'- -'.._( xc..c__- ~1 ,__) ('c.:_x:,_- -_:3:_,),--,(:._x_-_:4~) -=-13:..::2

, (3)(1)(-2) . (5)(3)(2)

-1 3

= 10 (x-3)(x-4)(x-6) + '2(x-l)(x-4)(x-6)

22 -5(x-1)(x-3)(x-6) + '5 (x-l)(x-3)(x-4)

1

= 10 [ - ( X - 3 ) ( X - 4) ( X - 6 ) + 15 ( x-I) ( X - 4 ) ( X - 6 )

- 50 ( x-I) ( X - 3 ) ( X - 6 ) + 44 ( x-I ) ( X - 3 ) ( x - 4 ) ] We can use the basic expansion formula,

( X - a ) ( X - b ) ( X - c) = x3 - x2 ( a + b + c ) + X ( ab + be + ca ) - abc

IN!1I:ril!POLATION

395

I ( v ) = 110 [ - ( x3 - 13x2 + 54x - 72 ) T 15 ( x3 - 11x2 + 34x - 24 ) - 50 (x3 -10x2 + 27x -18) + 44 (x3 - 8x2 + 19x -12) I

1 ~ -

= 10 l 8x3 - 4x2 - 58x + 84 J

III wnhe required polynomial is f ( x) = ~ [ 4x3 - 2x2 - 29x + 42 ]

.~-----------------------------------------

" 86, Given "o = 707, u? = 819, "s = 866 and u = 966 compute u

_ 6 4

using Lagrange's interpolation formula.

ilLet

X = 4 Y = ?

Xo = 0 xl = 2 x2 = 3 x3 = 6

Yo = 707 Y 1 = 819 Y 2 = 866 Y 3 = 966

We' have Lagrange's interpolation formula,

• ( X - xl ) ( X - x2 ) ( X - x3 ) Yo ( X - Xo ) ( X - x2 ) ( X - x3 ) Yl

1/ f( x ) = + ---------=-----=----=:

. ( Xo - Xl ) ( Xo - x2 ) ( Xo - x3 ) ( Xl - Xo ) ( Xl - x2 ) (xl - X3 )

+ (X - Xo ) ( x - Xl ) ( X - X3 ) Y2 + (X - Xo ) ( X - xl ) ( X - X2 ) Y3

( X2 - Xo ) ( X2 - Xl ) ( X2 - X3 ) (X3 - Xo ) ( X3 - Xl ) (X3 - X2 )

.~

f ( 4) = (2) ( 1 ) ( - 2 ) 707 + (4) ( 1 ) ( - 2 ) 819

(-2)(-3)(-6) (2)(-1)(-4)

. ( 4 ) ( 2 ) ( - 2 ) 866 ( 4 ) ( 2 ) ( 1 ) 966

+ ( 3 ) ( 1 ) ( - 3) . + ( 6 ) ( 4 ) ( 3 ) = 906.43

1ltliH 'U4 = 906.43

:a'7. Applying Lagrange's formula inversely to find x when Y = 6 given lite data

X

20

40

30

2

4.4

7.9

Xo = 20 xl = 30 x2 = 40 X = ?

Yo = 2 . YI = 4.4 Y2 = 7.9 Y = 6

WI! II ive Lagrange's inverse interpolation formula,

396

NUMERICAL METHODS - II

(Y-Yl)(Y-Y2)XO (Y-YO)(Y-Y2)Xl (Y-YO)(Y-YI)X2

X = + +

(yo - .111) ( YO - .112) (.111 - YO )( Yl - .112) (Y2 - yO) (Y2 - .111 )

X ( 6) = (1.6) ( - 1. 9 ) 20 + (4) ( - 1.9 ) 30 + (4) ( 1.6 ) 40

(-2.4)(-5.9) (2.4)(-3.5) (5.9)(3.5)

= 35.2462

Thus the value of x when y = 6 is 35.2462

(? 38. The observed values of a function are respectively 168, 120, 72 and 63 atthe four positions 3, 7, 9, 10 of the independent variable. What is the best estimate you can give for the value of the function at the position 6 of the independent variable ?

» For the function .11 = f ( X ), x is the independent variable andy is the

dependent variable. '

xo = 3 Let Yo = 168

x = 6, Y = ?

We have Lagrange's interpolation formula,

(X - xl) (x - X2 ) ( X - X3 ) YO (X - Xo ) (X - X2) (X - X3 ) Yl

Y = f ( X ) = + --::..__---='----=-~

( Xo - Xl ) ( Xo - X2 ) ( Xo - X3 ) (Xl - Xo ) (Xl - X2 ) ( Xl - X3 )

(X - Xo) (X - Xl) (x - X3) .112 (X - Xo) (X - Xl) (X - Xl) Y3

+ +

( X2 - Xo ) ( X2 -r- Xl ) ( X2 - X3 ) ( X3 - Xo ) ( X3 - Xl ) ( X3 - X2 )

f( 6) = (-1) (- 3) (- 4) 168 + (3) (- 3) (- 4) 120

(-4)(-6)(-7) (4)(-2)(-3)

( 3 ) ( - 1 ) ( - 4 ) 72 ( 3 ) ( - 1 ) ( - 3 ) 63

+ (6)(2)(-1) + (7)(3)(1)

= 12+180-72+27 = 147

Thus the ~stimate at position 6 of the independent variable is 147

39. Apply Lagrange's formula inversely to find a root of the equation f(x) = ° given that f(30) = -30, f(34) = -13 f(38) = 3 r f(42) = 18.

» Here we have to find x such that f ( x) = .11 = °

IN II 111lQLATION

397

1111

''"0 = 30 Xl = 34 . x2 = 38 YO = - 30 .111 = -13 .112 = 3

X3 = 42

.113 = 18 x = ? .11 = °

WI' h.w Lagrange's inverse interpolation formula,

.v - Yl ) (Y - Y2) (y - .113) Xo (Y - yo) (Y - Y2) (Y - .113) Xl

+

(yo - Yl ) (yo - Y2) (yo - .113) (.111 - yo) (Yl - .112) (.111 - Y3 )

(Y - yo) (Y - Yl ) (Y - Y3 ) X2 (Y - Yo) (Y - Yl ) (Y - Y2 ) X3

or + --.::...._--.::....._------'::._-.:::.

(Y2 - YO ) (Y2 - Yl ) (Y2 - Y3) (Y3 - yo) (Y3 - Yl ) (Y3 - Y2)

.Y ( 0) = (13) ( - 3 ) ( - 18 ) 30 + (30) ( - 3 ) ( - 18 ) ( 34 )

(-17) (-33) (-48) (17) (-16) (-31)

( 30 ) ( 13 ) ( - 18) 38( ,3 .:....::.O...!..._) -'-( 1=3_..!...)-'....( -_3~),--,,4=2

+ +-

( 33 ) ( 16 ) ( - 15 ) ( 48 ) ( 31 ) ( 15 )

= - 0.7821 + 6.5322 + 33.6818 - 2.2016

'\: ( 0) = 37.2303

11111 an approximate root of f (x) = 0 is 37.2303

",0. it an interpolating polynomial of the form x = f ( Y ) for the data and ""//('I! find x ( 5 ), Y ( 5 )

;j 2 10 17
1 3 4
x = 2 Xl = 10 x2 = 17
1,( 'l 0 x=f(y)=?
V = 1 Yl = 3 Y2 = 4
·0 lilt I' tho polynomial in Y is needed, we consider Lagrange's inverse IIIh" pol Ilion formula,

v

(Y - .'11) (Y - Y2) Xo (y - Yo) (Y- Y2) Xl

fey) = + . .

( YO - Yl ) (yo - Y2 ) (Yl - yo) (Yl - Y2 )

(Y - yo) (.11 - Yl) X2

+

(.'12 - yo) (Y2 - Yl )

398

NUMERICAL METHODS -II

(y-3)(y-4)2. (y-l)(y-4)10 (lJ-l)(y-3)17

~ -t- +

'l ( __ 2 ) ( - 3 ) - ( 2 ) ( - 1), ".. (3) ( 1 )

1 . ..- .. 17~· ..

=/ 3 (y-3)(y-4)-5(y-l)(y-4) -t- 3(y-1)(y-3)

:;{ = ~ (l- 7y + 12 ) - 5 ( l- 5y + 4) + 1; (l- 4y + 3) Thus :;{ = f( y) = l + 1 is the required polynomial

(i) At Y = 5, x = 52 + 1 = 26

- - ? 1

(li) Atx =:-), j = Y-+ or

Thus :d 5) = 26 and y ( 5) = 2

Note: !/'lhen more number of values are given at unequal intervals for intr;rpolatiol1 without the specific mention of the formula, we must prefer Newton 5 general interpolation formula.

------------------EXERCISES------------------

A~~I;-1"~~r~~~e:s-f~~~I~ ;o-fi;d-y- ;t~he-gi;e~ ~:l:~ ~i; - [l-t~ 3]--

1. [; I 9:.8 I 8~.9 I 8:.3 I 6~~7 I

l = 4 or y = 2

2.

yell) =?
1.2 2.0 I 3.0 I
x 2.5 I
V 1.36 0.58 0.34 __j_ 0.20 I
y (1.6) = ?
x 10 12 19 22 J
y 24 48 162 200 I 3.

y ( 18) =? (to the nearest integer)

4. Hf(l) = 2, f(2) =,4: f(3) =8, f(7) = 128,findf(5) and f( 6) using Lagrange s interpolation formula.

Use Laerange's interpolation formula to fit a polynomial for the followiPg data [problems 5 and 6]

5. 5~~_L_~_±_:J ~_j 1~1 I

NlJMEBICAL DIFFERENTIATION

399

1

1

2

4

5

14

41

197

350

7. Use Lagrange's inverse interpolation formula to find the value of x nor y = 100 given y ( 3) = 6, Y (5) = 24, Y ( 7) = 58,

V ( 9) = 108, Y ( 11) = 174.

H. Use Lagrange's formula in the appropriate form to fit a polynomial 0f the form x = f (y ) for the data & hence find x when y = 4

-------------------------------------------

ANSWERS

.-----------------------------------~------

I. 74.925 2. 0.8932
~. ~45 4. 38.8,74
i + 2x2 + 2x + 1 6. 2x3 + 3x2 + 4x + 5
7. 8.66 8. x = l + 2y + 2 ; 26 ~-~----------------------------------------

)( 6.6 Numerical Differentiation

uppose Yo' YI' Y2' ... Yn are the values of an unknown function

V .f ( x) corresponding to x: Xo r Xl' x2, . . . xn the process of

IlIlt!>ubng i' (x ), i" ( x ), 1''' ( x ), etc., at some particular value of the Illdt'p ndent variable x is known as Numerical Differentiation.

1'111' approximate value of these derivatives are obtained by IIIf'l't'l!lntiating an appropriate interpolation formula.

1 il. ~: The given values of x are equidistant and the given x is near III\'()' We prepare the forward difference table and consider Newton's

hll ward interpolation formula:

r(r-1) 2 1'(1'-1)(1'-2) 3

I( 'l)+rh)=yo+r6Yo + --2-!-6 Yo + 3! 6 YO+'"

I )lfll'l' ~ilhating w.r.t r on both sides we get,

Das könnte Ihnen auch gefallen