Originally Posted by

**Reckoner** There is no 2 in the numerator, but the one in the denominator comes from the formula for the area of a trapezoid (or trapezium, if you are British):

$\displaystyle A = \frac12h(b_1+b_2),$

where $\displaystyle b_1$ and $\displaystyle b_2$ are the lengths of the bases, and $\displaystyle h$ is the height.

Also, rather than find the areas of each trapezoid directly, you can apply the Trapezoidal Rule,

$\displaystyle \int_a^b f(x)\,dx \approx \frac{b-a}{2n} \left(f(x_0) + 2f(x_1) + 2f(x_2)+\cdots+2f(x_{n-1}) + f(x_n) \right),$

as specified in the problem's instructions. For reference, Simpson's Rule is

$\displaystyle \int_a^bf(x)\,dx$

$\displaystyle \approx\frac{b-a}{3n}\left[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x _{n-1})+f(x_n)\right].$

You can easily find derivations of these with a quick search.