In calculus, the trapezoidal rule (informally trapezoid rule; or in British English trapezium rule) is a technique for numerical integration, i.e. approximating the definite integral:
∫ a b f ( x ) d x . {\displaystyle \int _{a}^{b}f(x)\,dx.}
The trapezoidal rule works by approximating the region under the graph of the function
f ( x ) {\displaystyle f(x)} as a trapezoid and calculating its area. This is easily calculated by noting that the area of the region is made up of a rectangle with width ( b − a ) {\displaystyle (b-a)} and height f ( a ) {\displaystyle f(a)} , and a triangle of width ( b − a ) {\displaystyle (b-a)} and height f ( b ) − f ( a ) {\displaystyle f(b)-f(a)} . Therefore,
∫ a b f ( x ) d x ≈ ( b − a ) ⋅ f ( a ) ⏟ Area of rectangle + 1 2 ( b − a ) ⋅ [ f ( b ) − f ( a ) ] ⏟ Area of triangle = ( b − a ) ⋅ ( f ( a ) + 1 2 f ( b ) − 1 2 f ( a ) ) = ( b − a ) ⋅ ( 1 2 f ( a ) + 1 2 f ( b ) ) = 1 2 ( b − a ) [ f ( a ) + f ( b ) ] . {\displaystyle {\begin{aligned}\int _{a}^{b}f(x)\,dx&\approx \underbrace {(b-a)\cdot f(a)} _{\text{Area of rectangle}}+\underbrace {{\tfrac {1}{2}}(b-a)\cdot [f(b)-f(a)]} _{\text{Area of triangle}}\\&=(b-a)\cdot \left(f(a)+{\tfrac {1}{2}}f(b)-{\tfrac {1}{2}}f(a)\right)\\&=(b-a)\cdot \left({\tfrac {1}{2}}f(a)+{\tfrac {1}{2}}f(b)\right)\\&={\frac {1}{2}}(b-a)[f(a)+f(b)].\end{aligned}}}
… excerpt ends here. Continue reading the full article.



![Trapezoidal rule: Illustration of "chained trapezoidal rule" used on an irregularly spaced partition of
[
a
,
b
]
{\displaystyle [a,b]}](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Integration_num_trapezes_notation.svg/500px-Integration_num_trapezes_notation.svg.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)

