Simpson's Rule Via Table

845 Views Asked by At

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

2

There are 2 best solutions below

1
On BEST ANSWER

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$.

0
On

Yes, the book is wrong. You have implemented the rule correctly. As in the comments, the book is dividing by $6$, but just an eyeball average says the function is somewhere in the range of $35-40$ and the interval is $6$, so the area is somewhere in the range $210-240$. Your result is squarely inside this bound, while the book is not.