Math Iv Chapter 3
Math Iv Chapter 3
(Part Two)
f (xn ) − f (xn−1 )
f (xn−1 , xn ) = [xn−1 , xn ] = .
xn − xn−1
Again, the second divided difference of f (x) for the arguments x0 , x1 and
x2 is defined as f (x0 , x1 , x2 ) = [x0 , x1 , x2 ] = [x1 , xx22]−[x
−x0
0 , x1 ]
.
[x2 , x3 ]−[x1 , x2 ]
f (x1 , x2 , x3 ) = [x1 , x2 , x3 ] = x3 −x1 .
The third divided difference is given as
f (x0 , x1 , x2 , x3 ) = [x0 , x1 , x2 , x3 ] = [x1 , x2 ,xx33]−[x
−x0
0 , x1 , x2 ]
In general, we have
Where the last term is the reminder term in the formula. The formula (i)
above is called Newton’s Divided interpolation formula.
Example
Construct a divided difference table for the following data.
x 4 5 7 10 11 13
f (x) 48 100 294 900 1210 2028
Using Newton’s divided difference formula, find the cubic function from the
following table of values:
x 0 2 3 5
y 1 15 40 156
Solution: We form the table of divided differences as follows:
x y 1st 2nd 3rd
0 1
2 15 7
3 40 25 6
5 156 58 11 1
Exercise II.3
x -4 -1 0 2 5
f (x) 1245 33 5 9 1335
x 0 1 3 5
f (x) 8 11 35 123
x 0 2 3 6
f (x) 659 705 729 804
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 − xn−1 ).
Until
yn
an = .
(xn − x0 )(xn − x1 )(xn − x2 ) . . . (xn − xn−1 )
(x − x1 )(x − x2 )(x − x3 ) . . . (x − xn )
y = f (x) = y0
(x0 − x1 )(x0 − x2 )(x0 − x3 ) . . . (x0 − xn )
(x − x0 )(x − x2 )(x − x3 ) . . . (x − xn )
+ y1
(x1 − x0 )(x1 − x2 )(x1 − x3 ) . . . (x1 − xn )
+ .......................................
(x − x0 )(x − x1 )(x − x2 ) . . . (x − xn−1 )
+ yn . (2)
(xn − x0 )(xn − x1 )(xn − x2 ) . . . (xn − xn−1 )
Note:
1 This formula can be used irrespectively of whether the values
x0 , x1 , x2 , . . . , xn are equally spaced or not.
2 It is simple and easy to remember but its application is not speedy.
3 The main drawback of it is that if another interpolation value is inserted,
then the interpolation coefficients are required to be recalculated.
Example
Use Lagrange’s interpolation formula to find the value of y when x = 10, if the
values of x and y are given as below:
x 5 6 9 11
y 12 13 14 16
Solution: Here,
x0 = 5, x1 = 6, x2 = 9, x3 = 11, y0 = 12, y1 = 13, y2 = 14, y3 = 16
. By Lagrange’s formula in equation 2
(x − 6)(x − 9)(x − 11) (x − 5)(x − 9)(x − 11)
y= (12) + (13)
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11)
(x − 5)(x − 6)(x − 11) (x − 5)(x − 6)(x − 9)
+ (14) + (16)
(9 − 5)(9 − 6)(9 − 11) (11 − 5)(11 − 6)(11 − 9)
Putting x = 10 in the above equation, we get
(10 − 6)(10 − 9)(10 − 11) (10 − 5)(x − 9)(10 − 11)
y10 = (12) + (13)
(5 − 6)(5 − 9)(5 − 11) (6 − 5)(6 − 9)(6 − 11)
(10 − 5)(10 − 6)(10 − 11) (10 − 5)(10 − 6)(10 − 9)
+ (14) + (16)
(9 − 5)(9 − 6)(9 − 11) (11 − 5)(11 − 6)(11 − 9)
∴ y10 = 14.6666667.
Exercise II.4
x 0 2 3 6
y 648 704 729 792
INVERSE INTERPOLATION
Definition
So far, given a set of values of x and y , we were required to find the value
of y corresponding to a value of x. Sometimes, we may require to find the
value of x corresponding to a certain value of y .
The process of finding such a value of x is called inverse interpolation.
In this section, we shall study two methods of inverse interpolation:
1 Lagrange’s method.
2 Iterative method.
We apply Lagrange’s method when the arguments (xi ) are unequally spaced
and the iterative method when the arguments are equally spaced.
Lagrange’s Method
(y − y1 )(y − y2 )(y − y3 ) . . . (y − yn )
x = f (y ) = x0
(y0 − y1 )(y0 − y2 )(y0 − y3 ) . . . (y0 − yn )
(y − y0 )(y − y2 )(y − y3 ) . . . (y − yn )
+ x1
(y1 − y0 )(y1 − y2 )(y1 − y3 ) . . . (y1 − yn )
+ .......................................
(y − y0 )(y − y1 )(y − y2 ) . . . (y − yn−1 )
+ xn . (3)
(yn − y0 )(yn − y1 )(yn − y2 ) . . . (yn − yn−1 )
Lagrange’s Method
Example
The following table gives the values of x and y :
x 30 35 40 45 50
y 15.9 14.9 14.1 13.3 12.5
Lagrange’s Method
Iterative Method
Iterative Method
Iterative Method
Note:
1 This method can be applied equally well by starting with any other
interpolation formula.
2 It is powerful iterative procedure to find the root of an equation to a good
degree of accuracy.
Example
From the following table
Iterative Method
Solution:
The forward differences table is given as follows
x y 4 42 43 44
1.8 2.9
2.0 3.6 0.7
2.2 4.4 0.8 0.1
2.4 5.5 1.1 0.3 0.2
2.6 6.7 1.2 0.1 -0.2 -0.4
1 1
x (1) = [yx − y0 ] = (5 − 2.9) = 3.
4y0 0.7
Iterative Method
Solution:
Using Equation
h (7), then the second approximation is given as i
(1) (1) (1) (1) (1)
1
x (2) = 4y 0
y x − y0 − x (x2! −1) 42 y0 − x (x −1)(x
3!
−2) 3
4 y0 − . . .
1 3(3−1) 3(3−1)(3−2) 3(3−1)(3−2)(3−3)
= 0.7 5 − 2.9 − 2 (0.1) − 3! (0.2) − 4! (−0.4)
1
= 0.7 (5 − 2.9 − 0.3 − 0.2) = 2.2857143.
x (3) = 2.4724147
(4)
x = 2.64364724
x (5) = 2.5373869
(6)
x = 2.5985062
(7)
x = 2.5611579
Iterative Method
Solution:
Proceeding on as explained above, we get
x (8) = 2.5841148
(9)
x = 2.5700665
(10)
x = 2.5786872
(11)
x = 2.573406
x (12) = 2.5766447
(13)
x = 2.5746598
(14)
x = 2.5758768
(15)
x = 2.575625.
Exercise II.5
1 Given values f (14) = 68.7, f (17) = 64, f (31) = 44, and f (35) = 39. Find
f (27) using Lagrange’s formula.
2 Given u1 = 22, u2 = 30, u3 = 82, u4 = 106 and u5 = 206. Find u6 using
Lagrange’s interpolation formula.
3 Apply Lagrange’s formula inversely to obtain the root of f (x) = 0, given
that f (300 = −30, f (34) = −13, f (38) = 3, and f (42) = 18.
4 Find x when f (x) = 0.163, given that
x 80 82 84 86 88
f (x) 0.131 0.154 0.176 0.200 0.221
Introduction
dy dy dp
Then dx = dp dx by Chain rule.
dy 1 1 1
= 4y0 + (2p − 1)42 y0 (10)
dx h 2! h
1 1
+ [(p − 1)(p − 2) + p(p − 1) + p(p − 2)] 43 + . . .
3! h
dy 1
h
2p−1 2 3p 2 −6p+2 3 4p 3 −18p 2 +22p−6 4
i
= h 4y0 + 2 4 y0 + 6 4 y0 + 24 4 y0 + . . . (11)
.
dx
(11)
Expression (11) can be used for computing the value of dy dx for any
non-tabular value of x in [x0 , xn ]. For tabular values of x, the formula takes
a simpler form.
And
d 2y
1 2 3 11 4 5 5
= ∇ y n + ∇ y n + ∇ y n + ∇ y n + . . . . (16)
dx 2 x=xn h2 12 6
Example
Example
The population of a certain town (as obtain from census data) is shown in the
following table
Solution
We have to find the derivative at 1981 which is near the end of the table. Hence,
we use the derivative of Newton’s backward interpolation formula. The table of
differences is given as follows
x y ∇y ∇2 y ∇3 y ∇4 y
1951 19.96
1961 36.65 16.69
1971 58.81 22.16 5.47
1981 77.21 18.40 -3.76 -9.23
1991 94.61 17.40 -1 2.76 11.99
Solution
Example
Example
dy d 2y
Find the values of dx and dx 2 at x = 1.2 from the following table.
Solution
Here,
x = 1.2, h = 0.2, p = x−x
h
0
= 1.2−1
0.2 = 1.
2
dy 3p −6p+2 3 2p 3 −9p 2 +11p−3 4
= h1 4y0 + 2p−1
2
dx 2 4 y0 + 6 4 y0 + 12 4 y0 + ...
x=1.2
dy
dx =
x=1.2
1
0.618 + 21 (0.1333) − 61 (0.0294) + 1 1 1
0.2 12 (0.0067) + 20 (0.0013) + 30 (0.0001)
dy
dx = 3.2305.
x=1.2
On the other hand, by setting x0 = 1.2 and y0 = 3.3201, we get
dy 1 1 2 1 3 1 4
= 4y 0 − 4 y 0 + 4 y 0 − 4 y 0 + . . .
dx x=x0 h 2 3 4
Solution Cont....
dy
1
dx = 0.2 3.3201 − 12 (0.1627) + 13 (0.0361) − 1
4(0.0080)+ 15 (0.0014)
x=1.2
dy
= 3.3205
dx x=1.2
d 2 y
1 2 11 4
3 5 5
= 4 y0 − 4 y0 + 4 y0 − 4 y0 + . . .
dx 2 x=x0 h2 12 6
d 2 y
1 11 5
= 0.1627 − 0.361 + (0.0080) − (0.0014)
dx 2 x=1.2 0.22 22 6
= 3.318.
Exercise II.6
1 The table given below reveals velocity v of a body during time t specified.
Find its acceleration at t = 1.1.
t 1.0 1.1 1.2 1.3 1.4
v 43.1 47.7 52.1 56.4 60.8
2 For the following pairs of values of x and y , find numerically the first
derivative at x = 4.
x 1 2 4 8 10
y 0 1 5 21 27
dy 2p − 1 2 3p 2 − 6p + 2 3
= 4y0 + 4 y0 + 4 y0 + . . .
dp 2 6
dy
For maxima or minima, dp = 0.
Determination the right-hand side after third order difference and equating
it to zero, we obtain
1 2 1 3 1
4y0 − 4 y0 + 4 y0 + 42 y0 − 43 y0 + (42 y0 )p 2 = 0
2 3 2
Example
Example
Given the following data, find the maximum value of y .
x -1 1 2 3
y -21 15 12 3
Solution: Since the arguments are not equispaced, we will form the divided
difference table as follows
x y 1st divided difference 2nd div. differ 3rd div. differ
-1 -21
1 15 18
2 12 -3 -7
3 3 -9 -3 1
Solution Cont...
Example
Determine the maxima and minima of the function y = f (x) tabulated below.
x 0 1 2 3
y -5 -7 -3 13
Solution Cont....
Hence
x(x − 1) x(x − 1)(x − 2)
y = −5 + x(−2) + (6) + (6)
2 6
y = x 3 − 3x − 5.
In order to find the maxima and minima of the function, we have to solve
the following equations
( (
dy dy 2
dx = 0 dx = 3x − 3 = 0
2
d y ⇒ 2
d y ⇒ x = ±1
dx 2 dx 2 = 6x
Exercise II.7
1 Find the maximum and minimum values of the function from the following
table
x 0 1 2 3 4 5
y 0 0.25 0 2.25 16.00 56.25
dy d 2y
2 Evaluate dx and dx 2 for the following table
x 0 1 3 6
y 18 10 -18 90
3 For the following data gives corresponding values of pressure and specific
volume of super-heated steam.
v 2 4 6 8 10
p 105 42.07 25.3 16.7 13
Find the rate of change of pressure w.r.t volume when v = 2 and the rate
of change of volume w.r.t pressure when p = 105.
Jean Paul Nsabimana, Department
Approximation
of Mathematics
of the functions
University
(Part Two)
December of 2020
17, Rwanda Em
47 / 60
Numerical Integration Introduction
Numerical Integration
Numerical Integration
Therefore,
Z xn h i
n(2n−3) 2 n(n−2)2
y dx = nh y0 + n2 4y0 + 12 4 y0 + 24 43 y0 + . . . . (19)
x0
Trapezoidal Rule
We define that differences of second and higher order vanish, and we obtain
Z x1
1 h h
y dx = h y0 + 4y0 = (2y0 + 4y0 ) = (y0 + y1 )
x0 2 2 2
1
Simpson 3 Rule
1
Simpson 3 Rule
Similarly,
Z x4
h
y dx = [y2 + 4y3 + y4 ] ; . . .
x2 3
Z xn
h
y dx = [yn−2 + 4yn−1 + yn ] .
xn−2 3
3
Simpson’s 8 Rule
Setting n = 3 in Equation (19) and negleting all differences above the third
order, we get
Z x3
3 3 2 1 3
y dx = 3h y0 + 4y0 + 4 y0 + 4 y0
x0 2 4 8
3h
= [y0 + 3y1 + 3y2 + y3 ] .
8
Similarly,
Z x6
3h
y dx = [y3 + 3y4 + 3y5 + y6 ]
x3 8
.
.
.
Z xn
3h
y dx = [yn−3 + 3yn−2 + 3yn−1 + yn ]
xn−3 8
3
Simpson’s 8 Rule
Example
Evaluate Z 10
dx
by using
0 1 + x2
1 Trapezoidal rule.
1
2 Simpson’s 3 rule.
3
3 Simpson’s 8 rule.
Solution: Dividing the whole range of integration [0, 10] into 10 equal parts;
h = 1 and the value of integral for each point of subdivision are given below.
Solution
x y
x0 = 0 y0 = 1
x1 = 1 y1 = 12 = 0.5
x2 = 2 y2 = 15 = 0.2
1
x3 = 3 y3 = 10 = 0.1
1
x4 = 4 y4 = 17 = 0.0588235
1
x5 = 5 Y5 = 26 = 0.0384615
1
x6 = 6 y6 = 37 = 0.027027
1
x7 = 7 y7 = 50 = 0.02
1
x8 = 8 y8 = 65 = 0.0153846
1
x9 = 9 y9 = 82 = 0.0121951
1
x10 = 10 y10 = 101
Solution
1 By Trapezoidal Rule
Z 10
h
y dx = [y0 + 2(y1 + y2 + y3 + . . . + y9 ) + y10 ] = 1.4768422.
0 2
2 By Simpson’s 13 rule
R 10
0
y dx = h3 [y0 + 4(y1 + y3 + . . . + y9 ) + 2(y2 + y4 + . . . + y8 ) + y10 ]
Z 10
∴ y dx = 1.4316659.
0
3 Simpson’s 83 rule
R 10
0
y dx = 3h
8 [y0 + 3(y1 + y2 + y4 + y5 + y7 + y8 ) + 2(y3 + y6 + y9 ) + y10 ],
Z 10
∴ y dx = 1.4198828.
0
Example
The velocity v of a particle at distance s from a point on its path is given by the
following table:
s[ft] 0 10 20 30 40 50 60
v [t/s] 47 58 64 65 61 52 38
Estimate the time taken to travel 60ft using Simpson’s 13 rule. Compare the
result with Simpson’s 38 rule.
Solution:
ds
v= = rate of displacement is velocity
dt
R 60 R 60
So , t = 0 v1 ds = 0 y dx = time taken to travel 60 ft. It means that y = 1
v
and s = x.
Solution
s[x] y = 1/v
1
x0 = 0 y0 = 47 = 0.0212765
1
x1 = 10 y1 = 58 = 0.0172413
1
x2 = 20 y2 = 64 = 0.015625
1
x3 = 30 y3 = 65 = 0.0153846
1
x4 = 40 y4 = 61 = 0.0163934
1
x5 = 50 y5 = 52 = 0.192307
1
x6 = 60 y6 = 38 = 0.0263157
Here h = 10; By simpson’s 31 rule, we get
Z 60
h
y dx = (y0 + 2(y2 + y4 ) + 4(y1 + y3 + y5 ) + y6 ) = 1.063502.
0 3
By Simpson’s 38 rule, we get
Z 60
3h
y dx = (y0 + 3(y1 + y2 + y4 + y5 ) + 2(y3 ) + y6 ) = 1.0643723.
0 8
Exercise II.8
R2
1 Evaluate 0
y dx from the following table using Trapezoidal rule
2 When an a train is moving at 30 miles an hour, steam is shut off and brakes
are applied. The speed of the train in miles per hour after t seconds is
given by
t 0 5 10 15 20 25 30 35 40
v 30 24 19.5 16 13.6 11.7 10.0 8.5 7.0