Theory 1

The Trapezoid Rule is a technique to approximate the area under a curve as the sum of areas of thin trapezoids whose top corners lie on the curve.

center The tops of the trapezoids are lines that approximate the curve. They are determined as lines that agree with the curve at two points.

Trapezoid rule - area formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), the Trapezoid Rule determines the area formula:

Tn=12Δx(y0+2y1+2y2++2yn1+yn)

Notice the pattern in 2s and see how this formula comes about: The area of one trapezoid is Δx(yj1+yj2). All vertical values y1,,yn1 (excepting the endpoints f(a) and f(b)) are represented in two trapezoids, so their contribution is doubled.

Extra - Trapezoid rule - error bound

The error of the Trapezoid Rule approximation is bounded by this formula:

Error(Tn)K2(ba)312n2

Here K2 is any number satisfying K2|f(x)| for x[a,b].

The Midpoint Rule is a technique to approximate the area under a curve as the sum of areas of thin rectangles whose top midpoints lies on the curve.

center

The very same formula also represents the areas of trapezoids whose top midpoints lie on the curve and whose top line is tangent to the curve:

center

The reason they are equal is simple: when pivoting the top line on the ‘attached’ midpoint, the area of the trapezoid does not change.

Midpoint Rule - area formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), the Midpoint Rule determines the area formula:

Mn=Δx(f(c1)+f(c2)++f(cn1)+f(cn))

Here each ci is the midpoint of the interval [xi1,xi]. It can be given by the formula ci=a+(i1/2)Δx.

Extra - Midpoint Rule - error bound

The error of the Midpoint Rule approximation is bounded by this formula:

Error(Mn)K2(ba)324n2

Here K2 is any number satisfying K2|f(x)| for x[a,b].

Notice that Mn has an error bound that is 1/2 of the bound for Tn. This does not mean that Mn always has a smaller error than Tn. It means that without calculating the error, simply plugging numbers into the error bound formulas, we obtain a smaller bound for Mn than for Tn. This is about our knowledge of the error, not the reality of the error.

Theory 2

It turns out that the Midpoint Rule and the Trapezoid Rule tend to differ from the exact integral in opposite directions, and the Midpoint Rule tends to be twice as accurate. Therefore we may improve on both of them by constructing a weighted average of the formulas. This is called Simpson’s Rule.

center

Simpson’s Rule - defining formula

Simpson’s Rule is given by the weighted sum of the Trapezoid and Midpoint Rules:

Sn=12Tn+23Mn

Simpson’s Rule - computing formula

Given a function f and a partition of the range [a,b] labeled by x0,x1,,xn (with x0=a and xn=b), Simpson’s Rule determines the area formula:

Sn=13Δx(y0+4y1+2y2+4y3+2y4++2yn2+4yn1+yn)

Simpson’s Coefficient Pattern

Memorize the pattern for Simpson’s Rule:

1,4,2,4,2,4,2,,1

Simpson’s Rule - error bound

The error of Simpson’s Rule approximation is bounded by this formula:

Error(Sn)K4(ba)5180n4

Here K4 is any number satisfying K4|f(4)(x)| for x[a,b].

Simpson’s Rule = “Parabola Rule”

The formula of Simpson’s Rule can also be explained or defined geometrically: it is the formula giving the sum of areas under small parabolas that meet the curve in three points.

There is a unique parabola passing through any three points with differing x-values: center

These may be pieced together to form an approximation to the curve: center The area under the parabola through P0, P1, and P2 is given by this formula:

h3(y0+4y1+y2)

This formula may be verified using basic calculus (area under a parabola) and a lot of algebra. (Ambitious students should derive it.)

The area under the parabola through P2, P3, and P4 is given by a similar formula:

h3(y2+4y3+y4)

The Simpson’s Rule formula is the sum of all these formulas! So the 2s in Simpson’s come from duplication of endpoint terms as the “rectangular” regions are stacked end-to-end.