Session 7
Session 7
10 NUMERICAL INTEGRATION
We are required to compute the value of the definite integral
Z b
I = y dx, (35)
a
where the function y = f (x) is defined by the set of data points (xi , yi ), i = 0, 1, 2, 3, . . . , n.
To derive a general formula for numerical integration, we substitute Newton’s forward
difference formula for y(x) in Equation (35), where the interval [a, b] is devided into n equal
subintervals such that
a = x0 < x1 < x2 < . . . < xn = b.
We obtain
Z xn
1 2 1 3
I = y0 + p4y0 + p(p − 1)4 y0 + p(p − 1)(p − 2)4 y0 + . . . dx, (36)
x0 2 6
where putting x = x0 + ph. So dx = h dp, we get
Z n
1 2 1 3
I = h y0 + p4y0 + p(p − 1)4 y0 + p(p − 1)(p − 2)4 y0 + . . . dp,
0 2 6
2 2
n2 (n − 2)2 3
n n (2n − 3) 2
= h ny0 + 4y0 + 4 y0 + 4 y0 + . . . .
2 12 24
Therefore,
xn
n(n − 2)2 3
n(2n − 3) 2
Z
n
y dx = nh y0 + 4y0 + 4 y0 + 4 y0 + . . . . (37)
x0 2 12 24
The equation (37) is the general quadratic formula and is called Newton’s-cote’s formula.
40
Until
Z xn
h
y dx = (yn−1 + yn )
xn−1 2
1
2.10.2 For n = 2: Simpson 3
Rule
Setting n = 2 in Equation (37), we observe that differences of third and higher order vanish,
and we obtain
Z x2
2 2(2.2 − 3 2
y dx = 2h y0 + 4y0 + 4 y0
x0 2 12
1 2
= 2h y0 + 4y0 + 4 y0
6
h
6y0 + 64y0 + 42 y0
=
3
h
= [6y0 + 6(y1 − y0 ) + (y2 − 2y1 + y0 )]
Z x2 3
h
∴ y dx = [y0 + 4y1 + y2 ] .
x0 3
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
2.10.3 For n = 3: Simpson’s 8
Rule
Setting n = 3 in Eqaution (37) 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
41
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
Solution: Diving 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.
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
1. By Trapezoidal Rule
Z 10
h
y dx = [y0 + 2(y1 + y2 + y3 + . . . + y9 ) + y10 ] ,
x0 2
1 1
= 1 + 2(0.5 + 0.2 + 0.1 + . . . + 0.0121951) +
2 101
= 1.4768422.
42
1
2. By Simpson’s 3
rule
Z 10
h
y dx = [y0 + 4(y1 + y3 + . . . + y9 ) + 2(y2 + y4 + . . . + y8 ) + y10 ] ,
0 3
= 1.4316659.
3
3. Simpson’s 8
rule
Z 10
3h
y dx = [y0 + 3(y1 + y2 + y4 + y5 + y7 + y8 ) + 2(y3 + y6 + . . . + y9 ) + y10 ] ,
0 8
= 1.4198828.
Example 23. The velocity v of a particle at distance s from a point on its path is given by the
following table:
s[f t] 0 10 20 30 40 50 60
v[t/s] 47 58 64 65 61 52 38
1
Estimate the time taken to travel 60f t using Simpson’s 3
rule. Compare the result with Simp-
son’s 83 rule.
Solution:
ds
v= = rate of displacement is velocity
dt
So Z 60 Z 60
1
t= ds = y dx = time taken to travel 60 ft.
0 v 0
1
It means that y = v
and s = x.
s[x] y = 1/v
x0 = 0 y0 = 14 = 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
1
Here h = 10; By simpson’s 3
rule, we get
Z 60
h
y dx = (y0 + 2(y2 + y4 ) + 4(y1 + y3 + y5 ) + y6 )
0 3
1.063502.
3
By Simpson’s 8
rule, we get
Z 60
3h
y dx = (y0 + 3(y1 + y2 + y4 + y5 ) + 2(y3 ) + y6 )
0 8
= 1.0643723.
43
EXERCISES:
R2
1. Evaluate 0
y dx from the following table using Trapezoidal rule
4. Whe 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
44