Originally Posted by

**richard1234** 0^3 is 0.

I can't make a whole lot of sense out of your questions, but you seem to be applying the formula without knowing where it came from. The "formula" for the trapezoidal rule can be derived by simply drawing a function f(x) from x = a to x = b and splitting it into several trapezoids. By simply using geometry to find the area of each trapezoid, we will obtain

$\displaystyle \int_{a}^{b} f(x) \,dx \approx \sum_{i = 1}^{n} \frac{1}{2}(x_i - x_{i-1})(f(x_i) + f(x_{i-1}))$. Here, $\displaystyle x_i - x_{i-1}$ is the "height" of each trapezoid, and $\displaystyle f(x_i) + f(x_{i-1})$ is just the sum of the two bases of the trapezoid (this is why we get the coefficients of 1,2,2,...,2,1).

In the case where the $\displaystyle x_i's$ are evenly spaced, the sum $\displaystyle \sum_{i = 1}^{n} x_i - x_{i-1}$ will telescope to $\displaystyle x_n - x_0$, which is just $\displaystyle b-a$, so $\displaystyle x_i - x_{i-1} = \frac{b-a}{n}$, which is constant. Substitute that into the summation to obtain the formula.