Can anyone help me find my mistake?
$$I = \int_0^2 f(x) ~ dx, \qquad f(x)=\frac {3^x}{x+1}$$
I got $f(0)=1$
$f(0)=1$
$f(1/2)=\frac{2(3^{1/2})}3$
$f(1)=3/2$
$f(3/2)=\frac{6(3^{1/2})}5$
$f(2)=3$
Calculation $I = \frac16[1+2(\frac{2(3^{1/2})}3)+4(3/2)+2(\frac{6(3^{1/2})}5)+3]$ when I used and substituted in the formula then I am getting $2.7$.....
But, the actual answer is $3.32$....
If you are using Simpson's rule over two unit intervals it should be $$\frac 16[f(0)+4f(\frac 12)+2f(1)+4f(\frac 32)+1f(2)]$$ That gives $$\frac 16\left[1+4\cdot \frac 23\sqrt 3+2\cdot \frac 32+4\cdot \frac 65\sqrt 3+3\right]=\frac 16(7+\frac {112}{15}\sqrt 3)\approx 3.32$$ If the length of each interval were different from $1$ we would have to multiply by it. The $2$ in the center comes from adding $1$ from each interval.