Back to the on-screen lesson ·

Gaussian quadrature

Why the roots of the orthogonal polynomial are the only nodes that reach the ceiling, why the weights come out positive, and what changes when the rule is moved to another interval.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to prove that an $n$-point Gauss rule is exact through degree $2n - 1$, say which step orthogonality is used in, show the weights are positive and what that buys, and transform a tabulated rule to another interval.

2. What you already know

You know that an $n$-point rule can reach degree $2n - 1$ at best, and that the roots of an orthogonal polynomial are real, simple and strictly inside the interval. This lesson puts those two facts together, and the second turns out to be exactly what the first needs.

3. The words this lesson uses

A rule is interpolatory when its weights are $\int w L_i$, the integrals of the Lagrange basis polynomials for its nodes — which makes it exact through degree $n - 1$ automatically. A Gauss rule takes the nodes to be the roots of the $n$th orthogonal polynomial for the weight. The half-width of $[a, b]$ is $\dfrac{b - a}{2}$, the factor that appears when a rule is moved there from $[-1, 1]$.

4. The one node choice that makes the remainder invisible

Any $n$ distinct nodes with interpolatory weights give exactness through degree $n - 1$: integrate the interpolating polynomial, and for a polynomial of that degree the interpolant is the thing itself. The other $n$ degrees are what Gaussian quadrature buys, and the argument is three lines. Take $p$ of degree at most $2n - 1$ and divide by the orthogonal polynomial $p_n$: $p = qp_n + r$, with $q$ and $r$ both of degree below $n$. Then $\int w\,qp_n = 0$ by orthogonality, so $\int w\,p = \int w\,r$; the rule is exact on $r$; and at every node $p_n$ vanishes, so $p = r$ there and the rule returns the same value for both. Exact. The nodes are used twice — as roots, to kill the quotient term, and as distinct interior points, so the interpolatory weights exist — and both uses come from the root theorem. Two further properties come almost free. The weights are positive, because applying the rule to $L_i^{2}$ (degree $2n - 2$, inside the exactness range) gives $w_i$ on one side and a positive integral on the other; and positive weights mean the weight sizes sum to the interval length, so the rule cannot amplify rounding error. Finally, a rule tabulated on $[-1, 1]$ moves to $[a, b]$ by the affine change of variable: nodes to midpoint plus half-width times node, and every weight multiplied by the half-width.

Another way: steps

  1. Choose the weight function; that fixes the orthogonal family.
  2. Take the nodes to be the roots of $p_n$ and the weights interpolatory.
  3. The rule is then exact through degree $2n - 1$, with positive weights.
  4. To use it elsewhere, scale nodes and weights by the half-width and shift by the midpoint.

Another way: example

Two points on $[-1, 1]$: $p_2 = x^{2} - \tfrac13$, roots $\pm\tfrac{1}{\sqrt3}$, weights $1$ and $1$. For $f = x^{2}$ the rule gives $\tfrac13 + \tfrac13 = \tfrac23$, exact; for $f = x^{3}$ it gives $0$, exact; for $f = x^{4}$ it gives $\tfrac29$ against $\tfrac25$. Degree of exactness $3 = 2n - 1$.

5. The mistake to watch for

Tabulated nodes and weights are transplanted to another interval with the nodes mapped and the weights left alone. The answer then comes out wrong by exactly the half-width, and on $[0, 1]$ that is a factor of two — large enough to notice and small enough to be mistaken for a bug elsewhere. The check costs one line: the weights must sum to the length of the interval. The other mistake is supposing the nodes could be anything convenient with the weights adjusted to compensate. The weights are $n$ numbers and can impose $n$ conditions; the second half of the exactness came from the nodes and cannot be bought back.

6. Positive weights, and why they matter

  1. Three-point Gauss on $[-1, 1]$: weights $\tfrac59$, $\tfrac89$, $\tfrac59$, summing to $2$.

    All positive, sum correct.

  2. An error of $\varepsilon$ in each function value changes the answer by at most $2\varepsilon$.

    No amplification.

  3. The eight-point Newton-Cotes rule has weights of both signs summing in size to far more than the interval length.

    Unusable at high order.

7. Moving to another interval

  1. Two-point Gauss on $[0, 1]$: half-width $\tfrac12$, midpoint $\tfrac12$.

    The affine map.

  2. Nodes $\tfrac12 \pm \tfrac{1}{2\sqrt3}$, weights $\tfrac12$ and $\tfrac12$.

    Weights halved.

  3. Their sum is $1$, the length of $[0, 1]$.

    The check passes.

8. Your turn: the three-point Gauss rule on $[2, 6]$

  1. The half-width is $\tfrac{6 - 2}{2} = 2$ and the midpoint is $4$.

  2. Each tabulated node $t$ becomes $4 + 2t$, and each weight is doubled.

  3. Your turn: work this step out. Its working is at the end of the packet.

    The weights become $\tfrac{10}{9}$, $\tfrac{16}{9}$, $\tfrac{10}{9}$, summing to $4$ — the length of the interval, as required.

9. Guided practice

A Gauss rule is to be used on $[2, 16]$. What must its weights sum to?

Answer:

10. Guided practice

The two-point Gauss rule on $[-1, 1]$ is $f(-1/\sqrt3) + f(1/\sqrt3)$. Give what it returns for $x^{0}$, $x^{1}$, $x^{2}$ and $x^{4}$, as fractions where they are not whole.

IntegrandWhat the rule returns
The constant function$x^{0}$
The first power$x^{1}$
The square$x^{2}$
The fourth power$x^{4}$

11. Practice

Put the five steps that prove an $n$-point Gauss rule is exact through degree $2n - 1$ into order.

Number the steps in order (write the number in the box):

12. Practice

Match each property of an $n$-point Gauss rule to the reason it holds.

Division by $p_n$, with orthogonality killing the quotient termThe root theorem for orthogonal polynomialsApply the rule to the square of a Lagrange basis polynomialThe weight sizes sum to the interval length
Exact through degree $2n - 1$
Every node strictly inside the interval
Every weight positive
Rounding errors are not amplified

13. Somewhere new

A Gauss rule tabulated on $[-1, 1]$ is to be used on $[5, 11]$. Every weight is multiplied by the half-width, and each node $t$ becomes the midpoint plus the half-width times $t$. Give the half-width and the midpoint.

Half-width w and midpoint z.

14. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

15. Test question

An interpolatory rule with $2$ nodes is built, but the nodes are chosen to be equally spaced rather than the roots of $p_{2}$. What is lost?

16. What you can do now

You can prove the exactness of a Gauss rule and transform one to a new interval. Say in your own words why the nodes cannot be chosen for convenience and the weights adjusted to compensate.

Working for the steps left to you

8. Your turn: the three-point Gauss rule on $[2, 6]$, step 3