Approximate Integration: The Trapezoidal Rule Claus Schubert May 25, 2000
Why Approximate Integration? zCan’t always find an antiderivative Example: zDon’t always know the function
First Approach: Riemann Sums zUse left or right Riemann sums to approximate the integral. zLeft Riemann sum: x : length of the n subintervals x i :endpoints of the subintervals
x0x0 x1x1 x2x2 x3x3 Left Riemann Sums By refining the partition, we obtain better approximations. L n is the sum of all the inscribed rectangles starting at the left endpoints. It is called a left endpoint approximation. y x xx f(x0)f(x0) xx f(x1)f(x1) xx f(x2)f(x2)
x0x0 x1x1 x2x2 x3x3 Right Riemann Sums y x R n is the sum of all the inscribed rectangles starting at the right endpoints. It is called a right endpoint approximation.
If L n underestimates, then R n overestimates, and vice versa Left and Right Endpoint Approximations zObservations: Approximations get better if we increase n yTake the average of both approximations zIdea for improvement:
Trapezoidal Approximation a b h
LnLn RnRn x0x0 x1x1 x2x2 x3x3 y x TnTn
x0x0 x1x1 x2x2 x3x3 y x TnTn
An Example As an example, let us look at.
An Example
Error bounds zQuestion: How accurate is the trapezoidal approximation? zAnswer: where K is an upper bound for | f”(x) |.
Error bounds: An Example In our previous example, how large should n be so that the error is less than ?
Error bounds: An Example
Let’s Wrap Up zApproximations are useful if the function cannot be integrated or no function is given to begin with. zLeft and right endpoint approximations are too inaccurate, so take their average. zThe trapezoidal approximation is much more accurate than the left/right approximations, but better approximations exist (midpoint, Simpson’s etc.) You need a computer to find approximations with large n - or you need to get a life!!!