Professional Documents
Culture Documents
integration. The given interval of integration is subdivided into a large number of subintervals of equal width h and the functiontabulated at the points of subdivision is replaced by any one of the interpolatingpolynomials like Newton-Gregorys, Stirlings, Bessels over each of thesubintervals and the integral is evaluated. There ar e several formulae for numerical integration which we shall derive in the sequel.
xn
NEWTON-COTES QUADRATURE FORMULA Let I =aby dx, where y takes the values y0, y1, y2, .......,ynfor x = x0, x1, x2, ......, xn.Let the interval of integration (a, b) be divided into nequal sub-intervals, each of width h =(b-a)/n, so that -x0 = a, x1 = x0 + h, x2 = x0 + 2h, ......., xn= x0 + nh= b. Therefore,I =(x0)(x0+h)f (x) dx Since any x is given by x = x0 + rh and dx = hdr I = h0n f (x+rh)dr = h0n[y0+r y0+(r(r-1)/2!)2y0+(r(r-1)(r-2)/3!)3y0+]dr [by Newtons forward interpolation formula] =nh[y0+(n/2)y0+(n(2n-3)/12)2y0+]
(1)
This is a general quadrature formula and is known as Newton-Cotes quadrature formula. A number of important deductions viz. Trapezoidal rule, Simpsons one-third and three-eighth rules, Weddles rule can be immediately deduced by putting n = 1, 2, 3, and 6, respectively, in formula (1). SIMPSONS ONE-THIRD RULE (n = 2) Putting n = 2 in formula (1) and taking the curve through (x0, y0), (x1, y1) and (x2, y2) as a polynomial of degree two so that differences of order higher than two vanish, we get
(x0+2h)
Similarly,
(x0+2h) (x0+(n-2)h) (x0+4h) (x0+nh)
f (x)dx=(h/3)(y2+4y3+y4),.., f (x)dx=(h/3)(y(n-2)+4y(n-1)+yn)
NOTE:-While using this formula, the given interval of integration must be divided into an even number of sub-intervals, since we find the area over two sub-intervals at a time. Problem.:Evaluate 0 0.8(log(x+1)+sin(2x))dx ,where x is in radian, using Simpsons 1/3rd rule. Divide the entire interval into 8 strips. Solution: Analytical solution
y=f(x)
Read xn,x0,n
While(mod(n,2)~=2)
Read n again
h=(xn-xp)/n
ans=0
If(mod(i,2)~=0)
Ans=ans+2*f(x0+i*h)
Area=Area*(h/3)
END