Trapezoid Rule - Approximating Definite Integrals
For this rule we will do similar set up as for the Midpoint Rule. We will break up the interval [a, b] into n subintervals of width,
Δx = b - a / n
After that on each subinterval we will estimated the function with a straight line that is equivalent to the function values at either endpoint of the interval. Now here is a sketch of this case for n = 6.
Every object in this is a trapezoid (therefore the rule's name...) and like we can see some of them do a very good job of approximating the actual area within the curve and others don't do such a good job.
The area of the trapezoid in the interval [xi-1, xi] is given by,
Ai = Δx/2 (f (xi-1) + f (xi))
So, if we employ n subintervals the integral is just about,
∫ba f(x) dx ≈ Δx/2 (f (x0) + f (x1)) + Δx/2 (f(x1) + f (x2)) +.....+ Δx/2 (f (xn-1) + f (xn))
On doing a little simplification we reach at the general Trapezoid Rule.
∫ba f (x) dx ≈ Δx/2 [f (x0) + 2f (x1) + 2f (x2) + .... + 2f (xn-1) + f(xn)]
Note: all the function evaluations along with the exception of the first and last, are multiplied by 2.