Trapezoidal Formula for Definite Integrals

Theorem
Let $f$ be a real function which is integrable on the closed interval $\left[{a \,.\,.\, b}\right]$.

Let $P = \left\{{x_0, x_1, x_2, \ldots, x_{n - 1}, x_n}\right\}$ form a normal subdivision of $\left[{a \,.\,.\, b}\right]$:
 * $\forall r \in \left\{ {1, 2, \ldots, n}\right\}: x_r - x_{r - 1} = \dfrac {b - a} n$

Then the definite integral of $f$ $x$ from $a$ to $b$ can be approximated as:


 * $\displaystyle \int_a^b f \left({x}\right) \rd x \approx \dfrac h 2 \left({f \left({x_0}\right) + f \left({x_n}\right) + \sum_{r \mathop = 1}^{n - 1} 2 f \left({x_r}\right) }\right)$

where $h = \dfrac {b - a} n$.

Also known as
Non-US sources refer to this rule as the trapezium rule, as a result of the fact that the terms trapezoid and trapezium have the opposite definitions outside the US.