Alright, so I'm a bit stumped on this one. I learned Simpson's rule via my textbook as follows:
$$\frac{h}{3}[y_0 + y_n + 2(y_2+y_4+...+y_{n-2}) + 4(y_1+y_3+...+y_{n-1})]$$
I was given a problem in my book as follows:
Given the following data on $y = f(x)$,
$$\begin{array}{c|c} \text{x} & \text{y} \\ \hline 0 & 32 \\ \hline 1 & 38 \\ \hline 2 & 29 \\ \hline 3 & 33 \\ \hline 4 & 42 \\ \hline 5 & 44 \\ \hline 6 & 38 \\ \hline \end{array}$$
Calculate approximately $\int_{0}^6 f(x) dx$.
I plugged in the numbers into the formula as follows with $h = 1$:
$$\frac{1}{3}[32+38+2(29+42)+4(38+33+44)]$$
When I solve the formula I get 224 as my answer, but my book says the answer is 37.33 (somehow).
If anyone can point out my mistake that would be greatly appreciated.
Thanks.
Edit: 37.33 not 33.37
If your book says what you say it does, then I agree with you over your book.
Using Simpson's rule, $\int_0^6 f(x)dx\approx 224.$
For comparison, using the trapezoidal rule, the answer would be $\int_0^6 f(x)dx\approx \frac12(6)(32+38)=210.$
For some reason, the answer in the book apparently divided by $\int_0^6 dx=6$.