Section 17.4 Combining two rules
What combination of two rules should we use for approximations \(I_1\) and \(I_2\text{?}\) These rules should be of different accuracy; for example, it would be a bad idea to use the left endpoint and right endpoint rules. Both of these are about equally imprecise, so they may give the same answer which is still wrong by some large amount.
One can use, for example, the trapezoidal rule (order 2) and Simpson's rule (order 4). This has an advantage in that of of three evaluation points in Simpson's rule, two are also in trapezoidal rule. So one can compute function values once, for example
y = f([a, (a+b)/2, b]);
and obtain both trapezoidal and Simpson's rules from the vector y
. This property of two rules being nested (evaluation points of one rule are contained in the other) is valuable for speeding up the computation.
Since the Gauss integration rule is the most accurate of those we discussed, one may decide to use it for both \(I_1\) and \(I_2\text{,}\) just with different number of evaluation points, perhaps \(n\) and \(2n\text{.}\) A downside is that Gauss evaluation points are not nested. In practice, the Gauss rule is used for \(I_1\) and the Kronrod rule (also based on orthogonal polynomials, but beyond our scope) is used for \(I_2\text{.}\) The Kronrod rule is designed to include all of the points used by the Gauss rule, and some additional ones. A popular choice, e.g., in TI graphing calculators, is (G7, K15), meaning 7-point Gauss rule combined with 15-point Kronrod rule. Python library SciPy uses (G10, K21) combination.