Please note that the content of this book primarily consists of articles available from Wikipedia or other free sources online. In mathematics, the trapezium rule (also known as the trapezoid rule, or the trapezoidal rule in American English) is an approximate technique for calculating the definite integral int_{a}^{b} f(x),dx. The trapezoidal rule works by approximating the region under the graph of the function f(x) as a trapezoid and calculating its area. It follows that int_{a}^{b} f(x), dx approx (b-a)frac{f(a) + f(b)}{2}.To calculate this integral more accurately, one first splits the interval of integration [a,b] into n smaller subintervals, and then applies the trapezoidal rule on each of them. One obtains the composite trapezoidal rule: int_a^b f(x),dx approx frac{b-a}{n} left[ {f(a) + f(b) over 2} + sum_{k=1}^{n-1} f left( a+k frac{b-a}{n} right) right].This can alternatively be written as: 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) where x_k=a+k frac{b-a}{n},text{ for }k=0, 1, dots, n (one can not use a non-uniform grid, as the composite trapezoidal rule assumes equally sized segments).