

13.1 Quadrature Formulas









Partition of the interval of integration into subintervals

Trapezoidal rule










The special forms of the trapezoidal and of Simpson’s rule motivate the following definition.
Definition 13.1



A quadrature formula is determined by the
specification of the weights and nodes. Thus we denote a quadrature
formula by for short. Without loss of generality
the weights
are not zero, and the nodes are
pairwise different
for
.
Example 13.2








Definition 13.3




Example 13.4
(a) The trapezoidal rule has order 2.
(b) Simpson’s rule has (by construction) at least order 3.
The following proposition yields an algebraic characterisation of the order of quadrature formulas.
Proposition 13.5


Proof




![$$\begin{aligned} b_1 + b_2 + \ldots +b_s&= 1\\[2pt] b_1 c_1 + b_2 c_2 + \ldots + b_s c_s&= \tfrac{1}{2}\\[2pt] b_1 c_1^2 + b_2 c_2^2 + \ldots + b_s c_s^2&= \tfrac{1}{3}\\ \vdots&\\ b_1 c_1^{p-1} + b_2 c_2^{p-1} + \ldots + b_s c_s^{p-1}&=\tfrac{1}{p} \end{aligned}$$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_13_Chapter/215236_2_En_13_Chapter_TeX_Equ20.png)



Example 13.6
![$$\begin{aligned} b_1 + b_2 + b_3&= \tfrac{1}{6}+\tfrac{2}{3}+\tfrac{1}{6} =1\\[2pt] b_1 c_1 + b_2 c_2 + b_3 c_3&= \tfrac{2}{3}\cdot \tfrac{1}{2}+\tfrac{1}{6} =\tfrac{1}{2}\\[2pt] b_1 c_1^2 + b_2 c_2^2 + b_3 c_3^2&= \tfrac{2}{3}\cdot \tfrac{1}{4}+\tfrac{1}{6} = \tfrac{1}{3} \end{aligned}$$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_13_Chapter/215236_2_En_13_Chapter_TeX_Equ21.png)

The best quadrature formulas (high accuracy with little computational effort) are the Gaussian quadrature formulas. For that we state the following result whose proof can be found in [23, Chap. 10, Corollary 10.1].
Proposition 13.7
There is no quadrature formula with
s stages of order . On the other hand, for every
there exists a (unique) quadrature
formula of order
. This formula is called s-stage Gaussian quadrature formula.

![$$\begin{aligned} s = 1:\quad&c_1 = \frac{1}{2}, \quad b_1 = 1, \quad \text {order 2} \ \ \text {(midpoint rule);}\\[1mm] s = 2:\quad&c_1 = \frac{1}{2}-\frac{\sqrt{3}}{6}, \quad c_2 = \frac{1}{2} + \frac{\sqrt{3}}{6},\quad \ b_1 = b_2 = \frac{1}{2}, \quad \text {order 4;}\\[1mm] s = 3:\quad&c_1 = \frac{1}{2} - \frac{\sqrt{15}}{10}, \quad c_2 = \frac{1}{2}, \quad c_3 = \frac{1}{2} + \frac{\sqrt{15}}{10},\\&b_1 = \frac{5}{18}, \quad b_2 = \frac{8}{18}, \quad b_3 = \frac{5}{18}, \quad \text {order 6}. \end{aligned}$$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_13_Chapter/215236_2_En_13_Chapter_TeX_Equ23.png)
13.2 Accuracy and Efficiency






Accuracy-cost-diagram of the Gaussian quadrature formulas. The crosses are the results of the one-stage Gaussian method of order 2, the squares the ones of the two-stage method of order 4 and the circles the ones of the three-stage method of order 6
- (a)
The curves are straight lines (as long as one does not get into the range of rounding errors, like with the three-stage method in the left picture).
- (b)
In the left picture the straight lines have slope
, where p is the order of the quadrature formula. In the right picture this is only true for the method of order 2, and the other two methods result in straight lines with slope
.
- (c)
For given costs the formulas of higher order are more accurate.
![$$[\alpha , \alpha +h]$$](/epubstore/O/M-Oberguggenberger/Analysis-For-Computer-Scientists/OEBPS/images/215236_2_En_13_Chapter/215236_2_En_13_Chapter_TeX_IEq40.png)










In the right picture it has to be noted
that the second derivative of the integrand is discontinuous at 0. Hence the above
considerations with the Taylor series are not valid anymore. The
quadrature formula also detects this discontinuity of the high
derivatives and reacts with a so-called order reduction ; i.e., the methods show a lower order (in our
case ).
Experiment 13.8

Commercial programs for numerical integration determine the grid points adaptively based on automatic error estimates. The user can usually specify the desired accuracy. In MATLAB the routines quad.m and quadl.m serve this purpose.
13.3 Exercises
- 1.
-
For the calculation of
first determine an antiderivative F of the integrand f using maple. Then evaluate
to 10, 50, 100, 200 and 400 digits and explain the surprising results.
- 2.
-
Determine the order of the quadrature formula given by
- 3.
-
Determine the unique quadrature formula of order 3 with the nodes
- 4.
-
Determine the unique quadrature formula with the nodes
- 5.
-
Familiarise yourself with the MATLAB programs quad.m and quadl.m for the computation of definite integrals and test the programs for
- 6.
-
Justify the formulas
by numerical integration. To do so divide the interval [0, 1] into N equally large parts
and use Simpson’s rule on those subintervals. Why are the results obtained with the first formula always more accurate?
- 7.
-
Write a MATLAB program that allows you to evaluate the integral of any given (continuous) function on a given interval [a, b], both by the trapezoidal rule and by Simpson’s rule. Use your program to numerically answering the questions of Exercises 7–9 from Sect. 11.4 and Exercise 5 from Sect. 12.4.
- 8.
-
Use your program from Exercise 7 to produce tables (for
to
in steps of 0.5) of some higher transcendental functions:
- (a)
-
the Gaussian error function
- (b)
-
the sine integral
- (c)
-
the Fresnel integral
- 9.
-
(Experimental determination of expectation values) The family of standard beta distributions on the interval [0, 1] is defined through the probability densities
. Here
is the beta function, which is a higher transcendental function for non-integer values of r, s. For integer values of
it is given by
for various integer values of r and s and guess a general formula for
from your experimental results.