Numerical Analysis Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 450

Introduction

to
Numerical Computing
Suggested Readings:

1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


 Error in Numerical Calculations.
 Solution of Algebraic and Transcendental Equations.
 Interpolation.
 Numerical Differentiation.
 Numerical Integration.
 System of Linear equations.
 Eigen Value problem.
 Numerical solution of ordinary differential equations.
 For the Second-order polynomial equation:
ax 2  bx  c  0
analytical solution:
 
x   b  b2  4ac / 2a
 For many types of problems, such as a 5th-order
polynomial, a closed-form or analytical solution
does not exist. Then the iterative, or numerical,
approach must be used.
1. The solution procedure is iterative, with the
accuracy of the solution improving with
each iteration.
2. The solution procedure provides only an
approximation to the true, but unknown,
solution.
3. An initial estimate of the solution may be
required.
4. The algorithm is simple and can be easily
programmed.
5. The solution procedure may occasionally
diverge from rather than converge to the
true solution.
 There are two kinds of numbers: exact and
approximate numbers.
Example- 1, 2, 3, ½, 3/2 etc.

 Approximate numbers are those that


represents the number to a certain degree of
accuracy
Example-approximate value of π is 3.1416 or
for better approximation we can use
3.14154.
 The digits that are used to express a number
are called significant digits

Example 1- 3.1416, 0.66667 and 4.0687


contain five significant digits.
Example 2- 0.0023 has two significant
digits.
Example 3- 0.00145, 0.000145 & 0.0000145
has three significant digits.
Note –In case of ambiguity scientific notation
should be used

Example- 25600=2.56 × 10^4 =2.560 ×


10^4 = 2.5600 × 10^4 have 3, 4 and 5
significant digits respectively.
 To round off a number to n significant
digits, discard all the digits to the right of
nth digit, and if the discarded number is
1. Less than half unit in the nth place, leave
the nth digit unaltered.
2. greater than half unit in the nth place, increase
the nth digit by unity.
3. Exactly half a unit in the nth place , increase the
nth digit by unity it is odd, otherwise leave it
unchanged.
Round off to 4 significant digit
Example 1: 1.6583 1.658

Example 2: 30.0567 30.06

Example 3: 0.859378 0.8594

Example 4: 3.14159 3.142


 In numerical analysis, you will get numerical
solution to a particular problem.

 So for the desired solution, you have to


ensure what are errors and what are the
sources of errors.
 In general, errors can be classified based on
their sources as non-numerical and
numerical errors.

 Non-numerical errors:
(1) modeling errors: generated by
assumptions and limitations.
(2) blunders and mistakes: human errors
(3) uncertainty in information and data
Source of Numerical errors:

(1) round-off errors: due to a limited number of


significant digits.

(2) truncation errors: due to the truncated terms


e.g. infinite Taylor series
 Absolute errors

 Relative errors

 percentage errors
 Error= True value (X)- approximate value (X1)

 Absolute error (EA) = |Error|

 Relative Error (ER) = EA /true value

 Percentage Error (EP) = ER × 100


If ∆X be a number such that
|X1- X| ≤ ∆X
Then ∆X is a upper limit on the magnitude of the absolute
error.
Example: If the number X is rounded to N decimal places
then
∆X =1/2 (10-N)
If X= 0.51 and is correct to 2 decimal places then
∆X=0.005

ER = 0.005/0.51 =0.98
 Example: Numerical Errors Analysis

x 3  3x 2  6 x  8  0

The initial estimate x0 = 2

8
x 1  3 x0  6 
error:  2.828427
x0

e  x1  x0  0.828427
See the table on the next page.
Thank You
1. Bisection Method

2. Regula Falsi method

3. Secant Method

4. Newton Raphson method


 Bisection Method: Bisection Method is a numerical
method in Mathematics to find a root of a given
function

• Objective is to find a solution of f(x) = 0

where, f is a polynomial or a transcendental function, given explicitly.

• Exact solutions are not possible for most equations.

•A number x ± ε, (ε > 0 ) is an approximate solution of the equation if


there is a solution in the interval.
 Root of a function:

Root of a function f(x) is a value a such that:

f(a) = 0
 Example:

Function: f(x) = x2 - 4

Roots: x = -2, x = 2

Because:
f(-2) = (-2)2 - 4 = 4 - 4 = 0
f(2) = (2)2 - 4 = 4 - 4 = 0
Well-known Mathematical Property:

If a function f(x) is continuous on the interval [a, b] and


sign of f(a) ≠ sign of f(b), then

There is a value c ∈ [a, b] such that: f(c) = 0


i.e., there is a root c in the interval [a, b]
 Example:
 The Bisection Method is a successive approximation
method that narrows down an interval that contains a
root of the function f(x)
 The Bisection Method is given an initial interval [a..b]
that contains a root (We can use the property sign of f(a)
≠ sign of f(b) to find such an initial interval)
 The Bisection Method will cut the interval into 2 halves
and check which half interval contains a root of the
function
 The Bisection Method will keep cut the interval in halves
until the resulting interval is extremely small
The root is then approximately equal to any value in the
final (very small) interval.
 Example:

• Suppose the interval [a..b] is as follows:


 We cut the interval [a..b] in the middle: m =
(a+b)/2
 Because sign of f(m) ≠ sign of f(a) , we proceed
with the search in the new interval [a..b]:
We can use this statement to change to the new
interval:
b = m;
 In the above example, we have changed the end
point b to obtain a smaller interval that still
contains a root

In other cases, we may need to changed the end


point a to obtain a smaller interval that still
contains a root
 Here is an example where you have to change
the end point a:

• Initial interval [a..b]:


 After cutting the interval in half, the root is
contained in the right-half, so we have to change
the end point a:
 Rough description (pseudo code) of the
Bisection Method:
Given: interval [a, b] such that: sign of f(a) ≠ sign of
f(b)

repeat (until the interval [a, b] is "very small")


{
a+b
m = -----; // m = midpoint of interval [a, b]
2

if ( sign of f(m) ≠ sign of f(b) )


{
use interval [m, b] in the next iteration
(i.e.: replace a with m)
}
else
{
use interval [a..m] in the next iteration
(i.e.: replace b with m)
}
}

Approximate root = (a+b)/2; (any point between [a..b] will do


because the interval [a..b] is very small)
Calculation of Number of iteration

repeat (until the interval [a, b] is "very small say ε)


|b-a|
----- ≤ ε
2n
|b-a| ≤ ε . 2n

|b-a|
2n ≥ --------
ε
n loge(2) ≥ log (|b-a| / ε)
n ≥ log (|b-a| / ε) / loge(2)

Example: if |b-a| =1 and ε = 0.001

n ≥ loge (1/ 0.001) / loge(2) = loge (1000) / loge(2) =10 (approx)


 Always convergent
 The root bracket gets halved with each
iteration - guaranteed.

19
 Slow convergence
 If one of the initial guesses is close to the
root, the convergence is slower

20
 If a function f(x) is such that it just touches
the x-axis it will be unable to find the lower
and upper guesses.

f(x)

f x   x 2

21
Let a=2 and b=3
f(a)=-9 (-ve) f(b)=6 (+ve)
As f(a) × f(b)<0
So first approximation x0= (a+b)/2
=(2+3)/2
=2.5
Now, f(2.5)= (2.5)3-4 × 2.5- 9=-3.375 (-ve)
So root lies between 2.5 and 3
Second approximation
x1=(2.5+3)/2 = 2.75
f(x1)= 2.753-4 × 2 .75-9 = 0.7969 (+ve)

So root lies between 2.5 and 2.75


third approximation, x2=(2.5+2.75)/2 =
2.625,
Compute f(x2) =-1.41121 (-ve)
x3= (2.75+2.625)/2 = 2.6875
repeat this procedure till the desired result
is obtained.
x4= 2.71875, x5= 2.70313
x6= 2.71094, x7= 2.70703
x8= 2.70508, x9= 2.70605
x10= 2.70654, x11= 2.70642
The computed result is correct to 3 decimal
places.
Let a=1 and b=2
f(a)=-1 (-ve) f(b)=5 (+ve)
As f(a) × f(b)<0
So first approximation x0= (a+b)/2
=(1+2)/2
=1.5
Now, f(1.5)= (1.5)3-1.5-1=(+ve)
So root lies between 1 ans 1.5
x1=(1+1.5)/2 = 1.25

f(x1)= 1.253-1.25-1 = -ve

So root lies between 1.25 and 1.5


Second approximation, x2=(1.25+1.5)/2,

Compute f(x2), and repeat this procedure till


the desired result is obtained.
x3=1.3125
x4=1.34375
x5=1.328125
.
.
.
.
1. Find the real root of the equation x3-2x-5=0,
correct to 2 decimal places.

2. Find the real root of the function f(x)=xex-


1correct to three decimal places, which lies
between 0 and 1.
 To refine the bisection method, we can choose a
‘false-position’ instead of the midpoint.

 The false-position is defined as the x position


where a line connecting the two boundary points
crosses the axis
 Choose two points a and b such that f(a) and
f(b) are of opposite sign i.e f(a) × f(b) <0

 So root must lie between these two points.


 The equation of chord joining two points [a, f(a)] and [b,
f(b)] is given by:

(y2-y1)
y-y1 = ---------- (x-x1) ……..(1)
(x2-x1)

f(b) –f(a)
y-f(a) = ----------- (x- a) ……………(2)
b-a

Note: This method consists in replacing the part of the


curve between the points [a, f(a)] and [b, f(b)] by means of
the chord joining these points.
take the point of intersection of the chord with x axis as
an approximation to the root.
→ y=0
f(b) –f(a)
0-f(a) = ----- (x- a) ……………(3)
b-a

f(a)
x = a- ----- (b- a) ……………….(4)
f(b) –f(a)

Let x1 is the first approximation


a f(b) –bf(a)
x1= -----------
…………………(5)
f(b)-f(a)
 If f(x1)=0, then it is the required root, else
if f(x1) and f(a) are of opposite signs, then
the root must lie between a and x1 and we
replace b by x1.
 Otherwise replace a by x1.

 Note: the procedure is repeated till the root


is obtained to the desired accuracy.
Practice problem
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Numerical Computing
Root Finding Methods
1. Bisection Method

2. Regula Falsi method

3. Secant Method

4. Newton Raphson method


The False-Position Method (Regula-Falsi)
• To refine the bisection method, we can choose a ‘false-
position’ instead of the midpoint.

• The false-position is defined as the x position where a line


connecting the two boundary points crosses the axis
The False-Position Method (Regula-
Falsi) Cont..
• Choose two points a and b such that f(a) and
f(b) are of opposite sign i.e f(a) × f(b) <0

• So root must lie between these two points.


 The equation of chord joining two points [a, f(a)] and [b, f(b)] is given
by:

(y2-y1)
y-y1 = ---------- (x-x1) ……..(1)
(x2-x1)

f(b) –f(a)
y-f(a) = ----------- (x- a) ……………(2)
b-a

Note: This method consists in replacing the part of the curve between
the points [a, f(a)] and [b, f(b)] by means of the chord joining these
points.
take the point of intersection of the chord with x axis as an
approximation to the root.
→ y=0
f(b) –f(a)
0-f(a) = ------------ (x- a) ……………(3)
b-a

f(a)
x = a- ------------ (b- a) ……………….(4)
f(b) –f(a)

Let x1 is the first approximation


a f(b) –bf(a)
x1= ----------------- ----- …………………(5)
f(b)-f(a)
• If f(x1)=0, then it is the required root, else if f(x1)
and f(a) are of opposite signs, then the root must lie
between a and x1 and we replace b by x1.
• Otherwise replace a by x1.

• Note: the procedure is repeated till the root is


obtained to the desired accuracy.
Find the real root of the equation x3-2x-5=0 using Regula falsi
method, correct to 3 decimal places.

Let f(x)=x3-2x-5,
Now, f(2)=-1 and f(3)= 16 i.e. a root lies between 2 and 3.
Taking a=2 and b=3
f(a)=-1 and f(b)=16
First approximation,
Let x1 is the first approximation

a f(b) –bf(a) 2×16-3×-1 35


x1= --------------- = ------------- = ------- = 2.0588
f(b)-f(a) 16-(-1) 17

f(x1)=f(2.0588)=2.05883-2 ×2.0588-5= -0.3908


Now, f(x1)=f(2.0588)= -0.3908, i.e. the root lies between 2.0588 and 3
so, taking a=2.0588 and b= 3, f(a)= - 0.3908, f(b)= 16

Second approximation,

a f(b) –bf(a) 2.0588×16-3× -0.3908


x2= --------------- = --------------------------- = 2.0813
f(b)-f(a) 16-(-0.3908)
Repeating this process the successive approximations are:
x3=2.0862,
x4=2.0915,
x5=2.0934,
x6= 2.0941,
x7=2.0943, hence 2.0943 is the root correct to 3 decimal
places
Practice Problem
1. Find the real root of the equation 3x-cos x-1=0 using false
position method, correct to 2 decimal places.

2. Find the real root of the function f(x)=xex-1 using false


position method correct to three decimal places, which lies
between 0 and 1.
Secant Method
• This method is an improvement over the method of false position. As it
does not require the condition f(a) × f(b) < 0 of that method.

• The graph of the function y=f(x) is approximated by a line but at each


iteration two most recent approximations to the root is used to find the next
approximation.

• It is not necessary that the interval must contain the root .


f(x)

E D A X
Xn X0 X1
Secant Method
In the neighborhood of an exact root, we approximate the curve by a straight
line.
i.e. f(X)= a0 X+a1 =0 ……………(1)
X= -a1 /a0 ……………(2)
Now these constant can be found as follows:
Let Xn-1 and Xn be any two approximation to the root.
Now represent f(Xn-1)= f n-1 and f(Xn)=fn
Since it satisfies equation 1
f(Xn-1) =a0 Xn-1 +a1
f n-1 = a0 Xn-1 +a1 ………….(3)
& f n = a0 Xn +a1 ………….(4)
f(Xn-1) =a0 Xn-1 +a1
f n-1 = a0 Xn-1 +a1 ………….(3)
& fn = a0 Xn +a1 ………….(4)
On solving eq (3) and (4) for a0 and a1
fn – fn-1 = a0 (Xn - Xn -1 )

( fn – fn-1 )
a0= -----------------
(Xn - Xn -1)

a1= fn - a0 Xn

( fn – fn-1 )
a1= fn - ------------- Xn
(Xn - Xn -1)
So the required approximated root Xn+1,
Xn+1= -a1 /a0
From equatoion 4
Xn+1= - (fn –a0Xn) /a0 = Xn –fn/a0

(Xn - Xn -1)
Xn+1= Xn – --------------------------- fn
( fn – fn-1 )

Xn-1 fn - Xn fn-1
Or Xn+1= -------------------------------------, n=1,2,3……….
fn – fn-1
A real root of the equation x3-5x+1=0 lies in the interval (0, 1).
Perform four iterations of the secant method.

We have, x0=0, x1= 1


f(x0)=1 and f(x1)=-3
• By Secant method

Xn-1 fn - Xn fn-1
Xn+1= ------------------------------------- , n=1,2,3……….
fn – fn-1

x0f1-x1f0 0×-3-1 ×1 -1
x2= ------------ = -------------- = ----------= 0.25
f1-f0 -3-1 -4
f(x2)= -0.234375
Xn-1 fn - Xn fn-1
Xn+1= ------------------------------------- , n=1,2,3……….
fn – fn-1

As, x2= 0.25 and f(x2)= -0.234375


x1f2-x2f1
x3= ------------ = 0.186441
f2-f1
f(x3)= 0.074276
x2f3-x3f2
x4= ------------ =0.201736
f3-f2
f(x4)= -0.000470
x3f4-x4f3
x5= ------------ = 0.201640
f4-f3
x5=0.2016 is the required approximated root correct to 3 decimal
places
Practice problems

1. Find the real root of the equation x3-2x-5=0 using secant method, correct to
2 decimal places.

2. Find the real root of the equation 3x-cos x-1=0 using secant method, correct
to 2 decimal places.
Suggested books
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Numerical Computing
Root Finding Methods
1. Bisection Method

2. Regula Falsi method

3. Secant Method

4. Newton Raphson method


Bisection Method

• sign of f(m) ≠ sign of f(a) , we


proceed with the search in the new
interval [a..b]:
The False-Position Method (Regula-
Falsi) Cont..
Secant Method

f(x)

E D A X
Xn X0 X1
Newton Raphson’s Method
Let x0 be an approximate root of the equation f(x)=0.

f(x)
If x1=x0+h be the exact root, then f(x1)=0
Expanding f(x1)=f(x0+h) by taylor’s series f(xi) B

f(x0+h)=0

h 2 f ' ' (x0 )


f ( x0 )  hf ' (x0 )   .........  0 C  A X

2! xi+1 xi

Since h is small, neglecting h2 and higher power of h, we get

f ( x0 )  hf ' (x0 )  0

f ( x0 )
h
or f ' (x0 )
A closer approximation to the root is given by
x1=x0+h
A closer approximation to root is given by
f ( x0 )
x1  x0 
f ' (x0 )
Similarly, starting with x1, a still better approximation x2 is given by

f ( x1 )
x2  x1 
f ' (x1 )
In general, nth approximation can be given by

f ( xn )
xn 1  xn 
f ' (xn )
n=0,1,2….
Derivation
f(x)

AB
f(xi) B tan(  
AC

f ( xi )
f ' ( xi ) 
xi  xi 1
C  A X f ( xi )
xi+1 xi xi 1  xi 
f ( xi )

Derivation of the Newton-Raphson method.


8
A real root of the equation x3-5x+1=0 lies in the interval (0, 1).
Perform four iterations of the Newton Raphson method.

f(x) = x3-5x+1=0
The smalest root lies in the interval (0,1). Take the initial approximation as
x0=0.5.
We have, f(x)=x3-5x+1 and f’(x)=3x2-5
Using Newton Raphson method

f ( xn )
xn 1  xn 
f ' (xn )
( x 3n  5 xn  1) 2 x 3n  1
xn1  xn  2
 2
, n  0,1,2....
3x - 5
n 3x - 5
n

Starting with x0=0.5, we obtain, x1=0.176471


x2=0.201568
x3=0.201640
x4=0.201640

The exact value correct to six decimal places is 0.201640


Practice problems

1. Find the real root of the equation x3-2x-5=0 using Newton Raphson method,
correct to 4 decimal places.

2. Find the real root of the equation 3x-cos x-1=0 using Newton Raphson
method, correct to 3 decimal places.

3. Obtain the cube root of 12 correct to five decimal places by Newton


Raphson method
Convergence of Root finding methods
Order of an iterative method-
An iterative method is of order p if
| εn+1| ≤ c | εn |p

Where, ‘c’ is called the asymptotic error constant.


Note: Error at any iteration can be defined as
εn=xn-ε
Where, ε is the exact root, εn is th error between Xn and ε
Rate of convergence of Newton
Raphson method

Let  n1  xn1   and  n  xn   ,


 xn1   n1   and xn   n  
Therefore by Newton Raphson method:

f ( xn )
xn 1  xn 
f ' (xn )
f ( n   )
 n 1     n   
f ' ( n  )
f ( n   )
 n 1   n 
f ' ( n  )
By..taylor ...series...
  n2 
 f (  )   n f ' (  )  f ' ' (  )  .....
 n 1   n   2 
  n2 
 f ' ( )   n f ' ' ( )  f ' ' ' ( )  .....
 2 
as... ....is...the...exact .....root...so... f ( )  0
  n2 
 0   n f ' ( )  f ' ' ( )  .....
 n 1   n   2 
  n2 
 f ' ( )   n f ' ' ( )  2 f ' ' ' ( )  .....
 
1
  n2  f ' ' ( )  n2 f ' ' ' ( ) 

 n f ' ( )  f ' ' ( )  .....1     .....
f ' ( ) 2 f ' ( )
n

 n 1   n 
1  2  
f ' ( )
  n2  f ' ' ( ) 

 n f ' ( )  f ' ' ( )  ..... 1    .....
1  2  
n
f ' (  ) 
 n 1   n 
f ' ( )
 f ' ( )  n2 f ' ' ( )  f ' ' ( ) 
 n 1   n   n   ..... 1   n  .....
 f ' ( ) 2 f ' ( )  f ' ( ) 
  n2 f ' ' ( )  f ' ' ( ) 
 n 1   n   n   ..... 1   n  .....
 2 f ' ( )  f ' ( ) 
  n2 f ' ' ( )  n2 f ' ' ( )  n3  f ' ' ( ) 
2

 n 1   n   n      
 f ' ( ) 2 f ' ( ) 2  f ' ( )  
  n2 f ' ' ( ) 3 
 n 1   n   n   o( n ) 
 2 f ' ( ) 
 n2 f ' ' ( )
 n 1  n n   o( n3 )
2 f ' ( )
 n2 f ' ' ( )
 n 1   o( n3 )
2 f ' ( )
as.. n ...is...small... n3 ...will ..be...much...smaller .....
.neglecting ...higher ...order...term...
 n 1  c n2
 p2
Find the rate of Convergence of Secant Method.
Suggested books
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
 Lagrange’s Interpolation
 Divided Differences
 Interpolation using Divided Differences
 Newton Interpolation Formula

2
Given (x0,y0), (x1,y1), …… (xn,yn), find the value
of ‘y’ at a value of ‘x’ that is not given.

3
Polynomials are the most common choice
of interpolation because they are easy to:

• Evaluate
• Differentiate, and
• Integrate.

4
If y=f(x) takes the values y0, y1, y2……yn , corresponding to
x0, x1, x2…….xn then

( x  x1 )( x  x2 ).....( x  xn ) ( x  x0 )( x  x2 ).....( x  xn )
f ( x)   y0   y1  ..........
( x0  x1 )( x0  x2 ).....( x0  xn ) ( x1  x0 )( x1  x2 ).....( x1  xn )
( x  x0 )( x  x1 ).....( x  xn 1 )
 yn
( xn  x0 )( xn  x1 ).....( xn  xn 1 )

5
Let y=f(x) be a function which takes the data points
( x0 , y0 ), ( x1 , y1 ).....( xn , yn ) since there are n+1 pairs of values of x.
we can represent f(x) by a polynomial in x of degree n. Let
this polynomial be of the form

y  f ( x)  a0 ( x  x1 )( x  x2 ).....( x  xn ) 
a1 ( x  x0 )( x  x2 ).....( x  xn ) 
a2 ( x  x0 )( x  x1 )( x  x3 )  .....( x  xn )  ....  ………(1)
an ( x  x0 )( x  x1 )( x  x2 )  ........( x  xn 1 )

6
Lagrange’s Interpolation (Cont..)
Putting x=x0 and y=y0 in equation (1)
y0=a0(x0-x1)(x0-x2)……(x0-xn)
y0
a0 
( x0  x1 )( x0  x2 ).....( x0  xn )

Similarly putting x=x1 and y=y1 in equation (1), we have

y1
a1 
( x1  x0 )( x1  x2 ).....( x1  xn )
Proceeding the same way, we find a2, a3, …..an.

7
Substituting the values of a0, a1…..an in equation (1), we get

( x  x1 )( x  x2 ).....( x  xn ) ( x  x0 )( x  x2 ).....( x  xn )
f ( x)   y0   y1  ..........
( x0  x1 )( x0  x2 ).....( x0  xn ) ( x1  x0 )( x1  x2 ).....( x1  xn )
( x  x0 )( x  x1 ).....( x  xn1 )
.............  yn
( xn  x0 )( xn  x1 ).....( xn  xn1 )

Lagrange’s formula can be applied whether the values xi are


equally spaced or not. It is easy to remember but cumbersome to
apply.

8
Lagrangian interpolating polynomial is given by
n
f n ( x)   Li ( x) f ( xi )
i 0

where ‘ n ’ in f n (x) stands for the n th order polynomial that approximates the function y  f (x)

given at (n  1) data points as x0 , y 0 , x1 , y1 ,......,  x n 1 , y n 1 , x n , y n  , and


n x  xj
Li ( x)  
j 0 xi  x j
j i

Li (x) is a weighting function that includes a product of (n  1) terms with terms of j  i


omitted.

9
Given the values

x f(x)
5 150
7 392
11 1452
13 2366
17 5202

Evaluate f(9), using Lagrange’s formula.

10
3
f ( x)   Li ( x) f ( xi )
i 0

x0=5, x1=7, x2=13, x3=17


f(x0)=150, f(x1)=392, f(x2)=1452, f(x3)=5202
(9  7)(9  11)(9  13)(9  17) (9  5)(9  11)(9  13)(9  17)
f (9)  150   392 
(5  7)(5  11)(5  13)(5  17) (7  5)(7  11)(7  13)(7  17)

(9  5)(9  7)(9  13)(9  17) (9  5)(9  7)(9  11)(9  17)


1452   2366
(11  5)(11  7)(11  13)(11  17) (13  5)(13  7)(13  11)(13  17)
(9  5)(9  7)(9  11)(9  13)
  5202
(17  5)(17  7)(17  11)(17  13)
 810

11
1. The following table is given
X 0 1 2 5
f(x) 2 3 12 147

What is the form of f(x)?

2. Apply Lagrange’s formula to find f(5) given that


f(1)=2, f(2)=4, f(3)=8, f(4)=16, f(7)=128.

12
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
 Lagrange’s Interpolation
 Divided Differences
 Interpolation using Divided Differences
 Newton Interpolation Formula

2
Let f(x0), f(x1), …… f(xn) be the values of the function y=f(x)
corresponding to the values x0, x1, ……….xn of the argument x.
where, x1- x0, x2- x1 …… xn- xn-1 are not necessarily equal i.e.
when there is a case of unequal intervals.

The first divided difference of f(x) for the argument x0, x1 is


denoted by f [x0, x1] or  f ( x0 )
x1

f ( x1 )  f ( x0 )
so f [ x0 , x1 ] 
x1  x0

3
Similarly the other divided difference of f(x) for the argument x1,
x2, x3…..xn-1 are
f ( x2 )  f ( x1 )
f [ x1 , x2 ] 
x2  x1
.
.
.
f ( xn )  f ( xn 1 )
f [ xn 1 , xn ] 
xn  xn 1

This is called first divided difference,


Again the second and higher divided differences are defined in
terms lower divided differences example the second divided
difference of f(x) for the arguments (x0, x1, x2) is given by

4
Again the second and higher divided differences are defined in
terms lower divided differences,
example the second divided difference of f(x) for the arguments
(x0, x1, x2) is given by

f [ x1 , x2 ]  f [ x0 , x1 ]
f [ x0 , x1 , x2 ]    f ( x0 )
2

x2  x0 x1 , x2

5
Similarly, the nth divided difference is given by

f [ x0 , x1 ,.......xn ] 

f [ x1 , x2 .....xn ]  f [ x0 , x1......xn 1 ] n
  f ( x0 )
xn  x0 x1 , x2 ....xn

6
Given the values

x f(x)
0 2
1 3
2 12
5 147

Prepare Newton’s divided difference table.

7
x0=0, x1=1, x2=2, x3=5
f(x0)=2, f(x1)=3, f(x2)=12, f(x3)=147

Divided difference table:


x f(x) ∆ ∆2 ∆3

0 2 (3-2)/1-0)=1 (9-1)/(2-0) (9-4)/(5-0)=1


=4
1 3 (12-3)/(2-1)=9 (45-9)/(5-1)
=9
2 12 (147-12)/(5-2)
=45
5 147

8
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
 Lagrange’s Interpolation
 Divided Differences
 Interpolation using Divided Differences
 Newton Interpolation Formula

2
Let f(x0), f(x1), …… f(xn) be the values of the function y=f(x)
corresponding to the values x0, x1, ……….xn of the argument x
not necessarily equally.
Let the polynomial of degree n be

Pn ( x)  a0  ( x  x0 )a1 
( x  x0 )( x  x1 )a2  ( x  x0 )( x  x1 )( x  x2 )a3  .........
..........  ( x  x0 )( x  x1 )...........( x  xn 1 )an .................(1)

Now it should fit the data Pn(xi)= f(xi)


3
For x=x0
Pn(x0)= f(x0)
Now putting this in equation (1)
a0= f(x0)
Now at x=x1 Pn ( x1 )  f ( x1 )  a0  ( x1  x0 ) a1
f ( x1 )  a0
 a1 
( x1  x0 )
As , a0  f ( x0 )
f ( x1 )  f ( x0 )
a1   f [ x0 , x1 ]
( x1  x0 )
4
Now at x=x2

Pn ( x2 )  f ( x2 )  a0  ( x2  x0 )a1  ( x2  x0 )( x2  x1 )a2

f ( x2 )  a0  ( x2  x0 )a1
 a2 
( x2  x0 )( x2  x1 )

5
f ( x1 )  f ( x0 )
As , a0  f ( x0 ).....and .....a1 
( x1  x0 )
f ( x1 )  f ( x0 )
f ( x2 )  f ( x0 )  ( x2  x0 )
( x1  x0 )
 a2 
( x2  x0 )( x2  x1 )
f ( x2 ) f ( x1 ) f ( x1 )
  
( x2  x0 )( x2  x1 ) ( x1  x0 )( x1  x2 ) ( x0  x1 )( x0  x2 )
 f [ x0 , x1 , x2 ]

Now, By...Induction
.
.
an  f [ x0 , x1 , x2 ]
6
Now from equation (1)

Pn ( x)  f [ x0 ]  ( x  x0 ) f [ x0 , x1 ] 
( x  x0 )( x  x1 ) f [ x0 , x1 , x2 ]  ....  ( x  x0 )( x  x1 )......( x  xn 1 ) f [ x0 , x1 ,....xn ]
………(2)
So form the divided difference table and place the values in
equation (2) to get the required polynomial.

7
Given the values

x f(x)
0 1
1 3
3 55

Find the polynomial of the lowest possible degree


using Newton’s divided difference interpolation.
.

8
x0=0, x1=1, x2=3
f(x0)=1, f(x1)=3, f(x2)=55

Divided difference table:


x f(x) ∆ ∆2

0 1 (3-1)/1-0)=2 (26-2)/(3-0)
=8
1 3 (55-3)/(3-1)=26
3 55

9
x f(x) ∆ ∆2

0 1 (3-1)/1-0)=2 (26-2)/(3-0)
=8
1 3 (55-3)/(3-1)=26
3 55

The Newton divided difference interpolating polynomial


becomes
P2 ( x)  f (0)  ( x  0) f [0,1]  ( x  0)( x  1) f [0,1,3]
 1  2 x  x( x  1)8
 8x 2  6 x  1

10
Given the values

x f(x)
0 2
1 3
2 12
5 147

Find the polynomial of the lowest possible degree


using Newton’s divided difference interpolation.
.

11
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Divided Differences
Interpolation using Divided Differences
Finite Differences
or Gregory
Newton formula
o Forward
o Backward

2
3
Now for equal interval, we consider the more simpler
formula. Let for equal spaced (h) data, We have x0, x0 +h,
x0 0 +nh, Or xn= x0 +nh

Some finite difference operators are as follows:


1. Shift Operator
2. Forward difference operator
3. Backward difference operator
4. Central difference operator

4
It is defined as

For example

5
It is defined as

0 1 n-1 are called first forward differences

6
The difference of first forward difference is called second
forward difference and are denoted by 2y0, 2y1

7
The difference of first forward difference is called second
forward difference

Similarly, third, fourth and other forward difference can be obtained

8
It is defined as

9
It is defined as:

10
x f(x) 1 2 3

x0 y0 2y 3y 2y 2y
0=y1-y0 0 1- 0 0 1- 0

x1 y1 2y
1=y2-y1 1 2- 1

x2 y2 2=y3-y2

x3 y3

11
1 2 3
x f(x)

2y 3y 2y 2y
x0 y0 y1=y1-y0 2= y2- y1 3= 3- 2

x1 y1 y2=y2-y1 2y
3= y3- y2

x2 y2 y3=y3-y2

x3 y3

Note: 0= y1 and
2y
0 =
2y
2

12
As

Again,

13
As

14
R.H.S.
E-1
E-1(E-1) as -1)
1-E-1
L.H.S

15
1. - =-
2. -
3. = (1- )-1/2

16
For equal interval, we
consider the more simpler formula. Let for equal spaced (h) data, We have x0,
x0 +h, x0 0 +nh, Or xn= x0 +nh

17
2. Backward Difference Formula: For equal interval, we
consider the more simpler formula. Let for equal spaced (h) data, We have x0, x0
+h, x0 +2h, x0 +nh, Or xn= x0 +nh, n=0,1,2 .

18
Given the values

x -2 -1 0 1 2 3

f(x) -4 1 0 -1 4 21

Construct Newton forward difference table for the given data.

19
x f(x) 2 3 4

-2 -4 (1+4)=5 -6 6 0

-1 1 0-1=-1 0 6 0

0 0 -1-0=-1 6 6

1 -1 4+1=5 12

2 4 21-4=17

3 21

20
Given the values

x -2 -1 0 1 2 3

f(x) -4 1 0 -1 4 21

Construct an interpolating polynomial for the data given in the


table using Newton forward interpolation formula and
compute the value of f(-1.5).

.
21
x f(x) 2 3 4

-2 -4 (1+4)=5 -6 6 0

-1 1 0-1=-1 0 6 0

0 0 -1-0=-1 6 6

1 -1 4+1=5 12

2 4 21-4=17

3 21

22
23
At x=-1.5

24
Given the values

x -2 -1 0 1 2 3

f(x) -4 1 0 -1 4 21

Compute the value of f(2.5) using Newton Backward


interpolation formula and

25
1 2 3
x f(x)

2y 3y 2y 2y
x0 y0 y1=y1-y0 2= y2- y1 3= 3- 2

x1 y1 y2=y2-y1 2y
3= y3- y2

x2 y2 y3=y3-y2

x3 y3

26
x f(x) 1 2 3 4

-2 -4 (1+4)=5 -6 6 0

-1 1 0-1=-1 0 6 0

0 0 -1-0=-1 6 6

1 -1 4+1=5 12

2 4 21-4=17

3 21

Where,
27
Where, u=(2.5-3)/1=-0.5

28
Given the values

x 0 1 2 3 4

f(x) 1 7 23 55 109

find f(0.5) and f(1.5) using Newton's forward difference formula.


.

29
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Systems of Linear Equations
Suppose, we have system of linear equation

a11x1+a12x2+a13x3+…….. +a1nxn =b1


a21x1+a22x2+a23x3+…….. +a2nxn =b2
.
.
an1x1+an2x2+an3x3+…….. +annxn =bn

 a11 a12 . . a1n   x1   b1 


a a2 n  x  b 
 21 a22 . .
 2  2
A . 
Let   X  .  b . 
 .     
an1 an 2 . . ann  . .
 xn  bn 

Ax=b
A Matrix is an array of numbers:

4 10 5
A
5 12 20

(This one has 2 Rows and 3 Columns)


Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Skew-Symmetric Matrix
Square Matrix A is said to be skew-symmetric if aij=−aji for all i and j.
In other words, we can say that matrix A is said to be skew-symmetric
if transpose of matrix A is equal to negative of Matrix A i.e (AT=−A).
Note that all the main diagonal elements in skew-symmetric matrix are zero.
Types of Matrix (Cont…)
Types of Matrix (Cont…)
Orthogonal Matrix: A square matrix with real numbers or values is termed as an
orthogonal matrix if its transpose is equal to the inverse matrix of it. In other words, the product of a
square orthogonal matrix and its transpose will always give an identity matrix.

Suppose A is the square matrix with real values, of order n × n.


Also, let AT is the transpose matrix of A. Then according to the definition:
If, AT=A−1 condition is satisfied,
then A ×AT= I

Example: cos   sin  


A 
 sin  cos  
1  cos  sin   T  cos  sin  
A   ,A 
 sin  cos    sin  cos  
Systems of Linear Equations
Suppose, we have system of linear equation

a11x1+a12x2+a13x3+…….. +a1nxn =b1


a21x1+a22x2+a23x3+…….. +a2nxn =b2
.
.
an1x1+an2x2+an3x3+…….. +annxn =bn
 a11 a12 . . a1n   x1   b1 
a a2 n  x  b 
 21 a22 . .
 2  2
A . 
  X  .  b . 
Let  .     
an1 an 2 . . ann  . .
 xn  bn 

Ax=b
For the given system of linear equations, we have
[A | b] : Augmented matrix

Case 1: if |A| ≠ 0 ⟹ A-1 exist.


⟹x= A-1 b

Case 2: if b=0 : Homogeneous system


& if |A| ≠ 0, ⟹x= A-1 b=0, we will get a trivial solution i.e. 0
Consistency and inconsistency of System of Linear equation

Consistency: If solution exists for Ax=b

Inconsistency: If solution does not exists for Ax=b

For Augmented matrix, [A | b], n= no. of unknowns

1. If rank (A) = rank([A | b])=n


⟹ System is consistent and has unique solution.
2. If rank (A) = rank([A | b])=n1<n
⟹ system is consistent and has infinite number of solutions.
3. If rank (A) ≠ rank([A | b])
⟹ System is inconsistent and has no solution.
A system of equations is a group of two or more
equations. To solve a system of equations means to find
values for the variables that satisfy all of the equations in
the system.

Systems of equations can involve any number of


equations and variables; however, we will limit ourselves
to situations containing two variables in this section.

17
Systems of Linear Equations
Graphing a system of two linear equations in two
unknowns gives one of three possible situations:

Case 1: Lines intersecting in a


single point. The ordered pair that
represents this point is the unique
solution for the system.

3x+y=17
4x-y=18
Systems of Linear Equations

Case 2: Lines that are distinct parallel lines


and therefore don’t intersect at all. Because
the lines have no common points, this
means that the system has no solutions.

3x+2y=5
6x+4y=8
Systems of Linear Equations

Case 3: Two lines that are the same


line. The lines have an infinite number
of points in common, so the system
will have an infinite number of
solutions.
2x+4y=8
x+2y=4
Systems of Linear Equations

In numerical methods, there are two types of


methods:

•Direct Method

•Iterative Method
Systems of Linear Equations
Example 1: For System of linear equation Ax=b,
If A is Diagonal Matrix,
a11 0 0 0   x1   b1 
0 a 0 0   x  b 
 22  2    2 
0 0 . 0  .   . 
    
 0 0 0 a nn   xn  bn 

bn
xn 
ann
Systems of Linear Equations
Example 2: For System of linear equation Ax=b,
If A is Lower Triangular Matrix,
l11 0 0 0   x1   b1 
l 0   x2  b2 
 21 l22 0

. . . .  .   . 
    
ln1 ln 2 . lnn   xn  bn 

b1 1
x1  , x2  (b2  l1 2 x1 )
l1 1 l2 2
1
xn  (bn  l1n x1  l2 n x2 .....)
l2 2

This is called forward substitution method.


Systems of Linear Equations
Example 3: For System of linear equation Ax=b,
If A is Upper Triangular Matrix,
U11 U12 .... U1n   x1   b1 
 0 U 22 .... U 2 n   x2  b2 
 
 . . . .  .   . 
    
 0 0 . U nn   xn  bn 

bn
xn 
U nn

This is called Backward substitution method.


A set of n equations and n unknowns
a11x1  a12 x2  a13x3  ...  a1n xn  b1 …(1)

a21x1  a22x2  a23x3  ...  a2n xn  b2 …(2)


. .
. .
. .
an1x1  an 2 x2  an3 x3  ...  ann xn  bn

(n-1) steps of forward elimination


Step 1
For Equation 2, divide Equation 1 by a11 and
multiply by a21 .

 a21 
 a (a11x1  a12 x2  a13x3  ...  a1n xn  b1 )
 11 
a21 a21 a21
a21x1  a12 x2  ...  a1n xn  b1
a11 a11 a11
Subtract the result from Equation 2.
a21x1  a22x2  a23x3  ...  a2n xn  b2
a21 a21 a21
− a21x1  a a12 x2  ...  a a1n xn  a b1
_________________________________________________
11 11 11

 a21   a21  a21


 a22  a12  x2  ...   a2 n  a1n  xn  b2  b1
 a11   a11  a11

or a x  ...  a x  b
'
22 2
'
2n n
'
2
Repeat this procedure for the remaining
equations to reduce the set of equations as
a11x1  a12x2  a13x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
'
a32 x2  a33
'
x3  ...  a3' n xn  b3'
. . .
. . .
. . .

an' 2 x2  an' 3 x3  ...  ann


'
xn  bn'

End of Step 1
Step 2
Now eliminate x2 from the last (n-2) equations.

a11x1  a12x2  a13x3  ...  a1n xn  b1


'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
"
a33 x3  ...  a3"n xn  b3"
. .
. .
. .

an" 3 x3  ...  ann


"
xn  bn"
End of Step 2
Repeat this process till we finally obtain upper triangular
form:
a11x1  a12 x2  a13 x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
a x  ...  a x  b
"
33 3
"
3n n
"
3
. .
. .
. .

n 1 n 1 
ann xn  bn

End of Step (n-1)


a11 a12 a13  a1n   x1   b1 
 0 a' a'  '
a2 n  x   b' 
 22 23  2   2 
0 "
0 a33  "
a3n   x3    b3 
"

    
           
 0 0 0 0 ann   xn  bn 
(n 1 )
    (n-1 )
a11x1  a12 x2  a13 x3  ...  a1n xn  b1
'
a22 x2  a23
'
x3  ...  a2' n xn  b2'
"
a33 x3  ...  an" xn  b3"
. .
. .
. .

n 1 n1 
ann xn  bn
 n 1
Where, ann indicates that the element ann has
changed (n-1) times
The required solution is obtained from the last equation
because it has only one unknown

( n 1)
b
xn  n
( n 1)
a nn
Then, xn-1, xn-2…….. x1 can be calculated.
Example-1 Use Gauss Elimination method to solve
2x1+x2+x3=10 ………..(1)
3x1+2x2+3x3=18 ………..(2)
x1+4x2+9x3=16 ………..(3)

Solution: At first eliminate x1 from eq. (2) and (3)


Multiply eq.(1) by (3/2) and subtract from eq(2)
3x1+2x2+3x3=18
- [3x1+(3/2)x2+(3/2)x3=10(3/2)]
____________________________________
(2-3/2)x2 +(3-3/2)x3=18-15
(1/2)x2+(3/2)x3=3
x2+3x3 =6 ………(4)
Multiply eq.(1) by (1/2) and subtract from eq(3)
x1+4x2+9x3=16
- [x1+(1/2)x2+(1/2)x3=10(1/2)]
____________________________________
(4-1/2)x2 +(9-1/2)x3=16-5
(7/2)x2+(17/2)x3=11
7x2+17x3 =22 ………(5)
Solution (Cont……)

Now eliminate x2 from eq. (5)


Multiply eq.(4) by (7) and subtract from eq(5)
7x2+17x3 =22
- [7x2+21x3 =42]
____________________________________
(17-21)x3=22-42
(-4)x3=-20
x3 =5
Now from eq.(4)
x2+3x3 =6
x2+3×5=6
x2 =6-15=-9
Now from eq.(1)
2x1+x2+x3=10
2x1-9+5=10
x1 =7
Pivot
If, in the system of linear equation pivot (a11) is zero or very small
compared to other coefficients of the equation, then we can find
the largest available coefficient in the column below the pivot
equation & then interchange the two rows.

In this way we can find the pivot equation with a non zero pivot.

Note: if we search both column and rows for largest element, the
procedure is called “Complete pivoting”
Example-1 Use Gauss Elimination method with partial pivoting to solve
x1+2x2+4x3=9 ………..(1)
2x1+5x2-3x3=9 ………..(2)
5x1+12x2-2x3=25 ………..(3)

1 2 4 | 9 
2 5 3 | 9 
 

5 12 2 | 25

5 12 2 | 25
2 3 | 9 
 5  R1  R3

1 2 4 | 9 

1 12 / 5  2 / 5 | 5
2 3 | 9
 5  R1  R1 / 5

1 2 4 | 9 
1 12 / 5 2/5 | 5 
0  11 / 5 |  1
 1/ 5  R2  R2  2 R1 , R3  R3  R1

0 2/5 22 / 5 | 4 

1 12 / 5  2 / 5 | 5 
0  2 / 5 22 / 5 | 4  R  R
  2 3

0 1 / 5  11 / 5 |  1
1 12 / 5  2 / 5 | 5 
0 1  11 |  10  R  R /( 2 / 5)
  2 2

0 1 / 5  11 / 5 |  1 
1 12 / 5  2 / 5 | 5 
0 1  11 |  10  R  R  R (1 / 5)
  3 3 2

0 0 0 | 1 

Since rank(A) ≠ rank(A | b)


2≠ 3
So no solution exists
Practice Problems

1. Solve the following linear system of equation using Gauss


elimination method:
y+z=2
2x+3z=5
x+y+z=3

2. Use Gauss Elimination method with partial pivoting to solve

2x+3y+z=9
x+2y+3z=6
3x+y+2z=8

39
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Gauss Elimination Method
LU Decomposition Method
Iterative Method
Systems of Linear Equations
Suppose, we have system of linear equation

a11x1+a12x2+a13x3+…….. +a1nxn =b1


a21x1+a22x2+a23x3+…….. +a2nxn =b2
.
.
an1x1+an2x2+an3x3+…….. +annxn =bn

 a11 a12 . . a1n   x1   b1 


a a2 n  x  b 
 21 a22 . .
 2  2
A . 
Let   X  .  b . 
 .     
an1 an 2 . . ann  . .
 xn  bn 

Ax=b
Factorization method or Decomposition or
Triangularisation or LU Decomposition method

This method is based on the fact that a square matrix


A can be factorized into the form LU,

A=LU
Where, L=lower triangular matrix and U=upper triangular matrix

 a11 a12 . . a1n 


a a22 . . a2 n 
 21 
A . 
Let  
 . 

 an1 an 2 . . ann 
LU Decomposition method
 a11 a12 . . a1n    11 0 0 0 0  u11 u12 u13 ... u1n 
a a . a2 n   21  22 0 0 0   0 u22 .. .. u2 n 
Let  21 22 .
 .  . . . 0 0   0 0 u33 ... u3n 
    
 .   . . . . 0  0 0 0 .. .. 
an1 an 2 . . ann   n1  n 2  n3 .  nn   0 0 0 .. unn 

  11 0 0  u11 u12 u13 



A  LU    21  22  
0   0 u22 u23 
 31  32  33   0 0 u33 
LU Decomposition method
The basic idea is to multiply the values at R.H.S. and
calculate the value of unknowns.
Note:
A: n2 elements
l: no. of unknowns: 1+2+3+….n=1/2(n(n+1))
U : no. of unknowns: 1+2+3+….n=1/2(n(n+1))

Total no. of unknowns on R.H.S=n2+n


Note: when we multiply the values at R.H.S and compare
with the elements of L.H.S.
The number of equations=n2
→we are getting n arbitrary unknowns
LU Decomposition method

Choose either
1) lii =1, i=1, 2, 3, ……n, called Do-little method.

2) uii =1, i=1, 2, 3, ……n , called Crout’s method.


Do-little’s method
A Square matrix can be factorized as LU
Where, L=unit lower triangular matrix and U=upper triangular matrix
i.e. lii=1

A  LU 
 a11 a12 a13   1 0 0 u11 u12 u13 
a a23    21 1 0  0 u22 u23 
 21 a22
a31 a32 a33   31  32 1  0 0 u33 
Do-little’s method
 a11 a12 a13   1 0 0 u11 u12 u13 
a a23    21 1 0  0 u22 u23 
 21 a22
 a31 a32 a33   31  32 1  0 0 u33 
 a11 a12 a13   u11 u12 u13 
a a23   l21u11 l21u12  u22 l21u13  u23 
 21 a22 
 a31 a32 a33  l31u11 l31u12  l32u22 l31u13  l32u23  u33 
u11  a11, u12  a12,u13  a13
l21u11  a21, l21u12  u22  a22 , l21u13  u23  a23
l31u11  a31, l31u12  l32u22  a32 , l31u13  l32u23  u33  a33
Do-little’s method
On solving, we get
a2 1 a2 1 a3 1 a3 1
l2 1   , l3 1  
u1 1 a1 1 u1 1 a1 1
a2 1
u 2 2  a 2 2  l 2 1u1 2  a 2 2  a1 2
a1 1
a2 1
u 2 3  a 2 3  l 2 1u1 3  a 2 3  a1 3
a1 1
a3 1
l3 2u 2 2  a3 2  l3 1u1 2  a3 2  a1 2
a1 1
1  a3 1 
l3 2   a
 32  a 
12 
u2 2  a1 1 
u3 3  a3 3  l3 1u1 3  l3 2u 2 3
Do-little’s method
Consider the system of linear equations

a11x1+a12x2+a13x3+…….. +a1nxn =b1


a21x1+a22x2+a23x3+…….. +a2nxn =b2
.
.
an1x1+an2x2+an3x3+…….. +annxn =bn

 a11 a12 . . a1n   x1   b1 


a a2 n  x  b 
 21 a22 . .
 2  2
A . 
Let   X  .  b . 
 .     
an1 an 2 . . ann  . .
 xn  bn 

Which can be written Ax=b


Do-little’s method
Which can be written
Ax=b ………….(1)
Let A=LU ………….(2)
LUx=b ………….(3)
Let Ux=Y in eq. (3) ………..(4)
Now eq. (3) becomes
LY=b
Y  b 
As, 1 0 0
 
1
b  b 
1

Y  Y2 
L   21 1 0  2
Y3  b3 
 31  32 1

Y1=b1
l21Y1+Y2=b2
l31Y1+l32Y2+Y3=b3
Do-little’s method
Let Ux=Y ………..(4)
Y1=b1
l21Y1+Y2=b2
l31Y1+l32Y2+Y3=b3
this can be solved using forward substitution, when Y is
known,

Ux=Y becomes
U11x1+U12x2+U13x3=Y1
U22x2+U23x3=Y2
U33x3=Y3
Which can be solved using backward substitution
Crout’s method
A Square matrix can be factorized as LU
Where, L=lower triangular matrix and U=unit upper triangular matrix
i.e, Uii=1

A  LU 
 a11 a12 a13    11 0 0  1 u12 u13 
a a23    21  22 0  0 1 u23 
 21 a22
a31 a32 a33   31  32  33  0 0 1 
Crout’s method (Cont…)

 a11 a12 a13    11 0 0  1 u12 u13 


a a a23    21  22 0  0 1 u23 
 21 22

a31 a32 a33   31  32  33  0 0 1 


 a11 a12 a13    11  11u12  11u13 
a a a23    21  21u12   22  21u13   22u23 
 21 22

a31 a32 a33   31  31u12   32  31u13   32u23   33 


Crout’s method (Cont…)
 a11 a12 a13    11  11u12  11u13 
 a a a     u    u   u 
 21 22 23   21 21 12 22 21 13 22 23 
a31 a32 a33   31  31u12   32  31u13   32u23   33 
 11  a11,  11u12  a12 ,  11u13  a13
  11  a11,
a12 a12
u12  
 11 a11
a13 a13 Similarly the values of other unknowns
u13   can be determined.
 11 a11
Solve the following linear system of equations using LU Decomposition method
2x1+3x2+x3=9
x1+2x2+3x3=6
3x1+x2+2x3=8

We have, 2 3 1 
A  1 2 3
3 1 2
A  LU orLU   A

 1 0 0 u11 u12 u13  2 3 1


 1 0  0 u22 u23   1 2 3
 21
 31  32 1  0 0 u33  3 1 2

17
2 3 1   u11 u12 u13 
1 2 3  l u   
  =  21 11 l u
21 12 u 22 l u
21 13 u 23 
3 1 2 l31u11 l31u12  l32u22 l31u13  l32u23  u33 

u11=2, u12=3 , u13=1


l21u11=1, l21=1/u11 , l21=1/2
l31u11=3, l31=3/u11 , l31=3/2
Now, l21u12+u22=2, u22=2-l21u12 , u22=2-(1/2)(3)=1/2
And l21u13+u23=3, u23=3-l21u13 , u23=3-(1/2)(1)=5/2
l31u12+l32u22=1, l32u22=1-l31u12 , l32 =-7
l31u13+l32u23+u33 =2, u33 =18

18
u11=2, u12=3 , u13=1
l21u11=1, l21=1/u11 , l21=1/2
l31u11=3, l31=3/u11 , l31=3/2
Now, l21u12+u22=2, u22=2-l21u12 , u22=2-(1/2)(3)=1/2
And l21u13+u23=3, u23=3-l21u13 , u23=3-(1/2)(1)=5/2
l31u12+l32u22=1, l32u22=1-l31u12 , l32 =-7
l31u13+l32u23+u33 =2, u33 =18
A  LU
1 0 0 u11 u12 u13 
A   21 1 0  0 u22 u23 
 31  32 1  0 0 u33 

 1 0 0  2 3 1 
A  1 / 2 1 0 0 1 / 2 5 / 2
3 / 2  7 1 0 0 18 

19
Now....... A  LU
and ... Ax  b
 LUx  b
LetUx  y
 Ly  b
 1 0 0   y1  9 
1 / 2 1 0  y   6 
  2   

3 / 2 71 y3 
 
8 

 y1  9, y 2  3 / 2, y3  5
Now....Ux  y
2 3 1   x1   y1 
0 1/ 2 5 / 2 x    y 
  2   2

0 0 18  x3 
 
 y3 

2 3 1   x1   9 
0 1/ 2 5 / 2  x   3 / 2
  2   

0 0 18  x3 
 
 5  

20
2 3 1   x1   9 
0 1/ 2 5 / 2  x2   3 / 2

0 0 18   x3   5 

Using backward substitution


5 29 35
x3  , x2  , x1 
18 18 18

Which is required solution.

21
Practice Problems

1. Solve the following linear system of equations using LU


decomposition method
y+z=2
2x+3z=5
x+y+z=3

2. Solve the following linear system of equations using LU


decomposition method
7x-2y+z=12
14x-7y-3z=17
-7x+11y+18z=5

22
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
Eigen Value Problem
Power method
Cayley Hamilton Theorem
Jacobi’s method for diagonalization of real symmetric
matrix.
The Eigen value Problem
Let A be a square matrix of order n with element aij, we have to
find a column vector X and a constant λ
s.t.
AX= λX …………(1)
| A- λI |X=0 …………(2)

on expansion, it gives a polynomial of nth degree in λ, which is called


Characteristic equation of the matrix A, its roots λi (i=1,2,3…..n)
are called Eigen values or latent roots.
Corresponding to each Eigen values from eq. (2) there exists a non
zero solution
x=[x1,x2……xn]

Which is known as Eigen vector


Since x is required to be nonzero, the eigenvalues must satisfy

det(A - I) = 0

which is called the characteristic equation. Solving it for values


of  gives the eigenvalues of matrix A.

4
1 -2 1 -  -2
A= 3 -4 so A - I = 3 -4 - 

det(A - I) = (1 - )(-4 - ) – (3)(-2)


= 2 + 3  + 2

Set 2 + 3  + 2 to 0

Then =  = (-3 +/- sqrt(9-8))/2

So the two values of  are -1 and -2.


5
Once you have the eigenvalues, you can plug
them into the equation Ax = x to find the
corresponding sets of eigenvectors x.

1 -2 x1 = -1 x1 so
x1 – 2x2 = -x1
3 -4 x2 x2 3x1 – 4x2 = -x2

These equations are not


(1) 2x1 – 2x2 = 0
independent. If you multiply
(2) 3x1 – 3x2 = 0
(2) by 2/3, you get (1).

The simplest form of (1) and (2) is x1 - x2 = 0, or just x1 = x2.

6
Since x1 = x2, we can represent all eigenvectors for eigenvalue -1
as multiples of a simple basis vector:

E=t 1 , where t is a parameter.


1

So [1 1]T, [3 3]T, [100 100]T are all possible eigenvectors


for eigenvalue -1.

For the second eigenvalue (-2) we get

1 -2 x1 = -2 x1 so x1 – 2x2 = -2x1
3 -4 x2 x2 3x1 – 4x2 = -2x2

(1) 3x1 – 2x2 = 0


(2) 3x1 – 2x2 = 0 so eigenvectors are of the form t 2 .
3
7
For 2 x 2 matrix A = a b ,
c d

1 + 2 = a + d, which is called trace(A)


and
12 = ad – bc, which is called det(A).

Finally, zero is an eigenvalue of A if and only if


A is singular and det(A) = 0.

8
Power Method:

The method for finding the largest eigen value in magnitude


and the corresponding eigen vector of the eigen value problem
Ax = λ x, is called the power method.

It is used to calculate largest eigen value in magnitude of a


given matrix and the corresponding eigen vector.

9
Power Method (Cont..)
It is an iterative method implemented using an initial starting vector X. the
starting vector can be arbitrary if no suitable approximation is available.

Let x be a column vector, which is as near the solutions as possible and


evaluate Ax(0), which is written as λ(1)x(1)
so the first eigen value and the corresponding eigen vector
Ax(0)= λ(1)x(1)
Similarly, the second eigen value and the corresponding eigen vector
Ax(1)= λ(2)x(2)
Repeat this process till |xn-xn-1| is negligible.
λn will be the largest Eigen value and xn will be the largest eigen vector.

This iterative procedure for finding the dominated eigen value of a matrix
is known as Rayleigh’s power method.

10
Example: Find the largest eigen value and vector of the
following matrix
1 2 0 
A  2 1 0 
0 0  1

Let the initial eigen vector be x(0) = [0,1,0]’

1 2 0  0 
Ax ( 0 )  2 1 0  1
0 0  1 0
 2 1
Ax ( 0 )  1   2 0.5
0  0 

So first eigen value is 2 and eigen vector=[1,0.5,0]’


11
λ(1) =2 and x(1)= [1,0.5,0]’

Second iteration
1 2 0   1 
Ax (1)  2 1 0  0.5
0 0  1  0 
2 0.8
Ax (1)
 2.5  2.5 1 
λ(2) =2.5 and x(2)= [0.8,1,0]’
 0   0 
1 2 0  0.8
Third iteration Ax ( 2 )  2 1 0   1 
0 0  1  0 
 2.8  1 
Ax ( 2 )  2.6  2.80.93
 0   0 

λ(3) =2.8 and x(3)= [1,0.93,0]’ 12


Fourth iteration

1 2 0   1 
Ax (3)  2 1 0  0.93
0 0  1  0 
2.86 0.98
Ax (3)   2.93  2.93 1 
 0   0 
λ(4) =2.93 and x(4)= [0.98,1,0]’
.
.
.
 3 1 
x (7)  3  31
0 0

λ(7) =3 and x(7)= [1,1,0]’ 13


Diagonalization of real symmetric matrix by Jacobi’s method or
Jacobi’s method-

Let A be a given real symmetric matrix. Its eigen values are real
and there exists a real orthogonal matrix B such that B-1AB is a
diagonal matrix (D).

Jacobi method consists of diagonalizating ‘A’ by applying series


of orthogonal transformations B1, B2,….Bn, such that their
product satisfies B-1AB=D.

16
Diagonalization of real symmetric matrix by Jacobi’s method or
Jacobi’s method (Cont..)

For this purpose, we choose the numerically largest non diagonal


element aij and form a 2 × 2 submatrix

 aii aij 
A1   
a ji a jj 
where, aij  a ji
Which can easily be diagonalized.

17
Consider an orthogonal matrix
Cos  Sin  
B1  
 Sin  Cos 
1  Cos Sin    aii aij  Cos  Sin  
AB1   
Cos  a ji a jj   Sin  Cos 
then , B1
 Sin 
 1 
a
 ii Cos 2
  a jj Sin 2
  a jj Sin 2 aij Cos 2  (a jj  aii ) Sin 2 
1 2
B1 AB1   
1
 aij Cos 2  (a jj  aii ) Sin 2 aii Sin   a jj Cos   aij Sin 2 
2 2

 2 

Now the matrix will be reduce to the diagonal form if


1
aij Cos 2  (a jj  aii ) Sin 2  0
2
2aij
tan 2 
(aii  a jj )
The value of θ can be calculated, which results diagonal matrix.
At next step the largest non diagonal element in the rotated matrix can be choosen and
the above procedure is repeated using orthogonal matrix B2

18
Advantage-

It gives all Eigen value simultaneously.

Disadvantage-

It is applicable on symmetric matrix only.

19
Example: Find all eigen values of the matrix
1 2 2
 
A 2 3 2
 2 2 1 

Using the Jacobi method.


Solution: Here the largest non diagonal element is a13=a31=2
2a13 2 2
tan 2   
a11  a33 11
tan 2  

2 
2

 
4

cos  0  sin   1 / 2 0 1/ 2 


 
thenB1   0 1 0    0 1 0 
 sin  0 cos   1 / 2 0 1 / 2 
20
cos  0  sin   1 / 2 0  1 / 2 
 
thenB1   0 1 
0  0 1 0 
 sin  0 cos   1 / 2 0 1 / 2 
 1/ 2 0 1/ 2  1 2 2  1 / 2 0  1 / 2 
1    
D1  B1 AB1   0 1 0  2 3 2  0 1 0 
 1 / 2 0 1 / 2   2 2 1  1 / 2 0 1 / 2 
 
3 2 0 
D1  B11 AB1  2 3 0 
0 0  1

21
Now the largest non diagonal element is a12=a21=2

2a12 2 2
tan 2   
a11  a22 33
tan 2  

2 
2

 
4
cos   sin  0 1 / 2 1/ 2 0
 
thenB 2   sin  cos  0  1 / 2 1/ 2 0
 0 0 1  0 0 1 

22
cos   sin  0 1 / 2 1/ 2 0
 
B2   sin  cos  0  1 / 2 1/ 2 0
 0 0 1  0 0 1

The second transformation gives

1 / 2 1/ 2 0
 1/ 2 1/ 2 0  3 2 0  
 
0 2 0  
1/ 2 1/ 2 0
D2  B21 AB2   1 / 2 1/ 2 3
 0 0 1
 0 0 1 0 0  1  

 
5 0 0
D2  B AB2  0
1
2 1 0 
0 0  1

Hence the eigen values of the given matrix are 5, 1.-1 and the
corresponding eigen vectors are column of matrix B1B2

23
Hence the eigen values of the given matrix are 5, 1.-1 and the
corresponding eigen vectors are column of matrix B1B2

1 / 2 0 1/ 2  1 / 2 1/ 2 0
  
B1 B2   0 1 0  1 / 2 1/ 2 0
1 / 2 0 1 / 2   0 0 1

1 / 2 1/ 2 1/ 2
 
B1 B2  1 / 2 1/ 2 0 
1 / 2 1/ 2 1 / 2 

24
Practice Problems

1. Find the Eigen values and vectors of the following matrix

5 4
A 
1 2 
2. Find the largest Eigen values and corresponding vector of the
following matrix using power method.
 10  2 1 
A   2 10  2
 1  2 10 
3. Find all the eigen values of the matrix using Jacobi method. Iterate till
off diagonal elements in magnitude are less than 0.0005

3 2 1 
A  2 3 2
1 2 3
25
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
 Numerical Differentiation
◦ Derivative using forward difference formula
◦ Differentiation using difference oprator
 Numerical Integration
◦ Trapezoidal rule
◦ Simpson’s 1/3 rule
◦ Simpson’s 3/8 rule

2
3
It is the process of calculating the values of the derivative
of a function at some assigned value of x from the given
set of values (xi,yi).

To compute this first replace the exact relation y=f(x) by


the best interpolating polynomial, then differentiate it as
many times as required.

4
1. Newton’s Forward Difference Formula: For equal interval, we
consider the more simpler formula. Let for equal spaced (h) data, We have x0,
x0 +h, x0 +2h,……… x0 +nh, Or xn= x0 +nh, n=0,1,2…….

  x  x0  
f ( x)  f  x0   h 
  h  
 x  x0 
Let... : u   
 h 
f ( x)  f ( x0  uh)
f ( x)  E u f ( x0 )
f ( x)  (1  ) u f ( x0 )
f ( x0 ) 2 f ( x0 ) n f ( x0 )
f ( x)  f ( x0 )  u  u (u  1)  ...u (u  1)...(u  (n  1))
1! 2! n!

5
2. Newton’s Backward Difference Formula: For equal interval, we
consider the more simpler formula. Let for equal spaced (h) data, We have x0, x0
+h, x0 +2h,……… x0 +nh, Or xn= x0 +nh, n=0,1,2…….

  x  xn  
f ( x )  f  xn   h 
  h  
 x  xn 
let .....u   
 h 
f ( x)  f ( xn  uh)
f ( x )  E u f ( xn )
f ( x)  (1  ) u f ( xn )
  2 n 
f ( x)  1  u  u (u  1)  ...u (u  1)...(u  n  1)  f ( xn )
 1! 2! n! 

f ( xn )  2 f ( xn )  n f ( xn )
f ( x )  f ( xn )  u  u (u  1)  ...u (u  1)...(u  n  1)
1! 2! n!
6
f ( x0 ) 2 f ( x0 ) 3 f ( x0 )
f ( x)  f ( x0 )  u  u (u  1)  u (u  1)(u  2)  ........
1! 2! 3!
n f ( x0 )
.............u (u  1)...(u  (n  1))
n!
y0 2 y0 3 y0
y  y0  u  u (u  1)  u (u  1)(u  2)  ........
1! 2! 3!
n y0
..........u (u  1)...(u  (n  1)) ............(1)
n!

7
f ( x0 ) 2 f ( x0 ) 3 f ( x0 )
f ( x)  f ( x0 )  u  u (u  1)  u (u  1)(u  2)  ........
1! 2! 3!
n f ( x0 )
.............u (u  1)...(u  (n  1))
n!
y0 2 y0 3 y0
y  y0  u  u (u  1)  u (u  1)(u  2)  ........
1! 2! 3!
n y0
..........u (u  1)...(u  (n  1)) ............(1)
n!
x  x0
x  x0  uh, u  ............(2)
h

8
Differentiate eq (1) w.r.t u

dy y0 2 y0 3 y0
  (2u  1)  (3u  6u  2)
2
 ........
du 1! 2! 3!
x  x0
u
h
du 1

dx h
dy dy du
now,  
dx du dx
dy 1 y0 2 y0 3 y0
 (  (2u  1)  (3u  6u  2)
2
 ........) ………..(3)
dx h 1! 2! 3!

9
At x=x0, u=0
 dy  1  y0 2 y0 3 y0 
    1 2  ........
 dx  x  x0 h  1! 2! 3! 
 dy  1  y0 2 y0 3 y0 
D       ........
 dx  x  x0 h  1 2 3 
Differentiating eq(3) w.r.t x
d 2 y d  dy  du
  
dx 2
du  du  dx
d2y 1  2 y0 3 y0 
2
  (2)  (6u  6)  ........
dx h 2! 3! 
At x=x0, u=0
d 2 y 1  2 y0 3 y0 11 4 
D  2  2 
2
   y0 ........
dx h  1 1 12  10
f ( xn )  2 f ( xn )  n f ( xn )
f ( x )  f ( xn )  u  u (u  1)  ...u (u  1)...(u  n  1)
1! 2! n!
y n  2 yn  n yn
yn ( x)  yn  u  u (u  1)  ...u (u  1)...(u  n  1)
1! 2! n!
x  xn
xn  x  uh, u 
h
 dy  1  y n  2 y n  3 y n 
   
    ........ 
 dx  xn h  1 2 3 
and
 d2y  1  11 
 2   2   2 yn   3 yn   4 yn  ........ 
 dx  xn h  12 

11
As we know E  1 

E  1    and  E 1/ 2  E 1 / 2
1

now
Ef ( x )  f ( x  h)
h 2 ''
Ef ( x )  f ( x )  hf ( x ) 
'
f ( x )  .....
By taylor series, 2!
h2
Ef ( x )  f ( x )  hDf ( x )  D 2 f ( x )  .....
2!
 h2 
Ef ( x )  1  hD  D 2  ..... f ( x )
 2! 
Ef ( x )  e hD f ( x )
E  e hD
take log
log E  hD log e
1
D  log E 12
h
For forward difference operator
1
D log(1  )
h
1   2 3 
D      ........ 

h 1 2 3 
1   2 3 
Df ( x)      ........  f ( x)

h 1 2 3 
2
1   2 3 
D f ( x)  2     ........  f ( x)
2

h 1 2 3 

Similarly, the higher order derivatives can be calculated.

13
As
E  1   
1

As we know Ef ( x )  e h D f ( x )
E  ehD
take log
log E  hD log e
1
D log E
h
log 1   
1 1
D
For backward h
Difference operator D   log 1   
1
h
1 2 3 
D      ......
h 2 3 
1  2 3 
Df ( x )      ...... f ( x)
h  2 3 
14
x f(x) ∆1 ∆2 ∆3

x0 y0 ∆y0=y1-y0 ∆2y0=∆y1-∆y0 ∆3y0=∆2y1-∆2y0

x1 y1 ∆y1=y2-y1 ∆2y1=∆y2-∆y1

x2 y2 ∆y2=y3-y2

x3 y3

15
x f(x) ∇1 ∇2 ∇3

x0 y0 ∇y1=y1-y0 ∇2y2=∇y2-∇y1 ∇3y3=∇2y3-∇2y2

x1 y1 ∇y2=y2-y1 ∇2y3=∇y3-∇y2

x2 y2 ∇y3=y3-y2

x3 y3

Note: ∆y0=∇y1 and ∆2y0 = ∇2y2

16
Given the values

x 1 1.1 1.2 1.3 1.4

f(x) 7.989 8.403 8.781 9.129 9.451

Calculate dy/dx at x=1

17
We have
x f(x) ∆ ∆2 ∆3 ∆4 ∆5 ∆6

1 7.989 0.414 -0.036 -0.006 -0.002 -0.002 -0.003

1.1 8.403 0.378 -0.030 0.004 0.000 -0.001

1.2 8.781 0.348 -0.026 0.004 -0.001

1.3 9.129 0.322 -0.023 0.005

1.4 9.451 0.299 -0.018

1.5 9.750 0.281

1,6 10.031

18
x f(x) ∆ ∆2 ∆3 ∆4 ∆5 ∆6

1 7.989 0.414 -0.036 -0.006 -0.002 -0.002 -0.003

1.1 8.403 0.378 -0.030 0.004 0.000 -0.001

1.2 8.781 0.348 -0.026 0.004 -0.001

1.3 9.129 0.322 -0.023 0.005

1.4 9.451 0.299 -0.018

1.5 9.750 0.281

1,6 10.031

1   2 3 
Df ( x)      ........  f ( x)
h 1 2 3 
dy 1  0.0036 0.006 0.002 0.002 0.003 
  0.414     
dx 0.1  2 3 4 5 6 

Compute it by yourself 19
Let f(x) be given for certain data points (x0,y0), (x1,y1)……(xn,yn),
where f(x) is not known explicitly.
It is required to compute the value of integral
b
I   ydx
a

Let the interval [a,b] be divided into n equal subintervals


a=x0<x1<…………xn=b,
Clearly, xn=x0+nh
Hence the integral becomes,
xn
I   ydx
x0

20
Approximating
x
y by Newton’s forward difference formula
I  
n
ydx
x0

 xn y0 2 y0 3 y0 
I    y0  u  u (u  1)  u (u  1)(u  2)  ......du
x0
 1! 2 ! 3 ! 
x  x0  uh, dx  hdu
atx  x0 , u  0
xn  x0
atx  xn , u 
h
x  x0
Letsayu  n  n( no.ofsub int ervals)
h
Hence,
n
 u 2 y0  u 3 u 2  2 y0 
I  h  y0 u       ........
 2 1!  3 2  2! 0
x0  nh  n y0  n( 2n  3)  2 y0 
x0
ydx nh  y0 
 2

 12


 ........

……..(1)
21
Put n=1 in eq (1) and neglect second and higher differences

22
Put n=1 in eq (1) and neglect second and higher differences
x0  h  1 y0   y0  y1 
x0 ydx h  y0  2   h
  2 

similarly
x0  2 h  y  y2 
 x0  h
ydx h  1
 2 

.
.
x0  n h  y n 1  y n 
x0  ( n 1) h ydx h 
 2 

on, combining
h
 y0  2( y1  y2  ... yn 1 )  yn 
xn
 x0
ydx 
2

23
Put n=2 in eq (1) and neglect second and higher differences
In Simpson’s 1/3 rule approximate the given curve by a polynomial of degree 2.
Due to which it gives better result.
x0  2 h  1 2 y0   ( y 2  y1  y0 ) 
x0 ydx  2 h 

y 0   y 0 
6


 2 h 

y 0  ( y1  y 0 ) 
6 


2h
6 y1  y2  2 y1  y0   h  y0  4 y1  y2 
6 3
similarly

 y 2  4 y3  y 4 
x0  4 h h
 x0  2 h
ydx 
3
.
.

 yn  2  4 yn 1  y2 
x0  n h h
 x0  ( n  2 ) h
ydx 
3
on, combining
h
 y0  4( y1  y3  ... yn 1 )  2( y2  y4  ...... yn  2 )  yn 
xn
 x0
ydx 
3

24
Put n=3 in eq (1) and neglect second and higher differences

x0 ydx  8 ( y0  yn )  3( y1  y2  y2  ... yn1 )  2( y3  y6  ...... yn3 )


xn 3h

*Do it by yourself
25
6 dx using trapezoidal and simpson’s 1/3 rule
Evaluate 0 1  x 2
x 0 1 2 3 4 5 6

f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.622

Divide the interval into 6 parts each of width 1.

26
x 0 1 2 3 4 5 6

f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.622

By trapezoidal rule

0 1  x 2  2 y0  y6  2( y1  y2  y3  y4  y5 )
6 dx h

0 1  x 2  2 1  0.622  2(0.5  0.2  0.1  0.0588  0.0385)


6 dx 1

6 dx
0 1  x 2  1.4108

27
x 0 1 2 3 4 5 6

f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.622

By Simpson’s 1/3 rule

x0 1  x 2  3 y0  y6  4( y1  y3  y5 )  2( y2  y4 )
6 dx h

0 1  x 2  2 1  0.622  4(0.5  0.1  0.0385)  2(0.2  0.0588)


6 dx 1

6 dx
0 1  x 2  1.3662

28
1. Find the first and second derivative of the function f(x) at
x=1.5
x 1.5 2.0 2.5 3.0 3.5 4.0

f(x) 3.3 7.00 13.625 24.0 38.875 59.00

4
2. Evaluate 0 dx using trapezoidal and simpson’s 1/3 rule and
x
e
compare with the actual value.

29
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
829
830 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 831
832 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 833
834 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 835
836 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 837
838 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 839
840 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 841
842 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 843
844 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 845
846 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 847
848 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 849
850 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 851
852 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 853
854 Engineering Mathematics through Applications
Finite Differences, Numerical Differentiations and Integrations 855

Example 23: Given: log 100 = 2, log 101 = 2.0043, log 103 = 2.0128, log 104 = 2.0170,
find log 102.
Solution: Take the missing entry (or the entry under question) as f(102) = A and write the
data as under
xi: 100 101 102 103 104
f(xi) : 2.000 2.0043 A = f(102) 2.0128 2.0170
Since the four values of the variate are given and hence the function is a polynomial of
degree 3. Therefore, the third differnces are constant and consequently fourth differences
are zero.
i.e. ∆4f(x) = 0 for all x.
⇒ ∆4f(100) = 0
⇒ (E – 1)4f(100) = 0
⇒ (E4 – 4E3 + 6E2 – 4E + 1)f(100) = 0
⇒ f(104) – 4f(103) + 6f(102) – 4f(101) + f(100) = 0
⇒ 2.0170 – 4 × 2.0128 + 6f(102) – 4 × 2.0043 + 2.0000 = 0
12.0514
⇒ f (102) = = 2.0086 or f(log 102) = 2.0086.
6
Alternately: Let the missing entry be y2, then the difference table is
TABLE 13.13

xi yi = log xi ∆y ∆2 y ∆3 y ∆4 y

100 2.0000

→ 0.0043
101 2.0043 
→ y2 – 2.0086

→ y2 – 2.0043 
→ 6.0257 – 3y2
102 y2 
→ 4.0171 – 2y2 6y2 – 12.0514


→ 2.0128 – y2 
→ 3y2 – 6.0257
103 2.0128 
→ y2 – 2.0086

→ 0.0042
104 2.0170

As the fourth differences are zero by above stated assumptions, we have


12.0514
6y2 – 12.0514 = 0 ⇒ log 102 = y2 = = 2.0086 approx.
6
Example 24: Without forming the difference table find the missing entry in the following
table
x:0 1 2 3 4
y:1 3 9 – 81
Explain why the resulting value differs from 33.
856 Engineering Mathematics through Applications

Solution: Since the four values of the variate are given and hence the function is a polynomial
of degree 3, and consequently fourth differences are zero.
∴ ∆4y0 = 0 ⇒ (E – 1)4y0 = 0
i.e. (E4 – 4E3 + 6E2 – 4E + 1)y0 = 0
⇒ y4 – 4y3 + 6y2 – 4y1 + y0 = 0
⇒ 81 – 4y3 + 6 × 9 – 4 × 3 – 1 = 0
⇒ y3 = 31
Since f(x) = 3x is not a polynomial and hence y3≠33.

Example 25: Given y0, y1, y2,…, y5 (fifth differences constant), prove that
1 25 ( c – b ) + 3 ( a – c )
y = c+ , where a = (y0 + y5), b = (y1 + y4), c = (y2 + y3).
21 2 256
2

1
Solution: y2 1 = E 2 y0 = (1 + ∆ )
2 5/2
y0
2

 5 (5/2)(3/2) 2 (5/2)(3/2)(1/2) 3 (5/2)(3/2)(1/2) ( −1/2 ) 4


= 1 + ∆ + ∆ + ∆ + ∆
 2 1.2 1.2.3 1.2.3.4

(5/2)(3/2)(1/2) ( − 1/2)( − 3/1) 5 


+ ∆  y0
1.2.3.4.5 

5 15 2 5 3 5 4 3 5
= y0 + ∆y0 + ∆ y0 + ∆ y0 − ∆ y0 + ∆ y0
2 8 16 128 256

5
= y0 + (E − 1) y0 + 15 (E − 1)2 y0 + 5 ( E − 1)3 y0 − 5 (E − 1)4 y0 + 3 (E − 1)5 y0
2 8 16 128 256

= y0 +
5
(y1 − y0 ) + 15 (y2 − 2y1 + y0 ) + 5 (y3 − 3y2 + 3y1 − y0 )
2 8 16


5
( y4 − 4y3 + 6y2 − 4y1 + y0 ) + 3 ( y5 − 5y4 + 10y3 − 10y2 + 5y1 − y0 )
128 256

=  1 − +
5 15 5 5 3   5 15 + 15 + 5 + 15  y
− − −  y0 +  −  1
 2 8 16 128 256   2 4 16 32 256 

+ 
15 15 15 15   5 + 5 + 15  y
− − −  y2 +   3
 8 16 64 128   16 32 128 

+  −
5 15   3 y
−  y4 +   5
 128 256   256 
Finite Differences, Numerical Differentiations and Integrations 857

3 25 75 75 25 3
= y0 − y1 + y2 + y3 − y4 + y5
256 256 128 128 256 256

=
3
( y0 + y5 ) − 25 ( y1 + y4 ) + 75 ( y2 + y3 )
256 256 128

3 25 75
y 1 = a− b+ c
2
2
256 256 128

1 3 ( a − c ) + 25 ( c − b ) 1 3a 3c 25 25
Also, R.H.S. = c+ = c+ − + c− b
2 256 2 256 256 256 256

=
3 25 1 3 25 
a− b+ − + c
256 256  2 256 256 
3 25 75
a− = b+ c
256 256 128
Hence the result.

1
Alternately: Taking n = in the Bessel’s Formula for Interpolation, where
2

n ( n − 1)  n − 
1
n ( n − 1) 2  2  δ3 y
yn = y0 + nδ y1/2 + µδ y1/2 + 1/2
2! 3!

n ( n212 ) (n − 2 )  n − 
1
n ( n2 − 12 ) ( n − 2)  2  5
+ µδ4 y1/2 + δ y1/2 + …
4! 5!
1
From above, Ist two terms with n = become,
2

y0 + n δ y1/2 =  y0 + δ y1/2  = y0 + ( y1 − y0 ) = ( y0 + y1 )
1 1 1
 2  2 2

n (n − 1)  n − 
1
n (n − 1) 2 1  ∆2 y−1 + ∆2 y0  
Similarly, µ δ y1/2 = −   and 2  δ3 y = 0 and so on,
2! 8 2 3!
0

we have

1  ∆2 y−1 + ∆2 y0  3  ∆4 y−2 + ∆4 y−1 


y1/2 =
1
( y0 + y1 ) −  + 128 
2 8  2   2 

858 Engineering Mathematics through Applications

( y0 + y1 ) − ( ∆2 y−1 + ∆2 y0 ) + ( ∆4y−2 + ∆4y−1 )


1 1 3
y1/2 =
2 16 256
Shifting origin by 2,

y 1 =
1
(y2 + y3 ) − 1 (∆2 y1 + ∆2 y2 ) + 3 (∆4 y0 + ∆4 y1 ).
2
2 2 16 256

12
Example 26: Given u1 = 1, u2 + u3 = 5.41, u4 + u5 + u6 = 18.47, ∑ ux = 90.36
x =7

Find the value of ux for all integral values of x from 1 to 12.

12
Solution: Let ∑ ux = F(1) = u1 + (u2 + u3) + (u4 + u5 + u6) + (u7 + u8 + … + u12)
1
∴ F(1) = 1.00 + 5.41 + 18.47 + 90.36 = 115.24 …(1)
12
Similary: ∑ ux = F(4) = (u4 + u5 + u6) + (u7 + u8 + … + u12)
1

= 18.47 + 90.36 = 108.83 …(2)


12
and ∑ ux = F(7) = u7 + u8 + … + u12 = 90.36 …(3)
7

The difference table with h = 3 is given below


TABLE 13.15

x F(x) ∆F(x) ∆2F(x)

1 115.24
– 6.41
4 108.83 – 12.06
– 18.47
7 90.36

Now 1 + δ ≡ (1 + ∆)1/3
1  1 1
 − 
δ≡ ∆+ 3  ∆2 ≡ 1 ∆ − 1 ∆2
∴ 1 3 …(4)
3 1.2 3 9
1 1
δF (1) = ∆F (1) − ∆2 F (1)
3 9
1 1
= × ( −6.41) − × ( −12.06 ) ; − 2.14 + 1.34 ; − 0.80, …(5)
3 9
1 1
δF ( 4 ) = ∆ F ( 4 ) − ∆2 F ( 4 )
3 9
Finite Differences, Numerical Differentiations and Integrations 859

1 1
= × ( − 18.47 ) − × ( − 12.06 ) ; − 6.16 + 1.34 ; − 4.82 …(6)
3 9
1 2
Further, δ2 ≡ ∆
9

1 2 1
∴ δ2 F (1) = ∆ F (1) = × ( − 12.06) = −1.34
9 9
Second differences being constant i.e.,
δ2F(1) = δ2F(2) = … = – 1.3 4
The differences table for unit interval is as below:
TABLE 13.16

x F(x) δF(x) δ2F(x) ux = F(x) – F(x + 1)

1 115.24 u1 = F(1) – F(2) = 1



→ – 0.80
2 114.24 
→ – 1.34 u2 = F(2) – F(3) = 2.14

→ – 2.14
3 112.10 
→ – 1.34 u3 = F(3) – F(4) = 3.27

→ – 3.48
4 108.83 
→ – 1.34 u4 = 4.82

→ – 4.82
5 104.01 
→ – 1.34 u5 = 6.16

→ – 6.16
6 97.85 
→ – 1.34 u6 = 7.50

→ – 7.50
7 90.36 
→ – 1.34 u7 = 8.34

→ – 8.84
8 81.52 
→ – 1.34 u8 = 10.18

→ – 10.18
9 71.34 
→ – 1.34 u9 = 11.52

→ – 11.52
10 59.82 
→ – 1.34 u10 = 12.86

→ – 12.86
11 46.96 
→ – 1.34 u11 = 14.20

→ – 14.20
12 32.76 u12 = 32.76

It is being given that u1 = F(1) – F(2) = 1


∴ F(2) = F(1) – 1 = 115.24 – 1.00 = 114.24.
Values within boxes are known. With the help of these values, the table has been completed.
e.g. δ2F(1) = – 1.34
∴ δF(2) = δF(1) + δ2F(1) = – 0.80 – 1.34 = – 2.14
Similarly: δF(3) = δF(2) + δ2F(2) = – 2.14 – 1.34 = – 3.48 and so on.
F(3) = F(2) + δF(2) = 114.24 – 2.14 = 112.10 and so on.
860 Engineering Mathematics through Applications

In the last column values u1, u2,…, u12 have been obtained.
12 12
ux = F(x) − F(x + 1) = ∑ ux − ∑ ux
x x+1

12 12
e.g. u2 = F(2) − F(3) = ∑ ux − ∑ ux etc.
x=2 x=3
Thus, the values required are 1, 2.14, 3.27, …, 32.76.

ASSIGNMENT 2
1. Prove, y4 = y3 + ∆y1 + 2∆2y1 + ∆3y1. [Hint. y4 – y3 = ∆y3]
2. y4 = y0 + 4∆y0 + 6∆2y–1 + 10∆3y–1. [Hint. y4 = E5y–1]
3. u0 + nC u x + nC u x2 + … = (1 +
1 1 2 2 x)nu0 + nC1(1 + x)n – 1x∆u0 + nC2(1 + x)n – 2 x2∆2u0.
[Hint. R.H.S. = (1 + x + x∆)n u0]
1 1 1 1 3
4. u0 − u1 + u2 − …… = u0 − ∆u0 + ∆2u0 − ∆ u0 + ……
2 4 8 16

1 2 1.3 4 1.3.5 6 1 1 2
5. ux − 8 ∆ ux −1 + 8.16 ∆ ux − 2 − 8.16.24 ∆ ux − 3 + …. = ux + 1 − 2 ∆ux + 1 + 4 ∆ ux + 1 − ……
2 2 2

−1/2
  1 + 1 ∆2 E−1  
ux = 2E1/2 ( 2 + ∆ ) ux. = L.H.S.
−1
 Hint. R.H.S.
 
 4 
m m
∆ x + … =  x + 1  −  x − 1  .
1 2 m 1.3 3 m 1.3.5 4 m
6. ∆x − ∆x + ∆x −
m
2 2.4 2.4.6  2  2

u1x u2 x2  x2 2 
7. u0 + + + …… = ex u0 + x ∆u0 + ∆ u0 + ….. . [Hint. exE = ex(1 + ∆) = exex∆]
1! 2!  2! 
8. Evaluate
(i) (2∆ + 3)(E + 2)(3x2 + 2)
(ii) (∇ + ∆)2(x2 + x + 1)
(iii) (∆ – 1)(2∆ + 1)(x2 + x + 2).

13.9. INTERPOLATION WITH EQUAL INTERVAL OF ARGUMENT


Here we find suitable polynomials for replacing any given function over a given interval by
two ways, using forward and backward differences.

1. Newton-Gregory Forward Interpolation Formula


Let y = f(x) denote a function which takes values y0, y1, y2,…, yn for equidistant values x0, x1,
x2,…, xn of the independent variable x, and let fn(x) denote a polynomial of nth degree. Thus,
this polynomial may be written as:
Finite Differences, Numerical Differentiations and Integrations 861

fn(x) = a0 + a1(x – x0) + a2(x – x0)(x – x1)


+ a3(x – x0)(x – x1)(x – x2) + a4(x – x0)(x – x1)(x – x2)(x – x3)
+ … + an(x – x0)(x – x1)(x – x2)… (x – xn – 1) …(1)
Now, our object is to determine the unknown coefficients a0, a1, a2, …, an
Substituting in (1), f(x0) = y0, f(x1) = y1, f(x2) = y2, …, f(xn) = yn
to successive values x0, x1, x2, …, xn with x1 – x0 = h, x2 – x0 = 2h, … etc., we get
y0 = a0 or a0 = y0 …(2)
y1 = a0 + a1(x1 – x0) = y0 + a1h

y1 − y0 ∆ y0
or a1 = = ; …(3)
h h
Likewise, y2 = a0 + a1(x2 – x0) + a2(x2 – x0)(x2 – x1)

 y − y0 
= y0 +  1
 h 
(2h) + a2 (2h)( h )

y2 − 2y1 + y0 ∆2 y0
or a2 = = …(4)
2h2 2h2
Again, y3 = a0 + a1(x3 – x0) + a2(x3 – x0)(x3 – x1) + a3(x3 – x0)(x3 – x1)(x3 – x2)
y1 − y0 y − 2y1 + y0
= y0 + 3h + 2 ( 3h )( 2h ) + a3 ( 3h )( 2h )( h )
h 2h2
y3 − 3y2 + 3y1 − y0 ∆3 y0
or a3 = =
6h3 3 h3 ; …(5)

By continuing this process for calculating the coefficients, we see that


∆4 y0 ∆5 y0 ∆n y0
a4 = , a5 = ,… , an = ; …(6)
4 h4 5 h5 n hn

∆y0 ∆2 y0 ∆3 y0
∴ fn(x) = y0 + (x − x0 ) + ( x − x0 )(x − x1 ) + (x − x0 )(x − x1)(x − x2 ) + …
h 2h2 3 h3

∆n
+ (x − x0 )(x − x1)(x − x2 )…..(x − xn ) …(7)
n hn

x − x0
Now, if we take = p , this formula takes the simple form as:
h
p(p − 1) 2 p(p − 1)(p − 2) 3
fn(x) = y0 + p∆y0 + ∆ y0 + ∆ y0 + … +
2 3

p(p − 1)(p − 2)…(p − n − 1)∆n yn


+ …(8)
n
862 Engineering Mathematics through Applications

This is known as Newtons-Gregory formula for forward interpolation.


Working Rule: For any real number p,
yp = f(x0 + ph) = Epf(x0) = (1 + ∆)py0
 p(p − 1) 2 p(p − 1)(p − 2) 3 
= 1 + p∆ + ∆ + ∆ + …… y0
 2! 3! 
(Binomial Expansion)
p(p − 1) 2 p(p − 1)(p − 2) 3
= y0 + p∆y0 + ∆ y0 + ∆ y0 + …… …(9)
2! 3!
Note: This formula is particularly useful for interpolating the values of f(x) near the beginning of the set of given values.

2. Newton-Gregory Backward Interpolation Formula.


For deriving the formula in this case, we take the polynomial
fn(x) = a0 + a1(x – xn) + a2(x – xn)(x – xn – 1) + a3(x – xn)(x – xn – 1)(x – xn – 2)
+ … + an(x – xn)(x – xn – 1)(x – xn – 2) … (x – x1) …(1)
On substituting values f(xn) = yn, f(xn – 1) = yn - 1, f(xn – 2) = yn – 2
corresponding to the successive values of x = xn, x = xn – 1, x = xn – 2, respectively, we get
yn = a0 or a0 = yn …(2)
Similarly, yn – 1 = a0 + a1(xn – 1 – xn) = yn + a1(–h)
yn − yn −1 ∇ yn
or a1 = = ; …(3)
h h
Again, yn – 2 = a0 + a1(xn – 2 – xn) + a2(xn – 2 – xn)(xn – 2 – xn – 1)
y − yn−1
= yn + n (−2h) + a2(−2h)(−h)
h
yn − 2yn −1 + yn − 2 ∇2 yn
or a2 = = ; …(4)
2h2 2h2
By continuing this process for calculating the coefficient, we see that
∇3 yn ∇4 yn ∇n yn
a3 = 3 , a4 = 4 , … , an = ; …(5)
3! h 4! h n ! hn
Substituting these values of a0, a1, a2,etc. in (1), we have
∇ yn ∇2 yn ∇3 yn
f (x) = yn + (x − xn ) + ( x − x )( x − x − ) + (x − xn )(x − xn −1 )(x − xn − 2 )
h 2! h2
n n 1 3! h3
∇n yn
+… + (x − xn )(x − xn−1)(x − xn− 2 )…(x − x1) …(6)
n ! hn

f (x) = yn + ∇ yn
( x − xn ) + ∇2 yn  x − xn   x − xn−1  + ∇3 yn  x − xn   x − xn −1   x − xn − 2 
or         
h 2  h  h  3!  h h h

∇n yn  x − xn   x − xn −1   x − xn −2   x − xn 
+…… +       ……  …(7)
n! h h h h 
Finite Differences, Numerical Differentiations and Integrations 863

x − xn
Now if we take, = p, then the formula takes the simple form
h
p ( p + 1)
f (x) = f ( xn + ph ) = yn + p∇ yn + ∇2 yn + ………
2!
x − xn
Since if we put, = p or x = xn + ph,
h
then xn – 1 = xn – h, xn – 2 = xn – 2h, … etc.
x − xn−1 x − ( xn − h ) x − xn + h x − xn
and = = = +1= p+1
h h h h
Similarly
x − xn − 2 x − ( xn − 2h ) x − xn + 2h x − xn
= = = +2=p+2
h h h h

x − x1 x −  xn − ( n − 1) h  x − xn + (n − 1) h
= = = ( p + n − 1) …(8)
h h h
Using (8),
p(p + 1) 2 p(p + 1)(p + 2) 3
f (x) = f (xn + ph) = yn + p∇ yn + ∇ yn + ∇ yn + …
2! 3!
p(p + 1)(p + 2)…(p + n − 1) n
+ ∆ yn …(9)
n!
This is called Newton-Gregory backward interpolation formula because it contains values
of the tabulated function from yn backward to the left and none to the right.

Note: This formula is useful for interpolating values near the end of a set of tabular values.
Alternately: yp = f(xn + ph) = Epyn = (1 – ∇ )–pyn

p(p + 1) 2 p(p + 1)(p + 2) 3


= yn + p∇ yn + ∇ yn + ∇ yn + ….
2! 3!

Example 27: Given sin45° = 0.7071, sin50° = 0.7660, sin55° = 0.8192, sin60° = .8660, find
sin52°, using Newton’s Forward formula.

Solution:
Write 52° = x0 + nh, where x0 = 45° be the base values

7
so that 52 = 45 + n.5 or n= = 1.4
5
864 Engineering Mathematics through Applications

The required difference table on taking 10–4 common to all y is as follows:


TABLE 13.17

xi 104yi ∆yi ∆2 y i ∆3 y i

x0 = 45 y0 = 7071

→ ∆y0 = 589
x1 = 50 y1 = 7660 
→ ∆2y0 = – 57

→ ∆y1 = 532 
→ ∆3y0 = –7
x2 = 55 y2 = 8192 
→ ∆ y1 = – 64
2


→ ∆y2 = 468
x3 = 60 y3 = 8660

The value 45° is chosen as the base value, since it will have inclusion of forward differences
of highest order, leading to the maximum accuracy in results.
Now 104y52 = y45 + nC1∆y45 + nC2 ∆2y45 + nC3 ∆3y45 + nC4 ∆4y45 + …
(1.4) (1.4)(.4) (1.4)(.4)(− .6)
= 7071 + 589 + (−57) + (−7)
1! 2! 3!

31.92 2.352
= 7071 + 824.6 − +
2 6
= 7071 + 824.6 – 16 + 0.4
104y52 = 7880 ⇒ y52 = .7880.

Example 28: Find the number of men getting wages between Rs. 10.00 and Rs. 15.00 from
the follwing data.
Wages in Rs.: 0–10 10–20 20–30 30–40
Frequency : 9 30 35 42

Solution:

xi (no. of persons getting Rs. less yi (cumulative frequency )


than the mention amount)
Less than (upto) 10 9
,, 20 39
,, 30 74
,, 40 116

We have to find first, the persons getting wages less then Rs. 15 i.e., form the difference
table as follows:
Finite Differences, Numerical Differentiations and Integrations 865

TABLE 13.18

xi yi ∆yi ∆2 y i ∆3 y i

x0 = 10 9

→ ∆y0 = 30
x1 = 20 39 
→ ∆2y0 = 5

→ ∆y1 = 35 
→ ∆3y0 = 2
x2 = 30 74 
→ ∆2y1 = 7

→ ∆y2 = 42
x3 = 40 116

For xn = x0 + nh,
5 1
15 = 10 + n × 10 or n==
10 2
n n(n − 1) 2 n(n − 1)(n − 2) 3
∴ y15 = y(x0 + nh) = y0 + ∆y0 + ∆ y0 + ∆ y0 + ……
1! 2! 3!

11
− 1
11
− 1  − 2
1
1      
= 9 + × 30 + 2 2 ×5+ 2 2 2 ×2
2 2! 3!

1  1 1  1  3
− ×5 − −
2  2    2
= 9 + 15 + + 2 2 ×2
2 6
5 1
= 9 + 15 − + = 9 + 15 − 0.62 + 0.12
8 8
= 23.50 = 24 approximately.
Thus, the persons getting wages less than or upto Rs. 15 are 24 and, the persons getting
wages in between Rs. 10 to 15 are (24 – 9) = 15.

Example 29: Given u1 = 40, u3 = 45, u5 = 54, find u2 and u4.

Solution: Take
TABLE 13.19

xi yi ∆yi ∆2 y i ∆3 y i ∆4 y i

xi y1 = 40

→ A – 40
x2 y2 = ? = A 
→ 85 – 2A

→ 45 – A 
→ (3A + B – 175)
x3 y3 = 45 
→ B + A – 90 
→ 0

→ B – 45 
→ (189 – 3B – A)
x4 y4 = ? = B 
→ 99 – 2B

→ 54 – B
x5 y5 = 54
866 Engineering Mathematics through Applications

With three known values, polynomial will be of degree 2 and the differences of 3rd and
higher order will be zero.
i.e. 3A + B – 175 = 0  3A + B = 175 


⇒ 

– 3B – A + 189 = 0  A + 3B = 189 
On solving the above equations, we find, A = 42 and B = 49.

Example 30: Given y0 = 3, y1 = 12, y2 = 81, y3 = 200, y4 = 100, y5 = 8, without forming the
difference table, find ∆5y0.

Solution: We know that ∆5 = (E – 1)5


∴ ∆5y0 = (E – 1)5y0
= (5C0 E5 – 5C1 E4 + 5C2 E3 – 5C3 E2 + 5C4 E – 5C5 E0)y0
= 5C0 E5y0 – 5C1 E4y0 + 5C2 E3y0 – 5C3 E2y0 + 5C4 Ey0 – 5C5 y0
= y5 – 5y4 + 10y3 – 10y2 + 5y1 – y0
= 8 – 5 × 100 + 10 × 200 – 10 × 81 + 5 × 12 – 3
= 8 – 500 + 2000 – 810 + 60 – 3
= 755.

10 10 10
Example 31: Given ∑ f (x) = 500426, ∑ f (x) = 329240, ∑ f (x) = 175212 and f(10) = 40365.
1 4 7
Find f(1).

10
Solution: Taken F1 = ∑ f ( x ) = 500426
1
10
F4 = ∑ f (x) = 329240
4
10
F7 = ∑ f (x) = 175212
7

F10 = f(10) = 40365


Form the difference table:
TABLE 13.20

xi yi ∆yi ∆2 y i ∆3 y i

1 F1 = 500426

→ ∆F1 = – 171186
4 F4 = 329240 
→ ∆2F1 = 17158

→ ∆F4 = – 154028 
→ ∆3F1 = 2023
7 F7 = 175212 
→ ∆ F4 = 19181
2


→ ∆F7 = – 134847
10 F10 = 40365
Finite Differences, Numerical Differentiations and Integrations 867

10 10
Now, we are to find f (1) = ∑ f (x) − ∑ f (x) = F1 − F2
1 2
Write F(2) = F(a + nh),
1
where a + nh = 2 ⇒ 1 + n × 3 = 2 ⇒ n =
3
n(n − 1) 2 n(n − 1)(n − 2) 3
F(2) = F(a + nh) = F(a) + n∆F(a) + ∆ F(a) + ∆ F(a)
2! 3!

1  2 1  2  5
− − −
1  − 171186  3  3  3  3  3
= 500426 + + 17158 + 2023
3 1!  2! 3!
= 441582.43
Hence f(1) = F(1) – F(2) = 500426 – 441582.43 = 58843.568.
Alternately:
TABLE 13.21

xi yi ∆Fi ∆ 2F i ∆ 3F i

10
x 10 F10 = ∑ = 40365
r = 10


→ 134847
10
x7 F7 = ∑ = 175212 
→ 19181
r =7


→ 154028 
→ – 2023
10
x4 F4 = ∑ = 329240 
→ 17158
4

→ 171186
10
x1 F1 = ∑ = 500426
1

Now, we are to find f(1) = F1 – F2 with h = – 3


8
Here, xn = x0 + nh ⇒ 2 = 10 + n × (–3) ⇒ n=
3

n(n − 1) 2 n(n − 1)(n − 2) 3


So that F(2) = F(a) + n∆F(a) + ∆ F(a) + ∆ F(a)
2! 3!

8 5 8 5 2
× × × × ( −2023 )
8 134847 3 3
= 40365 + × + × 19181 + 3 3 3
3 1! 2! 3!
868 Engineering Mathematics through Applications

= 40365 + 35992.00 + 42622.22 – 999.01 = 441580.21


∴ f(1) = F(1) – F(2) = 500426 – 441580.21 = 58843.79.

ASSIGNMENT 3
1. If u–1 = 10, u1 = 8, u2 = 10, u4 = 50 find u0 and u3.
2. Estimate the values of f(22) and f(42) from the following data:

x: 20 25 30 35 40 45
y: 354 332 291 260 231 204

3. Apply Newton’s backward difference formula to the data below, to obtain a polynomial
of degree 4 in x:
x: 1 2 3 4 5
y: 1 –1 1 –1 1

4. In the following table, the values of y are consecutive terms of a series of which 12.5 is
the 5th term. Find the first and tenth term of the series ;
x: 3 4 5 6 7 8 9
y: 2.7 6.4 12.5 21.6 34.3 51.2 72.9

5. From the following data, estimate the number of persons having income between 2000
and 2500:
Income : Below 500 500–1000 1000–2000 2000–3000 3000–4000
No. of
Persons : 6000 4250 3600 1500 650

13.10. INTERPOLATION WITH UNEQUAL INTERVALS


In the proceeding articles, we have discussed formula for interpolation when functions are
given at equally spaced independent variable or arguments. Very oftenly it is inconvenient
and some time even impossible to interpolate functions at unequal values of arguments. For
such cases, two interpolation formula viz. Lagrange’s and Newton’s formula for unequal
intervals have been developed, the difference used in Newton’s formula are called divided
differences which are obtained in the usual manner and then divided by certain differences of
the agruments.

13.11. DIVIDED DIFFERENCES


Let y0, y1, …, yn denote the functional values corresponding to the arguments x0, x1, …, xn
where the intervals x1 – x0, x2 – x1,… xn – xn – 1 are not necessarily equally spaced. Then the
divided differences of y in the ascending order are defined as follows:
First order divided differences:
Finite Differences, Numerical Differentiations and Integrations 869

[ x0 , x1 ] = x1 −− x0 ,
y − y1 y − y2
, [ x2 , x3 ] = 3
y y
 x1, x2  = 2 , etc.
1 0 x2 − x1 x3 − x2
Second order divided differences:

 x1 , x2  −  x0 , x1  ,  x , x , x  =  x2 , x3  −  x1 , x2  , etc.
 x0 , x1 , x2  = x2 − x0  1 2 3 x3 − x1
Third order divided differences:

 x1 , x2 , x3  −  x0 , x1 , x2  , etc.
 x0 , x1 , x2 , x3  = x3 − x0
nth order divided differences:

 x1 , x2 , …, xn  −  x0 , x1 , …, xn −1  , etc.
 x0 , x1 , x2 …, xn  = xn − x0

Note: Order of any divided difference is less by unity than the number of values of the arguments in it. Thus, if (x0,y0),
(x1,y1) etc. are points on a curve, the divided difference is the slope of the secant line through any of these two points.

Table of Divided Differences:


TABLE 13.22

Argument Entry First Second Third Fourth Div. diff.


Div. diff Div. diff. Div. diff. Div. diff.

x0 y0

→ [x0,x1]
x1 y1 
→ [x0, x1, x2]

→ [x1, x2] 
→ [x0, x1, x2, x3]
x2 y2 
→ [x1, x2, x3] 
→ [x0, x1, x2, x3, x4]

→ [x2, x3] 
→ [x1, x2, x3, x4]
x3 y3 
→ [x2, x3, x4]

→ [x3, x4]
x4 y4

Alternately: Divided Difference Table is Comparable to an ordinary Differences table as follows:


TABLE 13.22

Argument Entry First Second Third Fourth


Div. diff Div. diff Div. diff Div. diff

x0 y0
y1 − y0

→ h
y2 − 2y1 + y0
x1 y1 
→ 2h.h
y2 − y1 y3 − 3y2 + 3y1 − y0

→ h

→ 3h.2h.h
870 Engineering Mathematics through Applications

y3 − 2y2 + y1 y4 − 4y3 + 6y2 − 4y1 + y0


x2 y2 
→ 2h.h

→ 4h.3h.2h.h
y3 − y2 y4 − 3y3 + 3y2 − y1

→ h

→ 3h.2h.h
y4 − 2y3 + y2
x3 y3 
→ 2h.h
y4 − y3

→ h
x4 y4

Hence from this table we see that nth divided difference for any function yk
∆n
i.e. [ x0 , x1,…, xn ] = n ! hynk

13.12. PROPERTIES OF DIVIDED DIFFERENCES

Theorem 1: The value of a divided difference is independent of the arguments.


Proof: The first divided difference [x0, x1] is given by
y − y0 y1 y0 y1 y0
[x0 , x1 ] = x1 = − = +
x1 − x0 x1 − x0 ( x1 − x0 ) ( x0 − x1 ) …(1)
1 − x0
The second divided difference

1  y2 − y1  1  y1 − y0 
[ x0 , x1, x2 ] = x  −  
− x0  x2 − x1  x2 − x0  x1 − x0 
2

1  y1 y2  1  y0 y1 
= + − +
( x2 − x0 )  x1 − x2 x2 − x1  x2 − x0  x0 − x1 x1 − x0 
 

y0  1 1 
= + −
( x0 − x1 )( x0 − x2 )  ( x2 − x0 ) ( x1 − x2 ) ( x2 − x0 )( x1 − x0 )  1
y

y2
+
( x2 − x0 ) ( x2 − x1 )
=
y0
+
( x2 − x0 ) y1 +
y2
( x0 − x1 )( x0 − x2 ) ( x2 − x0 )( x1 − x0 ) ( x1 − x2 ) ( x2 − x0 ) ( x2 − x1 )
y0 y1 y2
= + +
( 0 − 1 )( 0 − 2 ) ( 1 − 0 ) ( 1 − 2 ) ( 2 − 0 ) ( x2 − x1 )
x x x x x x x x x x …(2)

Results (1) and (2) show that divided differences [x0, x1], [x0, x1, x2] are symmetrical i.e., if
the arguments are changed in any order, the values of divided differences remain to be the
same. Thus, [1, 5, 9] = [5, 9, 1] = [5, 1, 9], etc.
We may thus write, [xn, xn – 1, …, x2, x1, x0] = [x0, x1, x2, …, xn – 1, xn], etc.
It can be proved by mathematical induction that
Finite Differences, Numerical Differentiations and Integrations 871

[ x, x0 , x1, …, xn ] = (x − x )( x − yx )…(x − x ) + (x y0
− x )( x0 − x1 )…( x0 − xn )
0 1 n 0

y1 yn
+ +…+ .
( x1 − x ) (x1 − x0 )… (x1 − xn ) ( xn − x )( xn − x0 )… (xn − xn −1 )
Theorem 2: The nth divided differences of a polynomial of nth degree are constant.
Theorem 3: The nth divided differences can be expressed as the quotient of two determinants,
each of order n + 1.
Theorem 4: The nth divided differences can be expressed as the product of multiple integrals
i.e.,
1 u1 u2 un − 1
f (x1, x2 , ……, xn) =
∫ ∫
0
du1
0
du2.
∫ 0 ∫
du3 …
0
f n − 2(vn)dvn −1

where vn = (1 – u1)x1 + (u1 – u2)x2 + … + (un – 2 – un – 1)xn – 1 + un – 1xn,


u1, u2, …, un are independent variables and fn–1 means the (n – 1)th derivative of
f = f(x1,x2, …, xn). (Proof of all these theorems are not under consideration)

13.13. NEWTON'S DIVIDED DIFFERENCE FORMULA


Let y0, y1, ……, yn be the values of y = f(x) corresponding to the variables x0, x1, ……, xn, then
by definition of divided differences,

[ x, x0 ] = x −− x0 i.e. y = y0 + ( x − x0 ) [ x, x0 ]
y y
…(1)
0

 x, x0  −  x0 , x1 
Again  x, x0 , x1  = 
x − x1
which implies [x, x0] = [x0, x1] + (x – x1)[x, x0, x1] …(2)
On substituting the above value of [x, x0] in (1), we get
y = y0 + (x – x0){[x0 – x1] + (x – x1)[x, x0, x1]}
or y = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x, x0, x1] …(3)

 x, x0 , x1  −  x0 , x1, x2 
Further,  x, x0 , x1 , x2  = 
x − x2
which implies
[x, x0, x1] = [x0, x1, x2] + (x – x2)[x, x0, x1, x2] …(4)
On substituting the above value of [x, x0, x1] in equation (3), we get
y = y0 + (x – x0)[x, x0] + (x – x0)(x – x1)[x0, x1, x2]
+ (x – x0)(x – x1)(x – x2)[x, x0, x1, x2] …(5)
On continuing in this way, we get
f(x) = y = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x0, x1, x2]
872 Engineering Mathematics through Applications

+ (x – x0)(x – x1)(x – x2)[x0, x1, x2, x3]


+ …… + (x – x0)(x – x1)(x – x2) …… (x – xn)[x0, x1, x2 …… , xn] …(6)
Observations:
1. All the terms on the right hand side of (6), have dimensions of y regardless of the nature of ‘x’ and its
units of measurement. Since dimensions of ‘x’ cancels out in each terms on the right-hand side of (6).

( y1 − y0 )
For example see the 2nd term, ( x − x0 )  x0 , x1  = ( x − x0 ) x − x
( 1 0)
Here dimensions of 'x' in numerator and denominator cancels out.
2. The last term in the formula (6), is the remainder term after n + 1 terms and is written as:
Rn + 1 = (x – x0)(x – x1)(x – x2) …… (x – xn)[x0, x1, x2, …, xn]

Example 32: Using divided difference formula, find cosec 25°.167 from the following data:
x: 25º.05 25º.13 25º.25 25º.32 25º.41
f(x): 2.36178256 2.35475007 2.34428805 2.33823275 2.33049827

Solution: The divided difference table is as follows:


TABLE 13.24

x cosec x First Div. diff. Second Div.diff. Third Div. diff.

25°.05 2.36178256
– 0.087906125
25°.13 2.35475007 0.0036131525
– 0.087183500 – 0.000141907
25°.25 2.34428805 0.0035748105
– 0.086504286 – 0.0001475607
25°.32 2.33823275 0.0035351188
– 0.085938667
25°.41 2.33049827

Now employ the formula


y = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x0, x1, x2]
+ (x – x0)(x – x1)(x – x2)[x0, x1, x2, x3]
With x = 25° .167, y0 = 2.35475007
y = 2.35475007 + 0.037(– 0.087183500) + 0.037( – 0.083)(0.0035748105)
+ 0.037( – 0.083)( – 0.153)( – 0.000147561)
= 2.35475007 – 0.003225790 – 0.000010978 – 0.000000069
= 2.35151323.
Example 6.23: By means of Newton’s Divided difference formula (for unequal intervals),
find value of f(8) and f(15) from the following table: [Madurai 1996, Calcutta 1995]

x: 4 5 7 10 11 13
f(x) = y : 48 100 294 900 1210 2028
Finite Differences, Numerical Differentiations and Integrations 873

Solution: The divided difference table is as follows:


TABLE 13.25

xi yi Ist divided IInd divided IIIrd divided IVth divided


difference difference difference difference

f (x) − f (x0 )
x0 = 4 48 (x1 − x0 )
(100 − 48)
=
(5 − 4) = 52
(97 − 52)

→ = 15
(7 − 4)
f (x2) − f (x1)
x1 = 5 100 (x2 − x1)
(294 − 100) (21 − 15)
=
(7 − 5)
= 97 → (10 − 4) = 1

202 − 97

→ 10 − 5
= 21 
→0
f ( x3 ) − f ( x2 )
x2 = 7 294
( x3 − x2 )
=
( 900 − 294 ) 27 − 21
( 10 − 7 ) = 202 
→ 11 − 5 = 1

310 − 202

→ = 27 
→0
11 − 7
f (x4 ) − f (x3 )
x3 = 10 900 (x4 − x3 )
(1210 − 900) 33 − 27
= 
→ 13 − 7 = 1
(11 − 10) = 310

409 − 310

→ 13 − 10 = 33
f (x5) − f (x4 )
x4 = 11 1210 (x5 − x4 )
(2028 − 1210)
= = 409
(13 − 11)

x5 = 13 2028

Now,
y(x) = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x0, x1, x2]
+ (x – x0)(x – x1)(x – x2)[x0, x1, x2, x3] + …
+ (x – x0)(x – x1) … (x – xn – 1)[x0, x1, …, xn]
874 Engineering Mathematics through Applications

1 2
⇒ y(x) = y0 + (x – 4) f(4) + (x – 4)(x – 5) f(4)
5 5, 7

3
+ (x – 4)(x – 5) (x – 7) f(4)
5, 7, 10

4
+ (x – 4)(x – 5)(x – 7)(x – 10) f(4)
5, 7, 1 0 , 1 1

5
+ (x – 4)(x – 5)(x – 7)(x – 10)(x – 11) f(4)
5 , 7 , 1 0 , 1 1, 1 3

y(8) = 48 + (8 – 4)52 + (8 – 4)(8 – 5)15 + (8 – 4)(8 – 5)(8 – 7) × 1


+ (8 – 4)(8 – 5)(8 – 7)(8 – 10) × 0 + 0 + 0
= 48 + 208 + 180 + 12 = 448.

Example 34: The observed value of a function are respectively 168, 120, 72 and 63 at the
four positions 3, 7, 9 and 10 out of the independent variable. What is the best estimate
you can give for value of the function at the position 6 of the independent variable.

Solution: Here we employ divided difference to find f(6). The desired table is as follows` :
TABLE 13.26

xi yi Ist Divided diff. 2nd Divided diff. 3rd Divided diff.

3 168
120 − 168
= − 12
7−3
−24 − 12
7 120 = −2
9−3
72 − 120 5+2
= −24 =1
9−7 10 − 3
−9 + 24
9 72 =5
10 − 7
63 − 72
= −9
10 − 9
10 63

Here x = 6
∴ f(x) = y = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x0, x1, x2]
+ (x – x0)(x – x1)(x – x2)[x0, x1, x2, x3]
f(6) = 168 + (x – 3)( – 12) + (x – 3)(x – 7)( – 2) + (x – 3)(x – 7)(x – 9) × 1
= 168 – 3 × 12 + (3)( – 1)( – 2) + (3)( – 1)( – 3)(1)
= 168 – 36 + 6 + 9 = 147.

Example 35: Find the polynomial of the lowest degree which assumes the values 1245, 33,
5, 9 and 1335 at x = –4, – 1, 0, 2 and 5. Also find the nature of the polynomial at abscissa
x = 1.
Finite Differences, Numerical Differentiations and Integrations 875

Solution: The desired divided differences for the arguments –4, –1, 0, 2 and 5 are as follows:
TABLE 13.26

xi yi Ist Divided diff. 2nd Divided diff. 3rd Divided diff. 4th Divided diff.

–4 1245

33 − 1245

→ = −404
−1 + 4

−28 + 404
–1 33 
→ 0+4
= 94

5 − 33 10 − 94
→ 0 + 1 = −28
 
→ 2+4
= −14

2 + 28 13 + 14
0 5 
→ = 10 
→ =3
2+1 5+4

9−5 88 − 10

→ 2−0 = 2 
→ 5+1
= 13

442 − 2
2 9 
→ = 88
5−0

1335 − 9

→ = 442
5−2
5 1335

∴ f(x) = y0 + (x – x0)[x0, x1] + (x – x0)(x – x1)[x0, x1, x2]


+ (x – x0)(x – x1)(x – x2)[x0, x1, x2, x3]
+ (x – x0)(x – x1)(x – x2)(x – x3)[x0, x1, x2, x3, x4]
= 1245 + (x + 4)( – 404) + (x + 4)(x + 1)(94)
+ (x + 4)(x + 1)(x)( – 14) + (x + 4)(x + 1)(x)(x – 2)(3)
= 1245 – 404(x + 4) + 94(x2 + 5x + 4) – 14(x3 + 5x2 + 4x) + 3(x4 + 3x3 – 6x2 – 8x)
f(x) = 3x4 – 5x3 + 6x2 – 14x + 5
which is the required polynomial.
Now f(1) = 3 – 5 + 6 – 14 + 5 = – 5

13.14. LAGRANGE'S INTERPOLATION FORMULA


Let f(x) denotes a polynomial of nth degree which takes the values y0, y1, y2, …, yn when x
takes the values x0, x1, x2, …, xn respectively. Then the (n + 1)th differences of the polynomial
are zero and hence [x, x0, x1, …, xn] = 0.
Thus,
876 Engineering Mathematics through Applications

y y0
+
(x − x0 )(x − x1)(x − x2 ) … (x − xn ) (x0 − x)(x0 − x1)(x0 − x2 ) … (x0 − xn )

y1
+ +…
(x1 − x)(x1 − x0 )(x1 − x2 ) … (x1 − xn )

yn
+ =0 …(1)
(xn − x)(xn − x0 )(xn − x1) … (xn − xn −1)
On solving for y and then cancelling common factors (x – x0), (x – x1), (x – x2), ……, (x – xn)
in all terms, we get
(x − x1)(x − x2 ) … (x − xn ) (x − x0 )(x − x2 ) … (x − xn )
y= y0 + y1
(x0 − x1)(x0 − x2 ) … (x0 − xn ) (x1 − x0 )(x1 − x2 ) … (x1 − xn )
(x − x0 )(x − x1) … (x − xn −1)
+…+ yn …(2)
(xn − x0 )(xn − x1 ) … (xn − xn−1 )
This is Lagrange's formula and is seen to give y = y0, y1, … yn
when x = x0, x1, …, respectively.
The Lagrange's formula can also be written in the form
n Pn(x)
y= ∑ yi , i = 0, 1, …, n
i = 0 (x − xi )Pn´(x)

d
where Pn(x) = (x – x0)(x – x1) ……(x – xn), and Pn´(x) = Pn(x)
dx
Observations
1. Lagrange's formula is mearly a relation between two variables, either of which may be taken as the
independent variable and hence on interchanging x and y in (2), we get

(y − y1)(y − y2 ) … (y − yn) (y − y0)(y − y2 ) … (y − yn)


x= x0 + x1
(y0 − y1)(y0 − y2 ) … (y0 − yn) (y1 − y0)(y1 − y2 ) … (y1 − yn)

(y − y0)(y − y1) … (y − yn −1)


+ …… + xn
(yn − y0)(yn − y1) … (yn − yn −1)
2. It can be proved that the sum of the Lagrangian coefficients is unity.

Example 36: Use Lagrange’s interpolation formula to find the value of y when x = 7, if the
following values of x and y are given: [V.T.U. 2000, Madras 2000]
x: 5 6 9 11
y: 12 13 14 16

Solution: If f(x) be a function which takes the values (x0, y0), (x1, y1), (x2, y2), ……, (xn, yn),
then
(x − x1)(x − x2 ) … (x − xn ) (x − x0 )(x − x2 ) … (x − xn )
y = f (x) = y0 + y1
(x0 − x1)(x0 − x2 ) … (x0 − xn ) (x1 − x0 )(x1 − x2 ) … (x1 − xn )
Finite Differences, Numerical Differentiations and Integrations 877

(x − x0 )(x − x1 ) … (x − xn −1 )
+ …… + y
(xn − x0 )(xn − x1 ) … (xn − xn −1 ) n

(7 − 6)(7 − 9)(7 − 11) (7 − 5)(7 − 9)(7 − 11)


f (x) = f (7) = × 12 + × 13
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11)

(7 − 5)(7 − 6)(7 − 11) (7 − 5)(7 − 6)(7 − 9)


+ × 14 + × 16
(9 − 5)(9 − 6)(9 − 11) (11 − 5)(11 − 6)(11 − 9)
1 × −2 × −4 2 × − 2 × −4 2 × 1 × −4 2 × 1 × −2
= × 12 + × 13 + × 14 + × 16
−1 × −4 × −6 1 × −3 × −5 4 × 3 × −2 6×5×2
208 14 16
= −4 + + − = 13.46.
15 3 15

Example 37: Given log100 = 2.000, log101 = 2.0043, log103 = 2.0128, log104 = 2.017; find
log102.

Solution: Consider this problem as a case of unequal interval, then by Lagrange’s formula
for unequal intervals, we have y = f(x) for different given values of y = y0, y1, …, yn
corresponding to x = x0, x1, ……, xn.
(x − x1)(x − x2 ) … (x − xn ) (x − x0 )(x − x2 ) … (x − xn )
∴ y = f (x) = (x − x )(x − x ) … (x − x ) y0 + (x − x )(x − x ) … (x − x ) y1
0 1 0 2 0 n 1 0 1 2 1 n

(x − x0 ) … (x − xn −1)
+…… + yn
(xn − x0 )(xn − x1 ) … (xn − xn −1 )

(102 − 101)(102 − 103)(102 − 104)


y(102) = ×2
(100 − 101)(100 − 103)(100 − 104)
(102 − 100)(102 − 103)(102 − 104)
+ × 2.0043
(101 − 100)(101 − 103)(101 − 104)
(102 − 100)(102 − 101)(102 − 104)
+ × 2.0128
(103 − 100)(103 − 101)(103 − 104)
(102 − 100)(102 − 101)(102 − 103)
+ × 2.017
(104 − 100)(104 − 101)(104 − 103)

(1)(−1)(−2) (2)(− 1)(−2)


= ×2+ × 2.0043
(−1)(− 3)(− 4) (1)(−2)(−3)
(2)(1)(−2) (2)(1)(−1)
+ × 2.0128 + × 2.017
(3)(2)(−1) (4)(3)(1)
1 × −1 × −2 2 × −1 × −2
= ×2+ × 2.0043
−1 × −3 × −4 1 × −2 × −3
878 Engineering Mathematics through Applications

2 × (1) × (−2) (2) × (1) × (−1)


+ × 2.0128 + × 2.017
(3) × (2) × (−1) (4) × (3) × (1)
= – 0.3333 + 1.3362 + 1.3419 – 0.3362
= 2.0086.

Example. 38: The mode of a certain frequency curve is very near to x = 9 and the values of
the frequence density f(x) for x = 8.6, 9, 9.3 are respectively 0.30, 0.35 and 0.25, calculate the
approximate value of the mode. [NIT Kurukshetra, 2005]

Solution: Using Langranges formula, define the polynomial as:


(x − x1)(x − x2 ) (x − x0 )(x − x2 ) (x − x0 )(x − x1 )
f (x) = y0 + y1 + y2
(x0 − x1 )(x0 − x2 ) (x1 − x0 )(x1 − x2 ) (x2 − x0 )(x2 − x1)
with (x0, y0) = (8.6, 0.30), (x1, y1) = (9, 0.35), (x2, y1) = (9.3, 0.25)
x2 − x(x1 + x2 ) + x1x2 x2 − x(x0 + x2 ) + x0 x2 x2 − x(x0 + x1) + x0 x1
∴ f(x) = y0 + y1 + y2
(x0 − x1)(x0 − x2 ) (x1 − x0 )(x1 − x2 ) (x2 − x0 )(x2 − x1)

2x − (x1 + x2 ) 2x − (x0 + x2 ) 2x − (x0 + x1 )


Here f ’(x) = y0 + y1 + y2
(x0 − x1)(x0 − x2 ) (x1 − x0 )(x1 − x2 ) (x2 − x0 )(x2 − x1 )

2x − 18.3 2x − 17.9 2x − 17.6


= + +
0.04 0.03 0.12
x 2 x
For mode, f’(x) = 0 i.e. − 4.575 + x − 6.0667 + − 1.49167 = 0
2 3 6
1.3333x = 4.575 + 6.0667 + 1.49167 or x = 9.10005 ≅ 9.
Here the mode of the frequency curve will have mode value at x = 9.1.

ASSIGNMENT 4
1. If y(1) = –3, y(3) = 9, y(4) = 30, y(6) = 132, find the Lagrange's interpolation polynomial
that takes the same values as y at the given points.
2. Given f(0) = – 18, f(3) = 0, f(1) = 0, f(5), = – 248, f(6) = 0, f(9) = 13104, find f(x).
3. Certain corresponding values of x and log10 x are given below :
x: 300 304 305 307
f(x): 2.4771 2.4829 2.4843 2.4871
Find log10 310 by (i) Lagrange's formula (ii) Newton's Divided Diff.

13.15 CENTRAL DIFFERENCE INTERPOLATION FORMULA


In the preceeding sections, we derived Newton-Gregory Forward and Backward formulae
for equal interval of arguments, Newton’s Divided difference and Langrange’s formulae for
unequal interval of arguments.
Finite Differences, Numerical Differentiations and Integrations 879

Now, we shall develop central difference formulae which are most suitable for interpolation near the
middle of the difference table.
Central Difference Table:
If x takes x0 – 2h, x0 – h, x0, x0 + h, x + 2h with corresponding y as y–2, y–1, y0, y1, y2, then the
corresponding central difference table becomes
TABLE 13.28

xi yi δyi Ist diff. δ2yi 2nd diff. δ3yi 3rd diff. δ4yi 4th diff.

x0 – 2h y –2

→ ∆y –2 = δy– 3/2

→ ∆ y –2 = δ y– 1
2

2
x0 – h y –1

→ ∆y –1 = δy– 1/2 → ∆ y –2 = δ y –1/2


3 3
 
x0 y0 
→ ∆2
y– 1 = δ 2
y 0 → ∆ y –2 = δ y0

4 4

→ ∆y0 = δy1/2 → ∆ y –1 = δ y 1/2


2 3
 
→ ∆ y0 = δ y1
2

2
x0 + h y1
→ ∆y1 = δy3/2

x0 + 2h y2

Clearly, the expression y–1 – y–2 = ∆y–2 is called the first order central difference of y–3/2
and is written as:
δy–3/2 = y–1 – y–2 and in general δyn = yn+1/2 – yn – 1/2.

1. Gauss Forward Interpolation Formula


Newton's forward formula:
p(p − 1) 2 p(p − 1)(p − 2) 3
yp = y0 + p ∆ y0 + ∆ y0 + ∆ y0 + …… …(1)
2! 3!
We know, ∆2y0 – ∆2y – 1 = ∆3y – 1
i.e. ∆2y0 = (∆2y – 1 + ∆3y – 1) …(2)
Similarly ∆3y0 = (∆3y – 1 + ∆4y – 1) and so on …(3)
Also, ∆3y –1 –
–2 = ∆3y–2 ∆4y
i.e. ∆3y
– 1 = (∆ y – 2 + ∆ y – 2)
3 4 …(4)
Similarly, ∆ y – 1 = ∆4y – 2 + ∆5y – 2 and so on.
4 …(5)
On substituting values of ∆2y0, ∆3y0, …etc., we get
p(p − 1) 2 p(p − 1)(p − 2) 3
yp = y0 + p ∆ y0 + (∆ y−1 + ∆3 y−1) + (∆ y−1 + ∆4 y−1)
2! 3!
p(p − 1)(p − 2)(p − 3) 4
+ (∆ y−1 + ∆5 y−1)
4!
p(p − 1)(p − 2)(p − 3)(p − 4) 5
+ (∆ y−1 + ∆6 y−1 ) + … …(6)
5!
on using ∆3y – 1, ∆4y – 1 etc we get
880 Engineering Mathematics through Applications

p(p − 1) 2 p(p2 − 1) 3
or yp = y0 + p∆y0 + ∆ y−1 + ∆ y−1
2! 3!

p(p2 − 1)(p − 2) 4 p(p2 − 1)(p2 − 22 ) 5


+ ∆ y−2 + ∆ y−2 + … …(7)
4! 5!
This is the Gauss Forward formula.
Note: In the central differences natation this result will be
p(p − 1) 2 p(p2 − 1) 3 p(p2 − 1)(p − 2) 4
yp = y0 + p δ y1/2 + δ y0 + δ y1/2 + δ y0
2! 3! 4!

p(p2 − 12 )(p2 − 22) 5


+ δ y1/2 + … …(8)
5!
and this formula is employed to interpolate the value of y for p (0 < p < 1) measured forward from the origin.

2. Gauss Backward Interpolation Formula


By Newton’s forward formula
p(p − 1) 2 p(p − 1)(p − 2) 3
yp = y0 + p∆y0 + ∆ y0 + ∆ y0 + … …(1)
2 3
We know, ∆y0 – ∆y – 1 = ∆2y – 1
i.e. ∆y0 = ∆y – 1 + ∆2y – 1 …(2)
Similarly ∆2 y0 = ∆2 y−1 + ∆3 y−1 
 and so on …(3)
∆3 y0 = ∆3 y−1 + ∆4 y−1 
Also ∆3y – 1 – ∆3y – 2 = ∆4y – 2

Similarly ∆3y−1 = ∆3y−2 + ∆4y−2 


 and so on …(4)
∆4 y−1 = ∆4 y−2 + ∆5 y−2 
On substituting values ∆y0, ∆2y0, ∆3y0 … etc. in (1), we get
p(p − 1) 2
yp = y0 + p(∆y−1 + ∆2 y−1 ) + (∆ y−1 + ∆3 y−1 )
2!
p(p − 1)(p − 2) 3 p(p − 1)(p − 2)(p − 3) 4
+ (∆ y−1 + ∆ 4 y−1) + (∆ y−1 + ∆5 y−1) + … …(5)
3! 4!
p(p + 1) 2 (p + 1)p(p − 1) 3
= y0 + p ∆ y−1 + ∆ y−1 + (∆ y−2 + ∆4 y−2 )
2! 3!
(p + 1)p(p − 1)(p − 2) 4
+ (∆ y−2 + ∆5 y−2 ) + … …(6)
4!
Further, using values ∆3y – 1, ∆4y – 1 etc.
Finite Differences, Numerical Differentiations and Integrations 881

(p + 1)p 2 p(p2 − 1) 3
yp = y0 + p∆y−1 + ∆ y−1 + ∆ y−2
2! 3!
p(p2 − 1)(p + 2) 4 p(p2 − 1)(p2 − 22 ) 5
+ ∆ y−2 + ∆ y−3 + … …(7)
4! 5!
which is Gauss Backward formula.
Note: In the central differences notation, this result will become
(p + 1)p 2 p(p2 − 12 ) 3
yp = y0 + p δ y−1/2 + δ y0 + δ y−1/2
2! 3!

p(p2 − 12)(p + 2) 4 p(p2 − 12)(p2 − 22) 5


+ δ y0 + δ y−1/2 + … …(8)
4! 5!
and it is employed for negative value of 'p' lying between – 1 and 0. Though Gauss's forward and backward formulae are
not of much practical use, but, these serve as an entermediate steps for obtaining stirling’s, Bessel's and Everett's
formulas.

3. Stirling’s Formula
By Newton-Gregory forward formula
p(p − 1) 2 p(p − 1)(p − 2) 3
yp = y0 + p∆y0 + ∆ y0 + ∆ y0 + … …(1)
2! 3!
Here, ∆y0 = y1 – y0 = E1/2y1/2 – E–1/2y1/2 = (E1/2 – E – 1/2)y
1/2 = δy1/2 …(2)
Similarly, ∆y1 = δy3/2 , ∆y2 = δy 1 and so on
2
2

Again, ∆2y0 = ∆y1 – ∆y0 = δy3/2 – δy1/2 = δ(y3/2 – y1/2) = δ(δy1) = δ2y1 …(3)
Similarly ∆3y 0 = δ3y 3/2, ∆4y0 = δ4y2 and so on. …(4)
p(p − 1) 2 p(p − 1)(p − 2) 3
Thus, yp = y0 + p δ y1/2 + δ y1 + δ y3/2 + …… …(5)
2! 3!
1 1
Now, δy1/2 = [(δy−1/2 + δy1/2 )] + [(δy1/2 − δy−1/2 )], by rearrangement of terms
2 2

δ ( y−1/2 + y1/2 ) + δ ( y1/2 − y−1/2 )


1 1
=
2 2

δ ( E−1/2 + E1/2 ) y0 + δ ( E1/2 − E−1/2 ) y0


1 1
=
2 2
1 2
= µδy0 +
δ y0 …(6)
2
Similarly, δ2y1 = δ2y0 + (δ2y1 – δ2y0)
= δ2y0 + δ2(y1 – y0)
= δ2y0 + δ2(δy1/2)
882 Engineering Mathematics through Applications

= δ2 y0 + δ2 µδy0 + δ2 y0  ,
1
using (6)
 2 
1 4
= δ2 y0 + µδ3 y0 + δ y0 , and so on. …(7)
2
Using (6), (7), we get
p(p − 1)  2
yp = y0 + p  µδy0 + δ2 y0  + δ y0 + µδ3 y0 + δ4 y0  + …
1 1
 2  2!  2 

p2 2 p(p2 − 12 ) 3 p2( p2 − 12 ) 4
= y0 + p µδ y0 + δ y0 + µδ y0 + δ y0
2! 3! 4!

p(p2 − 12 )(p2 − 22 ) 5
+ µδ y0 + … …(8)
5!
This is Known as Stirling's Interpolation Formula
Further, in forward difference form it becomes,
∆y−1 + ∆y0 p2 2 p(p2 − 12 ) ∆3 y−2 + ∆3 y−1
yp = y0 + p ⋅ + ⋅ ∆ y−1 + ⋅
2 2! 3! 2

p2 (p2 − 12 ) 4 p(p2 − 12 )(p2 − 22 ) ∆5 y−3 + ∆5 y−2


+ ⋅ ∆ y−2 + ⋅ …(9)
4! 5! 2
Which is the mean of Gauss's Forward
The path of Stirling’s formula across a diagonal difference table is shown in the difference
table with entries that occur in the formula are printed in dark.
TABLE 13.29

y ∆y ∆2 y ∆3 y ∆4 y ∆5 y ∆6 y

y –3
→ ∆y –3
y –2 → ∆2 y –3
→ ∆y –2 → ∆3 y –3
y –1 → ∆ y –2
2
→ ∆4 y –3
→ ∆ y –1 → ∆ y –2
3
→ ∆ 5 y –3
y0 → ∆ y –1
2
→ ∆ y –2
4
→ ∆6 y–3
→ ∆y0 → ∆ 3 y –1 → ∆ 5 y –2
y1 → ∆2 y 0 → ∆4 y –1
→ ∆y1 → ∆ y0
3

y2 → ∆2 y 1
→ ∆y2
y3

Observations: Clearly from (9), the formula involves means of the odd differences just above and below the
central line as shown in the difference table 13.28.
Finite Differences, Numerical Differentiations and Integrations 883

4. Bessel’s Formula
As we have already derived

1 2
δy1/2 = µδy0 + δ y0 , (See equation (6) in Stirling’s Formula)
2

1 2
Implies δ y1 = µδ y1/2 + δ y1/2 , (Shift y to y1/2)
2

1 3
Further, δ2 y1 = µδ2 y1/2 + δ y1/2 …(10)
2

Again, δ2y1 = δ2y0 + µδ3y0 + δ4y1/2 , (Equation (7) in Stirling's Formula)


Implies δ2y3/2 = δ2y1/2 + µδ3y1/2 + δ4y1/2
Further, δ3y3/2 = δ3y1/2 + µδ4y1/2 + δ5y1/2 …(11)
By using (10) and (11), equation (5) of derivation becomes

p(p − 1)  p − 
1
p(p − 1) 2  2  δ3 y
yp = y0 + p δy1/2 + µδ y1/2 + 1/2
2! 3!

p(p2 − 12 )(p − 2)  p − 
1
p(p2 − 12 )(p − 2) 4  2  δ5 y + …
+ µδ y1/2 + 1/2
4! 5!
which is the desired expression.

Example 39: Interpolate by means of Gauss's backward formula, the population of a town
for the year 1974, given that:
Year : 1939 1949 1959 1969 1979 1989
Population : 12 15 20 27 39 52
(in thousands)
(Kottayam, 2005; Madras, 2003)

xp − x0 1974 − 1969
Solution: Taking x0 = 1969, h = 10, x0 + ph = xp i.e. p = = = 0.5, Form
h 10
the central difference table as:
884 Engineering Mathematics through Applications

TABLE 13.30

xi yi ∆yi ∆2yi ∆3yi ∆4yi ∆5yi

x–3 = 1939 12

→ 3
x–2 = 1949 15 ⇒ 2

→ 5 
→ 0
x–1 = 1959 20 ⇒ 2 ⇒ 3

→ 7 
→ 3 
→ – 10
x0 = 1969 27 ⇒ 5 ⇒ –7

→ 12 
→ –4
x1 = 1979 39 ⇒ 1

→ 13
x2 = 1989 52

Now, using Gauss Backward formula,

(p + 1)p 2 (p + 1)p(p − 1) 3
yp = y0 + p ∆ y−1 + ∆ y−1 + ∆ y−2 +
2! 3!

(p + 2)(p + 1)p(p − 1) 4 (p + 2)(p + 1)p(p − 1)(p − 2) 5


∆ y−2 + ∆ y−3 + ……
4! 5!

(1.5)(0.5)(5) (1.5)(− 0.5)


y5 = 27 + (0.5)(7) + + (3)
2 6

(2.5)(1.5)(−0.5) (2.5)(1.5)(0.5)(−0.5)(− 1.5)


+ (−7) + (−10)
24 120
= 27 + 3.5 + 1.875 – 0.1875 + 0.2743 – 0.1172 = 32.345 thousands approximate

Example 13.40: From following table


x: 20 25 30 35 40
f(x): 14.035 13.674 13.257 12.089 11.309
find f(32) using stirling’s formula.

We know that the Stirling’s formula is


n2 2 n(n2 − 1) 3
y(xo + nh) = y0 + n µδ y0 + δ y0 + µδ y0
2! 3!

n2 (n2 − 12 ) 4 n(n2 − 12 )(n2 − 22 ) 5


+ δ y0 + µδ y0 + … …(1)
4! 5!
Given table is
xi: 20 25 30 35 40 45
yi : 14.035 13.674 13.257 12.734 12.089 11.309
Finite Differences, Numerical Differentiations and Integrations 885

Now, we need to find the value of y at x = 32.

Here, x = 32, x0 = 30, h = yn − yn− 1 = 5,



x − x0 32 − 30 2 
∴ n= = = = 0.4 
…(2)
h 5 5
The corresponding difference table is as follows:
TABLE 13.31

x y ∆ ∆2 ∆3 ∆4 ∆5

20 14.035
–0.361
25 13.674 –0.056
–0.417 –0.05
x0 = 30 13.257 –0.106 0.034
–0.523 –0.016 – 0.031
35 12.734 –0.122 0.003
–0.645 –0.013
40 12.089 –0.135
–0.78
45 11.309

Now from the table, we calculate the following values:


y0 = 13.257, …(3)

1
∴ µδy0 =  − 0.417 + (− 0.523) = − 0.47,
2
…(4)

 E1/2 + E− 1/2  ∆y0 + ∆y− 1


As δ y0 = ∆ y−1/2, and µδy0 =   ∆ y− 1/2 =
 2  2

and δ2 y0 = ∆2 y−1 = − 0.106 …(5)

(∆y0 + ∆y−1 ) ∆3 y− 1 + ∆3 y− 2
As µδ3 y0 = δ2 (µδ y0 ) = δ2 =
2 2

1 1
∴ µδ y0 = − 0.05 − 0.016  = (− 0.066) = − 0.033
3
2
…(6)
2
and δ4 y0 = ∆4 y−1 = 0.034 …(7)
Subtituting the values of (3), (4), (5), (6), (7) and h in Stirling's formula stated in equation
(1), we will get y32
886 Engineering Mathematics through Applications

(0.4)2
∴ y32 = 13.257 + (0.4)(− 0.47) + (−0.106)
2

0.4 ((0.4)2 − 12 ) (0.4)2 ((0.4)2 − 12 )


+ (− 0.033) + (0.034)
3! 4!
= 13.257 + (–0.188) + (–0.00848) + (0.001848) – 0.0001904
= 13.257 – 0.1948224 = 13.0621776 ¾ 13.0622

Example 41: The pressure p of wind corresponding to the velocity v is given by the
following data. Estimate p, when v = 25.
v: 10 20 30 40
p: 1.1 2.0 4.4 7.9

Solution: The desired difference table is as follows:


TABLE 13.32

vi yi δyi δ2yi δ3yi

v–1 = 10 y–1 = 1.1



→ δy–1/2 = 0.9
v0 = 20 y0 = 2.0 
→ δ2y0 = 1.5

→ δy1/2 = 2.4 → δ3y1/2 = –0.4

v1 = 30 y1 = 4.4 
→ δ2y 1 = 1.1

→ δy3/2 = 3.5
v2 = 40 y2 = 7.9

v − vo 25 − 20 1
Taking v0 = 20, h = 10, p = = =
h 10 2

 1 1 3
As, p =   lies between and , therefore, it is appropriate to use Bessel's Formula,
2 4 4
given by

p(p − 1)  p − 
1
p(p − 1) 2  2  δ3 y + ...…
yp = y0 + p δ y1/2 + µδ y1/2 + 1/2
2! 3!
Here, y0 = 2.0,
δ y1/2 = 2.4,

1 1 1
µδ2 y1/2 = (δ2 y1 + δ2 y0 ) = (1.5 + 1.1) = (2.6) = 1.3,
2 2 2
Finite Differences, Numerical Differentiations and Integrations 887

δ3 y1/2 = − 0.4

1  1 1  1  1 1
− − −
∴ 1  2  2  2 2
y25 = 2.0 + (2.4) + 2 (1.3) + 2 (− 0.4)
2 2! 3!
1.3
= 2.0 + 1.2 − + 0 = 3.2000 − 0.1625 = 3.0375
8

Example 42: Use Bessel’s formula to obtain y25, given y20, = 24, y24 = 32, y28 = 35, y32 = 40.

Solution: By definition, Bessel's formula is given as:

n(n − 1)  n − 
1
n(n − 1) 2  2  δ3 y
yn = y(x0 + nh) = y0 + n δy1/2 + µδ y1/2 + 1/2
2! 3!

n(n2 − 12 )(n − 2)  n − 
1
n(n2 − 12 )(n − 2) 4  2  δ5 y + ...
+ µδ y1/2 + 1/2
4! 5!
Now interpolate using the table, taking y24 as the base value, with an interval length h = 4.
TABLE 13.33

xi yi ∆δyi ∆δ2yi ∆δ3yi

x–1 y–1 = y20 = 24


→ ∆y–1 ≡ δy–1/2 = 8

x0 y0 = y24 = 32 ⇒ ∆2y–1 = δ2y0 = –5
→ ∆y0 = δy1/2 = 3
 → ∆ y–1 = δ y1/2 = 7

3 3

x1 y1 = y28 = 35 ⇒ ∆2yo = δ2y1 = 2


→ ∆y1= δy3/2 = 5

x2 y2 = y32 = 40

y0 = 32, δ y1/2 = 3, µδ2 y 1 = δ2 µy1/2 = δ2 (E1/2y + E− 1/2 y ) = δ2 (y + y )


Here 1/2 1/2 1 0
2 2 2
1 1 3
= (δ2 y1 + δ2 y0 ) = (− 5 + 2) = −
2 2 2
and δ3 y1/2 = 7

1
Subtituting these values in yn = y0 + nh implies 25 = 24 + 4n ⇒ n =
4

11  1  1   1 1
−1 −1 −
1    − 3 + 4  4   4 2
∴ y25 = 32 + × 3 + 4 4 …(7)
4 2!  2 3!
888 Engineering Mathematics through Applications

3 9 7
= 32 + + + = 32 + 0.75 + 0.140 + 0.005 = 32.945.
4 64 128
Example 43: Given the table
xi : 310 320 330 340 350 360
logxi : 2.4914 2.5052 2.5185 2.5315 2.5441 2.5563
Find the value of log 337.5 by Stirling’s and Bessel’s formula.

Solution: Let us take log330 as the base value so that


xn = x0 + nh when h = 10
7.5
or 337.5 = 330 + n × 10 ⇒ n= = .75
10
Thus, write the difference table as:
TABLE 13.34

xi yi ∆yi ∆2yi ∆3yi ∆4yi ∆5yi

x–2 y–2 = 2.4914


→ ∆y–2 = 0.0138
x–1 y–1 = 2.5052 → ∆2y–2 = –0.0005
→ ∆y–1 = 0.0133 → ∆3y–2 = 0.0002
x0 y0 = 2.5158 → ∆2y–1 = –0.0003 → ∆4y- 2 = –0.0003
→ ∆y0 = 0.0130 → ∆3y–1 = –0.0001 → ∆5y–2 = 0.0004
x1 y1 = 2.5315 → ∆2y0 = –0.0004 → ∆4y –1 = 0.0001
→ ∆y1 = 0.0126 → ∆3y0 = –0.00
x2 y2 = 2.5441 → ∆2y1 = –0.0004
→ ∆y2 = 0.0122
x3 y3 = 2.5563

Stirling's formula is
n2 2 n(n2 − 12 ) 3 n2 (n2 − 12 )δ4 y0 n (n2 − 12 )(n2 − 22 ) 5
yn = y0 + nµδy0 + δ y0 + µδ y0 + + µδ y0 + …
2! 3! 4! 5!
Now,
δ (E1/2 y0 + E− 1/2 y0 ) δ (y1/2 + y− 1/2 )
(i) µδy0 = δµ y0 = =
2 2
1 1
= (δy1/2 + δy−1/2 ) = (∆y0 + ∆y−1 )
2 2
1 1
= (0.0133 + 0.0130) = (0.0263) = 0.0131
2 2
(ii) δ2 y0 = ∆ 2 y−1 = − 0.0003
 y1/2 + y− 1/2 
(iii) µδ y0 = δ µ y0 = δ 
3 3 3

 2 
Finite Differences, Numerical Differentiations and Integrations 889

1 1
=  δ3 y1/2 + δ3 y− 1/2  =  ∆3 y1/2 − 3/2 + ∆3 y− 1/2 − 3/2 
2 2
1 1
=  ∆3 y− 1 + ∆3 y− 2  = 0.0002 − 0.0001 = 0.00005.
2 2
(iv) δ4 y0 = ∆4 y− 2 = − 0.0003
(y1/2 + y−1/2 ) 1 5
µδ5 y0 = δ5 = δ y1/2 + δ5 y− 1/2 
2 2
1 1
=  ∆5 y−2 + ∆5 y− 3  = 0.0004 + 0  = 0.0002
2 2
Therefore,
(.75)2 (− 0.0003) (.75)(.752 − 1)
yn = 2.5185 + 0.75 × 0.0131 + + × 0.0005
2! 3!
(.75)2 (.752 − 1) .75(.752 − 1)(.752 − 2)
+ (− 0.0003) + × 0.0002
4! 5!
= 2.5185 + .009825 – .0008457 – .000000055. = 2.5283

Example 44: Employ Bessel’s formula to find to the value of y at x = 1.95, given that
[NIT Kurukshetra, 2005; 2009]
x: 1.7 1.8 1.9 2.0 2.1 2.2 2.3
y: 2.979 3.144 3.283 3.391 3.463 3.997 4.491
Which other intepolation formula can be used here? Which is more appropriate? Give
reasons.

Solution: Construct the table as:


TABLE 13.35
x y ∆y ∆2y ∆3y ∆4y ∆5y ∆6y

1.7 2.979
0.165
1.8 3.144 –0.026
0.139 –0.005
1.9(x0) 3.283(y0) –0.031 0
δy1/2)
0.108(δ –0.005 δ3y
(δ 1/2) δ5y1/2)
0.503(δ
2.0 3.391 –0.036 0.503 –2.006
0.072 0.498 –1.503
2.1 3.463 0.462 –1
0.534 –0.502
2.2 3.997 –0.040
0.494
2.3 4.491
890 Engineering Mathematics through Applications

Using Bessel’s formula,


p(p − 1) 2 p(p − 1)(p − 1/2) 3
yn = y0 + p δ y1/2 + µδ y1/2 + δ y1/2
2! 3!

p(p2 − 12 )(p − 2) 4 p(p2 − 12 )(p − 2)(p − 1/2) 5


+ µδ y1/2 + δ y1/2 + ....
4! 5!
1.95 − 1.90 0.05
p= = = 0.5
0.1 0.1
δy1/2 = 0.108
− 0.031 − 0.036
µδ2 y1/2 = = − 0.0335
2
δ3y1/2 = – 0.005
0 + 0.503
µδ4 y1/2 = = 0.2515
2
δ5y1/2 = – 0.503
(0.5)(0.5 − 1)
∴ y(1.95) = 3.283 + (0.5)(0.108) (− 0.0335)
2
(0.5)(0.5 − 1)(0.5 − 0.5) (0.5)(0.52 − 1)(0.5 − 2)
+ (− 0.005) + × 0.2515
6 24
(0.5)(0.52 − 1)(0.5 − 2)(0.5 − 0.5)
+ × 0.503
120
(0.5)(0.5) (0.5)(0.75)(1.5)(0.2515)
= 3.283 + 0.0540 + (0.0335) + 0 + +0
2 24
= 3.34708 = 3.3471

ASSIGNMENT 5
1. Using Stirling’s formula find y35, given y20 = 512, y30 = 439, y40, = 346, y50 = 243.
2. Apply Bessel’s formula to obtain y25 , given y20 = 2854, y24 = 3162, y28 = 3544, y32 = 3992.
3. Given
θ: 0° 5° 10° 15° 20° 25° 30°
tan θ : 0 0.0875 0.1763 0.2679 0.3640 0.4663 0.5774
Using Stirling's formula, show that tan 16° = 0.2867.
4. From the data:
x: 10° 20° 30° 40° 50° 60° 70° 80°
cosx: 0.9848 0.9397 0.8660 0.7660 0.6428 0.5000 0.3420 0.1737
obtain cos 23°, using Bessel’s formula.
5. Use Gauss’s forward formula to evaluate y30 given that y21 = 18.4708, y25 = 17.8144,
y29 =17.1070, y33 = 16.3432 and y37 =15.5154.
Finite Differences, Numerical Differentiations and Integrations 891

13.16. INVERSE INTERPOLATION


Inverse interpolation is the process of finding the value of the argument corresponding to a
given value of the function when the function is intermediate between two tabulated values.
Out of several methods of inverse interpolation, only two are explained.
1. Lagrange‘s Formula
This technique has already been explained while explaining unequal interpolation by
Lagrange’s method, where x (the argument) can be expressed as a function of y.
2. Reversion of Series
The most obvious method of solving the problem of inverse interpolation is by reversion of
series, for all the interpolation formulas developed in the form of power series.
Thus the power series
y = c0 + c1x + c2x2 + c3x3 + ... + cnxn +...… …(1)
when reverted becomes
2 3 4
 y − c0   y − c0   y − c0   y − c0   y − c0 
n
x =  + a1   + a2   + a3   +…… + an − 1  c  + … …(2)
 c1   c1   c1   c1   1 
c2
Where a1 = − ,
c1
2
c3 c 
a2 = − + 2 2  ,
c1  c1 
3
c c c  c 
a3 = − 4 + 5  2 23  − 5  2  ,
c1  c1   c1 
2 4
c5 cc c   c 2c  c 
a4 = − + 6 2 24 + 3  3  − 21  2 33  + 14  2  ,
c1 c1  c1   c1   c1 
5
c c c +c c   c 2 c + c c2 c3c c 
a5 = − 6 + 7  2 5 2 3 4  − 28  2 4 3 2 3  + 84 2 4 3 − 42  2  …(3)
c1  c1   c1  c1  c2 
In this way, compute all c2's and then substitute their values in (2), to find x.
We write inverse interpolation formula for Newton’s, Stirling’s and Bessel’s formulae in
the power series form.
(a) Newton’s Formula:
p(p − 1) 2 p(p − 1)(p − 2) 3 p(p − 1)(p − 2)(p − 3) 4
y = y0 + p ∆y0 + ∆ y0 + ∆ y0 + ∆ y0 + … …(4)
2! 3! 4!
(Limiting the expression upto 4th difference, however, it could be extended desirably)

 ∆2 y0 ∆3 y0 ∆4 y0   ∆2 y0 ∆3 y0 11 4  2
y = y0 +  ∆ y0 − + − p +  2 − 2 + 24 ∆ y0  p
 2 3 4 
 ∆3 y0 ∆4 y0  3 ∆4 y0 4
+ − p +
4 
p …(5)
 6 24
892 Engineering Mathematics through Applications

On comparison of (1)and (4), we get

c0 = y0 
∆ y0 ∆ y0 ∆ y0 
2 3 4
c1 = ∆y0 − + − , 
2 3 4 
∆2 y0 ∆3 y0 11 4 
c2 = − + ∆ y0 ,
2 2 24 
∆3 y0 ∆4 y0  …(6)
c3 = − , 
6 4 
∆4 y0 
c4 = .
24 
(b) Stirling’s Formula
∆y−1 + ∆y0 p2 2 p(p2 − 1) ∆3 y−2 + ∆3 y−1 p2(p2 − 1) 4
y = y0 + p + ∆ y−1 + ⋅ + ∆ y− 2 …(7)
2 2 6 2 24

 ∆y + ∆y0 ∆3 y−2 + ∆3 y−1   ∆2 y−1 ∆4 y−2  2


= y0 +  −1 −  p +  2 − 24  p
 2 12   

 ∆3 y−2 + ∆3 y−1  3 ∆4 y−2 4


+ p + p …(8)
 12  24
On comparing (7) with (1), we get

c0 = y0 
1 1 3 
c1 = (∆y− 1 + ∆y0 ) − (∆ y−2 + ∆3 y−1 )
2 12
1 1 4 
c2 = ∆2 y−1 − ∆ y−2  ...(9)
2 24 
1 3 
c3 = (∆ y−2 + ∆ y−1)
3

12
1 4 
c4 = ∆ y−2 
24 
(c) Bessel’s Formula:

p2 − 1  p  p2 − 
1
 y0 + y1   4   ∆2 y− 1 + ∆2 y0   4  ∆3 y
y=  + p ∆y0 +   + −1
 2  2  2  6

 p2 − 1   p2 − 9 
   4
4   ∆ y−2 + ∆ y−1 
4
+ 4 
 
…(10)
24  2 
Finite Differences, Numerical Differentiations and Integrations 893

1 1 3
= (y0 + y1 ) − (∆2 y− 1 + ∆2 y0 ) + (∆4 y−2 + ∆4 y− 1)
2 16 256

+  ∆y0 −
1 3 
∆ y−1 p +  (∆2 y−1 + ∆2 y0 ) − (∆4 y−2 + ∆4 y−1 ) p2
1 5
 24  4 96 
1 1 4
+ ∆3 y−1 p3 + (∆ y−2 + ∆4 y−1) p4 …(11)
6 48
On comparing (11) with (1), we get

(∆4 y−2 + ∆4 y−1 )


1 1 3
c0 = (y + y1 ) − (∆2 y− 1 + ∆2 y0 ) +
2 0 16 256
1 3 
c1 = ∆y0 − ∆ y− 1 
24 
1 5 4 
c2 = (∆2 y−1 + ∆2 y0 ) − (∆ y−2 + ∆4 y−1 )  …(12)
4 96 
1 
c3 = ∆3 y−1
6 
c4 =
1 4
(∆ y−2 + ∆ y−1 )
4 
48 

x
 2 
Example 45: Using given table of values of the Probability integral 
 x  ∫e
0
− x2
dx, find

1
the value of x for which integral value equals to .
2
xi yi ∆yi ∆ 2y i ∆ 3y i ∆ 4y i
(10–7) (10–7) (10–7) (10–7)

x–2 = 0.45 0.4754818


91737
x–1 = 0.46 0.4846555 –840
90897 –11
x0 = 0.47 0.4937452 –851 1
90046 –10
x1 = 0.48 0.5027498 –861 2
89185 –8
x2 = 0.49 0.5116683 –869
88316
x3 = 0.50 0.5204999

1
Solution: Here, (y0 + y1 ) = 0.4982475,
2
1 2
(∆ y− 1 + ∆2 y0 ) = 0.0000856; 
2 
1 4  …(1)
(∆ y− 2 + ∆ 4 y− 1 ) = 0.00000015 
2 
894 Engineering Mathematics through Applications

Hence, Using result (12), of Reversion of series (Inverse Interpolation) we get

= 0.4982582, 
0.0000856
c0 = 0.4982475 +
8 
0.0000010 
c1 = 0.0090046 + = 9.00900464, 
24 
c2 =−
0.0000856
= − 0.0000428,  …(2)
2 
0.0000010 
c3 =− = − 0.00000017, 
6
c4 = 0, practically 

Now
c2 0.0000428 
=− = − 0.004753, 
c1 0.00900464
2 
 c2  
  = (− 0.004753) = 0.0000225910, 
2

 c1  
3 
 c2  
  = (− 0.004753) = 0.0000001074, 
3
…(3)
 c1  
= − 0.00001888 
c3 0.00000017
=−

c1 0.00900464 
For finding the desired argument, say,
2 3
 y − c0   y − c0   y − c0 
x=  + a1   + a2  + ...…
 c 
…(4)
 c  1  c 1 1

We find

c2 
a1 = − = 0.004753, 
c1
2 
c3  c2  
a2 = − + 2   = 0.00001888 + 2 (0.000022591) 
c1  c1  
= 0.00006406,  …(5)
c  cc   c 
3

c3 = − 4 + 5  2 23  − 5  2  
c1  c1   c1  
= 0 + 5(− 0.004753)(− 0.00001888) − 5(− 0.0000001074)
= 0.000000986 
y − c0 0.5 − 0.4982582 
= = = 0.1934336 
c0 0.0090046 4 
∴ x = 0.1934336 + 0.004753 (0.1934336)2 + 0.00006406 (0.1934336)3
= 0.1934336 + 0.0001778 + 0.00000043
= 0.193612.
Finite Differences, Numerical Differentiations and Integrations 895

Example 46: Using stirling's inverse interpolation formula, find x for given sinh x = 62,
employing data below:
x : 4.80 4.81 4.82 4.83 4.84
y = sinh x: 60.7511 61.3617 61.9785 62.6015 63.307

Solution: Using equations (9) Artical 13.16 (Inverse Interpolution using Reversion of series)

c0 = y0 = 61.9785, 
c1 = 0.6199, 

= 0.0031,
0.0062
c2 =
2 
c3 = 0 = c4 
For finding x, employ equation (2)
Here y = 62,
y − c0 62 − 61.9785
∴ = = 0.034683,
c1 0.6199
c2 0.0031
= = 0.005001
c1 0.6199
c2
Hence a1 = − = − 0.005001,
c1

2
c c 
a2 = − 3 + 2  2  = 2(0.005001)2 = 0.00005002, (as c3 = 3)
c1  c1 
With above values of a1, a2, we get
p = 0.034683 - 0.005001 (0.034683)2 + 0.00005002 (0.034683)3 = 0.0347
∴ x = (x0 + ph) = 4.82 + 0.01(0.0347) = 4.8203
Note: The problem of inverse interpolation by reversion of series is employed when the number of digits involved is large.

ASSIGNMENT 6
1. If cosh x = 1.285, find x by inverse interpolation, using data in the follwing table
x: f(x)
0.735 1.2824937
0.736 1.2832974
0.737 1.2841023
0.738 1.2849085
0.739 1.2857159
0.740 1.2865247
0.741 1.2873348
0.742 1.2881461
896 Engineering Mathematics through Applications

13.17. NUMERICAL DIFFERENTIATION


Numerical differentiation is the process of evaluating derivative of the interpolating
polynomial at some particular value of the variate. The choice of the interpolating formula
for derivative employing differences, are the same as in the case of interpolation. For
equidistant value of the independent variable, generally, we employ Newton's Forward
Difference formula and Newton BackwardDifference formula for finding the value of the
derivative at the beginning and at the end of the interval respectively, whereas, in such cases
where the value of the derivative is desired in the middle of the table, Stirling’s and Bessel’s
formula of central differences are employed. However, in case of unequidistant value of
independent variables, Lagrange’s or Hermite interpolation techniques are preferably
employed for finding the derivative of a function.
Consider the function y = f(x) tabulated for various x = a + ph, p = 0, 1, 2, ...
(a) Derivative Using Newton's Forward Difference Formula
p(p − 1) 2 p(p − 1)(p − 2) 3
y = y0 + p ∆ y0 + ∆ y0 + ∆ y0 + ...… …(1)
2! 3!
where x = x0 + ph and y0 = f(a)
dy dy dp
So that = ⋅
dx dp dx

1 2p − 1 2 3p2 − 6p + 2 3 
=  ∆y0 + ∆ y0 + ∆ y0 + ...… …(2)
h 2 6 

dy
This formula is used to calculate the value of for non-tabulated value of x.
dx
However, for tabular values, the formula becomes simpler by taking x = x0 at., p = 0
 dy  1 1 1 1 
i.e.,  dx  =  ∆y0 − ∆2 y0 + ∆3 y0 − ∆4 y0 + ...… ...(3)
x = x0 h  2 3 4 
For obtaining IInd order derivative, differentiate (2) again with respect to p.
d2 y 1  2 6p − 6 3 12p2 − 36p + 22 4 
∴ 2
= 2  ∆ y0 + ∆ y0 + ∆ y0 + ...… ...(4)
dx h  6 24 

 d2 y 
= 2  ∆2 y0 − ∆3 y0 + ∆ y0 + ...… , (p = 0)
1 11 4 5 137 6
and thus,  dx2  ∆ y0 − ∆5 y0 +
 x = x0 h  12 6 180 
...(5)
Higher order derivatives may be obtained by successive differentiation.
(b) Derivative Using Newton’s Backward Formula:
p(p + 1) 2 p(p + 1)(p + 2) 3
y = yn + p∇ yn + ∇ yn + ∇ yn + ...… ...(6)
2! 3!
Finite Differences, Numerical Differentiations and Integrations 897

 dy 
= ∇ yn + ∇2 yn + ∇3 yn + ∇4 yn + ...… ,
1 1 1 1
giving  dx  h  2 3 4  ...(7)
x = xn

 d2 y  1 ∇2 y + ∇3 y + 11 ∇4 y + 5 ∇5 y + ...…
and  dx2  = 2  n n n n  ...(8)
 x = xn h 12 6

(c) Derivative Using Stirling’s Interpolation Formula:


p2 2 p(p2 − 1) 3 p2 (p2 − 1)2 4
f (a + ph) = f (a) + p µδ f (a) + δ f (a) + µδ f (a) + δ f (a) + ...
2! 3! 4!
…(9)
On sucessively differentiating both sides with respect to p, we get

1 2 1
hf '(a + ph) = µδ f (a) + p δ2 f (a) + (3p − 1) µδ3 f (a) + (4p3 − 2p) δ4 f (a) + ...… …(10)
6 24

1
and h2 f ´´ (a + ph) = δ2 f (a) + p µδ3 f (a) +
(12p2 − 2) δ4 f (a) + ...… ...(11)
24
However, at x = x0 (i.e., p = 0) these results become

1
µδ5 f (a) − …...
1 1
f ´(a) = µδ(a) f (a) − µδ3 f (a) +
h 
...(12)
6 30 

1 δ2 ( ) − 1 δ4 ( ) + 1 δ6 ( ) − ...…
and f ´´ (a) =  f a 12 f a 90 f a  ...(13)
h2
Note: Derivation of rest of the interpolation techniques for finding differentiation of a function has been left to the
readers.

Example 47: Given that


x: 1.0 1.1 1.2 1.3 1.4 1.5 1.6

y: 7.989 8.403 8.781 9.129 9.451 9.750 10.031

dy d2 y
Find and at x = 1.1 and x = 1.6.
dx dx2

Solution: As the value of y(x) is required at the ends, so we follow forward difference
formula, for derivative at x = 1.1 and backward difference formula, for derivative at x = 1.6.
The difference table is:
898 Engineering Mathematics through Applications

TABLE 13.37

x y ∆ ∆2 ∆3 ∆4 ∆5 ∆6

1.0 7.989
0.414
1.1 8.403 –0.036
0.378 0.006
1.2 8.781 –0.030 –0.002
0.348 0.004 0.002
x0 = 1.3 9.129 –0.026 0.000 –0.003
∆y0 = 0.322 0.004 –0.001
1.4 9.451 ∆2y0 = –0.023 –0.001
0.299 ∆3y0 = 0.005
1.5 9.750 –0.018
0.0281
1.6 10.031

 dy  1 1 2 1 3 1 4 
Thus   =  ∆y − ∆ y0 + ∆ y0 − ∆ y0 + ... ...(1)
 x0
dx h  2 3 4 

 d2 y  1  ∆2 y − ∆3 y + 11 ∆4 y − 5 ∆5 y + ...
and  2 = 2  0 0 0 0  ...(2)
 dx x0 h 12 6

Here x0 = 1.1, h = 0.1, ∆y0 = 0.378, ∆2y0= – 0.03 and so on.

 dy  1 
0.378 − (− 0.03) + (0.004) − (0) + (− 0.001) = 3.941,
1 1 1 1
∴   =  ...(3)
 dx 1.1 0.1  2 3 4 5 

 d2 y  1  11 5 
 dx2  = (0.1)2  − 0.03 − (0.004) + 12 (0) − 6 (− 0.001) = − 3.3167 ...(4)
 1.1
Now,

 dy  1 1 2 1 3 1 4 
  = ∇yn + ∇ yn + ∇ yn + ∇ yn + ... ...(5)
dx xn h  2 3 4 

 d2 y  1 ∇2 y + ∇3 y + 11 ∇4 y + 5 ∇5 y + ...
and  dx2  = h2  n n n n  ...(6)
 xn 12 6
Here xn = 1.6, h = 0.1, –yn = 0.281, –2yn = – 0.018 and so on.
 dy  1 
0.281 + (− 0.018) + (0.005) + (−0.001) + (− 0.001) = 2.732
1 1 1 1
∴   = 
 dx xn 0.1  2 3 4 5 
...(7)
 d y
2
1  − 0.018 + 0.005 + 11 (− 0.001) + 5 (− 0.001)  = − 1.475
and  dx2  = (0.1)2  12 6  ...(8)
nx
Finite Differences, Numerical Differentiations and Integrations 899

Example 48: A slider in a machine moves along a fixed straight rod. Its distance x cm
along the rod is given below for various values of the time t seconds. Find the velocity
and acceleration of the slider when t = 0.3 seconds.
t: 0 0.1 0.2 0.3 0.4 0.5 0.6
x: 30.13 31.62 32.87 33.64 33.95 33.81 33.24

Solution: As the derivatives are required near the middle of variate range, therefore, we
use Stirling’s formula.
The corresponding difference table is as follows:
TABLE 13.38

t f(t) = x ∆ ∆2 ∆3 ∆4 ∆5 ∆6

0.0 30.13
1.49
0.1 31.62 –0.24
1.25 –0.24
0.2 32.87 –0.48 0.26
0.77 0.02 –0.27
t0 = 0.3 33.64 –0.46 –0.01 0.29
0.31 0.01 0.02
0.4 33.95 –0.45 0.01
–0.14 0.01
0.5 33.81 –0.43
–0.57
0.6 33.24

1
µδ5 f (t0 ) − ...
d ( ) 1 1
f ´(t0 ) = f t0 =  µδf (t0 ) − µδ3 f (t0 ) + …(1)
dt t = t0 h 6 30 

1 
δ f (t0 ) − ...
d2 1 4 1 6
and f ´´ (t0 ) = f (t0 ) t = t0 = 2 δ2 f (t0 ) − δ f (t0 ) + …(2)
dt 2
h  12 90 
Here t0 = 0.3, h = 0.1, f(t0) = 33.64
∆x− 1 + ∆x0 (0.77 + 0.31) 
µδf (t0 ) = = = 0.54, 
2 2 
∆ x− 2 + ∆ x− 1 (0.02 + 0.01)
3 3

µδ3 f (t0 ) = = = 0.015,  …(3)
2 2 
∆ x− 3 + ∆ x− 2 (− 0.27 + 0.02)
5 5
µδ f (t0 ) =
5
= = − 0.125
2 2 
δ2 f (t0 ) = − 0.46,
 …(4)
δ4 f (t0 ) = − 0.01, 
δ6 f (t0 ) = 0.29 
1 
(−0.125) = 5.34 cm/sec.
1 1
∴ f ´(0.3) = 0.54 − (0.015) +
0.1 
…(5)
6 30 
900 Engineering Mathematics through Applications

f ´´ (0.3) =
1  − 0.46 − 1 (−0.01) + 1 (0.29) = − 45.6 cm/sec2
and
(0.1)2  12 90  …(6)

Hence, the velocity is 5.34 cm/sec and acceleration is –45.6 cm/sec2.

Example 49: A rod is rotating in a plane. The following table gives the angle θ (radians)
through which the rod has turned for various values of the time t seconds.
t: 0 0.2 0.4 0.6 0.8 1.0 1.2
θ: 0 0.12 0.49 1.12 2.02 3.20 4.67
Calculate the angular velocity and angular acceleration of the rod, when t = 0.6 and
t = 0.7 seconds.
Solution: Form the difference table:
TABLE 13.39

t θ (= f(t)) ∆ ∆2 ∆3 ∆4

0 0
→ 0.12
0.2 0.12 → 0.25
→ 0.37 → 0.01
0.4 0.49 → 0.26 0
→ 0.63 → 0.01
to = 0.6 1.12 = θ0 → 0.27 0
→ 0.90 = ∆θ0 → 0.01
0.8 2.02 → 0.28 = ∆2θ0 0
→ 1.18 → 0.01 = ∆3θ0
1.0 3.20 → 0.29
→ 1.47
1.2 4.67


As here angular velocity, ω = is demanded at t = 0.6 seconds, which is in the middle of
dt
the variate range, we shall follow the method of central differences.
∴ Angular velocity,

dθ 1 
µδ5 f (t) − ...…
1 1
ω= = µδ f (t) − µδ3 f (t) + ...(1)
dt h  6 30 

and angular acceleration,

& =dθ= 1 δ2 ( ) − 1 δ4 ( ) + 1 δ6 ( ) − ...…


2
ω  f t 12 f t 90 f t  …(2)
dt2 h2
Finite Differences, Numerical Differentiations and Integrations 901

(0.63 + 0.90) = 0.765 


1
µ δf (t) =
Here t = 0.6, h = 0.2 and t = 0.6
2  …(3)
1 
µ δ3 f (t) t = 0.6 = (0.01 + 0.01) = 0.01 
2 
δ2 f (t) t = 0.6 = 0.27 

δ f (t)
4
=0 
t = 0.6 

1 
0.765 − (0.01)  = 3.817 radians per sec.
1
Hence, ω = θ& =
0.2 
…(4)
6 

&& =
& =θ
ω
1 0.27 − 1 (0) = 6.75 radians per sec2
(0.2)2  2  …(5)

Alternates: Stirling's formula in forward differences can also be employed:

dθ 1  ∆y + ∆y0 1 ∆3 y−2 + ∆3 y−1 1 ∆5 y−3 + ∆5 y−2 


=  −1 − + + …
dt t = 0.6 h  2 6 2 30 2 

1  0.63 + 0.90 1 0.01 + 0.01  1  1 


= −  = 0.2 0.765 − 6 0.01
0.2  2 6 2
= 3.817 rad/sec.
…(6)
dθ 12
 ∆2 1 4 1 6 
Similarly, =  y− 1 − 12 ∆ y− 2 + 90 ∆ y− 3 − ...
dt2 h2

=
1 0.27 − 1 0  = 6.75 rad/sec2
(0.2)2  12  …(7)

For finding the values of angular valocity (θ& ) and angular accelerarion (&&
θ) at t = 0.7 which
is also approximately in the middle of the given range of the variate but not at the given
values of the variate, we follow the stirling's formula for derivatives viz. equations (10,11),
6.17 (b).
1 2 1
hf ´(a + ph) = µ δ f (a) + p δ2 f (a) + (3p − 1) µδ3 f (a) + (4p3 − 2p) δ4 f (a) + … …(8)
6 24
1
and h2 f ´´ (a + ph) = δ2 f (a) + p µ δ3 f (a) + (12p2 − 2) δ4 f (a) + ...… …(9)
24
Here take a = t0 = 0.6, h = 0.2 so that 0.6 + p × 0.2 = 0.7 or p = 0.5 …(10)
dθ 1
∴ h t = 0.7 = 0.765 + (0.5)(0.27) + (3 × 0.52 − 1)(0.01)
dt 6

h = 0.765 + 0.135 − 0.00125 = 0.89875
dt
902 Engineering Mathematics through Applications

i.e., Angular velocity (θ& ) = 0.89875 = 4.4937 ; 4.50 rad/sec


0.2
d2
and h2 θ = 0.27 + (0.5)(0.01) = 0.275
dt2
0.275
i.e., Angular Acc (&&
θ) = = 6.875 rad/sec2
(0.2)2

Example 50: If y = f(x) and yn denotes f(x0 + nh), derive that if powers of h above h6 be
neglected,
 dy  3 
(y3 – y− 3 ) .
1 1
  = (y1 – y− 1 ) – (y2 – y− 2 ) +
dx  x0 4h  5 45 

Solution: Here y = f(x) simply implies that the variable y depends upon the independent
variable x. Secondly, yn denoting f(x0 + nh) implies that f(x) is a polynomial in x with a
 dy 
restriction that in its expansion in powers of h above h6 are neglected.  dx  indicates the
x0

dy
use of central difference formula for finding the value of the derivative at x = x0 when
dx
the sets of values of (xi, ti) varies from (x–3, y–3) to (x3, y3 ).

 dy 
=  µδy0 − µδ3 y0 + − 
1 1 1
Use,   µδ5 y0 …(1)
dx x = x0 h  6 30 

(E1/2 + E−1/2 ) 1/2 1


Now, µδ = (E − E− 1/2 ) = (E − E− 1 ),
2 2
…(2)

(E1/2 + E−1/2 )
where µ= and δ = E1/2 − E−1/2
2

(E − E− 1 ) 1/2
µ δ3 = (µδ)δ2 =
2
( E − E−1/2 )
2

1 1
= (E − E− 1 )(E −2 + E− 1 ) = (E2 − 2E + 2E− 1 − E− 2 )
2 2

=
2
(E − E−2 ) − 2(E − E− 1)
1 2
…(3)

1 2
µ δ5 = (µδ3 )δ2 = (E − 2E + 2E− 1 − E− 2 )(E − 2 + E−1)
2
Finite Differences, Numerical Differentiations and Integrations 903

1
= (E3 − E− 3 ) − 4 (E2 − E− 2 ) + 5(E − E− 1 
2
…(4)

 dy 
On applying these operators expressions on y0 in the formula of   above, we get
 dx x = x0

 dy  1 1
{
  =  (y1 − y− 1 ) −
dx x0 h  2
1 1
} {
((y − y− 2 ) − 2 (y1 − y− 1))
6 2 2 }
+ {
1 1
30 2
( )}

(y3 − y− 3 ) − 4(y2 − y− 2 ) + 5 (y1 − y− 1 ) 

1  1 1 1   1 + 1  (y − y ) + 1 (y − y ) 
=  + +  (y1 − y− 1) −   2
h   2 6 12 
−2 3 −3 
 12 15  60 

 dy  3  1 1
(y3 − y− 3 )
⇒   =  y1 − y− 1) − (y2 − y− 2 ) + 
 dx x0 4h  5 45

Example 13.40: Find value of cos 1.747, using the value given in the table below:
x: 1.70 1.74 1.78 1.82 1.86
sin x: .9916 .9857 .9781 .9691 .9584 [KUK June 2009]

Solution: Formulate the difference table as below:


TABLE 40

x f(x) = sin x ∆ sin x ∆2 sin x ∆3sinx ∆4sinx

1.70 0.9916
→ –0.0059
1.74 0.9857 → –0.0017
→ –0.0076 → 0.0003
1.78 0.9781 → –0.0014 → –0.0006
→ –0.0090 → –0.0003
1.82 0.9691 → –0.0017
→ –0.0107
1.86 0.9584

Take h = 0.04 so that a + ph = 1.747


implying 1.74 + p(0.04) = 1.747 or p = 0.175

d d dp 1 d 1
Now, cos x = sin x = sin(a + ph) = f (a + ph) = f (a + ph), x = a + ph
dx dp dx h dp h

1
∆f (a) − ∆2 f (a) + ∆3 f (a) − ∆4 f (a) + ……
1 1 1
f ´(a + ph) =
and 
h 2 3 4  (2) ∫ ∫ 6.17(a)
904 Engineering Mathematics through Applications

which implies
1 
− 0.0076 − (− 0.0014) + (− 0.0003) − (−0.0006) + ...…
1 1 1
cos(1.747) =
.04  2 3 4 

1
= − 0.0076 + 0.0007 − 0.0001 − 0.00015 
0.04

1
= − .00715  = − 0.176.
0.04

ASSIGNMENT 7
1. The population of a certain town (as obtained from census data) is shown in the following
table:
Year : 1921 1931 1941 1951 1961
Population : 19.96 39.65 58.81 77.21 94.61
(in thousand)

Estimate the population in the year 1936 and 1963. Also find the rate of growth of
population in 1951?
2. Given sin 0° = 0.0000, sin10° = 0.1736, sin20°= 0.3420, sin30°= 0.5000, sin40°= 0.6428,
(a) Find the value of sin 23°,
dy
(b) Find the numerical value of at x = 10° for y = sin x
dx
d2 y
(c) Find the numerical value of at x = 20° for y = sin x.
dx2

13.18. NUMERICAL INTEGRATION ( NUMERICAL QUADRATURE)


It is the process of evaluating a definite integral from a set of numerical values of the integrand,
f(x). This process when applied to a function of a single variable is termed as quadrature.
The problem of numerical integration is solved by firstly approximating the integrand by
a polynomial with the help of a interpolation formula and then integrating this expansion
between the limits of integration. Finally ,add them up to obtain the integral for the entire
range.
A general quadrature formula for equidistant ordinates is called Newton-Cote’s formula.

Newton-Cote’s Formula
These formulas are the most common numerical techniques based on strategy of replacing a
complicated function or tabulated data with some approximating function that is easy to
integrate. The integral is approximated using the polynomial or a series of polynomial applied
piecewise to the function or data over segments of constant length.
Clearly figures 1,2,3, are the examples where the approximation of an integral by areas (i)
area under a single straight line, (ii) a single parabola (iii) three straight line segments are
Finite Differences, Numerical Differentiations and Integrations 905

used.

f (x ) f (x )

a b x a b x

Fig. 13.1 Fig. 13.2

f (x )

a a1 b1 b x

Fig. 13.3

Figures 13.4 and 13.5 are the clear examples of closed and open Newton-Cote’s formula
respectively
f( x )
f( x )

a b x a b x

Fig. 13.4 Fig. 13.5

Derivation
b

Let I= ∫ f (x) dx ; ∫ f (x) dx


a
n

where fn(x) is a polynomial of degree n. f(x) be defined in the interva1 (a, b) for certain
equidistant values of x say, x0, x1, x2, ......, xn by dividing (b – a) into n equal parts each of
906 Engineering Mathematics through Applications

width h and corresponding yi, as y0, y1, y2 ,...., yn.

y0 y1 y2 yn –1 yn

X
x0 = a x1 x2 xn –1 xn = b = x0 + nh

Fig. 13.6
x0 + nh
Then I= ∫ x0
fn(x) dx


n
=h f (x0 + rh) dr, taking x = x0 + rh so that dx = h dr
0

n
 r(r − 1) 2 r(r − 1)(r − 2) 3 
0
∫
= h  y0 + r ∆y0 +
2!
∆ y0 +
3!
∆ y0 + …… dr
 …(2)

Further, on integrating term by term, we obtain


x0 + nh  n(2n − 3) 2 n(n − 2)2 3 

n
I= f (x) dx = nh  y0 + ∆y0 + ∆ y0 + ∆ y0 + ... …(3)
x0  2 12 24 
This is known as ‘Newton-Cote’s Formula’ in its general form which a number of formulae
can be derived by putting n = 1, 2, 3, … for the curve to be a polynomial of degree 1 (i.e.
straight line), degree 2 (i.e. a parabola particularly), polynomial of degree 3, etc.
Closed and open forms of the Newton-Cote’s formulae are available. The closed forms
are those where the data points at the beginning and end of the limits are known, where as
open forms have integration limits that extends beyond the range of the data, means they
are akin to extrapolation. Newton-Cote’s formulae are primarily used for evaluation of
improper integrals and for the solution of ordinary differential equations.
Particularly, cases of Newton-cote’s Formula for various value of n = 1, 2, 3 etc. are as:

1. Trapezoidal Rule: (Newton-Cote’s Formula for n = 1)


Taking the curve through the sets of values (x0, y0), (x1, y1), …, (xn, yn) as a straight line i.e.,
a polynomial of degree 1.
Suppose f(x) is tabulated for x = a, x = a + h, ......., x = a + (n – 1)h, x = a + nh = b respectively,
then
a+h a + 2h a + nh

∫ ∫ ∫ ∫
b
I= f (x) dx = f (x) dx + f (x) dx + … + f (x) dx …(4)
a a a+ h a + (n −1)h
Finite Differences, Numerical Differentiations and Integrations 907

or I = I1 + I2 + … + In
If we put x = a + rh, dx = h dr
Limits: x = r = 0; x = a + h, r = 1
a+ h

∫ ∫ h f (a + rh) dr,
1
Now f (x) dx =
a 0

By Newton’s Forward formula,


r(r − 1) 2
f (a + rh) = f (a) + r ∆f (a) + ∆ f (a) + …… …(5)
2
a+h
 r(r − 1) 2 r(r − 1)(r − 2) 3 
∫ ∫
1
∴ I1 = f (x) dx =h  y0 + r ∆ y0 + ∆ y0 + ∆ y0 + … …(6)
0  2! 3! 
a

= h  y0 + (y 1 − y0 ) + 0 + 0 ……
1
 2 
(Since the curve passing through x0, x1, x2, ......, xn is a polynomial of Ist degree and hence,
the differences of order higher than first, vanishes.)


I1 = h  y0 + (y1 − y0 ) = (y0 + y1),
1 h

 2  2
x0 + 2h 


h
I2 = h fn(x) dx = (y1 + y2 ), 
2
x0 + h 

………………………………
………………………………
x0 + nh 


h
Similarly, In = fn(x) dx = (yn − 1 + yn ) 
2
x0 +(n −1)h 


Add all above,


h (
I=  y0 + yn ) + 2(y1 + y2 + ... + yn −1 )
2
…(8)

which is called the Trapezoidal formula. Trapezoidal Rule is the simplest formula for numerical
integration, but is also the least accurate.
Observation: Under trapzoidal Rule, the area of each strip is calulated seperately and then the area under
the curve is the sum of the areas of all n trapeziums.

2. Simpson’s One Third Rule (Newton-Cote’s formula for n = 2):


Suppose that the curve y = f(x) is tabulated for x = a, a + 2h, a + 4h, …, a + nh = b passing
through these points represents a parabola, then
908 Engineering Mathematics through Applications

a + 2h a+ 4 h a + nh

∫ ∫ ∫ ∫
b
I= f (x) dx = f (x) dx + f (x) dx + ...... + f ( x) dx
a a a + 2h a + (n − 2)h …(9)
I1 I2 In

a + 2h

∫ ∫
2
Here I1 = f (x) dx = h f (a + rh) dr, taking x = a +rh, dx = hdr
a 0

Limits for x = a, r = 0; for x = a + 2h, r = 2

r(r − 1) 2 r(r − 1)(r − 2) 3


∫  f (a) + r ∆f (a) + ∆ f (a) + …… dr
2
=h ∆ f (a) +
0 2! 3! 

  r2 
2 2
1  r3 r2  2 
= h  y0 (r )0 +   ∆y0 +  −  ∆ y0 + ……
2
 2 0 2 3 2 0 …(10)
 
As the curve passing through the points x0, x1, x2, …, xn is a polynomial of degree 2, hence
the differences of order higher than 2 vanishes.

I1 = h 2y0 + 2(y1 − y0 ) + (y2 − 2y1 + y0 ) + 0 + ..... + 0 


1

 3 

h
= y0 + 4y1 + y2 
3

[y2 + 4y3 + y4 ], 
h
Similarly, I2 =
3 
………………………… 
………………………… 
 …(11)
h
In = [yn −2 + 4yn − 1 + yn]
3 

Adding all these,

∫ ( y0 + yn ) + 4(y1 + y3 + ..... + yn−1) + 2(y2 + y4 + ..... + yn − 2 )


b
h
I= f (x) dx = …(12)
a 3
This important formula which is quite accurate for numerical integration or calculating
quadrature is known as Simpson’s One-third Rule. It is probably the most useful among all
formula for calculating mechanical quadrature.
1
Observations: While applying (12) for simpson’s Rule, the given integral should be divided into even
3
number of equal sub-intervals.
Finite Differences, Numerical Differentiations and Integrations 909

3. Simpson’s Three Eight Rule (Newton-Cote Formula, when n = 3 )


Taking the curve through the sets of values (x0, y0), (x1, y1), … (xn, yn) as a polynomial of
degree three so that the differences of order higher than three vanishes.
Suppose f(x) is tabulated for x = a, x = a + 3h, … a + nh respectively, then
a + 3h a + 6h a + nh

∫ ∫ ∫ ∫
b
I= f (x) dx = f (x) dx + f (x) dx + ...... + f (x) dx …(13)
a a a + 3h a +(n − 3)h
I1 I2 In
a + 3h 3
Now, I1 = ∫ a
f (x) dx = h∫ f (a + rh) dr ;
0
if x = a + rh and dx = h dr
limits are 0 and 3 for x = a and x = a + 3h

 y + r ∆y + r(r − 1) ∆2 y + r(r − 1)(r − 2) ∆3 y + … dr



3
=h  0 0 0 0 
0 2! 3!
3
 r2 ∆2 y0  r3 r2  ∆3 y0  r 4 3r3 2r2  
= h  y0 . r + ∆ y0 +  −  +  − + 
 2 2!  8 4 3!  4 3 2   0 …(14)

(On neglecting differences of order higher than 3)

Similarly, I1 =
3h
[y0 + 3y1 + 3y2 + y3 ], 
8 
3h  …(15)
I2 = [y3 + 3y4 + 3y5 + y6 ], 
8 
…………………………… 
3h 
In = [yn − 3 + 3yn −2 + 3yn− 1 + yn ]
8 
Adding all the above integrals, we get
3h
I= (y0 + yn ) + 3(y1 + y2 + y4 + y5 + … + yn − 2 + yn −1) + 2(y3 + y6 + … + yn − 3 )
8 
…(16)
3
Observations: While calculating the integral by using (16) for simpson's rule, divide the given interval
8
into a multiple of 3.

4. Boole’s Rule
Taking n = 4 in the general formula and neglecting all the differences above the fourth order,
we get
x0 + 4h
 7 4 

5
f (x) dx = 4h  y0 + 2∆y0 + ∆2 y0 + ∆ y0 
0  3 90 
2h
= 7 y0 + 32y1 + 12y2 + 32y3 + 7 y4 
45 
…(17)
Similarly,
x0 + 8 h


2h
f (x) dx = 7y4 + 32y5 + 12y6 + 32y7 + 7y8 
45 
…(18)
x0 + 4h
910 Engineering Mathematics through Applications

and so on
Adding all these integrals from x0 to x0 + nh, we get
x0 + nh


2h
f (x) dx = 7 y0 + 32y1 + 12y2 + 32y3 + 14y4 + 32y5 + 12y6 + 32y7 + 14y8 + ...
x0 45 

2h
45
[7y0 + 32(y1 + y3 + y5 + y7 …) + 12(y2 + y6 + y10 + …) +14(y4 + y8 + …)]
=

…(19)
This is known as Boole’s Rule.
Obeservation: While applying (19) for Boole's Rule, the number of sub-intervals should be taken as mulitple
of 4.

5. Weddle's Rule
Taking n = 6, in the general formula and neglecting all the differences above the sixth order,
we get
x0 + 6h
 ∆ y0 + ...

9 123 4 11 5 1 41 6
f (x) dx = 6h  y0 + 3∆y0 + ∆2 y0 + ∆ y0 + ∆ y0 + …(20)
x0  2 60 20 6 140 

41 6 3 3
If we approximate ∆ y0 as ∆ y0 , we get
140 10
x0 + 6 h


3h
f (x) dx = y0 + 5y1 + y2 + 6y3 + y4 + 5y5 + y6 
10 
…(21)
x0

x0 +12h


3h
f (x) = y6 + 5y7 + y8 + 6y9 + y10 + 5y11 + y12 
10 
Similarly, …(22)
x0 + 6h

and so on.
Add all these expression for x0 to x0 + nh, with n as multiple of 6, we get
x0 + nh


3h
f (x) dx = y0 + 5y1 + y2 + 6y3 + y4 + 5y5 + 2y6 + 5y7 + y8 + ...…
x0 10 
3h n
∑ kyn = …(23)
10 0
where k = 1, 5, 1, 6, 1, 5, 2, 5, 1, 6, 1, 5,2, etc.
This formula is known as Weddle’s rule.
It is more accurate in general, than Simpson’s Rule, but it requires at least seven consecutive
values of the function.
The geometrical meaning of Weddle’s Rule is that we replace the graph of the given
function by n/6 arcs of fifth-degree polynomials.
Obeservation: While applying (23), for weddle's Rule, the number of sub-intervals should be taken as a
multiple of 6.
Finite Differences, Numerical Differentiations and Integrations 911

Example 52: A river is 80 ft. wide. The depth d in feet at a distance x ft. from one bank is
given by the following table:
x 0 10 20 30 40 50 60 70 80
d 0 4 7 9 12 15 14 8 3
If h = 10 ft, find the approximate area of cross-section of river.

Solution: Using trapezoidal rule, the approximate area enclosed by the curve
h
A= (y0 + y8 ) + 2(y1 + y2 + ... + y7 )
2

=
10
2
[3 + 2(4 + 7 + 9 + 12 + 15 + 14 + 8)]
= 5[3 + 138] = 705 sq. ft. …(1)
1
By Simson’s Rule, approximate area,
3
h
A = (y0 + y8 ) + 4(y1 + y3 + y5 + y7 ) + 2(y2 + y4 + y6 )
3
10
= [.3 + 4 × 36 + 2 × 33] = 710 sq. ft. …(2)
3
3
By Simpson's Rule, the approx value of the integral
8
3h
A= (y0 + y8 ) + 3(y1 + y2 + y4 + y5 + y7 ) + 2(y3 + y6 )
8 
3 × 10 30
= [ 3 + 3 × 46 + 2 × 23] = [3 + 138 + 46] = 701.25. …(3)
8 8

π /2
Example 13.42: Calculate Aprroximate value of ∫0 sin x dx by

1
(i) Trapezoidal Rule (ii) Simpson Rule, using 11 ordinates.
3

Solution: Divide the range 0 to π/2 into 10 equal parts, so that


π π
h = 9° = 9 × =
180 20
Now
3π 3π
x0 = 0°, y0 = sin 0 = 0.000; x6 = , y6 = sin = 0.8090;
10 10
π π 7π 7π
x1 = , y1 = sin = 0.1564; x7 = , y7 = sin = 0.8910;
20 20 20 20
π π 2π 2π
x2 = , y2 = sin = 0.3090; x8 = , y8 = sin = 0.9511;
10 10 5 5
912 Engineering Mathematics through Applications

3π 3π 9π 9π
x3 = , y3 = sin = 0.4540; x9 = ; y9 = sin = 0.9817;
20 20 20 20
π π π π
x4 = , y4 = sin = 0.5878; x10 = , y10 = sin = 1.0000;
5 5 2 2
π π
x5 = , y5 = sin = 0.7071;
4 4
By Trapezoidal Rule, the approximate value of the integral is
π /2

∫ [(y0 + y10 ) + 2(y1 + y2 + … + y9 )]


h
sin x dx =
0 2

π 1
=
20 2
[(0.0 + 1.0) + 2(5.8531)] = 0.9981 …(1)

1
By Simpson’s Rule, approx. value of the integral is
3

=
h
3
[(y0 + y10 ) + 4(y1 + y3 + … + y9 ) + 2(y2 + y4 + … + y8 )]
π 1
=
20 3
[(0.0 + 1.0) + 12.7848 + 5.3138 ] = 0.0524 × 19.0986
= 1.0006 …(2)
π /2
Whereas, the actual value of ∫ 0 sin x dx = 1

1
The error in calculating value by Simpson‘s Rule is 0.0006 whereas by Trapezoidal rule
3
is 0.0019.
1
Thus, there is more accuracy in Rule.
3

Example 53: Employ Simpson’s Rule to calculate approximately the value of π from


1
dx
by dividing the interval (0, 1) into 4 equal parts.
0 (1 + x2 )
3
Also, find values of π by Simpson’s Rule as well as by Weddle's Rule.
8
[NIT Kurukshetra, 2008]

1
Solution: Divide (0, 1) into 4 equal parts with each parts having interval length as .
4
Finite Differences, Numerical Differentiations and Integrations 913

For x0 = 0, y0 = 1 = 1.0000;
1 16
1 y1 = = = 0.9412;
x1 = , 1+
1 17
4 16
1 4
1 y2 = = = 0.8000;
x2 = , 1+
1 5
2 4
1
3 y3 = = 0.6400;
x3 = , 1+
9
4 16
1 1
x4 = 1, y4 = = = 0.5000;
1+1 2
1
∴ By Simpson’s Rule
3


1
h (y + y ) + 4(y + y + … + y ) + 2(y + y + … + y )
y(x) dx =  0 n− 2 
3 
n 1 3 n− 1 2 4
0

× [(1 + 0.5000) + 4(0.9412 + 0.6400) + 2(0.8000)]


1 1
=
4 3
1
= [1.5000 + 6.3248 + 16000] = 0.7854
12
1
π π

1
1
Also dx = ( tan x ) = tan−1 1 − tan−1 0 = − 0 =
0 1 + x2 0 4 4
On equating the two values, we get
π or π = 3.1416 approximately.
= 0.7854
4

Example 54: A reservoir discharging water through sluices at a depth h below the water
surface area A for various values H as given below:
H ft : 10 11 12 13 14
A(sq.ft.) : 950 1070 1200 1350 1530

dH − 48H
If t denotes time in minutes, the rate of fall of the surface is given by = .
dt A
Estimate the time taken for the water level to fall from 14 to 10 ft. above the sluices
[NIT Krukahetra, 2003]

b 14
Solution: Here we find, I = ∫ f (x) dx = ∫ A dh
a 10
914 Engineering Mathematics through Applications

1
By Simpson’s rule,
3
14
∫ A dH = [(y0 + yn ) + 4(y1 + y3 + …) + 2(y2 + y4 + …)]
h
10 3

where h = 1,
y0 = 950
yn = 1530
;} y1 = 1070
y3 = 1350}; y2 = 1200

14
1
∴ ∫ AdH = [(950 + 1530) + 4(1070 + 1350) + 2 × 1200]
10 3

1 14560 cubic fts. (volume)


= [2480 + 4 × 2420 − 2 × 1200] =
3 3

dH 48H A dH
Now given, =− or = dt
dt A − 48 H

∫ ∫
1
⇒ A dH = dt
−48H

When H = – 4 (water level falls from the 14 ft. to 10 ft.) then,


1 1 14560
− AdH = t ⇒ t= × = 25.27 secs.
48(−4) 48 × 4 3

Example 55. Compute the value of the integral

∫ ∫
1.4 1
y(x) dx = (sin x – loge x + ex ) dx using (i) Trapezoidal (ii) Simpson’s Rule
0.2 3
3
(iii) Simpson's Rule (iv) Weddle’s Rule, and show that among all the four Rule, the
8
value obtain by trapezoidal are the least accurate and that by Weddle's Rule are the most
accurate.
Solution: We divide the interval of integration into twelve equal parts by taking y = sinx –
loge x + ex and h = 0.1, so that the values y’is corresponding xi’s are as follows:
xi yi
x0 = 0.2 y0 = 3.02950;
x1 = 0.3 y1 = 2.84935;
x2 = 0.4 y2 = 2.79753;
x3 = 0.5 y3 = 2.82130;
x4 = 0.6 y4 = 2.89759;
x5 = 0.7 y5 = 0.01464;
x6 = 0.8 y6 = 0.16604;
x7 = 0.9 y7 = 3.34830;
x8 = 1.0 y8 = 3.55975;
Finite Differences, Numerical Differentiations and Integrations 915

x9 = 1.1 y9 = 3.80008;
x10 = 1.2 y10 = 4.06984;
x11 = 1.3 y11 = 4.37050;
x12 = 1.4 y12 = 4.70418;
(i) By Trapezoidal Rule,
0.1
I= (3.02950 + 4.70418) + 2(2.84935 + …)
2 
1
= (7.73368) + 2(36.69492) = 4.05617 …(1)
20
1
(ii) By Simpson’s Rule,
3

I= [ y0 + yn ) + 4(y1 + y3 + … + yn −1) + 2(y2 + y4 + … + yn −2 )]


h (
3
0.1
= [(3.02950 + 4.70418) + 4(2.84935 + … + 4.37050)
3
+2(2.79753 + … + 4.06984)]
1
= 7.73368 + 4(20.20417) + 2(16.49075)
30 
1
= [121.53186 ] = 4.05106 …(2)
30
3 3h
(iii) By Rule, I = (y0 + yn ) + 3(y1 + y2 + yn − 2 + yn −1) + 2(y3 + y6 + … + yn − 3 )
8 8 
3(0.1)
= 7.73368 + 3(26.90750) + 2(9.78742)
8 
= 4.05116
(iv) By Weddle’s Rule,
I=
3h
10
[(y0 + yn) + 5(y1 + y5 + y7 + y11) + (y2 + y4 + y8 + y10 ) + 2y6 + 6(y3 + y9 )]
3
= [7.73368 + 5(13.58879) + 13.32471 + 2(3.16604) + 6(6.62138)]
100
= 4.05098
On direct evalution,
1.4
1.4
I = ∫ (sin x − loge x + ex ) dx = − cos x − x(loge x − 1) + ex 0.2
0.2

I = 4.05094 …(5)
Therefore, we see that Trapezoidal Rule is the least and Weddle's Rule is the most accurate
among all the above stated 4 Rules.
916 Engineering Mathematics through Applications

Weddle's rule is simple in form and very accurate, it has the disadvantage of requiring
that the number of sub-divisions be a multiple of six.This mean that when computing the
values of y in many problems the assigned values of x cannot be taken as a simple tenth as
done in other cases. However, when Simpson’s rule cannot give desired degree of accuracy,
use Weddle’s Rule.

Example 56: A Solid of revolution is formed by rotating about the X-axis the area between
the X-axis, the line x = 0 and x = 1 and a curve through the points with the following
coordinates
x: 0.00 0.25 0.50 0.75 1.00
y: 1.0000 0.9896 0.9589 0.9089 0.8415
Estimate the volume of solid formed.

Solution: We know that the volume of the solid formed,


1
V = ∫ π y2 dx
0

Hence, we need to calculate the values of y2. The values of y2 correct upto four decimal
places are as follows:
x : 0.00 0.25 0.50 0.75 1.00
y2 : 1.0000 0.9793 0.9195 0.8261 0.7081
1
Taking h = 0.25, and using Simpson’s Rule,
3
π(0.25)
V=
3
[1.0000 + 4(0.9793 + 0.8261) + 2(0.9195 + 0.7081)]
= 2.8192 units.

13.19. GAUSS’S QUADRATURE FORMULA


The most accurate of the quadrature formula in ordinary use is known as Gauss’s Formula.
In the preceeding sections, we discussed some integration formulae which require values of
the function at equally spaced points of interval but situation arises where subdivisons need
not be equal for better results. This notion is due to Gauss’s, under which ordinates are
symmetrically placed with respect to the mid-point of the interval of integration [a, b] with
unequal subinterval lengths to give greatest possible accuracy.

Derivation
b
Let I = ∫ y dx be the integral to be computed,
a

where y = f(x).
Changing the variable by the substitution
Finite Differences, Numerical Differentiations and Integrations 917

a+b
x = (b − a) t + …(1)
2
1 1
So that the limits of integration are − and .
2 2
With the above value of x, y = f(x) becomes
a+b
y = f  (b − a)t +  = φ(t), say …(2)
 2 
1/2
and I = (b − a) ∫ φ(t) dt …(3)
−1/2

= [W1 φ(t1) + W2 φ(t2) + … + Wn φ(tn)] …(4)


Wi and ti are called weights and abscissae which are symmetrical about the mid-point of
1 1
the interval ti,'s i.e., t1, t2, …, tn are the points of subdivison of the interval t = − to t = .
2 2
Assuming φ(t) in convergent power series form as:
Similarly, φ(t) = a0 + a1t + a2 t2 + a3 t3 + … + amtm + … 

φ(t1 ) = a0 + a1t1 + a2 t12 + a3 t13 + … + amt1m + …  …(5)
φ(t2 ) = a0 + a1t2 + a2 t22 + a3t23 + … + am t2m + … and so on 
 1  1 
As here in the problem (b − a) =  −  −   = 1, so that integral
 2  2 
1/2 1/2
I = ∫ φ(t) dt = ∫ (a0 + a1t + a2 t2 + … + am tm + …) dt
− 1/2 − 1/2

a2 a a a
= a0 + + 4 + 6 + 8 + …… …(6)
12 80 448 2304
(since on integration odd terms vanishes )
Substituting the values of φ(t1), φ(t2), … etc. in equation (4), we get
I = W1 (a0 + a1t1 + a2t21 + … +amtm1 + …)
+ W2 (a0 + a1t2 + a2t22 + … +amtm
2
+…) …(7)
…..……………………………………
+ Wn(a0 + a1tn + a2tn2 + …amtnm + …)
On rearranging, we get
I = a0 (W1 +W2 + W3 + … + Wn) + a1 (W1t1 + W2t2 + … + Wntn)
+ a2 (W1t12 + W2t22+ … + Wntn2)
……………………………………… …(8)
+ am (W1t1m + W2t2m + … + Wntnm)
918 Engineering Mathematics through Applications

On comparing the value of the integral I, from equations (6) and (8) we get

W1 + W2 + …Wn = 1, 
W1t1 + W2 t2 + …Wntn = 0, 
1 
W1t12 + W2 t22 + …Wntn2 = , 
12 
W1t13 + W2 t23 + …Wntn3 = 0, 
1 
W1t1 + W2t2 + …Wntn =
4 4 4
, 
…(9)
80 
………………………………… 
………………………………… etc.
By taking 2n of these simultaneous equations and solving them, it is, however, possible
theoretically to find values t1, t2, …, tn and W1, W2, …, Wn but practically it is extremely
difficult and hence alternate techniques are employed.
If φ(t) is a polynomial of degree not higher than (2n – 1), then t1, t2, …, tn are the zero of
the Legendre Ploynomial Pn(t) or the roots of the equation
n
dn  2  1  
2
 − =0
 2 
t …(10)
dtn  
These n roots t1, t2, …, tn of this nth degree equation are real in nature and in turn we can
find p's. The above equation can be discussed for various value of n.
Particular case, when n = 3.
3
d3  2  1 2  1 dn 2
 t −    = 0, comparable to Pn(x) = n (x − 1)n
dt3  2  2 n ! dxn

6
d3 41
2
2 1
4
1  = 0
6

or  t − 3t   + 3t −
    …(11)
dt3
 2 2 2 
On simplification, we get
1 3
t (20t 3 − 3) = 0 i.e., t = 0 t=± …(12)
2 5
1 3 1 3
Hence , t2 = 0, t3 =
t1 = −
2 5 2 5
Then from first three equations in (9), we get
P1 + P2 + P3 = 1

 1 3  1 3 
P1  −  + P3  =0
 2 5  2 5  

2 2 
 1 3  1 3 1 …(13)
P1  − + =
 2 5  3
 2 5 
P
12 

On solving these equation, we get


Finite Differences, Numerical Differentiations and Integrations 919

5 4 5
P1 = ,P = ,P = …(14)
18 2 9 3 18
Hence for t's the points of divison, we designate t0 as the mid-point of the interval and t±1
for the pair of symmetric points nearest to the mid-point and t±2 the next pair of symmetric
points, etc.

ASSIGNMENT 8

∫ 1 + x dx to six decimal places, using Simpson’s rule.


1
1
1. Compute
0

(KUK, 2000; BITS Ranchi, 2001)


2. A slider machine moves along a fixed straight rod. Its distance x cm along the rod is
given below for various values of time t seconds. Find the velocity of the slider when
t = 0.3 seconds.
t: 0 0.1 0.2 0.3 0.4 0.5 0.6
x: 30.13 31.62 32.87 33.64 33.95 33.81 33.24
(BITS, Rachi 2001)

ANSWERS

Assignment 1

1. (i) (a – 1)n ax (ii) ( )


1 − 2 sin x + 1 sin
2
1
2

1 x
3. [x] + 3[x]3 + 4[x] + c
2
4. y1 = 2.925, y3 = 0.225

Assignment 2
8. (i) 25x2 + 54x + 57
(ii) {[(x + 2)2 + (x + 2) + [(x – 2)2 + (x – 2) + 1] – 2(x2 + x + 1)}
(iii) –x(x + 3)

Assignment 3
1. 10, 22 2. 352, 219
2 4 100 2
3. y = x − 8x 3 + x − 56x + 31 4. u1 = 0.1, u10 = 100
3 3
5. 14706 Approx.
920 Engineering Mathematics through Applications

Assignment 4
1. x3 – 3x2 + 5x – 6 2. x5 – 9x4 + 18x2 – x2 + 9x – 19
3. 2.4786

Assignment 5
1. 395 2. 3250.875
4. 0.9205 5. 16.9216 Aprrox.

Assignment 6
1. 0.73811340.

Assignment 7
1. 49.30, 97.68; 1.8 Thausand/hr. 2. (a) 0.3907; (b) 0.9848; (c) 0.342

Assignment 8
1. 0.693147 2. 5.4 cm/sec.
 Ordinary Differential Equation
◦ Euler’s Method
◦ Euler’s Modified Method
◦ Predictor Corrector Method

2
The solution of ordinary differential equation means finding
an explicit expression for y in terms of a finite number of
elementary functions of x.

dy
 f ( x, y ), y( x0 )  y0
dx

3
dy
Consider the O.D.E y 
'
 f ( x, y ) …….(1)
dx
such that y( x0 )  y0

Let us divide LM into n sub intevals each of width h L1, L2, …..Ln
In the interval LL1, we approximate the curve by the tangent at P.
If the ordinate through L, meets this tangent in P1(x0+h,y1), then
y1=L1P1
y1=L1R1+R1P1
=y0+PR1 tanθ
y1 =y0+h tanθ
y1 =y0+h (dy/dx)p
y1 =y0+h f(x0,y0)

4
Q
y2 Slope=f(x1,y1) y2=y1+hf(x1,y1)

hf(x1,y1)
Slope=f(x0,y0)
P1
y1 y1=y0+hf(x0,y0)
hf(x0,y0)
θ
Y0 P

x0 x1 xn x
h h
L L1 M

5
Let P, Q be the curve of eq (1) through P1 and let its tangent at P1
Meet the ordinate through L2 in P2 (x0+2h,y2)

y2 =y1+h f(x1,y1)

Repeating this process n times, we finally reach on the approximation


of MQ

yn =yn-1+h f(xn-1,yn-1)

6
Q
y2 Slope=f(x1,y1) y2=y1+hf(x1,y1)

hf(x1,y1)
Slope=f(x0,y0)
P1
y1 y1=y0+hf(x0,y0)
hf(x0,y0)
θ
Y0 P

x0 x1 xn x
h h
L L1 M

7
(x1,y1)
B T T2
y1
T’
T1
P1
Y1(1)
D f(x1,y1(1))
θ
Y0 A

x0 x1
h
y-y0=(x-x0){f(x0,y0)+f(x1,y1(1))}/2
Yn-yn-1=(xn-xn-1){f(xn-1,yn-1)+f(xn,yn(1))}/2
Yn=yn-1 +(h/2){f(xn-1,yn-1)+f(xn,yn(1))}
8
dy
y 
'
 f ( x, y )
Consider the O.D.E dx …….(1)

such that y( x0 )  y0

Euler’s Method, yn =yn-1+h f(xn-1,yn-1)

Euler’s Modified Method, (yn)(m) =yn-1+(h/2)[ f(xn-1,yn-1)+f(xn,yn m-1 )]

9
Euler’s Method, yn =yn-1+h f(xn-1,yn-1) …..(1)

Euler’s Modified Method,

(yn)(m) =yn-1+(h/2)[ f(xn-1,yn-1)+f(xn,yn m-1)] ……(2)

Suppose we have to calculate y at x=0.2


So first we will calculate the value of y(0.2) using Euler’s Method.

Further, we will modify it using Euler modified method.

In eq(2), m is modified iteration.

10
We have y’=f(x, y) = (x+y2),

With x0 = 0, y0 = 1

And h=0.1

11
By Euler’s method,

with , x0  0, y0  1., h  0.1


First iteration x1  0.1
y ( x1 )  y0  hf ( x0 , y0 )
y ( x1 )  y0  0.1( x0  y02 )
y (0.1)  y1  y 0  0.1( x0  y02 )
y1  1  0.1(0  1)
with , x1  0.1, y1  1.1

12
Euler’s Modified method.
h
y m ( xn )  yn 1  [ f ( xn 1 , yn 1 )  f ( xn , ynm 1 )
2
Now, by Euler’s Modified , put n=1 and m=1
h
y1 (0.1)  y0  [ f ( x0 , y0 )  f ( x1 , y10 )
2
0.1
y (0.1)  y0 
1
[( x0  y02 )  ( x1  ( y10 ) 2 )
2
0.1
y (0.1)  1 
1
[(0  12 )  (0.1  (1.1) 2 )
2
y1 (0.1)  1.1155

13
Second iteration, By Euler’s method,

with , x1  0.1, y1  1.1155, h  0.1


x2  0.2
n2
y ( xn )  y n 1  hf ( xn 1 , y n 1 )
y ( x2 )  y1  0.1( x1  y12 )
y (0.2)  y 2  y1  0.1( x1  y12 )
y (0.2)  y 2  1.1155  0.1[0.1  (1.1155) 2 ]  1.2499
at , x2  0.2, y 2  1.2499

14
Second iteration, Euler’s Modified method
h
y m ( xn )  yn 1  [ f ( xn 1 , yn 1 )  f ( xn , ynm 1 )
2
Now, by Euler’s Modified , put n=2 and m=1
h
y1 (0.2)  y1  [ f ( x1 , y1 )  f ( x2 , y20 )
2
0.1
y (0.2)  y1 
1
[( x1  y12 )  ( x2  ( y20 ) 2 )
2
0.1
y (0.2)  1.1155 
1
[(0.1  1.11552 )  (0.2  (1.2499) 2 )
2
y1 (0.2)  1.2708

15
Second modification

Now, by Euler’s Modified , put n=1 and m=2


h
y ( xn )  yn 1  [ f ( xn 1 , yn 1 )  f ( xn , ynm 1 )
m

h
y (0.2)  y1  [ f ( x1 , y1 )  f ( x2 , y12 )
2

16
Consider the O.D.E dy …….(1)
y 
'
 f ( x, y )
dx
such that y( x0 )  y0

To find y at given x.

This method is made of two separate methods called


predictor and corrector.

http://numericalmethods.eng.usf.edu 17
Consider the O.D.E dy …….(1)
y 
'
 f ( x, y )
dx
such that y( x0 )  y0

To find y at given x.

Note: use atleast 4 iterations to reach x.

http://numericalmethods.eng.usf.edu 18
Step-1 Consider the data points, x0, x1=x0+h, x2=x0+2h,……,
Calculate the value of y1=y(x1), y2=y(x2), ….using any one of the
following methods:
Euler’s ,method, Euler’s modified method, Taylor’s method,
Picard’s method. This will give y=f(x,y)
Step-2 Now find the value of
y’1=f(x1,y1), y’2=f(x2,y2), y’3=f(x3,y3)
Step-3 By Milne’s Predictor formula
y4=y0+(4h/3) (2y1’-y2’+2y3’)
find y4’=f(x4,y4)
Step-4 By Milne’s Corrector formula
y4=y2+(h/3) (y2’+4y3’+y4’)

19
Now repeat this step 3 & 4 again to find y5.
To calculate y5
Find y4’,

Step-3 By Milne’s Predictor formula


y5=y1+(4h/3) (2y2’-y3’+2y4’)
find y5’=f(x5,y5)
Step-4 By Milne’s Corrector formula
y5=y3+(h/3) (y3’+4y4’+y5’)

20
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you
 Ordinary Differential Equation
◦ Predictor Corrector Method
◦ Runge Kutta Method

2
The solution of ordinary differential equation means finding
an explicit expression for y in terms of a finite number of
elementary functions of x.

dy
 f ( x, y ), y( x0 )  y0
dx

3
Consider the O.D.E dy …….(1)
y 
'
 f ( x, y )
dx
such that y( x0 )  y0

To find y at given x.

This method is made of two separate methods called


predictor and corrector.

4
Consider the O.D.E dy …….(1)
y 
'
 f ( x, y )
dx
such that y( x0 )  y0

To find y at given x.

5
Step-1 Consider the data points, x0, x1=x0+h, x2=x0+2h,……,
Calculate the value of y1=y(x1), y2=y(x2), ….using any one of the
following methods:
Euler’s ,method, Euler’s modified method, Taylor’s method,
Picard’s method. This will give y=f(x,y)
Step-2 Now find the value of
y’1=f(x1,y1), y’2=f(x2,y2), y’3=f(x3,y3)
Step-3 By Milne’s Predictor formula
yn+1=yn-3+(4h/3) (2yn-2’–yn-1’+2yn’)
y4=y0+(4h/3) (2y1’-y2’+2y3’)
find y4’=f(x4,y4)
Step-4 By Milne’s Corrector formula
yn+1=yn-1+(h/3) (yn-1’+4yn’+yn+1’)
y4=y2+(h/3) (y2’+4y3’+y4’)

6
Now repeat this step 3 & 4 again to find y5.
To calculate y5
Find y4’,

Step-3 By Milne’s Predictor formula


y5=y1+(4h/3) (2y2’-y3’+2y4’)
find y5’=f(x5,y5)
Step-4 By Milne’s Corrector formula
y5=y3+(h/3) (y3’+4y4’+y5’)

7
We have y’=f(x, y) = x-y2, x0 = 0, y0 = 0

Take , h=1/5=0.2

dy
y 
'
 x  y2
dx
y(0)  1

8
xn

y n  y0  
x0
f ( x, y n 1 ) dx

0.2

By Picard’s method. y1  y0  
0
f ( x, y0 ) dx

0.2
y1  0    2
( x y 0 ) dx
0
0.2
y1  0   ( x  0)dx
0

x2
y1 
2
x
y 2  y0   f ( x, y1 ) dx
0
x
y 2  0   ( x  y12 ) dx
0 9
By Picard’s method. x   x 2 2 
y2  0    x    dx
 2  
0
  
x
 x 
4
y2  0    x  dx
0
4 
x 2 x5
y2  
2 20
x 2 x5
so, y  
2 20
0.2 2 0.25
x1  0.2, y1    0.02
2 20
x2  0.4, y2  0.0795, x3  0.6, y3  0.176
10
x1  0.2, y1  0.02
y1'  f ( x1 , y1 )
y1'  ( x1  y12 )  0.2  (0.02) 2  0.1996
x2  0.4, y2  0.0795
y2'  x2  y22  0.3937
x3  0.6, y3  0.176
y3'  x3  y32  0.5690

11
By Milne’s Predictor formula
y4=y0+(4h/3) (2y1’-y2’+2y3’)
= 0.3049
find y4’=f(x4,y4)=x4-(y4)2=0.8-(0.3049)2=0.707

By Milne’s Corrector formula


y4=y2+(h/3) (y2’+4y3’+y4’)
=0.0795+(0.2/3)(0.3937+4*0.5690+0.707)
=0.3043

12
At x4=0.8, y4=0.3043
Now, y4’=f(x4,y4)=x4-(y4 )2 =0.7074

By Milne’s Predictor formula


y5=y1+(4h/3) (2y2’-y3’+2y4’)
= 0.4554
find y5’=f(x5,y5)=x5-(y5)2=1-(0.4554)2=0.7926

By Milne’s Corrector formula


y5=y3+(h/3) (y3’+4y4’+y5’)
=0.176+(0.2/3)(0.5690+4*0.7074+0.7926)
=0.4554

13
Consider the O.D.E dy …….(1)
y 
'
 f ( x, y )
dx
such that y( x0 )  y0

To find y at given x.

Note: for proof as we discussed in class you can see jain


and lynger book.

14
Consider the O.D.E dy
y 
'
 f ( x, y ) …….(1)
dx
such that y( x0 )  y0 , To find y at given x.

Yn+1=yn+1/6(k1+2k2+2k3+k4)
For xn+1=xn+h, n=0, 1, 2, 3, ……

Where,
k1=hf(xn,yn)
k2=hf(xn+h/2, yn +k1/2)
k3=h f(xn+h/2, yn +k2/2)
k4=h f(xn+h, yn +k3)

15
dy y 2
 x 2
Consider the O.D.E y'   2
dx y  x 2
such that y(0)  1 , find y at x=0.2 and 0.4.

dy y 2
 x 2
Solution: We have, y'   2
dx y  x 2
Taking h=0.2, x0=0, x1=x0+h=0+0.2=0.2, x2=0.4

By R.K method, put n=0


yn+1=yn+1/6(k1+2k2+2k3+k4), …….(1)
for xn+1=xn+h, n=0, 1, 2, 3, ……
Where,
k1=hf(xn,yn)
k2=hf(xn+h/2, yn +k1/2)
k3=h f(xn+h/2, yn +k2/2)
k4=h f(xn+h, yn +k3)
16
dy y 2
 x 2

Consider the O.D.E y'   f ( x, y )  2


dx y  x2
such that y(0)  1 , find y at x=0.2 and 0.4.
We have, dy y 2
 x 2
'
y  
dx y2  x2
Taking h=0.2, x0=0, x1=x0+h=0+0.2=0.2, x2=0.4

By R.K method, put n=0


y1=y0+1/6(k1+2k2+2k3+k4), …….(1)
for x1=0.2
Where,
k1=hf(x0,y0) = 0.2 f(0, 1) = 0.2
k2=hf(x0+h/2, y0 +k1/2)= 0.2 f(0.1, 1.1) = 0.19672
k3=h f(x0+h/2, y0 +k2/2)= 0.2f(0.1, 1+ 0.19672/2) = 0.1967
k4=h f(x0+h, y0 +k3) = 0.2f(0.2, 1+ 0.1967 ) = 0.1891
17
y1=y0+1/6(k1+2k2+2k3+k4), …….(1)
for x1=0.2
Where,
k1=hf(x0,y0) = 0.2 f(0, 1) = 0.2
k2=hf(x0+h/2, y0 +k1/2)= 0.2 f(0.1, 1.1) = 0.19672
k3=h f(x0+h/2, y0 +k2/2)= 0.2f(0.1, 1+ 0.19672/2) = 0.1967
k4=h f(x0+h, y0 +k3) = 0.2f(0.2, 1+ 0.1967 ) = 0.1891

Use these values in eq. (1)

y1=y0+1/6(k1+2k2+2k3+k4)

= 1+1/6(0.2+2* 0.19672+2* 0.1967+ 0.1891) =1.19599

18
By R.K method, put n=1 in eq(1)
y2=y1+1/6(k1+2k2+2k3+k4),

for x2=0.4
Where,
k1=hf(x1,y1) = 0.2 f(0.2, 1.196) = 0.1891
k2=hf(x1+h/2, y1 +k1/2)= 0.2 f(0.2+0.2/2, 1.196+0.1891/2) = 0.1795
k3=h f(x1+h/2, y1 +k2/2)= 0.2f(0.2+0.2/2, 1.196+ 0.1795/2) = 0.1793
k4=h f(x1+h, y1 +k3) = 0.2f(0.2+0.2, 1.196+ 0.1793 ) = 0.1688

Use these values in eq. (1)

y2=y1+1/6(k1+2k2+2k3+k4)

= 1.196+1/6(0.1891+2* 0.1795+2* 0.1793+ 0.1688) =?


19
20
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.

2. Numerical Analysis by Richard L. Burden.

3. Introductory methods of Numerical analysis by S.S. Sastry.


Thank you

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy