Example 1.  Consider the function  ,  the equally spaced quadrature nodes  , ,  ,  , and ,  and the corresponding function values  ,  ,  ,  ,  and  .  Apply the various quadrature formulas (4) through (7).

Trapezoidal Rule                                                Simpson’s Rule

Simpson’s 3/8 Rule                                                Boole’s Rule

Solution 1.

``````

```

```

Using (8) the Trapezoidal Rule:

Mathematica's Computation is:

``````
```

```

Using (9) Simpson’s Rule:

Mathematica's Computation is:

``````
```

```

Using (10) Simpson’s Rule:

Mathematica's Computation is:

``````
```

```

Using (11) Boole’s Rule:

Mathematica's Computation is:

``````
```

```

It is important to realize that the quadrature formulas (4) through (7) applied in the example above give approximations for definite integrals over different intervals.  The graph of the curve    and the areas under the Lagrange polynomials  , , , and   are shown in the figures for this example.

(c) John H. Mathews 2004