powered by
Implements Simpson's extended numerical integration rule
SimpsonInt(xin, h)
A vector of data points
grid length
returns the approximate integral value
The extended numerical integration rule is given by $$ \int_0^{x_{2n}} f(x)\,dx = \frac{h}{3}(f(x_0) + 4\{f(x_1) + \dots f(x_{2n-1}) \} +2 \{f(x_2) + f(x_4) + \dots f(x_{2n-2})\} + f(x_{2n})) -R_n $$
Weisstein, Eric W. "Simpson's Rule." From MathWorld--A Wolfram Web Resource