0% found this document useful (0 votes)
6 views62 pages

Numerical All

Uploaded by

studyhelpchatgpt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views62 pages

Numerical All

Uploaded by

studyhelpchatgpt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Solution of Equation 1

Solution of Equations
Bisection Method: The Bisection
Method is applicable for numerically
solving the equation ( ) = 0 for
the real variable , where ( ) is
a continuous function defined on an
interval [ , ] and where ( )
and ( ) have opposite signs. In this
case, by the intermediate value
theorem, the continuous
function ( ) must have at least one root in the interval (a, b).
At each step the method divides the interval [ , ] in two equal subintervals [ , ] and
[ , ] by computing the midpoint = of the interval [ , ]. Unless is itself a root
(which is very unlikely, but possible) there are now only two possibilities:
either ( ) and ( ) have opposite signs and there is a root between and , or ( )
and ( ) have opposite signs and there is a root between and . Explicitly, if ( )
and ( ) have opposite signs, then the method sets as the new value for , and if ( )
and ( ) have opposite signs then the method sets as the new . (If ( ) = 0
then may be taken as the solution and the process stops.) In both cases, the new ( )
and ( ) have opposite signs, so the method is applicable to this smaller interval. In this
way an interval that contains a zero of ( ) is reduced in width by 50% at each step. The
process is continued until the interval is sufficiently small, i.e., ( ) is near to zero.

1 . Find a real root of the equation ( ) = − − 1 = 0.


Solution : We get
(1) = 1 − 1 − 1 = −1 (-ve)
(2) = 2 − 2 − 1 = 5 (+ve)
Hence there is a root between 1 & 2 so we take = = 1.5
Now, ( ) = (1.5) = 1.5 − 1.5 − 1 = 0.875 (+ve)
.
Hence there is a root between 1 & . So we take = = = 1.25
We find, ( ) = (1.25) = (1.25) − 1.25 − 1 = −0.296875 (-ve)
. .
Hence the root lies between & . So we take = = =1.375
We obtain, ( ) = (1.375) = (1.375) − 1.375 − 1 = 0.2246 (+ve)
. .
Hence the root lies between & . So we take = = =1.3125
We obtain, ( ) = (1.3125) = (1.3125) − 1.3125 − 1 = −0.051 (-ve)
So we take = = 1.34375
Now, ( ) = 0.0826 (+ve)
Solution of Equation 2
So let = =1.328125
Now, f( )=0.0145, which is near to zero.
Hence the appropriate root of the given equation is 1.328125.

2 . Use bisection method determine the root of ( ) = − = 0


Solution : we get, (0) = 1 − 0 = 1 (+ve)
(1) = −0.63 (-ve)
Hence the root lies between 0 & 1 so we take = = 0.5
Now, ( ) = (0.5) = 0.1065 (+ve)
.
Hence the root lies between 1 & . So we take = = =0.75
We find, ( ) = (.75) = −0.278 (-ve)
. .
Hence the root lies between & , So we take = = =.625
We obtain, ( ) = (.625) = −0.088 (-ve)
. .
Hence the root lies between & . So we take = = =.5625
We obtain, ( ) = (.5625) = 0.0073, which is near to zero.
Hence the appropriate root of the given equation is 0.5625.

3 . Perform five interaction of the bisection method to determine the smallest positive real
root of ( ) = −5 +1 = 0
Solution : we get (0) = 1 (+ve)
(1) = −3 (-ve)
Hence the root lies between 0 & 1, So we take = = 0.5
Now, ( ) = (0.5) = −01.375 (-ve)
.
Hence the root lies between 0 & , So we take = = =0.25
We find, ( ) = (.25) = −0.234 (-ve)
.
Hence the root lies between 0 & . So we take = = =.125
We obtain, ( ) = (.125) = 0.377 (+ve)
Hence the root lies between & , So we take = = .1875
We obtain, ( ) = (.1875) = 0.069 (+ve)
. .
Hence the root lies between & . So we take = = =0.21875
We obtain, ( ) = (.21875) = −0.08 (-ve)
Hence the root lies between & . So we take = = 0.203125
We obtain, f( ) = f(.203125) = -0.007, which is near to zero.
Hence the smallest positive real root of the given equation is 0.20325
Solution of Equation 3
4. Use bisection method find of the equation √ − = 0 on [0,1]
Let , ( ) = √ −
Solution : we get (0) = − 1 (-ve)
(1) = 0.45970 (+ve)
Hence the root lies between 0 & 1. So we take = = 0.5
Now, ( ) = (0.5) = −0.17048 (-ve)
.
Hence the root lies between 1 & . So we take = = =0.75
We find, ( ) = (.75) = 0.13434 (+ve)
. .
Hence the root lies between & so we take = = =.625
Hence =0. 625

5. Use the bisection algorithm to find an approximation to √3.


Solution: Let , = √3
or, =3
or, −3=0
therefore √3 is a root of ( ) = −3=0
we get, (2) = 2 − 3 = 1 (+ve)
So, there is a root between 1 and 2. Hence we take = = 1.5
Now, ( ) = (1.5) = −0.75 (-ve)
.
So we obtain = = = 1.75
We find, ( ) = (1.75) = 0.0625 (+ve)
. .
Hence the root lies between 1.5 & 1.75 so we take = =1.625
We obtain, ( ) = (1.625) = −0.3593 (-ve)
Hence the root lies between & . So we take = = 1.6875
We obtain, ( ) = (1.6875) = −0.15234 (-ve)
. .
Hence the root lies between & . So we take = = =1.71875
We obtain, ( ) = (1.71875) = −0.045899 (-ve)
Hence the root lies between & so we take = = 1.734375
We obtain, ( ) = (1.734375) = 0.008, which is near to zero.
Hence 1.734375 is a root of -3=0
.’. √3=1.734375

Method of False Position: The False Position Method is applicable for numerically
solving the equation ( ) = 0 for the real variable , where ( ) is a continuous
function defined on an interval [ , ] and where ( ) and ( ) have opposite signs. In
Solution of Equation 4
this case, by the intermediate value theorem, the continuous function ( ) must have at
least one zero in the interval (a, b).

At each step the method repless the


curve ( ) by the straight line joining
the points ( , ( )) and ( , ( )). The
equation of this line is
( )
= ( )
. … (1)
( )
If this line intersect the axis at
(here = 0), then we get the value of
by solving (1) for with = 0. Therefore = − ( ) ( )
( ). Unless is itself
a root (which is very unlikely, but possible) there are now only two possibilities:
either ( ) and ( ) have opposite signs and there is a root between and , or ( )
and ( ) have opposite signs and there is a root between and . Explicitly, if ( )
and ( ) have opposite signs, then the method sets as the new value for , and if ( )
and ( ) have opposite signs then the method sets as the new . (If ( ) = 0
then may be taken as the solution and the process stops.) In both cases, the new ( )
and ( ) have opposite signs, so the method is applicable to this smaller interval. The
process is continued until the interval is sufficiently small, i.e., ( ) is near to zero.

1.Find a real root of ( ) = − 2 − 5 = 0 by method of false poaition.


Solution : we have
(2) = −1 (-ve) [Here = 2]
(3) = 16 (+ve) [Here = 3]
( ) ( )
So, = 2 − ( ) ( )
(3 − 2) = 2 −
( )
= 2+ = 2.0588
Now, ( ) = (2.0588) = − 0.386 (-ve)
and hence the root lies between 2.0588 and 3.
( . ) (. )
So, = 2 .0588 - ( )
(3-2.0588) = 2.0588 + (3-2.0588) = 2.0812
( . ) . .
We find, ( ) = (2.0812) = −0.1479 (-ve)
Hence the root lies between 2.0812 and 3
( . ) (. )
So, = 2 .0812 - ( )
(3-2 .0812) = 2 .0812 + (3-2.0812) = 2.0896
( . ) .
Now, ( ) = (2.0896) = − 0.0551 (-ve)
hence the root lies between 2.0896 and 3
( . ) (. )
So, = 2.0896 - ( ) ( . )
(3-2.0896) = 2.0588 + .
(3-2.0896) = 2.0927
Hence the root of the given equation is 2.0927.
Solution of Equation 5

2. Solve - -1 = 0 by the method of false poaition.


Solution : Let, ( ) = − −1
So, (1) = −1 < 0
(2) = 3 > 0
Hence the root lies between 1and 2.
( )
So, = 1- ( )
(2-1) = 1 + × 1 = 1.25
( )
We find, ( ) = (1.25) = −0.60938 < 0
Hence the root lies between 1.25 and 2.
( . ) .
So, = 1.25 - ( ) ( . )
(2-1.25) = 1.25 + .
(.75) = 1.3766
Now, ( ) = (1.3766) = − 0.28633 < 0.
Hence the root lies between 1.3766 and 2 .
( . ) .
So, = 1.3766 - ( )
(2-1.3766) = 1.3766 + (.6234) = 1.4304
( . ) .
Now, ( ) = (1.4304) = − 0.11938 < 0
Hence the root lies between 1.4304 and 2.
( . ) .
So, = 1.4304 - ( ) ( .
(2-1.4304) = 1.4304 + (.5696) = 1.4522
) .
Now, ( ) = (1.4522) = − 0.046362 < 0
hence the root lies between 1.4522 and 2.
( . ) .
So, = 1.4522 - ( )
(2-1.4522) = 1.4522 + (.5478) = 1.4595
( . ) .
Now, ( ) = (1.4595) = − 0.0212 < 0
hence the root lies between 1.4595 and 2.
( . ) .
So, = 1.4595 - ( ) ( . )
(2-1.4595) = 1.4595 + .
(.5405) = 1.4633
Now, ( ) = (1.4633) = − 0.00796, which is near to zero.
Hence the root is , =1.4633

Iteration Method :
1. Find a real root of the equation ( ) = + − 1 = 0 by iteration method .
Solution : we get
(0) = −1 (-ve)
(1) = 1 (+ve)
So, a root lies between 0 and 1 . Therefore we can take =0.5
To find this root , we put the equation in the form = ( ).
So + −1 = 0
or, =

So that ( ) = and ′( ) = ( ) /

′(
we have | )| < 1 for = = 0.5
Solution of Equation 6
Hence the iteration method can be applied.
We get,
= ( ) = (.5)= 0.81649
= ( ) = (.81649)= .74196
= ( ) = (.74196)=.75767
= ( ) = (.75767)= .75427
= ( ) = (.75427)= .75500
= ( ) = (.75500)= .75485
= ( ) = (.75485)= .75488
Hence the approximate value of the root is 0.75488.

2. Find the root of the equation 2 = + 3 correct to three decimal places by using
iteration method .
Solution : The given equation can be put in the form, = ( + 3)
So that ( ) = (cosx+3)
and ′( ) = (− )
′(
we have | )| = | |<1
Hence the iteration method can be applied .
Take , =1
We get,
= ( ) = (1)=1.7701
= ( ) = (1.7701)= 1.40098
= ( ) = (1.40098)=1.5845
= ( ) = (1.5845)= 1.4931
= ( ) = (1.4931)= 1.5388
= ( ) = (1.5388)= 1.5160
= ( ) = (1.5160)= 1.5274
= ( ) = (1.5274)= 1.5217
= ( ) = (1.5217)= 1.5245
= ( ) = (1.5245)= 1.5231
Hence the approximate value of the root is 1.5231.

3. Find a real root of = 10( − 1) correct to four significant figures by using


iteration method.
Solution : The equation can be written in the form ,
10 − 10 =
or, 10 = 10 +
or, = +1
Solution of Equation 7
So that, ( ) = sinx+1
And ′( ) =
we have | ′ ( )| < 1
Hence the iteration method can be applied .
We get, = ( )
Choose , =1
= ( ) = (1)= 1.0841
= ( ) = (1.0841)= 1.08834
= ( ) = (1.08834)= 1.08859
= ( ) = (1.08859)= 1.08860
= ( ) = (1.08860)= 1.08860
Hence the approximate value of the root is 1.089.

4. Use the iteration method to find a real root of the following equations.
(a) = 3 −1 (e) = 10
(b) x = ( ) (f) =

(c) = (5 − ) (g) = -1
(d) = 10( − 1) (h) =

Newton-Raphson Method:
Let be an approximate root of ( ) = 0 and let = + ℎ be the correct root so that
( ) = 0 that is, ( + ℎ) = 0
Now expending ( + ℎ) by Taylor’s series , we obtain,

( )+ℎ ( )+ ( )+ … … … … = 0
2!
Neglecting the second and higher order derivatives, we have
( )+ℎ ( ) = 0
( )
or, ℎ = −
( )
A better approximation than is therefore given by when ,
( )
= −
( )
Successive approximations are giveb by , , . … … … …
( )
Where , = --
( )
Which is Newton – Raphson formula.

1. The equation + 2 − 5 − 1 = 0 has a root near to 1.4 . Use the Newton-


Raphson method to find the root to four significant figures.
Solution of Equation 8
Solution : we have ,
( )= +2 −5 −1
therefore ( )= 3 +4 −5
Given that , =1.4
Now , ( ) = −1.336
( ) = 1.6162
( ) .
∴ = - = 1.4 - =1.6062
( ) .
Now, ( ) = .2723
( )=9.1641
( ) .
∴ = - = 1.6062 - =1.5765
( ) .
Now, ( ) = .0059
( )=8.7615
( ) .
∴ = - = 1.5765 - =1.5757
( ) .
Now, ( ) = .000003 which is near to zero .
Hence the approximate value of the root is 1.5757

2. Use Newton’s method to find a root of the equation −3 −5 = 0


Solution : we have , ( ) = −3 −5 = 0
(2) = 2 − 3.2 − 5 = −3
(3) = 3 − 3.3 − 5 = 13
So, there is a root between 2 & 3.
∴We choose =2
Now, (x)= 3 -3
∴ ( ) = (2) = −3
( )= (2)=9
( )
∴ = - =2- =2.3333
( )
Now,
( ) = 0.7037
( ) = 13.333
( ) .
∴ = - = 2.3333 - =2.2805
( ) .
Now,
( ) = (2.2805) = 0.01935
( )= (2.2805)=12.6028
( ) .
∴ = - = 2.2805 - =2.2790
( ) .
Now, ( ) = (2.2790) = 0.000016 Which is near to zero.
Hence the approximate value of the root is 2.2790.
Solution of Equation 9

2. Find a root of the equation + = 0


Solution : we have , ( ) = +
( )=
Choose , = =3.1416
∴ ( ) = −1
( )= -3.1416
( )
∴ = - = 3.1416 - =2.8233
( ) .
Now,
( ) = −0.06618
( )= -2.6816
( ) .
∴ = - = 2.8233 - =2.7985
( ) .
Now, ( ) = − 0.00056 Which is near to zero.
Hence the approximate value of the root is 2.7985.
4. − 2 − 5 = 0
5. +5 +1= 0
6. −5 +3= 0
7. = 1−
8. =4 .
Newton’s Interpolation 10

Newton’s Interpolation
Established the Newton’s forward difference interpolation formula.
Solution: Give the set of ( + 1) values, viz.( , ), ( , ), ( , ), … … … . ( , ),
of and , it is required to find ( ) , a polynomial of the nth degree such that y and
( ) agree at the tabulated points. Let the values of x be equidistant.
i.e., Let = + ℎ for = 1,2,3, … … … … .
Since ( ) is a polynomial of the nth degree, it may be written as
( )= + ( − ) + ( − )( − ) + ( − )( − )( − ) +
… … … … … . . + ( − )( − )( − ) … … … ( − ) ………(1)
Imposing now the condition that y and ( ) should agree at the set of tabulated values.
When = then =
When = then = + ( − )
 = + ℎ
 ℎ= -
 ℎ= −
 ℎ= ∆

 =
When = then = + ( − )+ ( − )( − )
 = + 2ℎ + 2ℎ. ℎ
 = +2 ℎ+2 ℎ
 = + 2∆ + 2 ℎ
2 ℎ = − − 2∆
= − − 2( − )
= − −( − )
=∆ −∆
=∆
∆ ∆
 = =
!
Similarly we get

=
!
…………….
…………….

= !
Putting the value of , , … …… … … ….. (1) we get
∆ ∆
(x) = + ( − )+ ( − )( − )
!

+ ( − )( − )( − ) + ⋯……………
3! ℎ
Newton’s Interpolation 11

+ ( − )( − )( − )…………..( − ) ……. (2)
!
Sitting = + ℎ
Then =
( )
= = − = −1
( )
= = − = −2
Similarly,
( ( ) ) ( )
= = − = − ( − 1)
Putting this value’s in (2) we get
( ) ( )( ) ( )( )….( )
( )= + ∆ + ∆ + ∆ +⋯+ ∆
! ! !
Where p =
Which is the Newton’s forward difference interpolation formula and is useful for
interpolation near the beginning of a set of tabulated value?

1. Find the cubic polynomial which takes the following values.


(0) = 1, (1) = 0, (2) = 1 and (3) = 10
Hence obtain y(4)
Soln. the difference table is as follows:
x y ∆ ∆ ∆
0 1
-1
1 0 2
1 6
2 1 8
9
3 10

Here h=1, =0
Hence p= = =x
Therefore from Newton’s forward interpolation formula we get
( ) ( )( )
y(x) = 1+x(-1)+ (2) + (6)
! !
= 1-x+ − + ( − 3 + 2)
= 1-x+ − + − 3 + 2
= −2 +1
Which is the required polynomial and (4) = 4 − 2(4) + 1
= 64 − 32 + 1
Newton’s Interpolation 12
= 33
2. The population of a country in the decennial census were as under .Estimate The
population for the year 1895.
Year : x 1891 1901 1911 1921 1931
Population : y(In thousands ) 46 66 81 93 101

Solution : We know that the Newton’s forward difference interpolation formula is ,


( ) ( )( )
(x)= +p∆ + ∆ + ∆ +… …
! !
( )( ) …… ( )
+ ∆ ……………………………..(1)
!
[ Where , p= ]
Now, put
h =10 , = 1891 , x = 1895
p= =0.4
The difference table is:

x y ∆ ∆ ∆ ∆
1891 46
20
1901 66 -5
15 2
1911 81 -3 -3
12 -1
1921 93 -4
8
1931 101

Hence (1) gives,


. ( . ) . ( . )(. ) . ( . )( . )( . )
y(1895) = 46 + 0.4(20) + (-5)+ (2)+ (−3)
! ! !
. ( . ) . ( . )( . ) . ( . )( . )( . )
=46 + 8 + (-5)+ (2)+ (−3)
=54.85 thousands

3. Given,
45° = 0.7071
50° = 0.7660
55° = 0.8192
60° = 0.8660
Find 52° by using Newton’s forward interpolation formula.
Solution: We know that the Newton’s forward difference interpolation formula is,
( ) ( )( ) ( )( ) …… ( )
(x)= +p∆ + ∆ + ∆ +… … …+ ∆
! ! !
Newton’s Interpolation 13
… ...(1)
[Where, p= ]
We have,
x 45° 50° 55° 60°
y 0.7071 0.7660 0.8192 0.8660

The difference table is as followed:

x y ∆ ∆ ∆
45° 0.7071
0.0589
50° 0.7660 -0.0057
0.0532 -0.0007
55° 0.8192 -0.0064
0.0468
60° 0.8660

° °
Here, ℎ = 5° , = 45° , = 52°, = °
= 1.4
So, from (1) we get,
1.4(1.4 − 1)
(52°) = 0.7071 + 1.4(0.0589) + (−0.0057)
2!
1.4(1.4 − 1)(1.4 − 2)
+ (−0.0007)
3!
= 0.7071 + 0.08246 − 0.001567 + 0.0000392
= 0.7880032
Thus, 52° = 0.788 ( approximately ).

Established the Newton’s backward difference interpolation formula.


Solution: Given the set of ( + 1) values viz. ( , ), ( , ), ( , ), … … . ( , ) f
and , it is required to find ( ) , a polynomial of the nth degree such that y and ( )
agree at the tabulated values, let the values of x be equidistant. i.e.,
Let = + ℎ for = 1,2,3, … … … … .
Since ( ) is a polynomial of the nth degree, it may be written as
( )= + ( − ) + ( − )( − ) + ( − )( − )( − )
+ … … . . . + ( − )( − )( − ) … … … ( − ) … … … … (1)
Imposing now the condition that y and ( ) should agree at the set of tabulated values.
When = then =
Newton’s Interpolation 14
When = then = + ( − )
 = + ( − )
 ( − )= -
 ℎ= −

 =
When = then = + ( − )+ ( − )( − )
 = − ( − )+ ( − )( − )
 = − 2ℎ + 2ℎ. ℎ
 = −2 ℎ+2 ℎ
2 ℎ = +2 ℎ−
= − 2( − )−
= +2 −2 −
= + −2
= − −
=( − )−( − )
=∇ − ∇
=∇

 = !
Similarly we get,

= . !
…………….
…………….

=
. !
Putting the value of , ,……………….. (1)
∇ ∇
(x) = + ( − )+ ( − )( − )
. !

+ ( − )( − )( − ) + ⋯ … … … … ………..
. !

+ ( − )( − )( − )……… ….. ( − ) ……………… (2)
. !
Sitting = + ℎ
Then =
( )
= = + = +1
( )
= = + = +2
Similarly,
( ( ) ) ( )
= = + = + ( − 1)
Newton’s Interpolation 15
Putting this value’s in (2) we get

( )=
( ) ( )( ) ( )( )….( )
+ ∇ + ∇ + ∇ + ⋯……+ ∇
! ! !
Where p =
Which is the Newton’s backward difference interpolation formula and is useful for
interpolation near the end of a set of the value?

4. The population of a country in the decennial census where as under .Estimate the
population for the year 1925.
Year : x 1891 1901 1911 1921 1931
Population : y (In thousands ) 46 66 81 93 101

Solution: Here the interpolation is desired at the end of the table and so we use Newton’s
backward differences interpolation formula.
We know that the Newton’s backward difference interpolation formula is,
( )=
( ) ( )( ) ( )( )….( )
+ ∇ + ∇ + ∇ + ⋯……+ ∇
! ! !
Now, put
ℎ = 10 , = 1931 , = 1925
= = -0.6
The difference table is :
x y ∇ ∇ ∇ ∇
1891 46
20
1901 66 -5
15 2
1911 81 -3 -3
12 -1
1921 93 -4
8
1931 101

Hence (1) gives,


. ( . ) . ( . )( . )
y(1925) = 101 + (-0.6)8 + (-4)+ (-1)
! !
. ( . )( . )( . )
+ (−3)
!
= 96.84 thousands
Newton’s Interpolation 16
5. The table below gives the value of tan(x) for 0.10≤ ≤ 0.30
X 0 .10 0.15 0.20 0.255 0.30
Y= ( ) 0.1003 0.1511 0.2027 0.2553 0.3093
Find tan 0.26
Solution. We know Newton’s backward difference interpolation formula is,
( + 1) ( + 1)( + 2)
( )= + ∇ + ∇ + ∇ +⋯……
2! 3!
( + 1)( + 2) … . ( + − 1)
+ ∇ … … … … … … … … (1)
!
Where p=
Here x=0.26, = 0.30,ℎ = 0.05
0.26 − 0.30
= = −0.8
0.05
The difference table is as follows,

x Y ∇ ∇ ∇ ∇
0.10 0.1003
0.0508
0.15 0.1511 0.0008
0.0516 0.0002
0.20 0.2027 0.0010 0.0002
0.0526 0.0004
0.25 0.25553 0.0014
0.0540
0.30 0.3093

Here(1) gives
(0.26) =
. ( . ) . ( . )( . )
0.3093 − 0.8(0.0540) + (0.0014) + (0.0004) +
! !
. ( . )( . )( . )
(0.0002)
!
= 0.2662
Interpolation with unequal Intervals 17
Interpolation with unequal Intervals
Discus about Divided Differences.
Let ( ), ( ),……………. ( )be the entries corresponding to the arguments
, , … … … … … … . where the intervals − , − , − may not be
equal.Then the first divided difference of ( ) for the arguments , is defined as
( ) ( ) ( ) ( )
and is denoted by , , that is, ( , )=
Similarly the other first divided differences of ( ) for the arguments
, ; , ;…………; , are
( ) ( )
( , )=
( ) ( )
( , )=
………………………………..
( ) ( )
( , )=
The second divided difference of ( ) for the three arguments , is defined as
( , ) ( , )
( , , )=
( , ,…. ) ( , ,….. )
The nth divided difference is given by ( , , ,…… )=

Note: If two of the arguments coincide the divided difference can be given a meaning
assigned by taking the limit. Thus
( , ) = lim → ( , + )
( ) ( )
=lim → ( )
( ) ( )
=lim →
= ( )
( )
Similarly ( , ,….. )= ( )
!
(r+1) arguments

Theorem: The divided difference are symmetrical in all its arguments, That is
independent of the order of the arguments.
Proof: We have
( ) ( ) ( ) ( )
( , )= = = ( , )
( ) ( )
= +
( )
=∑ , Showing that ( , ) is symmetrical in , ,
( , ) ( , )
Again ( , )=
Interpolation with unequal Intervals 18
( ) ( ) ( ) ( )
= [ − ]
( ) ( ) ( ) ( )
= [ − − + ]
1 ( ) 1 1 ( )
= [ − ( )( − )+ ]
− − − − −
( ) ( )
= [ − ( ) + ]
( )( )
( ) ( )( ) ( )
= [ −( )( )
+ ]
( ) ( ) ( )
= +( )( )
+( )( )
( )( )
( ) ( ) ( )
=( )( )
+( )( )
+( )( )
( )
=∑ ( )( )
,Showing that ( , , ) is symmetrical in , ,
Let us assume similar symmetrical expressions for the (n-1)th divided differences. That is,
let us assume that
( )
( , ,…… )=
( − )( − ) … … … … . . ( − )
( )
+ + ⋯…………
( − )( − ) … … … … . . ( − )
( )
+
( − )( − ) … …… …. .( − )
( )
=
( − )( − ) … … … … . . ( − )
And similar expressions for the other (n-1)th divided difference.
( , ,…… ) ( , ,…… )
Then ( , ,…… )=
( ) ( ) ( )
= [ + + −
( )……..( ) ( )……..( ) ( )……..( )
( ) ( ) ( )
+ + ⋯ ….+ ]
( )……..( ) ( )……..( ) ( )……..( )
( ) ( ) ( )
= + +
( )……..( ) ( )……..( ) ( )……..( )
( )
=∑
( )……..( )
showing that the nth divided difference ( , , … … ) is also symmetrical in
, , … … and thus completing the proof of the theorem by mathematical induction.

Theorem: The nth divided differences of a polynomial of the nth degree are constant.
Proof: First consider the function ( ) = .The first divided differences of this function
are given by
( ) ( )
( , )=
Interpolation with unequal Intervals 19

=
= + + ⋯ ……. + +
Which is a homogeneous expression of degree n-1 in and .The second divided
differences are given by
( , )− ( , )
( , , )=

( , ) ( , )
=
= [ ( , )− ( , )]
( )
( ) ( ) ( ) ( )
= [ − ]

= [ − ]

= [( + . + ⋯ … …… + + )−( + . +
…… … … + + )]
= + +
=( + +⋯+ )+ ( +⋯+ ) +⋯………….+
Which is a homogeneous expression of degree n-2 in , , by induction it can be
shown that ( , ,……………., ) is a homogeneous expression of degree n-m.
In particular, The nth divided difference of ( ) = is an expression of degree zero, it
is a constant, and is therefore independent of the values of , ,………
Since the nth divided difference of are constant, Therefore the divided differences of
of order greater than n will all be zero.
If ( ) = , where a is a constant, Then the nth divided difference of ( ) =
(The nth divided difference of )
Which is a constant.
Hence if ( ) = + + ⋯…………+ be a polynomial of degree n, Then
the nth divided differences of all the terms except will be zero. and so the nth
divided difference of the whole polynomial will be constant.

Newton’s interpolation formula for unequal intervals.


Or. Newton’s interpolation formula for divided difference.
Let ( ), ( ), … … … … … ( ) be the values of ( ) corresponding to the arguments
, , … … … … … . , not necessarily equally spaced. From the definition of divided
differences,
( )− ( )
( , )=

Or. ( ) = ( ) + ( − ) ( , ) (1)
Interpolation with unequal Intervals 20
( , ) ( , )
Also ( , , )=
⇒ ( , )= , +……( − ) ( , , )………………….. (2)
Similarly
( , , ) = ( , , )+( − ) ( , , ) ………………. (3)
…………………………………………………..
( , , ,……. ) = ( , ,….. ) + ( − ) ( , , ,…… )
…….. (4)
Multiplying the equation (2) by ( − ) (3) by ( − )( − ) and so on and finally
the equation (4) by ( − ). ( − ) … … . ( − ) and adding to the equation (1), we
have
( ) = ( ) + ( − ) ( , ) + ( − )( − ) ( , , ) + ⋯ … … …
+ ( − )( − ) … … ( − ) , ,…… +
Where is given by
= ( − )( − ) … … … … ( − ) ( , , , … … … … … … ) Assuming that
( ) is a polynomial of degree n, then ( , , … … … )
Vanishes, so that
( ) = ( ) + ( − ) ( , ) + ( − )( − ) ( , , ) + ⋯ … … +
( − )( − ) … … … . ( − ) ( , ,…… )
This formula is called Newton’s divided difference interpolation formula.

Ex 1. Fit a polynomial which passes through the points (1,4), (3,7), (4,8) and (6,11) by
using Newton’s divided difference formula. Also find the value of y at x=2.
Soln. The difference table is as follows.

x ( ) 1st diff 2nd diff 3rd diff

1 4
7−4
= 1.5
3−1
1 − 1.5
3 7 4−1
= −.167
8−7
=1 . 167 + .167
4−3 6−1
4 8 = .067

1.5 − 1
11 − 8 = .167
= 1.5 6−3
6−4
6 11

Here (1) = 4, (1,3) = 1.5, (1,3,4) = −.167 , (1,3,4,6) = .067


Interpolation with unequal Intervals 21
Therefore from Newton’s divided difference formula we get
( ) = (1) + ( − 1) (1.3) + ( − 1)( − 3) (1,3,4)
+ ( − 1)( − 3)( − 4) (1,3,4,6)
=4 + 1.5( − 1) − .167( − 1)( − 3) + .067( − 1)( − 3)( − 4)
Which is the required polynomial
Now put = 2, we get
= (2)
= 4 + 1.5(2 − 1) − .167(2 − 1)(2 − 3) + .067(2 − 1)(2 − 3)(2 − 4)
=5.799 Ans.

Ex 2. If ( ) = , find ( , ), ( , , ) ( , , , )
Soln : We have
( ) ( ) ( )( )
( , )= = = .
= ( )
=− …………. (1)
. .
( , ) ( , )
Again ( , , ) =
.
= .

( ) ( )
= .

= .
( ){( ) }
= . =
Similarly ( , , , ) = −

Ex 3. Show that ∆
= + +
Soln: ( ) =
∆ ( ) ( )
Now ( )= ( , )=

=
= + +

Similarly ( )= + +
∆ ( )= ∆
Now
= ( , , )
( , ) ( , )
=

=
Interpolation with unequal Intervals 22

=
( )( )
=
= + + proof.

Lagranges Interpolation formula for unequal intervals:


Let ( ) denote a polynomial of the nth degree which takes the values
, , … … … … … . when x has the values , , , … … … . . respectively. Then the
(n+1)th differences of this polynomial are zero. Hence
( , , , … … … … . ) = 0 ……………………………… (1)
But we have
( , , ,…………. )
=( )( )( )…….( )

+
( )( )( )……( )
+( )( )( )………( )
+ ⋯…………
+( )( )……….( )
∴ using (1) , we get

( − )( − )…… ……( − )
+
( − )( − )( − )…………( − )
+ + ⋯ … … … ..
( − )( − )( − )………( − )
+ =0
( − )( − )( − )…………( − )

⇒( )( )………….( )
= ( )( )( )……….( )

+ ( )( )( )……….( )
+ ⋯ … … … … … … ..+( )( )( )…………( )

( )( )( )…………( )
⇒ =( )( )( )………..( )
+
( )( )( )…………( )
( )( )( )………..( )
+……………..
( )( )( )…………( )
+( )( )( )………..( )
( )( )…………( ) ( )( )…………( )
∴ =( )( )………..(
+ ( )( )………..( )
+……………..
)
( )( )…………( )
+( )( )………..( )
Interpolation with unequal Intervals 23
Which is Lagranges formula .

. Apply Lagranges Formula Calculate (1.5) by using the following table.

x 1.00 1.20 1.40 1.60 1.80 2.00

( ) .2420 .1942 .1497 .1109 .0790 .0540

Soln. Using Lagrange formula we get,


(1.5 − 1.2)(1.5 − 1.4)(1.5 − 1.6)(1.5 − 1.8)(1.5 − 2)
(1.5) = (.2420)
(1 − 1.2)(1 − 1.4)(1 − 1.6)(1 − 1.8)(1 − 2)
(1.5 − 1)(1.5 − 1.4)(1.5 − 1.6)(1.5 − 1.8)(1.5 − 2)
+ (.1942)
(1.2 − 1)(1.2 − 1.4)(1.2 − 1.6)(1.2 − 1.8)(1.2 − 2)
(1.5 − 1)(1.5 − 2)(1.5 − 1.6)(1.5 − 1.8)(1.5 − 2)
+ (.1497)
(1.4 − 1)(1.4 − 1.2)(1.4 − 1.6)(1.4 − 1.8)(1.4 − 2)
(1.5 − 1)(1.5 − 1.2)(1.5 − 1.4)(1.5 − 1.8)(1.5 − 2)
+ (.1109)
(1.6 − 1)(1.6 − 1.2)(1.6 − 1.4)(1.6 − 1.8)(1.6 − 2)
(1.5 − 1)(1.5 − 1.2)(1.5 − 1.4)(1.5 − 1.6)(1.5 − 2)
+ (.0790)
(1.8 − 1)(1.8 − 1.2)(1.8 − 1.4)(1.8 − 1.6)(1.8 − 2)
(1.5 − 1)(1.5 − 1.2)(1.5 − 1.4)(1.5 − 1.6)(1.5 − 1.8)
(.0540)
(2 − 1)(2 − 1.2)(2 − 1.4)(2 − 1.6)(2 − 1.8)
= . 002835937 − .018964843 + .087714843
−.064980468 − .007714843 + .000632812
= .129484375 Ans.
Central Difference 24
Gauss’s Forward Difference Interpolation Formula:

We consider the following difference table in which the central ordinate is taken for
convenience as corresponding to x = .
x y Δ

The differences used in this formula lie on the line shown in the table.
The formula is, therefore, of the form.
= + + + + + ⋯ … … … . . (1)
Where , , ………….. have to be determined, the on the left side can be expressed
in terms of , Δ and higher order differences of as follows.
= = (1 + )
( ) ( )( ) ( )( )( )
= + ∆ + ∆ + ∆ + ∆ +⋯…
! ! !
Similarly the right side of (1) can also expressed in terms of ,∆ and higher order
differences.
Now ∆ =∆
Central Difference 25
=∆ (1 + ∆)
=∆ (1 − ∆ + ∆ − ∆ + ⋯ … … )
∴∆ =∆ −∆ +∆ −∆ + ⋯ … … … … … ….
∴∆ =∆ −∆ +∆ −∆ + ⋯ … … … … … ….
∆ =∆
=∆ (1 + ∆)
=∆ (1 − 2∆ + 3∆ − 4∆ + ⋯ … … )
=∆ − 2∆ + 3∆ − 4∆ + ⋯ ……
Hence (1) give the identity
( − 1) ( − 1)( − 2) ( − 1)( − 2)( − 3)
+ ∆ + ∆ + ∆ + ∆
2! 3! 4!
+ ⋯ … … … ….
= + ∆ + (∆ −∆ +∆ −∆ + ⋯ … … ) + (∆ −∆ +
∆ −∆ + ⋯ … … ) + (∆ − 2∆ + 3∆ − 4∆ + ⋯ …) + ⋯ … (2)
Equating the coefficients of
∆ ,∆ ,∆ ……………… ℎ (2),
=
( − 1)
=
2!
( )( )
- + =
!
( )( ) ( )
∴ = +
( ) ( )
=
!
( ) ( )( )
Similarly = !
etc.
Hence (1) becomes
( − 1) ( + 1) ( − 1)
= + ∆ + ∆ + ∆
2! 3!
( + 1) ( − 1)( − 2)
+ ∆ + ⋯………
4!
Which is Gauss’s forward formula.

EX 1. Use Gauss’s forward formula to find f(x) when x=3.6 from the data below
X 2.5 3.0 3.5 4.0 4.5

Y 24.145 22.043 20.225 18.644 17.644

Solution:
We know the gauss’s forward formula is,
Central Difference 26
( ) ( ) ( ) ( ) ( )( )
= + ∆ + ∆ + ∆ + ∆ +
! ! !
⋯ … … … …) (1)
Here we take = 3.5 , x=3.6, h=0.5
. .
P= = = 0.2
.
The difference table is as follows
X Y ∆ ∆ ∆ ∆

2.5 24.145

-2.012

3.0 22.043 .284

-1.818 -.47

3.5 20.225 .237 .391

-1.581 .344

4.0 18.644 .581

-1.000

4.5 17.644

Therefore = 20.225 , ∆ = −1.581 ,∆ = .237, ∆ = .344 , ∆ = .391


Hence from (1) we get
. = (3.6)
. 2(. 2 − 1)
= 20.225 + .2(−1.581) + (. 237)
2
(1 + .2)(. 2)(.2 − 1) (1 + .2)(. 2)(. 2 − 1)(.2 − 2)
+ (. 344) + (.391)
3! 4!
= 19.8844624 (answer)

Gauss’s backward difference interpolation formula


We consider the following difference table in which the central ordinate is taken for
convenience as corresponding to x=
Central Difference 27

X Y ∆ ∆ ∆ ∆

∆ ∆

∆ ∆

∆ ∆


The differences used in this formula lie on the line shown in the table. The formula is,
therefore of the form
= + ′∆ + ′∆ + ′∆ + ′∆ + ⋯ … … … … … … . . (1)
Where ′ , ′ , ′ , ′ , … … … … … . . ℎ .
on the left side of (1) can be expressed in terms of ,∆ ,and higher order differences
of as follows
= = (1 + )
( ) ( )( ) ( )( )( )
= + ∆ + !
∆ + !
∆ + !
∆ + ⋯ … … … ….
Similarly the right side of (1) can also expressed in terms of , ∆ and higher order
differences.
Now ∆ =∆
=∆(1 + ∆)
=∆(1-∆+∆ − ∆ + ⋯ … … … ..)
∴∆ =∆ -∆ +∆ −∆ + ⋯ … … … … … … … … ..
∴∆ = ∆ -∆ +∆ −∆ + ⋯ … … … … … … … … ..
∴∆ =∆
=∆ (1 + ∆)
=∆ (1-2∆+3∆ − 4∆ + ⋯ … … … ..)
∴∆ = ∆ -2∆ +3∆ − 4∆ + ⋯ … … … … … … … … ..
Central Difference 28
∴∆ = ∆ -2∆ +3∆ − 4∆ + ⋯ … … … … … … … … ..
Here (1) Gives the identity
( − 1) ( − 1)( − 2) ( − 1)( − 2)( − 3)
+ ∆ + ∆ + ∆ + ∆
2! 3! 4!
+ ⋯ … ..

= + ′ (∆ −∆ +∆ −∆ + ⋯……) + ′ (∆ −∆ +∆ −
′ (∆ ′
⋯… ……) + − 2∆ + 3∆ − ⋯ …) + (∆ −∆ +∆ − ⋯ ….)…
… …(2)
Equating the coefficient of
∆ ,∆ ,∆ ……………… ℎ (2),

=
′ ′
( − 1)
− + =
2!
′ ( ) ′ ( )
∴ = + = +
!
( )
=
!
′ ( ) ( ) ′ ( )( ) ( )
Similarly = And = etc.
! !
Hence (1) becomes,
( + 1) ( + 1) ( − 1)
= + ∆ + ∆ + ∆
2! 3!
( + 2)( + 1) ( − 1)
+ ∆ + ⋯………
4!
Which is Gauss’s backward formula.

Ex 3. Interpolate by means of Gauss’s backward formula the population for the year 1936,
Given the following table.
Year: 1901 1911 1921 1931 1941 1951

Population:(thousands) 12 15 20 27 39 52

Solution: We know the Gauss’s backward formula is,


( ) ( ) ( ) ( )( ) ( )
= + ∆ + ∆ + ∆ + ∆ + ⋯ ……
! ! !
……(1)
Here we take = 1931, x=1936, ℎ = 10
− 1936 − 1931 5
∴ = = = = 0.5
ℎ 10 10
The difference table is given below:
Central Difference 29

x Y ∆ ∆ ∆ ∆ ∆

1901 12

1911 15 2

5 0

1921 20 2 3

7 3 -10

1931 27 5 -7

12 -4

1941 39 1

13

1951 52

Therefore = 27, ∆ = 7, ∆ =5
∆ = 3, ∆ = −7, ∆ = −10

Hence from (1) we get,


= . = (1936)
( . ) . ( . )( . )( . ) ( . )( . )( . )( . )
=27+0.5(7) + (5) + (3) + (−7) +
! ! !
( . )( . )( . )( . )( . )
(−10)
!
=27+3.5+1.875-0.1875+0.2734-0.1172
=32.3437 (Thousand) Ans.

Stirling’s Formula:
We know the Gauss’s forward formula is
( − 1) ( + 1) ( − 1)
= + ∆ + ∆ + ∆
2! 3!
( + 1) ( − 1)( − 2)
+ ∆ + ⋯ … … … … … ….
4!
………………(1)
And the Gauss’s backward formula is,
Central Difference 30
( + 1) ( + 1) ( − 1)
= + ∆ + ∆ + ∆
2! 3!
( + 2)( + 1) ( − 1)
+ ∆ + ⋯ … … … … … ….
4!

………………………………………………………(2)
Now taking the mean of (1) and (2) we obtain
∆ +∆ ( − 1) ∆ +∆ ( − 1)
= + + ∆ + + ∆
2 2! 3! 2 4!
+⋯
Which is called the Stirling’s formula.

Ex 5. Use Stirling’s formula to find (35) where (20) = 512, (30) = 439, (40) =
346, (50)=243
Solution:We know the Stirling’s formula is
∆ +∆ ( − 1) ∆ +∆ ( − 1)
= + + ∆ + + ∆
2 2! 3! 2 4!
+⋯

……………………………………………………(1)
The difference table is as follows.
X Y ∆ ∆ ∆

20 512

-73

30 439 -20

-93 10

40 346 -10

-103

50 243

Here we take = 30, = 35, ℎ = 10, = ( − )/ℎ = (35 − 30)/10 = 0.5


Therefore from (1)
(−73 − 93) 0.5 0.5{0.5 − 1} 10 + 0
. = (35) = 439 + 0.5 + (−20) + .
2 2 3! 2
Central Difference 31
=395
Bessel’s formula:
This formula uses the differences as shown in the following table where brackets mean
that the average of the values have to be taken.

x y ∆ ∆ ∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆
∆ ∆

Here Bessel’s formula can be assumed in the form,


+ ∆ +∆ ∆ +∆
= + ∆ + + ∆ + + ⋯ … ….
2 2 2
∆ ∆ ∆ ∆
= + ( + 1⁄2)∆ + + ∆ + + ⋯ … ….
…………………….(1)
Where , , … … …. Have to be determined.The of the left side of (1) can be
expressed in terms of , ∆ and higher order differences of as follows.
= = (1 + ∆)
( − 1) ( − 1)( − 2)
= + ∆ + ∆ + ∆
2! 3!
( − 1)( − 2)( − 3)
+ ∆ + ⋯ … ..
4!
Similarly the right side of (1) can also be expressed in terms of , ∆ and higher order
differences as follows.
∆ =∆ = ∆ (1 + ∆)
= ∆ (1 − ∆ + ∆ − ∆ + ⋯ … )
∴∆ =∆ −∆ +∆ −∆ + ⋯…………
∴∆ =∆ −∆ +∆ −∆ + ⋯…………
∆ =∆ −∆ +∆ − ⋯ … … … … … ….
∆ =∆ = ∆ (1 + ∆)
= ∆ (1 − 2∆ + 3∆ − ⋯ … … … )
=∆ − 2∆ + 3∆ − ⋯ …… …
Here (1) Gives the identity
Central Difference 32
( − 1) ( − 1)( − 2) ( − 1)( − 2)( − 3)
+ ∆ + ∆ + ∆ + ∆
2! 3! 4!
+ ⋯ … ..
= +( 1/2)∆ + (∆ −∆ +∆ − ⋯ … … . +∆ )+ (∆ −∆
2
+∆ − ⋯ ……… ) + (∆ − 2∆ + 3∆ − ⋯………+ ∆
2
−∆ +∆ − ⋯)
= + + ∆ + (2∆ −∆ +∆ − ⋯ ……) + (∆ −∆ +∆ −
⋯… .) + (2∆ − 3∆ + 4∆ − ⋯ … … . ) … … … … … . (2)
Equating the coefficient of ∆ , ∆ ,∆ ,……………… etc on both sides of (2) ,we obtain.
P= + , = −
( − 1) ( − 1)
= , =
2! 2!
( − 1)( − 2)
⟹ =− +
3! 2
( )( ) ( )
⟹ = +
( )
= +
( )
=
( )( ) ( )( )
= =
!
( ) ( )( )
Similarly = etc
!
Thus (1) becomes
( − 1) ∆ +∆ ( − 1)( − )
= + ∆ + + ∆
2! 2 3!
( + 1) ( − 1)( − 2) ∆ +∆
+ + ⋯ … … ..
4! 2
Which is the Bessel’s formula,

Ex. The following table gives seadings of the temperature (0 ) secorded of given time (t).
2 3 4 5 6

61.87 54.08 47.03 40.65 34.88

Using Bessel’s formula find at t=4.3


Solution: We know the Bessel’s formula is ,
Central Difference 33

( − 1) ∆ +∆ ( − 1)( − )
= + ∆ + + ∆
2! 2 3!
( + 1) ( − 1)( − 2) ∆ +∆
+ + ⋯ … … ..
4! 2

The difference table is as follows,


t = ( ) ∆ ∆ ∆ ∆

2 61.87

-7.79

3 54.08 0.74

-7.05 -0.07

4( ) 47.03 0.67 (0.01)

-6.38 -0.06

5 40.65 0.61

-5.77

6 34.88

Here = 4, = 4.3, h=1 .


.
∴ = = =0.3
Thus from (1) we have ,
= ( ) = (4.3) = .
. ( . ) . . . ( . ) .
=47.03+0.3(-6.38)+ + (−0.06)
! !
=45.04838 ≅ 45.05 (Ans).
Numerical Differentiation 34

Numerical Differentiation
Defn: The process of calculating the derivatives of a function by means of the set of given
values of the function is called numerical differentiation.
Differentiation formula by using Newton’s forward interpolation formula:
Consider Newton’s forward difference formula
( ) ( )( ) ( )( )( )
( )= + ∆ + ∆ + ∆ + ∆
! ! !
+………………………… (1)
Where x = + ℎ
p=
=
Now differentiating (1) w. r. to x we get
( )= .

= .

= (∆ + !
∆ + !
∆ + !

+......................) (2)
Again differentiating (2) w.r.to x we get,
"
= (∆ + ∆ + ∆ ........). . . . . . . . . (3)
! !

Formula (2) and (3) can be used for computing the value of and for non-tabular
values of x. The formula takes a simpler form by using x=
we obtain,
p=0 , Hence from (2), we get
[ ] = [∆ + ∆ + ∆ + ∆ +.........]
! ! !
,[ ] = [∆ − ∆ + ∆ − ∆ +......] . . . . . . . (4)
Again from (3) we obtain,
"
= [∆ + ∆ + ∆ +......]
! !

, [ "] = [∆ −∆ + ∆ −........] . . . . . . . . . (5)


Equation (2) and (4) gives the 1st derivative and (3) and (5) give the 2nd derivative.
Similarly formula for higher derivatives may be obtained by successive differentiation.

Ex. Find the 1st and 2nd derivatives of the function tabulated below at the point x=3.
x 3.0 3.2 3.4 3.6 3.8 4.0

y=f(x) -14 -10.032 -5.296 .256 6.672 14


Numerical Differentiation 35

Soln: The difference table is as below.


x y ∆ ∆ ∆ ∆ ∆

3.0 -14.00

3.968

3.2 -10.032 .768

4.736 .048

3.4 -5.296 .816 0

5.552 .048 0

3.6 .256 .864 0

6.416 .048

3.8 6.672 .912

7.328

4.0 14.00

We know the differentiation formulas by using the Newton’s forward formula are
= [∆ − ∆ + ∆ − ∆ +......] . . . . . . . . (1)
"
= [∆ −∆ + ∆ −.........] . . . . . . . . (2)
Here, = 3.0, ℎ = .2, = −14.00
∆ = 3.968, ∆ = .768, ∆ = .048, ∆ = 0
Hence from (1) we get,
1 1 1
[ ] . = 3.968 − (. 768) + (. 048)
.2 2 3
=18
And from (2) we get,
1
[ "] . = [. 786 − .048 + 0 ]
(. 2)
=18
Ex. Find the 1st and 2 nd derivatives of the function tabulated below at the point x=1.1
Soln: Since the derivatives are required at x=1.1, which is near the beginning of the table,
we shall use Newton’s Forward formula.
The difference formula is as below
Numerical Differentiation 36

x y ∆ ∆ ∆ ∆

1.0 0

.1280

1.2 .1280 .280

.4160 .0480

1.4 .5440 .3360 0

.7520 .0480

1.6 1.2960 .3840 0

1.1360 .0480

1.8 2.4320 .4320

1.5680

2.0 4.00

We know Newton’s Forward difference formula is


( ) ( )( )
y(x)= + ∆ + ∆ + ∆
! !
( )( )( )
+ ∆ +. . . . . . (1)
!
Where p=
=
Differentiating (1) w.r.to x we get,
( )= [∆ + ∆ + ∆ + ∆ +......] (2)
Again differentiating (2) w. r. to x
"( )= [∆ + ∆ + ∆ +........] . . . . . .. (3)
Here, = 1.0, h= .2, x=1.1
. . .
p= = = = .5
. .
Hence from (2) we get,
1 2(. 5) − 1 3(. 5) − 6(. 5) + 2
(1.1) = [.1280 + (. 2880) + (.0480)
.2 2 6
= .630
Again from (3) we get,
" (1.1)
1 6(. 5) − 6
= . 2880 + (. 0480)
(. 2) 6
Numerical Differentiation 37

=0.660

Derivative using Newton’s backward difference formula:


Consider Newton’s backward formula:
( ) ( )( ) ( )( )( )
y(x)= + ∇ + ∇ + ∇ + ∇ +.............(1)
! ! !
Where x= + ℎ, =
=
Now differentiating (1) w.r.to x we get
( )= . =

= [∇ + + ∇ + + + ∇ +( + + + )∇ +....] .
. . . (2)
Again differentiating (2) w. r. to x
"( )= ∇ + ( + 1)∇ +( + + ∇ +........] . . . . . . . (3)

Formula (2) and (3) can be used for computing the value of and respectively for
non-tabular value of x.
For tabular value of x, the formula takes a simpler form for by using x= i.e. k=0.
Then (2) and (3) becomes
( )= [∇ + ∇ + ∇ + ∇ +........] . . . . . . (4)
"( )= [∇ +∇ + ∇ +........] . . . . . . . (5)
(4 ) and (5) gives 1st and 2 nd derivative.

Ex: Find (2.2) and "


(2.2) from the following table.
x 1.4 1.6 1.8 2.0 2.2

f(x) 4.0552 4.9530 6.0496 7.3891 9.0250

Soln: The difference table is as below:

x y=f(x) ∇ ∇ ∇ ∇

1.4 4.0552

.8918

1.6 4.9530 .1988

1.0966 .0441
Numerical Differentiation 38

1.8 6.0496 .2429 .0094

1.3395 .0535

2.0 7.3891 .2964

1.6359

2.2 9.0250

Here = 2.2, = 9.0250, ∇ = 1.6359, ∇ = .2964, ∇ = .0535,


∇ = .0094, h=.02
We know
( )= [∇ + ∇ + ∇ + ∇ +.........]
1 1 1 1
(2.2) = 1.6359 + (. 2264) + (. 0535) + (. 0094) = 9.021416667
.2 2 3 4
Again
"( )= [∇ +∇ + ∇ +.......]
"
(2.2) = (. )
. 2964 + .0535 + (. 0094) = 8.962916667

Derivative based on Stirling’s formula:


We know the Stirling’s formula is
∆ ∆ ( ) ∆ ∆ ( )
f(x)= + + ∆ + + ∆ +........(1)
! !
Where p = i.e. =
Differentiation (10 w. r. to x, we get
∆ ∆ ∆ ∆
( )= [ + ∆ + + ∆ +......] . . . . . . . . .(2)
! !
Again differentiating (2) w. r. to x
∆ ∆
"( )= [∆ + + ∆ +.........] . . . . . . (3)
!
For the point x= we get
p=0 Thus (2) and (3) becomes
∆ ∆ ∆ ∆
( )= [ − +........... (4)
"( )= [∆ − ∆ +.............. (5)
(2) and (4) gives the 1 derivative and (3) and (5) gives the 2 nd derivative.
st

Ex: Given the table


Numerical Differentiation 39

x 0 1 2 3 4

f(x) 6.9897 7.4036 7.7815 8.1281 8.4510


" (2)
Find (2) using appropriate formula.
Soln: Here we use the derivative which is obtained from Stirling’s formula.
The table is
x f(x) ∆ ∆ ∆ ∆

0 6.9897

.4139

1 7.4036 -.0366

.3779 .0047

2 7.7815 -.0313 .0025

.3466 .0076

3 8.1281 -.0237

.3224

4 8.4510

Here =2, ℎ = 1
= 7.7815, ∆ = .3466, ∆ = .3779,
∆ = −.0313, ∆ = .0076, ∆ = .0047, ∆ = .0025
We know that
∆ ∆ ∆ ∆
( )= [ − !
+........]
1 . 3779 + .3466 1 . 0047 + .0076
(2) = [ − ]
1 2 6 2
= .361225
"(
And )= [∆ − ∆ +........]
" (2)
1 1
= [−.0313 − (. 0025)]
1 2
= -.03151
Ex: Given the data
x 0 1 2 4

f(x) 5 14 41 98
Numerical Differentiation 40

Use the Lagrange’s interpolation formula to find (0.9).


Soln: We know the Lagrange’s formula is
( − )( − )( − ) ( − )( − )( − )
( )= ( )+ ( )
( − )( − )( − ) ( − )( − )( − )
( − )( − )( − ) ( − )( − )( − )
+ ( )+ ( )
( − )( − )( − ) ( − )( − ) − )

( )( )( ) ( )( )( )
=( )( )( )
(5) +
( )( )( )
(14)
( )( )( ) ( )( )( )
+( (41) + (98)
)( )( ) ( )( )( )

= ( 5) + (14)
−5 +4 −3 +2
+ (41) + (98)
−4 24
=(− + − + ) + − 28 + − +
− + − 41 + +5
∴ ( )=− + − +5
( )= + −
(. 9) = (.9) + (. 9 ) −
=18.26125

Ex: Use the following data to find (5)


0 2 3 4 7 9

( ) 4 26 58 112 466 922

Soln: Here we use Newton’s divided difference formula.


The table is

( ) 1st divided 2nd divided 3rd divided 4th divided


difference difference difference difference

0 4
Numerical Differentiation 41

11

2 26 7

32 1

3 58 11 0

54 1

4 112 16 0

118 1

7 466 22

228

9 922

We know the Newton’s divided difference formula is


( ) = ( )+( − ) ( , )+( − )
( − ) ( , , )+........
We can take = 0, = 2, = 3, =4
Therefore ( ) = 4, ( , ) = 11, ( , , ) = 7, ( , , , )=1
∴ ( ) = 4 + ( − 0)11 + ( − 0)( − 2)7 + ( − 0)( − 2)( − 3)1
= 4 + 11 + 7 − 14 + − 5 +6x
= + 2 +3x+4
So
( )=3 +4 +3
(5) = 3(5) + 4(5) + 3
= 98
Numerical Integration 42

Numerical Integration
*A General Quadrature Formula for Equidistance Ordinates.
Let a set of data points ( x0 , y0 ) , ( x1 , y1 ) , ( x2 , y2 ) , …………. ( xn , yn ) of a function = ( )
be given, where f(x) is not known explicitly, it is required to compute the value of the
definite integral
b
I   ydx (1)
a
Let the interval [a,b] be divided into n equal subintervals each length h such that
a  x0  x1  x2  .....  xn  b . Clearly, xn  x0  nh . Hence (1) becomes
xn
I  ydx
x0

Approximating y by Newton’s forward difference interpolation formula, we obtain


xn
 p ( p  1) 2 p ( p  1)( p  2) 3 
I    y0  py0   y0   y0  ............... dx
x0 
2 6 
Since x  x0  ph
dx  hdp
x  x0  p  0
x  xn  p  n and hence the above integral becomes
n
 p ( p  1) 2 p( p  1)( p  2) 3 
I  h   y0  py0   y0   y0  .......... ..... dp
0
2 6 
Which gives on simplification
 n2  n3 n 2  2 y0  n 4 3
3
2   y0


I  h ny0  y0      
 n n    ............... .
 2  3 2 2  4  6 
……………………………………………(2)
This is the general formula.

*Trapezoidal Rule.
Let a set of data points ( x0 , y0 ) , ( x1 , y1 ) , ( x2 , y2 ) , …………. ( xn , yn ) of a function = ( )
be given, where f(x) is not known explicitly, it is required to compute the value of the
definite integral
b
I   ydx (1)
a
Let the interval [a,b] be divided into n equal subintervals each length h such that
a  x0  x1  x2  .....  xn  b . Clearly, xn  x0  nh . Hence (1) becomes
Numerical Integration 43

xn
I  ydx
x0

Approximating y by Newton’s forward difference interpolation formula, we obtain


xn
 p ( p  1) 2 p ( p  1)( p  2) 3 
I    y0  py0   y0   y0  ............... dx
x0 
2 6 
Since x  x0  ph
dx  hdp
x  x0  p  0
x  xn  p  n and hence the above integral becomes
n
 p ( p  1) 2 p( p  1)( p  2) 3 
I  h   y0  py0   y0   y0  .......... ..... dp
0
2 6 
Which gives on simplification
 n2  n3 n 2  2 y0  n 4  3 y0 
I  h ny0  y0        n3  n 2   ............... .
 2  3 2 2  4  6 
……………………………………………(2)
nd
Putting n=1 in (2) and neglecting 2 and higher order differences, we get
x1
 1 
 y dx  h  y0  2 y0 
x0

 y  y0 
 h  y0  1
 2 
y  y 
 h 0 1 
 2 
x2
 y1  y2 
Similarly  y dx  h  2 
x1
x3
 y2  y3 
 y dx  h 2 
x2

………………
xn
 yn 1  yn 
 y dx  h  2 
x n 1

Adding those n integrals, we get


Numerical Integration 44

xn
h
 y dx  2  y0  2( y1  y2  .......  yn 1 )  yn 
x0

Which is known as trapezoidal rule.

5.2
Ex. Calculate the value of the integral  ln x dx by Trapezoidal rule.
4
Soln. Divide the interval [4, 5.2] into six equal parts. So that h=(5.2-4)/6=0.2 and the
value of ln x for each point of sub division are given below:
n x y=ln x
0 4.0 1.3862944
1 4.2 1.4350845
2 4.4 1.4816045
3 4.6 1.5260563
4 4.8 1.5686159
5 5.0 1.6094379
6 5.2 1.6486586
We have from the trapezoidal rule
x6
h
 y dx  2  y0  2( y1  y2  y3  y4  y5 )  y6 
x0
5.2
0.2 1.3862944  2(1.4350845  1.4816045 
  ln xdx 
4
2  1.5260563  1.5686159  1.6094379)  1.6486586

 0.1(18.276551)
 1.8276551

Ex. A curve is drawn to pass through the points given by the following table:
x 1 1.5 2 2.5 3 3.5 4
y 2 2.4 2.7 2.8 3 2.6 2.1
Find the area bounded by the curve, the x-axis and the lines x=1, x=4
Soln. In order to find the required area we shall compute the value of the integral
4
I   y dx
1
Here n=6, therefore h=(4-1)/6=0.5
We have from the trapezoidal rule
x6
h
 y dx  2  y0  2( y1  y2  y3  y4  y5 )  y6 
x0
Numerical Integration 45

5 .2
0. 5
  y dx  2  2(2.4  2.7  2.8  3  2.6)  2.1
4
2
 7.775

*Simpson’s 1/3 Rule.


Let a set of data points ( x0 , y0 ) , ( x1 , y1 ) , ( x2 , y2 ) , …………. ( xn , yn ) of a function = ( )
be given, where f(x) is not known explicitly, it is required to compute the value of the
definite integral
b
I   ydx (1)
a
Let the interval [a,b] be divided into n equal subintervals each length h such that
a  x0  x1  x2  .....  xn  b . Clearly, xn  x0  nh . Hence (1) becomes
xn
I  ydx
x0

Approximating y by Newton’s forward difference interpolation formula, we obtain


xn
 p ( p  1) 2 p ( p  1)( p  2) 3 
I    y0  py0   y0   y0  ............... dx
x0 
2 6 
Since x  x0  ph
dx  hdp
x  x0  p  0
x  xn  p  n and hence the above integral becomes
n
 p ( p  1) 2 p( p  1)( p  2) 3 
I  h   y0  py0   y0   y0  .......... ..... dp
0
2 6 
Which gives on simplification
 n2  n3 n 2  2 y0  n 4  3 y0 
I  h ny0  y0        n3  n 2   ............... .
 2  3 2 2  4  6 
……………………………………………(2)

Putting n=2 in (2) and neglecting 3rd and higher order differences, we get
x2
 1 2 
 y dx  2h  y0  y0  6  y0 
x0
Numerical Integration 46

 1 
 2h  y0  ( y1  y0 )  ( y2  2 y1  y0 )
 6 
h
  y0  4 y1  y2 
3
x4
h
Similarly  y dx  3  y2  4 y3  y4 
x2
x6
h
 y dx  3  y4  4 y5  y6 
x4

………………………..
xn
h
 y dx  3  yn  2  4 yn 1  yn 
x n2

Adding those integrals, we get

xn
h  y0  4( y1  y3  y5  .......  yn 1 )
 y dx  3  2( y2  y4  y6  ..... yn  2 )  yn 

x0

Which is known as Simpson’s 1/3 Rule, or simply Simpson’s rule. It should be noted that
this rule requires the division of the whole range into an even number of subintervals of
width h.

5 .2
Ex. Calculate the value of the integral  ln x dx by Simpson’s 1/3 Rule.
4

Soln. Divide the interval [4, 5.2] into six equal parts. So that h=(5.2-4)/6=0.2 and the
value of ln x for each point of sub division are given below:

n x y=ln x
0 4.0 1.3862944
1 4.2 1.4350845
2 4.4 1.4816045
3 4.6 1.5260563
4 4.8 1.5686159
5 5.0 1.6094379
6 5.2 1.6486586
We have from Simpson’s 1/3 rule
Numerical Integration 47

x6
h
 y dx  3  y0  4( y1  y3  y5 )  2( y2  y4 )  y6 
x0
5.2
  ln xdx
4

0.2 1.3862944  4(1.4350845  1.5260563  1.6094379) 



3  2(1.4816045  1.5686159)  1.6486586 

0.2
 ( 27.417709)
3
 1.8278472

1
dx
Ex. Find  1  x2 by using Simpson’s 1/3 Rule. Hence obtain the approximate value of 
0
.
Soln. Divide the the range of integration [0, 1] into 6 equal parts. So that h=(1-0)/6=1/6.
1
the value of y  for each point of sub division are given below:
1  x2
n x y
0 0 1
1 1/6 0.9729729
2 2/6 0.9
3 3/6 0.8
4 4/6 0.6923076
5 5/6 0.5901639
6 1 0.5
By Simpson’s 1/3 Rule we get
x6
h
 y dx  3  y0  4( y1  y3  y5  )  2( y2  y4 )  y6 
x0
1
dx
 2
01 x

1 / 6 1  4(0.9729729  0.8  0.5901639)



3  2(0.9  0.6923076)  0.5 

1
 (14.137163)
18
 0.7853979
1
But  1  x 2  tan
dx 1
x 10  tan 1
1  tan 1 0   / 4
0
Numerical Integration 48

Therefore  / 4  0.7853979
  4(0.7853979)  3.1415916

0.7
Ex. Evaluate  x1 / 2e  x dx by using Simpson’s 1/3 Rule.
0.5
Soln. Divide the range of integration [0.5, 0.7] into 4 equal parts. So that h=(0.7-
0.5)/4=.05. the value of y  x1 / 2e  x for each point of sub division are given below:

n x y
0 0.50 0.4288818
1 0.55 0.4278774
2 0.60 0.4251076
3 0.65 0.4208867
4 0.70 0.4154730
By Simpson’s 1/3 Rule we get
x4
h
 y dx  3  y0  4( y1  y3 )  2( y2 )  y6 
x0
1
  x1/2 e  x dx
0

0.05 0.4288818  4(0.4278774  0.4208867)



3  2(0.4251076)  0.4154730 

 0.0848271
1.4
Ex. Evaluate  (sin x  ln x  e x ) dx by using Simpson’s 1/3 Rule.
0. 2
Soln. Divide the the range of integration [0.2, 1.4] into 12 equal parts. So that h=(1.4-
0.2)/12=.1. the value of y  sin x  ln x  e x for each point of sub division are given
below:

n x y
0 0.2 3.02950
1 0.3 2.84935 2.84935
2 0.4 2.79753 2.79753
3 0.5 2.82130 2.82130
4 0.6 2.89759 2.89759
5 0.7 3.01464 3.01464
6 0.8 3.16604 3.16604
Numerical Integration 49

7 0.9 3.34829 3.34829


8 1.0 3.55975 3.55975
9 1.1 3.80007 3.80007
10 1.2 4.06984 4.06984
11 1.3 4.37050 4.37050
12 1.4 4.70418
sum 20.2042 16.4908

By Simpson’s 1/3 Rule we get


x6
h  y0  4( y1  y3  y5  y7  y9  y11)
 y dx  3  2( y2  y4  y6  y8  y10 )  y12 

x0
1. 4
  (sin x  ln x  e x ) dx
0.2
0.1
 3.02950  4(20.2042)  2(16.4908)  4.70418
3
 4.051059

*Simpson’s 3/8 Rule.


Let a set of data points ( x0 , y0 ) , ( x1 , y1 ) , ( x2 , y2 ) , …………. ( xn , yn ) of a function = ( )
be given, where f(x) is not known explicitly, it is required to compute the value of the
definite integral
b
I   ydx (1)
a
Let the interval [a,b] be divided into n equal subintervals each length h such that
a  x0  x1  x2  .....  xn  b . Clearly, xn  x0  nh . Hence (1) becomes
xn
I  ydx
x0

Approximating y by Newton’s forward difference interpolation formula, we obtain


xn
 p ( p  1) 2 p ( p  1)( p  2) 3 
I    y0  py0   y0   y0  ............... dx
x0 
2 6 
Since x  x0  ph
dx  hdp
x  x0  p  0
x  xn  p  n and hence the above integral becomes
Numerical Integration 50

n
 p ( p  1) 2 p( p  1)( p  2) 3 
I  h   y0  py0   y0   y0  ............... dp
0
2 6 
Which gives on simplification
 n2  n3 n 2  2 y0  n 4  3 y0 
I  h ny0  y0        n3  n 2   ............... .
 2  3 2 2  4  6 
……………………………………………(2)
Putting n=3 in (2) and neglecting 4th and higher order differences, we get
x3
 3 3 2 1 3 
 y dx  3h  y0  2 y0  4  y0  8  y0 
x0

 3 3 1 
 3h  y0  ( y1  y0 )  ( y2  2 y1  y0 )  ( y3  3 y2  3 y1  y0 ) 
 2 4 8 
x3
3h
 y dx   y0  3 y1  3 y2  y3 
x0
8
x6
3h
Similarly  y dx   y3  3 y 4  3 y5  y 6 
x3
8
x9
3h
 y dx   y6  3 y7  3 y8  y9 
x6
8
………………………..
xn
3h
 y dx  8  yn 3  3 yn  2  3 yn 1  yn 
x n 3

Adding those integrals, we get

xn
3h  y0  3( y1  y2  y4  y5 .......  yn  2  yn 1 )
 y dx  8   2( y3  6 ..... yn  3 )  yn 

x0

Which is known as Simpson’s 3/8 Rule.

5.2
Ex. Calculate the value of the integral  ln x dx by Simpson’s 3/8 Rule.
4
Soln. Divide the interval [4, 5.2] into six equal parts. So that h=(5.2-4)/6=0.2 and the
value of ln x for each point of sub division are given below:
n x y=ln x
0 4.0 1.3862944
1 4.2 1.4350845
2 4.4 1.4816045
Numerical Integration 51

3 4.6 1.5260563
4 4.8 1.5686159
5 5.0 1.6094379
6 5.2 1.6486586

We have from Simpson’s 3/8 rule


x6
3h
 y dx  y0  3( y1  y2  y4  y5 )  2( y3 )  y6 
x0
8
5.2
  ln xdx
4

1.3862944 
3  0.2 
  3(1.4350845  1.4816045  1.5686159  1.6094179) 
8  
 2(1.5260563)  1.6486586 
0.6
 ( 24.371294)
8
 1.827847

1
2
Ex. Calculate the value of the integral  e  x dx by Simpson’s 3/8 Rule.
0
Soln. Divide the interval [0, 1] into 10 equal parts. So that h=(1-0)/10=0.1 the value of
2
e x for each point of sub division are given below:
n x y= e  x
2

0 0.0 1.00000
1 0.1 0.99005
2 0.2 0.96079
3 0.3 0.91393
4 0.4 0.85214
5 0.5 0.77880
6 0.6 0.69768
7 0.7 0.61263
8 0.8 0.52729
9 0.9 0.44486
10 1.0 0.36788
Numerical Integration 52

We have from Simpson’s 3/8 rule


x10
3h  y0  3( y1  y2  y4  y5  y7  y8 )
 y dx 
8  2( y3  y6  y9 )   y10 

x0
1
2
  e x dx
0

1.00000 
3  0. 1 
  3(0.99005  0.96079  0.85214  0.77880  0.61263  0.52729) 
8  
 2(0.91393  0.69768  0.44486)  0.36788 
0.3
 1  3(4.7222)  2(2.05647)  0.36788
8
 0.73677825
System of Linear Equation 53

System of linear equation


#Gausses scidal method :
Consider the system of equations
x+ y+ z=
x+ y+ z=
x+ y+ z=
Now, we solve the 1st equation for x in terms of ‘y’ and ‘z’
x= (1)
Similarly from the 2nd & 3rd equation
y= (2)
And
z= (3)
Next, we make a first approximation to the solution which we call x , y &
z ( Usually we select zeros for the 1st approximation to the solution ) .
These 1st approximation are then used in equation (1) to compute a new approximate value
for x
= (4)
= (5)
= (6)
Proceeding in this way we get the general equation for the Gausses scidal iterations are
=
=
=

Ex: Solve the system by Gausses scidal method.


2x + y = 4
x – y = –1
Solution : Our initial estimation of the solution
=0 , =0
Iteration 1: = = =2
= = =3
Iteration 2: = = = 0.5

= = = = 1.5
.
Iteration 3 : = = = 1.25
.
= = = 2.25
Thus the approximate solution is x = 1.25 & y = 2.25
System of Linear Equation 54

Ex: Solve the system


27x + 6y –z = 85
6x + 15y + 2z = 72
x + y + 54z = 110
Solution: Solving the equations for the unknown we can rewrite the equations
x = (85 – 6y + z ) (1)
y= (72 – 6x -2z ) (2)
z = (110 – x –y ) (3)
Our initial estimations are
=0 , =0 & =0
st
1 iteration:
= (85 − 6 + ) = = 3.15
= (72 − 6 −2 ) = {72 − (6 × 3.15)} = 3.54
= ( 110 − − ) = 1.91
2nd Iteration: x = (85 − 6y + z ) = {85 − (6 × 3.54) + 1.91} = 2.43
= (72 − 6 −2 )= {72 − (6 × 2.43) − (2 × 1.91)} = 3.57
= (110 − − )= (110 − 3.57 − 2.43) = 1.93

3rd iteration:
1 1
= (85 − 6 + ) = {85 − (6 × 3.57) + 1.93} = 2.43
27 27
= (72 − 6 − 2 ) = {72 − (6 × 2.43) − (2 × 1.93)} = 3.57
= (110 − − ) = (110 − 3.57 − 2.43) =1.93
Thus the approximate result is x = 2.43, y = 3.57 & z = 1.93

#Gausses elimination method: (Forward elimination and backward substitution)


Consider the system
+ + + … … … … .. + = (1)
+ + + … … … … .. + = (2)
. . . . . . …………………………………………..
…………………………………………………..
+ + + … … … … .. + = (3)
The first phase is designed to reduce the set of equation to an upper triangular system.
The initial step in the process in to divide equation (1) ( pivot equation )by the constant
a , ( the pivote coefficient)
+ + ……….+ = (4)
The above process is called normalizations.
Next multiply the normalized equation (4) by the first coefficient of second equation, we
get
System of Linear Equation 55

+( ) + … … … … . +( ) = (5)
st nd
The 1 unknown can be eliminated from the 2 equation by substituting equation (5) from
(2)
− + … … … … . . +( − ) = −
⇒ + ………………+ =
Repeating the process for the remaining equation, the result become in the following
modified system.
+ + + … … …… … … .+ = (6)
+ + …………… …. + = (7)
+ + ……………….+ = (8)
…………….. ……… ……………………….
……………………………………………….
+ + ……… …… ….+ = (9)
nd
Now repeat the above process in order to eliminate the 2 unknown from equation (8)
through (9), we get
+ + + ……………..+ =
+ + ………………+ =
+ ………………+ =
+ ………………+ =
Where the double prime indicates that the eliminates have been changed or modified twice
.The procedure can be continued using the remaining pivot equations, we get
+ + + ……………..+ = (10)
+ + ………………+ = (11)
+ ………………+ = (12)
……………………………………
………………………………………
( ) ( )
= (13)
( )
From (13), we get = ( ) (14)
Remaining x’s can be represented by the following formula
( ) ( )

= ( ) (15)
[where i = n-1 ,n-2 ,………., 3 , 2 , 1 ]

Ex: Use Gausses elimination method to solve


3 − 0.1 − 0.2 = 7.85 (1)
0.1 + 7 − 0.3 = −19.3 (2)
0.3 + 0.2 + 10 = 71.4 (3)
Carry six significant figures during computation .
Solution: Now normalized the equation (1) by dividing the pivot coefficient 3 we get
− 0.333333 − 0.666666 = 2.61667 (4)
Next, multiplying equation (4) by 0.1 and subtracting the result from (2) we get
System of Linear Equation 56

7.00333 − 0.293333 = −19.5617 (5)


Now to eliminate x multiplying equation (4) by 0.3 and subtracting the result from (3) we
get the new system
3 − 0.1 − 0.2 = 7.85 (6)
7.00333 − 0.293333 = −19.5617 (7)
−0.190000 + 10.0200 = 70.6156 (8)
Now normalized the equation (7) dividing by 7.00333 we get
− 0.0418848 = −2.79320 (9)
Then multiplying the equation (9) by -0.190000 and subtracting the result from (8)
3 − 0.1 − 0.3 = 7.85
7.00333 − 0.293333 = −19.5617
10.0120 = 70.0843
We can now solve the equations by backward substitution
= 7.00003
= −2.50000
= 3.00000

Gausses Jordan method :


Let the system of equation be
+ + =
+ + =
+ + =
Then the augmented matrix is

By any number of row operation the above matrix is reduced to


1 0 0
0 1 0
0 0 1
Thus the solution is =
=
=

Ex: Solve the following system of equation by Gausses Jordan method .


x+y+z=6
x + 2y + 3z = 10
x + 2y + 4z = 1
Solution: The augmented matrix of the above system is
1 1 1 6
1 2 3 10
1 2 4 1
System of Linear Equation 57

1 1 1 6
~ 0 1 2 4 [R = R − R ] , [R = R − R ]
0 1 3 −5
1 1 1 6
~ 0 1 2 4 [R = R − R ]
0 0 1 −9
1 1 0 15
~ 0 1 0 22 [R = R − R ] , [R = R − 2R ]
0 0 1 −9
1 0 0 −7
~ 0 1 0 22 [R = R − R ]
0 0 1 −9
Thus the solutions are x = −7
y = 22
z = −9
Curve Fitting 58

Curve Fitting
Suppose we have m observations (x1, y1), (x2, y2). . . . . .(xm, ym) of two variables and
and it is requested to fit a curse of the type
y = a + bx + cx 2 + . . . . . . . . + kxn …………(1)
Now we have to determine the constants a, b . . . . . k such that it represents the curve of
best fit of that degree. In case m=n, we get in general a unique set of values satisfying the
given systems of equations. But if m>n, then by substituting the different values of x and y
in equation (1) we get m equations and we want to find only n constants. Hence there may
be no such solution to satisfy all m equations. So we try to obtain those values of a, b . . . .
k which may give the best fit i.e. which may satisfy all the equations as nearly as possible.
In such a case the principle of least squares asserts a suitable method.
Putting x1, x2 . . . . . . . xm for x in equation (1), we have
Y1 = a + bx1 + cx12 + . . . . . . . + kx1n
Y2 = a + bx2 + cx22 + . . . . . . . + kx2n
. . . . . . . .. .. . . .. . . .. . . .. . . . ….
Ym = a + bx m + cxm2 + . . . . . . . + kxmn
The quantities Y1, Y2 . . . . . . . . Ym are the expected values of y corresponding to x = x1,
x = x2 . . . . . . . x = xm respectively. The values y1, y2, . . . . .ym are the observed values of y
corresponding to the given values x1, x2, . . . . . . xm of x. In general the expected values are
different from the observed values.
Let Rr = yr – Yr. For different values of r these differences are called residuals.
The quantity R12 + R22 + . . . . . + Rm2 provides a measure of the ‘goodness of fit’ of
the curse to the given data.
If it is small, the fit is good, if is large the fit is bad.
Now set
U = ∑ i2
= ∑( yr – Yr)2
= ∑(yr – a – bxr – cxr2 - . . . . . . . .)2
By this principle of least square the constants a, b, c . . . . . k are chosen in such a
manner that sum of square of residuals in minimum. For maximum or minimum of U, we
must have
=0= = =. . . . . . . . .=
After simplifying these relations, we have
∑y = ma + b∑x + . . . . . . . + k∑x n
∑xy = a∑x + b∑x2 . . . . . . . + k∑xn+1
∑x2y = a∑x2 + b∑x3 . . . . . . . + k∑xn+2
. . . . . . .. . . . . . . . . . . . . . . . . . . . … . . .
∑xny = a∑xn + b∑xn+1 . . . . . . . + k∑x2n
These equations are (n+1) in number and can be solved as simultaneous equations to give
the values of the constants a, b . . . . . k. These equations are called normal equations.
Curve Fitting 59

If we calculate the second order partial derivatives and the values a, b . . . . . k are put in
these derivatives. They give a positive value of the function.
So U is minimum.
Particular case.
If n = 1, then the curve to be fitted is a straight line y = a + bx and the normal equations
are
∑y = ma + b∑x
∑xy = a∑x + b∑x2
If n = 2, then the curve to be fitted is a second degree parabola y = a + bx + cx2 and the
normal equations are
∑y = ma + b∑x + c∑x2
∑xy = a∑x + b∑x2 + c∑x3
∑x2y = a∑x2 + b∑x3 + k∑x4
Ex. Fit a straight line to the following data regarding x as the independent variable:
x: 0 1 2 3 4
y: 1 1.8 3.3 4.5 6.3
Solution. Let the straight line to be fitted to the given data be
y = a + bx. Then the normal equations are
∑y = ma + b∑x
∑xy = a∑x + b∑x2
Now
x y xy x2
0 1 0 0
1 1.8 1.8 1
2 3.3 6.6 4
3 4.5 13.5 9
4 6.3 25.2 16
Total 10 16.9 47.1 30

In this case m = 5, ∑x = 10, ∑y = 16.9, ∑xy = 47.1, ∑x2 = 30


Substituting these values in the normal equations, we have

16.9 = 5a + 10b
And 47.1 = 10a + 30b
Solving the above equations, we obtain a = 0.72, b = 1.33.
Hence the fitted line is
y = 0.72 + 1.33x (answer)
Curve Fitting 60

Ex: Fit a second degree parabola to the following data


x: 0 1 2 3 4
y: 1 5 10 22 38

Solution: Let the parabola to be fitted to the given data be y = a + bx + cx2.


Then the normal equations are ∑y = ma + b∑x + c∑x2
∑xy = a∑x + b∑x2 + c∑x3
∑x2y = a∑x2 + b∑x3 + k∑x4
Now
x y x2 x3 x4 xy x2 y
0 1 0 0 0 0 0
1 5 1 1 1 5 5
2 10 4 8 16 20 40
3 22 9 27 81 66 198
4 38 16 64 256 152 608
10 76 30 100 354 243 851

Substituting the values of ∑x, ∑y . . . . . etc in the normal equations, we get


76 = 5 + 10 + 30
243 = 10 + 30 + 100
851 = 30 + 100 + 354
Solving those equations simultaneously, we get
a = 1.43
b = 0.24
c = 2.21
Hence the parabola is
y = 1.43 + 0.24x + 2.21x2 (answer)

Ex. The weights of a calf taken at weekly intervals are given below. Fit straight line using
the method of least squares and calculate the rate of growth per week.
Age(x): 1 2 3 4 5 6 7 8 9 10
Weight
52.2 58.7 65.0 70.2 75.4 81.1 87.2 95.5 102.2 108.4
(y):

Solution: Here x and y denote the variables age and weight respectively.
Let the least square line is = + . Then the normal equations are
∑ = + ∑
∑ = ∑ + ∑ 2

Now
Curve Fitting 61

x y x2 xy
1 52.2 1 52.2
2 58.7 4 117.4
3 65.0 9 195.0
4 70.2 16 280.8
5 75.4 25 377.0
6 81.1 36 486.6
7 87.2 49 610.4
8 95.5 64 764.0
9 102.2 81 919.8
10 108.4 100 1084.0
55 795.9 385 4887.2

Substituting these values in the normal equations, we get


795.9 = 10 + 55
4887.2 = 55 + 385
Solving above equations, we get
= 45.61
= 6.18
∴ The line is
= 45.61 + 6.18 (answer)
Again we get

= 6.18
∴ the rate of growth per week is 6.18 units. (Answer)
Ex. Fit an exponential curve of the form = to the following data:
x: 1 2 3 4 5 6 7 8
y: 1.0 1.2 1.8 2.5 3.6 4.7 6.6 9.1

Solution. Here =
⟹ = + .

Let
=
=
=
∴ = +
The normal equations are
∑ = + ∑
∑ = ∑ + ∑ 2
Curve Fitting 62

x y Y = lny xY x2
1 1.0 0.0000 0.0000 1
2 1.2 0.0792 0.1548 4
3 1.8 0.2553 0.7659 9
4 2.5 0.3979 1.5916 16
5 3.6 0.5563 2.7815 25
6 4.7 0.6721 4.0326 36
7 6.6 0.8195 5.7365 49
8 9.1 0.9590 7.6720 64
36 30.5 3.7393 22.7385 204
Now
∴ From normal equations
3.7393 = 8A + 36B
22.7385 = 36A + 204B
Solving these, we get
= 1.8336, = 0.1406
∴ = ℯ = ℯ1.8336 = 0.68
= ℯ = ℯ0.1406 = 1.38
∴ The required curve is
=
= 0.68 × 1.38

You might also like