Choose points as well as weights
A quadrature rule approximates an integral by a weighted sum of function values. Unlike a rule whose nodes are fixed in advance, we can choose the evaluation points to make the rule exact for more polynomials. Begin with a deliberately symmetric two-node family on :
We will derive the rule within this symmetric family; this is not a proof that every possible two-node formula has the same form.
Definition 10.1.1
(Degree of exactness)
A quadrature rule for has degree of exactness if for every real polynomial of degree at most , but not for some polynomial of degree .
Match the first moments
Exactness for requires , so . Odd functions integrate to zero on , and the two symmetric values cancel, so the rule is automatically exact for and . For , exactness requires
Consequently
Theorem 10.1.2
(Two-point Gauss rule on )
Let .
- is exact for every real polynomial of degree at most .
- is not exact for : . Hence its degree of exactness is exactly .
- No rule , with any real nodes and weights, is exact for all polynomials of degree at most .
Proof
(Four monomials, then one nonnegative quartic)
Every polynomial of degree at most is a combination of , and both the integral and are linear, so it suffices to check these four. and . Both and are odd, so gives and so does the integral. This proves part 1. For part 2, and , and .
For part 3, given nodes and weights, put , a polynomial of degree . Then , but and is not identically zero, so . The rule fails on .
Proof X-ray
Why four monomials are enough, and why not five
The proof of part 1 uses linearity twice: once to reduce every cubic to the four monomials, and once to say that matching on those four matches on every combination, not merely on four isolated examples. Of the four, symmetry settles and for free; only and constrain the parameters, which is why the symmetric family has just enough freedom ( and ) for two equations. Part 3 is the opposite move: instead of testing a given rule, it builds a function that every two-node rule treats as zero because it vanishes at both nodes, yet whose integral is positive since it is a nonnegative function that is not identically zero. The assumption that the two nodes are real numbers is what makes .
The two nodes are strictly inside the interval; no endpoint samples are required.
Exactness has a boundary
For , the integral is , but
Thus the error in the convention integral minus rule is . The rule is not exact for every quartic; its degree of exactness is exactly 3. For a general nonpolynomial function, polynomial exactness alone supplies neither a numerical error bound nor a guarantee that the approximation is accurate.
Counterexample mode
Matching low degrees does not make every function exact
Claim: since is exact for all cubics, it is exact for every function that a cubic approximates well, in particular for and . For the integral is and , an error of . For the integral is , while , an error of about . The nodes were chosen to satisfy particular moment equations only; an error estimate for general integrands needs a further assumption on the integrand and a theorem that uses it.
A worked polynomial and a new interval
To integrate on with , set . The transformed rule is
The factor comes from ; it is essential. The rule remains exact for polynomials of degree at most 3 after this affine substitution.
Worked example 10.1.3
(A quadratic on the reference interval)
For , the rule gives
The odd terms cancel. Direct integration gives , confirming the same result.
Worked example 10.1.4
(A cubic and a quartic on [0,2])
Here and the nodes are , so with . For : , exact as promised. For : , while . The error is , the same as on because here the interval has half-length one.
Worked example 10.1.5
(A non-polynomial integrand)
For on the integral is , and , an error of about . The function is not a polynomial, so the degree of exactness gives no information about it, and the corner at lies between the two nodes.
Common mistake
(Forgetting the scale factor on a general interval)
For and the nodes are and , so , the correct integral. Moving the nodes but dropping the factor gives , which is wrong even for a constant. The factor is the Jacobian of the substitution.
A reproducible calculation
The following MATLAB fragment evaluates the worked polynomial and compares it with its exact integral. The elementwise power is intentional because nodes is a vector.
nodes = [-1, 1]/sqrt(3);
f = @(x) x.^2 + 3*x + 2;
approx = sum(f(nodes));
exact = 14/3;
disp([approx, exact, approx-exact])
Floating-point arithmetic can produce a small nonzero displayed difference; that is distinct from the mathematical exactness of the rule. Record the method and nodes when reporting the calculation.
Exercises and solutions
Quick check
(What are the two weights on ?)
Use exactness for .
Solution · Answer
Both are : .
Quick check
(What is ?)
Compare the values at the two nodes.
Solution · Answer
, since ; the integral of over is also .
Quick check
(What are the nodes on ?)
Use .
Solution · Answer
.
Quick check
(Does the quartic example prove that every polynomial of degree at most 4 has nonzero error?)
Try a polynomial of degree at most 3.
Solution · Answer
No; the example shows only that has nonzero error. For instance is integrated exactly.