To integrate a function f(x) in the interval (a,b) we can use Simpson's one third rule.
Divide the interval into n parts. Let the value of n is even.
Then width h=b−an.
Calculate the values of x0 to xn as x0=a,x1=x0+h,....,xn−1=xn−2+h,xn=b.
Consider y=f(x). Now find the value of y(y0 to yn) for the corresponding x(x0 to xn) values.
Now, substitute all the values in the Simpson's one third rule.
The formula for Simpson's one third rule is :
∫baf(x)dx=h3[(y0+yn)+4(y1+y3+...+yn−1)+2(y2+y4+...+yn−2)]