Let $n$ be the number of segments, which is a multiple of 3. And let $h$ be the width of each of these segments, where $h=\dfrac{(b-a)}{n}$.
So the formula I have is that the integral $I$ for a function $f(x)$ on an interval [$a$,$b$] is:
$$ I = \frac{3h}{8} \left[ f(x_0) + 3 \sum_{i=1,4,7,\dots}^{n-2}f(x_i) + \ 3 \sum_{i=2,5,8,\dots}^{n-1}f(x_i) + 2\sum_{i=3,6,9,\dots}^{n-3}f(x_i) + f(x_n) \right]$$
Also where $x_0 = a$ and $x_n = b$.
I was wondering if, this is the right formula for the composite simpson's 3/8 rule?