Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

6.2: Composite Rules

( \newcommand{\kernel}{\mathrm{null}\,}\)

We now use our elementary formulas obtained for (6.2) to perform the integral given by (6.1)

6.2.1. Trapezoidal rule

We suppose that the function f(x) is known at the n+1 points labeled as x0,x1,,xn, with the endpoints given by x0=a and xn=b. Define

fi=f(xi),hi=xi+1xi

Then the integral of (6.1) may be decomposed as

baf(x)dx=n1i=0xi+1xif(x)dx=n1i=0hi0f(xi+s)ds

where the last equality arises from the change-of-variables s=xxi. Applying the trapezoidal rule to the integral, we have

baf(x)dx=n1i=0hi2(fi+fi+1)

If the points are not evenly spaced, say because the data are experimental values, then the hi may differ for each value of i and (6.6) is to be used directly.

However, if the points are evenly spaced, say because f(x) can be computed, we have hi=h, independent of i. We can then define

xi=a+ih,i=0,1,,n

and since the end point b satisfies b=a+nh, we have

h=ban

The composite trapezoidal rule for evenly space points then becomes

baf(x)dx=h2n1i=0(fi+fi+1)=h2(f0+2f1++2fn1+fn)

The first and last terms have a multiple of one; all other terms have a multiple of two; and the entire sum is multiplied by h/2.

6.2.2. Simpson’s rule

We here consider the composite Simpson’s rule for evenly space points. We apply Simpson’s rule over intervals of 2h, starting from a and ending at b :

baf(x)dx=h3(f0+4f1+f2)+h3(f2+4f3+f4)++h3(fn2+4fn1+fn)

Note that n must be even for this scheme to work. Combining terms, we have

baf(x)dx=h3(f0+4f1+2f2+4f3+2f4++4fn1+fn)

The first and last terms have a multiple of one; the even indexed terms have a multiple of 2; the odd indexed terms have a multiple of 4; and the entire sum is multiplied by h/3.


This page titled 6.2: Composite Rules is shared under a CC BY 3.0 license and was authored, remixed, and/or curated by Jeffrey R. Chasnov via source content that was edited to the style and standards of the LibreTexts platform.

  • Was this article helpful?

Support Center

How can we help?