Numerical Analysis Notes
Numerical Analysis Notes
Numerical Analysis Notes
to
Numerical Computing
Suggested Readings:
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:
Relative errors
percentage errors
Error= True value (X)- approximate value (X1)
ER = 0.005/0.51 =0.98
Example: Numerical Errors Analysis
x 3 3x 2 6 x 8 0
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
3. Secant Method
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:
|b-a|
2n ≥ --------
ε
n loge(2) ≥ log (|b-a| / ε)
n ≥ log (|b-a| / ε) / loge(2)
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)
(y2-y1)
y-y1 = ---------- (x-x1) ……..(1)
(x2-x1)
f(b) –f(a)
y-f(a) = ----------- (x- a) ……………(2)
b-a
f(a)
x = a- ----- (b- a) ……………….(4)
f(b) –f(a)
3. Secant Method
(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 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
Second approximation,
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.
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
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.
3. 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
2! xi+1 xi
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 )
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
xn1 xn 2
2
, n 0,1,2....
3x - 5
n 3x - 5
n
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.
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
p2
Find the rate of Convergence of Secant Method.
Suggested books
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
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 )
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 xn1 )
............. yn
( xn x0 )( xn x1 ).....( xn xn1 )
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)
9
Given the values
x f(x)
5 150
7 392
11 1452
13 2366
17 5202
10
3
f ( x) Li ( x) f ( xi )
i 0
11
1. The following table is given
X 0 1 2 5
f(x) 2 3 12 147
12
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
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.
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
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
7
x0=0, x1=1, x2=2, x3=5
f(x0)=2, f(x1)=3, f(x2)=12, f(x3)=147
8
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
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)
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
8
x0=0, x1=1, x2=3
f(x0)=1, f(x1)=3, f(x2)=55
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
10
Given the values
x f(x)
0 2
1 3
2 12
5 147
11
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
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
4
It is defined as
For example
5
It is defined as
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
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
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
.
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
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
29
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
Ax=b
A Matrix is an array of numbers:
4 10 5
A
5 12 20
Ax=b
For the given system of linear equations, we have
[A | b] : Augmented matrix
17
Systems of Linear Equations
Graphing a system of two linear equations in two
unknowns gives one of three possible situations:
3x+y=17
4x-y=18
Systems of Linear Equations
3x+2y=5
6x+4y=8
Systems of Linear Equations
•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
bn
xn
U nn
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
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'
. . .
. . .
. . .
End of Step 1
Step 2
Now eliminate x2 from the last (n-2) equations.
n 1 n 1
ann xn bn
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 n1
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)
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
2x+3y+z=9
x+2y+3z=6
3x+y+2z=8
39
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
Ax=b
Factorization method or Decomposition or
Triangularisation or LU Decomposition method
A=LU
Where, L=lower triangular matrix and U=upper triangular matrix
Choose either
1) lii =1, i=1, 2, 3, ……n, called Do-little method.
A LU
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
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 LU
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…)
We have, 2 3 1
A 1 2 3
3 1 2
A LU orLU A
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
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
21
Practice Problems
22
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
det(A - I) = 0
4
1 -2 1 - -2
A= 3 -4 so A - I = 3 -4 -
Set 2 + 3 + 2 to 0
1 -2 x1 = -1 x1 so
x1 – 2x2 = -x1
3 -4 x2 x2 3x1 – 4x2 = -x2
6
Since x1 = x2, we can represent all eigenvectors for eigenvalue -1
as multiples of a simple basis vector:
1 -2 x1 = -2 x1 so x1 – 2x2 = -2x1
3 -4 x2 x2 3x1 – 4x2 = -2x2
8
Power Method:
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.
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
1 2 0 0
Ax ( 0 ) 2 1 0 1
0 0 1 0
2 1
Ax ( 0 ) 1 2 0.5
0 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.80.93
0 0
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 31
0 0
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).
16
Diagonalization of real symmetric matrix by Jacobi’s method or
Jacobi’s method (Cont..)
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
18
Advantage-
Disadvantage-
19
Example: Find all eigen values of the matrix
1 2 2
A 2 3 2
2 2 1
21
Now the largest non diagonal element is a12=a21=2
2a12 2 2
tan 2
a11 a22 33
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
1 / 2 1/ 2 0
1/ 2 1/ 2 0 3 2 0
0 2 0
1/ 2 1/ 2 0
D2 B21 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
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
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).
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
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
x1 y1 ∆y1=y2-y1 ∆2y1=∆y2-∆y1
x2 y2 ∆y2=y3-y2
x3 y3
15
x f(x) ∇1 ∇2 ∇3
x1 y1 ∇y2=y2-y1 ∇2y3=∇y3-∇y2
x2 y2 ∇y3=y3-y2
x3 y3
16
Given the values
17
We have
x f(x) ∆ ∆2 ∆3 ∆4 ∆5 ∆6
1,6 10.031
18
x f(x) ∆ ∆2 ∆3 ∆4 ∆5 ∆6
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
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
*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
26
x 0 1 2 3 4 5 6
By trapezoidal rule
0 1 x 2 2 y0 y6 2( y1 y2 y3 y4 y5 )
6 dx h
6 dx
0 1 x 2 1.4108
27
x 0 1 2 3 4 5 6
x0 1 x 2 3 y0 y6 4( y1 y3 y5 ) 2( y2 y4 )
6 dx h
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
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.
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
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 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
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
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
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
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).
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)
∆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
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
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
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:
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!
11
− 1
11
− 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.
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.
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
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
8 5 8 5 2
× × × × ( −2023 )
8 134847 3 3
= 40365 + × + × 19181 + 3 3 3
3 1! 2! 3!
868 Engineering Mathematics through Applications
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
[ 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.
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
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
Hence from this table we see that nth divided difference for any function yk
∆n
i.e. [ x0 , x1,…, xn ] = n ! hynk
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
[ 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
( 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
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
x: 4 5 7 10 11 13
f(x) = y : 48 100 294 900 1210 2028
Finite Differences, Numerical Differentiations and Integrations 873
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
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
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
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
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
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 )
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]
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.
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
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.
p(p − 1) 2 p(p2 − 1) 3
or yp = y0 + p∆y0 + ∆ y−1 + ∆ y−1
2! 3!
(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!
3. Stirlings 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
= δ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
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. Bessels 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
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
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
(p + 1)p 2 (p + 1)p(p − 1) 3
yp = y0 + p ∆ y−1 + ∆ y−1 + ∆ y−2 +
2! 3!
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
1
∴ µδy0 = − 0.417 + (− 0.523) = − 0.47,
2
…(4)
(∆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
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
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.
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
1
Subtituting these values in yn = y0 + nh implies 25 = 24 + 4n ⇒ n =
4
11 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.
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.
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
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
∆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
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
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
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)
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
= 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
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
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.
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
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)
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
dθ
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
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)
=
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
dθ
h = 0.765 + 0.135 − 0.00125 = 0.89875
dt
902 Engineering Mathematics through Applications
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 )
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]
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
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
Newton-Cotes 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
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
Derivation
b
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
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)
∫ ∫ ∫ ∫
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
= 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
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.
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
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.
h
= y0 + 4y1 + y2
3
[y2 + 4y3 + y4 ],
h
Similarly, I2 =
3
…………………………
…………………………
…(11)
h
In = [yn −2 + 4yn − 1 + yn]
3
∫ ∫ ∫ ∫
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
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. Booles 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
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
π 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
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
dH 48H A dH
Now given, =− or = dt
dt A − 48 H
∫ ∫
1
⇒ A dH = dt
−48H
∫
1 1 14560
− AdH = t ⇒ t= × = 25.27 secs.
48(−4) 48 × 4 3
∫ ∫
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 = 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.
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.
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
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 41
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
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
ANSWERS
Assignment 1
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)
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
9
Euler’s Method, yn =yn-1+h f(xn-1,yn-1) …..(1)
10
We have y’=f(x, y) = (x+y2),
With x0 = 0, y0 = 1
And h=0.1
11
By Euler’s method,
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,
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
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.
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.
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’,
20
1. Numerical Methods by S.R.K Lyenger & R.K. Jain.
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.
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’,
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
12
At x4=0.8, y4=0.3043
Now, y4’=f(x4,y4)=x4-(y4 )2 =0.7074
13
Consider the O.D.E dy …….(1)
y
'
f ( x, y )
dx
such that y( x0 ) y0
To find y at given x.
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
y1=y0+1/6(k1+2k2+2k3+k4)
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
y2=y1+1/6(k1+2k2+2k3+k4)