The Simpson approach states that the "integration range [a,b]" can always be divided into n (n must be even) strips
of width h = (b - a) / n.
Applying the Simpson's rule to two adjacent strips:
xi+2∫xi f(x)dx = h/3 [f(xi) + 4 f(x(i+1)
+ f(xi+2)]
|
Then the integral can be obtained by the sum:
I = ∫ba f(x)dx =
∑ni=0,2,4,... ∫x i+2xi f(x)dx =
h/3 ∑ ni=0,2,4,... [f(xi>) + 4 f(xi+1) + f(xi+2)]
|
It must also be stated that the Simpson's 1/3 rule requires the number of strips n to be even. If this condition is not
satisfied, it is posible to integrate over the first (or last) three strips by using Simpson's 3/8 rule (which is another condition):
I = 3h/8 [f(x0) + 3 f(x1) + 3 f(x2) + f (x3)]
|
and then use the Simpson's 1/3 rule for the rest of strips. Although a bit confusing it is really very simple to implement this rule.
|