The trapezoidal rule works by approximating the region under the graph of the function f(x) as a trapezoid and calculating its area.
The trapezoidal rule is to find the exact value of a definite integral using a numerical method. This rule is mainly based on the Newton-Cotes formula which states that one can find the exact value of the integral as an nth order polynomial.
When n=1 according to Trapezoidal rule, the area under the linear polynomial is stated as,
∫baf(x) dx=(b−a)(f(a)+f(b)2)