Professional Documents
Culture Documents
The process of evaluating a definite integral from a set of tabulated values of the integrand
f (x ) , which is not known explicitly is called Numerical Integration. Using numerical
methods we can obtain the approximated value of the integration.
b
∫ f ( x)dx
There are following three numerical methods to evaluate the definite integrals a .
1. Trapezoidal rule (n=1)
1
2. Simpson’s 3 Rule (n=2)
rd
3
3. Simpson’s 8 Rule (n=3)
th
∫ f ( x)dx
We can evaluate a by Trapezoidal Rule as follows:
Let’s divide the given interval [a , b] into n number of subintervals
a=x 0 , x 1 ,⋯, b=x n of step
size h.
b x1 x2 xn
In the interval
[ x0 , x1 ]
x
At 0 and x 1 the corresponding functional values are f (x 0 )= y 0 and f ( x 1 )= y 1 respectively.
By Lagrange’s formula
x−x 1 x−x 0 y y
f (x )= f ( x 0 )+ f ( x 1 )=− 0 ( x−x 1 )+ 1 ( x−x 0 )
x 0 −x 1 x 1 −x 0 h h
x1 x x
y0 1 y1 1 y 0 ( x−x 1 )2 x=x 1 y 1 ( x−x 0 )2 x= x1
⇒∫ f ( x )dx =− ∫ ( x−x 1 )dx + ∫ ( x−x 0 )dx =− |x=x 0 + |x= x 0
x h x h x h 2 h 2
0 0 0
x1
h
⇒∫ f ( x )dx = ( y 0 + y 1 )
x 2
0 , This is equivalent to the area of a Trapezium. Thus this is called
Trapezoidal Rule.
x1
∫ f ( x)dx = h2 ( y 0 + y 1 )
Hence in the interval
[ x0 , x1 ] , x0
x2
∫ f ( x )dx= h2 ( y 1 + y 2 )
Similarly, in the interval [ x 1 , x 2 ] , x1
xn
∫ f ( x )dx = h2 ( y n−1 + y n )
Continuing in this way, in the interval
[ x n−1 , xn ] , x n−1
b= xn x1 x2 xn
∫ f ( x)dx= b−a
2
[ f (a )+f (b )]
a .
1
∫ 1+dxx2
Example: Evaluate 0 using Trapezoidal rule with h=0 .2 . Hence determine the value of
π.
1
f (x )=
Solution: Given 1+ x 2 and h=0 .2 . The interval is [0, 1] . The values of y=f ( x ) for
each point of subdivision with h=0 .2 are got and tabulated as
x 0 0.2 0.4 0.6 0.8 1
y=f ( x ) 1 0.961 0.8621 0.7353 0.609 0.5
5 8
By Trapezoidal rule
b
0 x=0
π
⇒ ≃0 .7837
4
Hence by Trapezoidal rule, the value of π ≃4×0. 7837=3. 1348 .
0.5
∫ f (x )dx
Example: Apply Trapezoidal rule to evaluate 0 using f (0)=1 and f (0. 5)=0 .8.
Solution: Here a=0 , b=0 .5 and h=b−a=0 . 5 .
b
∫ f ( x)dx= b−a
2
[ f (a )+f (b )]
By Trapezoidal rule a
0 .5
0. 5
⇒ ∫ f ( x)dx≃ [1+0. 8]=0.25×1.8=0. 45
0 2
Simpson’s one third Rule
b
∫ f ( x)dx 1
rd
We can evaluate a by Simpson’s 3 rule as follows:
Let’s divide the given interval [a , b] into n number of subintervals 0 1 n of step a=x , x ,⋯, b=x
size h . We have to divide the range [a , b] in such way that the number of subintervals will be
multiple of 2 or even.
x, x
For n=2 , there are three points 0 1 and x 2 . The corresponding functional values are 0 1
y, y
and y 2 respectively.
In the interval 0 2 :
[x , x ]
By Lagrange’s formula the polynomial is
( x−x 1 )( x−x 2 ) (x −x 0 )( x−x 2 ) ( x−x 0 )( x−x 1 )
y ( x )= y ( x0 )+ y (x 1 )+ y ( x3 )
( x 0 −x 1 )( x 0 −x 2 ) ( x 1 −x 0 )( x 1 −x 2 ) ( x 2−x 0 )( x 2−x 1 )
In between two consecutive points the step size is h .
y0 y1 y3
⇒ y ( x )= 2 ( x−x 1 )( x−x 2 )− 2 ( x−x 0 )( x−x 2 )+ 2 ( x−x 0 )( x−x 1 )
2h h 2h
x2 x2 x2 x2
y0 y1 y3
⇒∫ y ( x )dx = ∫ ( x−x 1 )( x−x 2 )dx− h2 ∫ ( x−x 0 )( x−x 2 )dx + 2 h2 ∫ ( x−x 0 )( x−x 1 )dx
x0 2h 2 x 0 x0 x0
∫ y ( x )dx = h3 [ y 0 +4 y 1 + y 2 ] 1
rd
x0
, This is called Simpson’s 3 rule.
x4
∫ y ( x )dx = h3 [ y 2 +4 y 3 + y 4 ]
Similarly, in the interval [ x 2 , x 4 ] , x2
Note:
1
rd
1. Simpson’s 3 rule can be written as
b
∫ y( x)dx≃ h3 [(First Value+Last value )+4 (odd functional values)+2( even functional values )]
a
1
rd
2. Simpson’s 3 rule can be applied only when number of intervals is multiple of 2 or
there are even number of intervals i. e. n=2n .
1
3. If there are three points a, c , b with n=2 then by Simpson’s 3 rule
rd
[ ]
b
∫ f ( x )dx= h2
a
f (a )+4 f ( )
a+b
2
h
+f (c ) = [ f ( a)+4 f (c )+f (b)]
2 , h=c−a=b−c .
∫ f ( x)dx 3
th
We can evaluate a by Simpson’s 8 rule as follows:
Let’s divide the given interval [a , b] into n number of subintervals 0 1 a=x , x ,⋯, b=x
n of step
size h . We have to divide the range [a , b] in such way that the number of subintervals will be
multiple of 3.
x, x, x x
For n=3 , there are three points 0 1 2 and 3 . The corresponding functional values are
y 0 , y 1 , y 2 and y 3 respectively.
[x , x ]
In the interval 0 3 :
Integrating the Lagrange’s polynomial in the interval
[ x 0 , x 3 ] we get
x3
∫ y ( x )dx = 38h [ y 0 +3 y 1 +3 y 2 + y 3 ] 3
th
x0
, This is called Simpson’s 8 rule.
x6
∫ y ( x )dx = 38h [ y 3 +3 y 4 +3 y 5 + y 6 ]
[ x 3 , x 6 ] we get x3
Similarly, in the interval
[x , x ]
Continuing in this way, in the interval n−3 n we get
xn
3h
∫ y ( x )dx= [ y +3 y n−2 +3 y n−1 + y n ]
8 n−3
x n−3
b =x n x3 x6 xn
∫ 1+dxx
Example: Evaluate 0 by using Simpson’s rule with step size h=1/6 . Compare the result
with actual value of the integration.
1
y=f ( x )=
Solution: Here h=1/6 and 1+x .
1
y=
The values of 1+x for the points of subdivisions are as follows:
x 0 1/6 2/6 3/6 4/6 5/6 1
y 1 0.8571 0.75 0.6667 0.6 0.5455 0.5
1
rd
Simpson’s 3 rule
1
rd
Here number of interval n=6 , so we can apply Simpson’s 3 rule.
1
rd
By Simpson’s 3 rule
b
∫ y( x )dx≃ h3 [(First Value+Last value )+4 (odd functional values)+2( even functional values )]
a
1
dx h
⇒∫ ≃ [( y + y )+4( y 1 + y 3 + y 5 )+2( y 2 + y 4 )]
0 1+x 3 0 6
1
dx 1
⇒∫ ≃ [(1+0. 5 )+4 (0 .8571+0 .6667+0 . 5455)+2(0 . 75+0 .6 )]=0. 6932
0 1+x 18
3
th
Simpson’s 8 rule
3
th
Here number of interval n=6 , so we can apply Simpson’s 8 rule.
3
th
By Simpson’s 8 rule
b
Actual Integration
1
[ ]
x 1= x0 +h x1 =x 0+h
( x−x 0 )2 '' ( x−x 0 )3 '''
∫ ydx = ∫ y 0 +( x−x 0 ) y +
'
0
2!
y0+
3!
y 0 +⋯ dx
x0 x0
x1
(
= y0 x +
(x−x0 )2
2
( x−x 0 )3
y'0 +
6
y ''0 +
(x −x0 )4
24 ) x=x +h
y '''0 +⋯ |x =x0
0
2 3
h ' h ''
∫ ydx =hy 0 + 2! y 0 + y 0 +⋯
3!
x0
(2)
[x , x ]
Value of integration by Trapezoidal rule in the interval 0 1 :
x1
∫ y ( x )dx = h2 ( y 0 + y 1 )
x0
(3)
The Taylor’s series of y 1 = y (x 1 )= y ( x 0 +h) is
2
h
y 1 = y 0 +hy ′ + y ″ +⋯
0 2! 0
Using it in (3) we get
x1
( )
2 2 3
∫ e− x dx
2
Example: Evaluate 0 by dividing the range into 4 equal parts using Trapezoidal rule.
2
−x
Solution: It is given that y=e , x 0 =0 , x n =1 , n=4
xn −x 0 1−0
⇒h= = =0 . 25
n 4
− x2
The values of y=e for each point of subdivision are as follows:
x 0 0.25 0.5 0.75 1
y 1 0.9394 0.7788 0.5698 0.3679
By Trapezoidal rule
1
0
0.7
∫ e−x √ x dx
Example: Calculate 0.5 , taking 5 ordinates by Simpson’s rule.
−x
Solution: It is given that y( x )=e √ x , x0=0. 5 , x n =0 .7 , n+1=5
x n −x 0 0 .7−0 .5
⇒n=4 , ⇒ h= = =0 .05
n 4
−x
The values of y( x)=e √ x at equispaced points are as follows:
x 0.5 0.55 0.6 0.65 0.7
y 0.4289 0.4279 0.4251 0.4209 0.4155
1
rd
The number of interval is n=4 , so we can apply Simpson’s 3 rule.
1
rd
By Simpson’s 3 rule
0. 7
Example: The velocity v (km /min) of a moped which starts from rest, is given at fixed
intervals of time t( min) as follows:
t( min) 2 4 6 8 10 12 14 16 18 20
v(km /min ) 10 18 25 29 32 20 11 5 2 0
Estimate approximately the distance covered in 20 minutes.
Solution: If s(km) be the distance covered in time t( min ) , then
ds
=v
dt
20
⇒|s|t=20
t=0 = ∫ v dt
0
Here
h=2, v =0 , v =10 , v =18 , v =25⋯, v =0
0 1 2 3 10
There are 11 number of points, so number of interval is n=10 , so we can apply Simpson’s
1
3 rd rule.
1
rd
By Simpson’s 3 rule
20
|s|t=20
t=0 = ∫ v dt= h3 [(v 0 +v 10 )+4( v 1+v 3+ v 5+v7 +v 9 )+2( v 2+v 4+v 6 +v 8 )]
0
20
⇒|s|t=20
t=0 = ∫ v dt= 32 [(0+0)+4(10+25+32+11+2 )+2(18+29+20+5 )]=309 .33 km.
0
Hence the required distance covered in 20 minutes is s=309 . 33 km.
Assignment:
6
∫ 1+dxx2 1
rd
1. Evaluate 0 by using (i) Trapezoidal rule, (ii) Simpson’s 3 rule and (iii)
3
th
Simpson’s 8 rule. Take h=1.
0.6
∫ e−x dx
2
1 3
rd th
2. Use Simpson’s 3 rule and 8 rule to find 0 by taking seven ordinates.
6
∫ dxx
3. Find the value of 2 by Simpson’s rule. Hence obtain approximate value of ln 2.
5
∫ 4 dxx+5
4. Find an approximate value of ln 5 (take four decimal places) from 0 , using 11
coordinates by applying (i). Trapezoidal rule and (ii) Simpson’s rule.
π /2
∫ sin xdx 1
rd
5. Calculate the value of 0 by Simpson’s 3 rule, using 11 ordinates.
4
∫ e x dx
6. Evaluate 0 by Simpson’s rule, given that e=2.72, e 2 =7.39, e 3=20.09,
e 4 =54.6 and compare it with actual value.
7. Given that
x 4.0 4.2 4.4 4.6 4.8 5.0 5.2
f (x ) 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6484
5.2
∫ f ( x)dx
Evaluate 4 by using
i. Trapezoidal rule
1
rd
ii. Simpson’s 3 rule
3
th
iii. Simpson’s 8 rule
**********************************END************************************