Originally Posted by

**charikaar** Lets say the interval is [-4,4]

I am confused to choose the correct formula in given situations.

Can you help please.

$\displaystyle \int_{a}^{b} f(x) \, dx \approx \frac{b-a}{6}\left[f(a) + 4f\left(\frac{a+b}{2}\right)+f(b)\right]$

AND

$\displaystyle \int_a^b f(x) \, dx\approx

\frac{h}{3}\bigg[f(x_0)+2\sum_{j=1}^{n/2-1}f(x_{2j})+

4\sum_{j=1}^{n/2}f(x_{2j-1})+f(x_n)$

I think the aobve is used for n+1 nodes but I am not sure how to get the nodes. Is the original interval [-4,4] has zero nodes?

Thanks