I am having a hard time understanding how to use this formula. If given the following problem:
Compute ∫ sin x dx using Simpson's rule with 3 points in the range 0 to Pi/2.
Do I have to take the integral of this before plugging into the formula:
h/3 (f1 + 4f2 + f3)
Or would I simply plug in sin x directly?
As a side note... is there a page on formatting mathematical questions? I wasn't able to find any information while looking around the site. I'm not sure if there is a way to include subscripts or put the range on the integral itself.
Numerical integration's purpose is to approximate an integral with a weighted sum of point-wise value of the integrand.
In the case of Simpson's rule, you say that the grayed area (below) of the parabolic arc crossing your function at $x_0$, $x_1$ and $x_2$ is a good approximation. As you know how to write the equation of this arc in terms of $f(x_0)$, $f(x_1)$, $f(x_2)$, and know also how to integrate it, you can get a formula: this is Simpson's.
Newton-Cotes is just a generalisation of that.