Topic 13.1: Trapezoidal Rule (Error Analysis)

Contents Previous Chapter Start of Chapter Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

The error for the trapezoidal rule may be found by integrating the corresponding Taylor series and applying integration by parts. Taylor's series gives us that:

fa=fx+f1xa-x+12f2ξa-x2

where ξ is in the interval [a, x].

Integrating each side with respect to the variable x from a to b, we get the expression:

fab-a=abfxx+afb-afa-abxf1xx+16f2ξb-a3

Recall from calculus the technique of integration by parts. In this case, may rewrite the integral of x f(1)(x) as:

abxfxx=xfx x=ab-abfxx

Substituting this into our expression, we get:

fab-a=2abfxx-fbb-a+16f2ξb-a3 ">

Exchanging the integral and the left-hand side, dividing each side by −2, and collecting appropriately, we get:

abfxx=12fa+fbb-a-112f2ξb-a3

Note, we sort of cheated here, because ξ depends on x, however we may replace f(2)(ξ) by the average value:

abfxx12fa+fbb-a-112f2b-a3

Example of Error

Consider the integral of cos(x) from 0.2 to 0.4. The correct value of this integral is 0.1907490115, 0.5⋅(cos(0.2) + cos(0.4))⋅0.2 = 0.1901127572, and the difference between these is −0.0006362543. If we calculate the average value of the 2nd derivative and multiply this by −0.23/12, we get −0.0006358300384, and thus our approximation of the error is very close (less than 0.1% error in our estimation of the error).

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.