You are on page 1of 16

Numerical Integration

The process of computing the value. of


KS 1 Introduction. the integrand
from a set of
numerical values of
a delinite integral When applied to
the integration
is called Numerical Integration. the process is known,
as

of a single variablc,
ofa function
quadrature.
numerical integration, like
that of numerical
of
Tneproblem solved representing the integrand by a
difterentiation, is by this formula between
formula and then integrating
interpolation value of the definite
integral
the desired limits. Thus, to find the
interpolation formula,
dx, we replace the function y by an
y
and then integrate this formula
usually one involving differences, we can derive quadrature
between the limits a and b. In this way for
integration of any function
formula for the approximate
known.
which nymerical values are
Ordinates.
Quadrature Formula for Equidistant
A General (Meerut M.Sc.1986)
cercain
Let I=y dx where y=fx). Letf(x) be given for
Let the range
x say X. Xo+h, Xot+2h,..
.

equidistant values of
paris, each of width h so that
(a, b)be divided into n equal
b-a=nh.
Xn=atnh=b.
Let Xo=a, X1=Xo+h=a+h, X^=a-+2h, ..,

at
yn are
the ntl ordinates yo» V1, ,
We have assumed that
equal intervals.
h du
. dx=" y, dx-+uh
where u= dx=hdu
h

A+ (u-1) {u--2) yt.. du


u
or I=hotuA),4" ! 31

+»+(3)+
n+n t u p t o (n+1) terms
...(1)
We
We can
can dedice
formula.
quadrature
This is the general putting n=1, 2, ...
this
from by
number of formulace
Rule.
3. The Trapezoidal seco
the formula (1) of §
2 and neglecting
Putting n=1 in
we
differences, get
and higher order

=h

Similarly L dx-=h

(o+ nh

these integrals, we get


]
Adding n

o+ y dx=h (Vo+y») +01+y»t.-+Yn-1)]


=distance between two consecutive ordinates
x{mean of the first and the last ordinates+sum of all the
intermediate ordinates).
This rule is known as the Trapezoidal rule.
Note. Here we have assumed that y is a function of x of
first degree, i.e., the equation of the curve is of the form
y=a+bx.
S4. Simpson's One-third Rule.
(MeerutM.Sc. 1987, 88; Rohilkhand 88)
Putting n=2 in the formula (1) of $ 2 and neglecting third
and higher order differences, we get

o+ 2hy dx=h | 2yo+2Ayo+-2


2
=h [20+2 (V-)+} (V»-21+yo)]
h
+4y1+yi).
Similarly, L i y dx=(Vat4ya+y)

+nh h
x t(n 2) h y dx3 (Va-t 4y,-1ty.),

when n is ever
Adding all these integrals,
we get

o t
y dr= [(0o+y») +4 (y1+at.+Jn)
+2 (2+yat+yn-)).
one-third rule.
This formula is known as Simpson's
all differences above the
Note. Here we have neglected
must be a polynomial of second degree only, that is
second, s0 y
y=ax-+ bx+c.
M.Sc. 1972, 86)
5. Simpson's Three-cighth's Rule. (Meerut all
and neglecting
Putting n=3 in the formula (1) of §2
differences above the third, we get

(ot3h Av+(2)
JXo
+279)9

+ -3yat+3-)
3h
3y, +3y. +yal.
h
Similarly, dr=yat3y +3y, +yl

3h
tnh n-3t 3y-e+ 3y'n-1+Jn].
Jx,+ (n-s) h) ax3 have
all these integrals where n is a multiple of 3, we
Adding
Tnh 3/h
y dx=[(yo+y»)+3 (y1+2+y+ Ys+.+yn-1)
+2 (+J'st+.+y»-g).
This formula is known as Simpson's three-eighth's rule.
Here have neglected all differences above the third
Note. we

so y is a polynomial of the third degree, i.e.,


y=ax3+bx3+cx-+d.
Solved Examples

Ex1)Calculate the value of the integral


f6.2
log x dx by

(a) Trapezoidal rule, (b) Simpson's'}' rule


(c) Simpson's 3° rule,
After finding the true value of the integral, compare the errors
in the four cases.
Taking h=*2 divide the whole range of integration
Sol.
Six equal parts. The values of logx for cach point
4, 5:2) into, are given below;
ofSub-divislon
y=log. X
X y=l0ge X.

=40Jo=1'3862944x+4h=48 =l-56861 59
X=40
th=42 =14350845 + Sh=50 =l6094379
y=l6486586
o+2h-44
+2h=414 =l-4816045 x+6h=52
+3h=46 =15260563

(a) By Trapezoidal rule, we have

logx dx= tyt2+»ttutys


3:034953+2x76207991|
=1 (18:276551)=1:8276551
(b) By Simpson's '} rule, we have
5.2
log. xdx=[ otye+4(nty»tvs)+21+)
3-034953+4 (4 5705787)+2 (3-0502204)
3-034953-418 282315+6.004408
x27-417709=1 8278472.
(c) By Simpson'srule, we have

log. x dx= tt3 (t+y+)+2s


3-034953 +3 (6-0947428)+2 (15260563)
3-0349534+18-284228+30521126 x24371294
=1-827847.
Hence the errors due to different formulae are

(a)0001924 (b) 0090003


(c) 0000005

Find Find b
dx y using Simpson's rule

Hence obtain the approximate value of Tt in each case.


(Meerut 1980)
Sol. Divide the range of integration (0, 1) into 6 equal
parts each of width = - so that h. The values of f(x)
6
at each point of sub-division are given below:

=0
1/1=1Q000000
Xo+h=1/6 36/37-0 9729729
X+2h-2/6 36/40=09000000
Xg+3h=3/6 36/45=08000000
X+4h-4/6 36/52=06923076
+Sh=5/6 36/61 =0 5901639
g+6h=1
1/2-05000000
By Simpson's "1/3 rule,
we get
dx x+6h dx
1+x
o+Ys+4 (y+raty3)
1+x? Jx
+2 (y»+d

1-5000000+4 (23631369)+2 (1:5923077)

(14'137163)=07853979. .(1
By Simpson's '3/8' rule, we get
dx
I + 3 otya+3 (v+yty+y3)+2ya

1-5000000-+3 (3.1554446) +2 (8000000)


T (12:566334)=0-7853958.
2)
dx
But . tan =tan-1 1-tan-1 0=r/4: .(3)
1+x
. Now from (1) and (3), we get
T/4-0-7853979 or T=3-1415916.

From (2) and (3), we get


4=0-7853958 or t=3-1415835.
Ex4 Calculate by Simp
Simpson's
son's rule an
an approximate value of
approximate value of
dx by taking seven equidistant ordinates.
ds
J-3
Compare it with

the exact value and the value obtained by using the Trapezoidal
rule.
Sol. Divide the range of integration (-3, 3) into six equal
--)=1. Hence h=l. The values.of
91
width-
parts
cach of are given below
sub-division
for each
point of
function
the

y=x

(3)4-81
-3
(-2)=16
+h-2
(-1=1
x+2h-1

04=0
+3h=0
14=1
x+4h=1
24=16
+Sh=2
34=81
+6h=3

By Simpson's rule, we get

d D»++4 (%t»ty)+2 01+y)l


=i [1624+4x 32+2x 2]
=}x29498.
The exact value of

-3

x486=972.
By Trapezoidal rule, we get
d 9 V+yat+2 (tatstyt+yd|
1624-2x 34-115.
In this case we
observe that the Trapezoidal
give an accurate result. In rule does no
result than the general Simpson's rule gives a ette
Trapezoidal rule.
dx
Ex. 6.
Show that
J. 1+log 2-069315.
(Meerut B. Sc. 74)
Sol. To use Simpson's *1/3" rule, divide the range of inte-
gration (0, 1) into ten equal parts cach of width 1/10. Hence
Hence
h=1/10='1, n=10.
The values of y at each point of sub-division are given
below
1/119090909

th /1 2 8333333

, t2h2 1/1 3 = 7 6 9 2 3 0 7

+ 3h-3 /14=7142857

+ 4h4
1/15=6666666
Sh=5

1/166250000
X+6h=6
1/1 7-5882352
+7h-:7
1/1 8=5555555
x+8h=8
1/1-9-5263157
X+9h-9
1/2-5000000
x+10h1

By Simpson's ' ule, we get


dx h (tyatst»t»)

+2 (a+tyaty)|
[15+4x 3:4595391 +-2x2:7281745]
20794505=6931501
=69315.

The actual value


of og(1+*) Jo
= log 2-log l=log 2.
dx
Hence1Llog 2=69315.
es.1) Calculate (upto 4 places of decimal) by divid
by divid-

ing the range into 1+x


eight equal parts.
(Meerut B. Sc. 1975, 76, 77, 80 ; M. Sc. 86)
Sol. Divide the range of integration (2, 10) into eight equal
Hence h=1. The values of y
parts each of width =1.
below:
for each point of sub-division are given

y4x
X=2 1/3

th=3 1/4
+2h-4 1/5
+3h-5 1/6
o+4h-6 1/7
+Sh=7 /8
+6h-8 1/9
+7h-9 1/10

x+8h=10 1/11

By Simpson's '1/3' rule, we get


10 dx
14 otyat4 (tstysty)+2 (a+yu+y
(++)

=4242424+4 (6416666)+2 (4539682)


=}x38988453=1-29961 51 =1 2996.
( dx
Ex. 8Evaluate b yusing (/) Simpson's '1/3' rule,
(i) Simpson's*3/8' rule, (Meerut 1980 ; Kanpur B. Sc. 73)
Sol. Divide the range of integration (0, 6) into six equal

=1. Hence h=1. The values of y for


parts each width
each point of sub-division are given below:
1

1/1=10000000

1/2-5000000

ot+h-1 1/52000000

t 2 h - 2

1/10=1000000

t3h3
1/17=0588235

t4h=4

1/26-0384615
t+Sh=5
1/37 0270270
+6h=6

rule, we get
By Simpson's '1/3
dx T = t t 4 (1tati)+2 (+3)

10270270-+2:5538462-+517647

=13661734.

By Simpson's 3/8' rule, we get


dx ( t + +yi)+2
3
8 1-0270270-+2:391855+200000
3
x3-618882=13570808.

Ex9 Evaluate dx, by Simpson's rule, given that


e=2:72, e=739, e®=20-09,
actual value. e"=54 60, and compare it with the
(Meerut M.Sc. 1971, 88)
Sol. Divide the whole range (0, 4) into 4 equal parts taking
h=1.
By Simpson's 1/3' rule, we get

ce dx=qyo+ya+4 (yi+pa)+2»

1+5460 +4 (2.72 +20-09)+2 x7-39


X16162=53 873333=53 87.

The actual value of|e dx= e =e1-e0


So
=54 60-1=53-60.
Use Simpson's rule to prove that log. 7 is aptr" ima-
Ex. 10,
dx
tely 1:9587 using
each of
Sol. Div'de the range (1, 7) into six equal parts
of sub-
width 1. Hence h=1. The values of y for each point
division are given below:
X = l x-2 x=3 X4 x^=5 x=6
Ja=1/7
y: yol y=1/2 y2=1/3 y=1/4 y=1/5 ys=1/6
have
By Simpson's *1/3" rule, we
Yo+y+4(yi+ys+y5)+2 (V+yd

x58761905
11428571 +3:6666667 +1 0666667
=1-9587302=1:9587.

=log, 7.
The exact vaule of log
Thus log. 7-19587.
2ol6 m/2
Calculate an approximate value of Jo sin: dx
. 12
rule, (6) Simpson's } rule, using 11
11 ordinate,
(a) the Trapezoidal
Sol. First we divide the range of integration into ter
parts by taking the
interval of differencing h=z/20 and equa
then
we compute the values of the for ea
function f(x)=sin x for
each
of sub-division. These computed values are as showo poing
shown in the
following table.

X y=sin x
y=Sinx

00000 x+6h=6/20 80902


t+h=/20 15643 +Th 77/20 89101
t+2h-27/20 30902 +8h=8m/20 95106
x+3h=37r|20 45399 o+9h=9/20 98769

a+4h47/2058778 X+10h=107/20 1-00000

tSh=57/20 70711

(a) By Trapezoidal rule, we have


(T/2
sin x
dx= yott-2 (V+7at.+y) ]
T
(re/20)
=

2
[T0000012(5-85311)1 [12:70622]
= 9981.

(b) By Simpson's *}' rule, we have


(T/2
sinx dx= 3 o+y10+4 (y+yat.+y»)
+2 (y+ya+..+Ys)]
100000 4+4 (3 19623) +-2 (2 65688)1
00000+12 78492+5 31376]
19:09868]=1-0006.
60
Again the exact value of the integral
|7/2
sin x dx=-cos x Je =1-0000.
Therefore the error
(i) Due to Trapezoidal rule=0919.
(ii) Du: to Simpson's }' rule= --0006.

You might also like