Professional Documents
Culture Documents
Numerical Integration
b b
Introduction: To Evaluate I = ydx = f ( x)dx
a a
xn
h
ydx = 3 ( y
x0
0 + yn ) + 2 ( y2 + y4 + y6 + yn −2 ) + 4 ( y1 + y3 + y5 + + yn −1 )
xn
3h
ydx = ( y0 + yn ) + 2 ( y3 + y6 + y9 + yn −3 ) + 3 ( y1 + y2 + y4 + y5 + + yn −2 + yn −1 )
x0
8
(9.1) Examples
1
1
1. Evaluate 1 + x dx using Trapezoidal rule with h = 0.2 . Hence determine the value of
0
2
1 rd
x2 1
2. Evaluate dx using Simpson’s rule with h = 0.25. Hence find the value of
0
1 + x3 3
log 2 .
3. Use the Trapezoidal rule and Simpson’s one third rule with 5 ordinates to find an
2
1
approximate value for the integral 1 + dx
1
x
4. Use the Trapezoidal rule and Simpson’s one third rule with 5 ordinates to find an
6
1
approximate value for the integral dx
4 3− x
1.4
1
5. Evaluate 1 2 + log e x
dx , using Trapezoidal and Simpson’s one-third rule with n = 4
1
1 1
6. Evaluate 0 x +14
dx , using Trapezoidal and Simpson’s one-third rule with h =
4
7
1
7. Evaluate 1 x 3
+1
dx , using Trapezoidal, Simpson’s one-third and Simpson’s three eighth
rule with n = 6
1
1
Example 9.1.1: Evaluate 1 + x dx using Trapezoidal rule with h = 0.2 . Hence determine the
0
2
value of .
1 1− 0
Solution: Here y = . Given that h = 0.2 . Number of sub-intervals n = =5
1+ x 2
0.2
By Trapezoidal rule
x5
h
ydx = 2 ( y
x0
0 + y5 ) + 2 ( y1 + y2 + y3 + y4 )
1
1 0.2
dx = (1 + 0.5 ) + 2 ( 0.96153 + 0.86206 + 0.73529 + 0.60975 )
0
1 + x 2
2
= 0.78371
= 0.78372
4
= 4 ( 0.78372 ) = 3.13488
1 rd
x2 1
Example 9.1.2: Evaluate dx using Simpson’s rule with h = 0.25 . Hence find the
0
1 + x3 3
value of log 2 .
x2 2 −1
Solution: Here y = . Given that Width of sub-intervals h = = 0.25
1+ x 3
4
1− 0
Number of sub-interval n = = 0.25
4
1
x2 0.25
dx = ( 0 + 0.5 ) + 2 ( 0.22222 ) + 4 ( 0.06153 + 0.39560 )
0
1 + x 3
3
= 0.23108 − − − − − − − −(1)
x 0 1
Put 1 + x 3 = t 3 x 2 dx = dt
t 1 2
1 1
1 2
x2
dx = dt
0
1+ x 3
1
t 3
1
= log t 1
2
3
1 1
= log 2 − log1 = log 2 − − − − − −(2)
3 3
From (1) and (2)
1
log 2 = 0.23108
3
log 2 = 3 0.23108 = 0.69324
Example 9.1.3: Use the Trapezoidal rule and Simpson’s one third rule with 5 ordinates to find
2
1
an approximate value for the integral 1 1 + dx
x
1
Solution: Here y = 1 + . Five ordinates means 4 sub-intervals. n = 4 .
x
2 −1
Width of sub-intervals h = = 0.25
4
By Trapezoidal rule
x4
h
ydx = 2 ( y
x0
0 + y4 ) + 2 ( y1 + y2 + y3 )
2
1 0.25
1 + dx = (1.41421 + 1.22474 ) + 2 (1.34164 + 1.29099 + 1.25356 )
1
x 2
= 1.30141
2
1 0.25
1 + dx = (1.41421 + 1.22474 ) + 2 (1.29099 ) + 4 (1.34164 + 1.25356 )
1
x 3
= 1.30014
Example 9.1.4: Use the Trapezoidal rule and Simpson’s one third rule with 5 ordinates to find
6
1
an approximate value for the integral 4 3 − x
dx
1
Solution: Here y = . Five ordinates means 4 sub-intervals. n = 4 .
3− x
6−4
Width of sub-intervals h = = 0.5
4
x x0 = 4 x1 = 4.5 x2 = 5 x3 = 5.5 x4 = 6
y y0 = 1 y1 = 1.138071 y2 = 1.30901 y3 = 1.52720 y4 = 1.81649
By Trapezoidal rule
x4
h
ydx = 2 ( y
x0
0 + y4 ) + 2 ( y1 + y2 + y3 )
6
1 0.5
dx = (1 + 1.81649 ) + 2 (1.138071 + 1.30901 + 1.52720 )
4 3− x 2
= 2.69126
6
1 0.5
dx = (1 + 1.81649 ) + 2 (1.30901) + 4 (1.138071 + 1.52720 )
4 3 − x 3
= 2.68259
1.4
1
Example 9.1.5: Evaluate 1 2 + log e x
dx , using Trapezoidal and Simpson’s one-third rule with
n=4
1
Solution: Here y = . Number of sub-intervals n = 4 .
2 + log e x
1.4 − 1
Width of sub-intervals h = = 0.1
4
Dividing the interval 1, 1.4 into 4 sub-intervals, each of width h = 0.1 .
By Trapezoidal rule
x4
h
ydx = 2 ( y
x0
0 + y4 ) + 2 ( y1 + y2 + y3 )
1.4
1 0.1
dx = ( 0.5 + 0.42799 ) + 2 ( 0.47725 + 0.45822 + 0.44201)
1
2 + log e x 2
= 0.18414
1.4
1 0.1
dx = ( 0.5 + 0.42799 ) + 2 ( 0.45822 ) + 4 ( 0.47725 + 0.44201)
1
2 + log e x 3
= 0.18404
1
1
Example 9.1.6: Evaluate 0 x4 + 1
dx , using Trapezoidal and Simpson’s one-third rule with
1
h=
4
1 1
Solution: Here y = . Given that h = = 0.25 .
x +1
4 4
1− 0
Number of sub-intervals n = =4
0.25
By Trapezoidal rule
x4
h
ydx = 2 ( y
x0
0 + y4 ) + 2 ( y1 + y2 + y3 )
1
1 0.25
dx = (1 + 0.70710 ) + 2 ( 0.99805 + 0.97014 + 0.87157 )
0 x +14 2
= 0.92332
1
1 0.25
dx = (1 + 0.70710 ) + 2 ( 0.97014 ) + 4 ( 0.99805 + 0.87157 )
0 x4 + 1 3
= 0.92715
7
1
Example 9.1.7: Evaluate 1 x 3
+1
dx , using Trapezoidal, Simpson’s one-third rule and
1
Solution: Here y = . Given that number of sub-intervals n = 6 .
x +1
3
7 −1
Width of the sub-intervals h = =1
6
x x0 = 1 x1 = 2 x2 = 3 x3 = 4 x4 = 5 x5 = 6 x6 = 7
y y0 = 0.5 y1 = 0.11111 y2 = 0.03571 y3 = 0.01538 y4 = 0.00793 y5 = 0.00460 y6 = 0.00290
By Trapezoidal rule
x6
h
ydx = 2 ( y
x0
0 + y6 ) + 2 ( y1 + y2 + y3 + y4 + y5 )
7
1 1
dx = ( 0.5 + 0.00290 ) + 2 ( 0.11111 + 0.03571 + 0.01538 + 0.00793 + 0.00460 )
1
x +1
3
2
= 0.42618
7
1 1
dx = ( 0.5 + 0.00290 ) + 2 ( 0.03571 + 0.00793 ) + 4 ( 0.11111 + 0.01538 + 0.00460 )
1
x +1
3
3
= 0.37151
3
= _________________________________________________________________
8
= ______