Numerical Integration: Msa / L-6 Cse-3512 - Numerical Methods 27 January, 2005
Numerical Integration: Msa / L-6 Cse-3512 - Numerical Methods 27 January, 2005
Numerical Integration
Numerical integration is the process of finding the numerical value of a definite integral
b
I=
a
f ( x) dx
when a function y = f (x) is not know explicitly. But we are given only a set of values of the function
y = f (x) corresponding to the same values of x.
To evaluate the integral, we fit up a suitable interpolation polynomial to the given set of values of
f (x) and then integrate it within the desired limits. Here we integrate an approximate interpolation
formula instead of f (x). When this technique is applied on a function of single variable, the
process is called Quadrature.
b
If f (x) is continuous over the closed interval [a, b], then the integral I =
a
f ( x) dx represents the
area under the curve y = f (x) bounded by the ordinates x = a, x = b and the x-axis.
Y y = f (x)
a b X
Fig: Area under the curve y = f (x)
Page 1 of 3
MSA / L-6 CSE-3512 - Numerical Methods 27th January, 2005
Trapezoidal Rule
Substituting n =1 in the general quadrature formula and neglecting all differences greater than
the first, we get
x 0 h
I1 = x0
f (x) dx
= h [y0 + 1/2 Δy0] = h [y0 + 1/2 (y1-y0)] = h/2 (2y0 + y1 - y0)
= h/2 (y0 + y1) for the first sub interval [x0, x0+h]
Similarly, we get
x 0 2 h
I2 = x 0 h
f (x) dx = h/2 (y1 + y2)
x 03h
I3 = f (x) dx = h/2 (y2 + y3).
x 0 2 h
.
.
x 0 nh
In = x 0 ( n 1) h
f (x) dx = h/2 (yn-1 + yn)
Page 2 of 3
MSA / L-6 CSE-3512 - Numerical Methods 27th January, 2005
Similarly, we get
x 0 4 h
I2 = x 0 2 h
f (x) dx = h/3 (y2 + 4y3 + y4)
x 06 h
I3 = f (x) dx = h/3 (y4 + 4y5 + y6)
x 0 4 h
.
.
x 0 nh
In/2 = x 0( n 2) h
f (x) dx = h/3 (yn-2 + 4yn-1 + yn)
Weddle’s rule:
Substituting n = 6 in the general quadrature formula and neglecting all differences above Δ6, we get
I = 3h/10 [(y0+yn) + (y2+y4+y8+y10+……+yn-4+yn-2) + 5 (y1+y5+y7+y11+…… +yn-5+yn-4)
+ 6 (y3+y9+y15+ …… +yn-3) + 2 (y6+y12+ …………. +yn-6)]
Substituting n = 4 in the general quadrature formula and neglecting all differences above Δ 4, we
get the Boole’s rule.
Page 3 of 3