Skip to main content

Section 6.7 Gaussian Quadrature: revisited

As we saw before in Chapter 4, we wish to find an approximate value for
\begin{equation*} \begin{aligned}I\amp = \int_{a}^{b} f(x) \, dx\end{aligned} \end{equation*}
typically, we let
\begin{equation*} \begin{aligned}I \approx I_{n}\amp = \sum_{k=1}^{n} w_{i} f(x_{i})\end{aligned} \end{equation*}
where \(w_{i}\) are called the weights and \(x_{i}\) are the nodes. The technique of Gaussian Quadrature finds the weights and the nodes with highest degree of precision as possible, that is, it integrates polynomials of highest possible degree exactly.
In the previous few sections, we have seen the Legendre Polynomials, which are the set of polynomials that are orthogonal with respect to the weight \(w(x)\equiv 1\text{.}\) The next theorem shows that if the nodes are the roots of the Legendre polynomials, then the result is that sought for Gaussian Quadrature.

Proof.

First, we will consider polynomials \(P(x)\) of degree less than \(n\) and write it as
\begin{equation*} \begin{aligned}P(x)\amp = \sum_{k=1}^{n} P(x_{i}) \prod_{\stackrel{j=1}{j\neq k}}^{n} \frac{x-x_{j}}{x_{k}-x_{j}}\end{aligned} \end{equation*}
with \(x_{k}\) as the roots of \(L_{n}(x)\text{.}\) This is the Lagrange form of the polynomial and since they are unique...
Integrating on \([-1,1]\text{,}\)
\begin{equation*} \begin{aligned}\int_{-1}^{1} P(x) \, dx\amp = \int_{-1}^{1} \sum_{k=1}^{n} P(x_{k}) \prod{\stackrel{j=1}{j\neq k}}^{n} \frac{x-x_{j}}{x_{k}-x_{j}}\, dx \\\amp = \sum_{k=1}^{n} P(x_{k}) \int_{-1}^{1} \prod_{\stackrel{j=1}{j\neq k}}^{n} \frac{x-x_{j}}{x_{k}-x_{j}}\, dx \\\amp = \sum_{k=1}^{n} c_{k} P(x_{k})\end{aligned} \end{equation*}
If \(P(x)\) has degree at least \(n\) and at most \(2n-1\text{,}\) then we divide \(P(x)\) by \(L_{n}(x)\) to get
\begin{equation*} \begin{aligned}P(x)\amp = Q(x) L_{n}(x) + R(x)\end{aligned} \end{equation*}
where \(L_{n}(x)\) is the \(n\)th degree Legendre polynomial. Note that at the Legendre roots,
\begin{equation*} \begin{aligned}P(x_{k})\amp = Q(x_{k}) L_{n}(x_{k}) +R(x_{k}) = Q(x_{k}) \cdot 0 + R(x_{k}) = R(x_{k}).\end{aligned} \end{equation*}
Since the Legendre polynomials are orthogonal to polynomials of degree less than \(n\text{,}\) then
\begin{equation*} \begin{aligned}\int_{-1}^{1} Q(x) L_{n}(x) \, dx\amp = 0\end{aligned} \end{equation*}
Also, since \(R(x)\) is a polynomial of degree less than \(n\text{,}\) therefore part 1 of the proof leads to
\begin{equation*} \begin{aligned}\int_{-1}^{1} R(x) \, dx\amp = \sum_{k=1}^{n} c_{k} R(x_{k})\end{aligned} \end{equation*}
Using these parts,
\begin{equation*} \begin{aligned}\int_{-1}^{1} P(x) \, dx\amp = \int_{-1}^{1} \bigl( Q(x) L_{n}(x) + R(x) \bigr) \, dx = \int_{-1}^{1} R(x) \,dx = \sum_{k=1}^{n} c_{k} R(x_{k}) = \sum_{k=1}^{n} c_{k} P(x_{k})\end{aligned} \end{equation*}
The consequence of this theorem is that using the Legendre roots and the weights given (eq:gq:weights) that this is Gaussian Quadrature.
\(n=2\)
\(\displaystyle L_{2}(x) = \frac{3}{2}x^{2} - \frac{1}{2}\text{.}\) The roots are \(\pm \sqrt{1/3}\) and the weights are
\begin{equation*} \begin{aligned}c_{1}\amp = \int_{-1}^{1} \frac{x-\sqrt{1/3}}{-\sqrt{1/3}-\sqrt{1/3}}\,dx = 1 \\ c_{2}\amp = \int_{-1}^{1} \frac{x+\sqrt{1/3}}{\sqrt{1/3}+\sqrt{1/3}}\,dx = 1\end{aligned} \end{equation*}
resulting in the Gaussian Quadrature formula,
\begin{equation*} \begin{aligned}\int_{-1}^{1} f(x) \, dx\amp \approx f\biggl(-\sqrt{\frac{1}{3}}\biggr)+ f\biggl(\sqrt{\frac{1}{3}}\biggr)\end{aligned} \end{equation*}
\(n=3\)
\(\displaystyle L_{3}(x) = \frac{5}{2}x^{3} - \frac{3}{2}x\text{.}\) The roots are \(0, \pm \sqrt{3/5}\) and the weights are:
\begin{equation*} \begin{aligned}c_{1}\amp = \int_{-1}^{1} \frac{(x-0)(x-\sqrt{3/5})}{(-\sqrt{3/5}-0)(-\sqrt{3/5}-\sqrt{3/5})}\,dx = \frac{5}{9}\\ c_{2}\amp = \int_{-1}^{1} \frac{(x-\sqrt{3/5})(x+\sqrt{3/5})}{(0-\sqrt{3/5})(0+\sqrt{3/5})}\, dx = \frac{8}{9}\\ c_{3}\amp = c_{1} =\frac{5}{9}\end{aligned} \end{equation*}
\(n=4\)
\(\displaystyle L_{4}(x) = \frac{35}{8}x^{4} -\frac{15}{4}x^{2} + \frac{3}{8}\text{.}\) The roots are
\begin{equation*} \begin{aligned}\pm \sqrt{525 \pm 70 \sqrt{30}}/35 = \pm 0.8611363114, \pm 0.3399810437\end{aligned} \end{equation*}
And the weights are:
\begin{equation*} \begin{aligned}c_{1}\amp =\int_{-1}^{1} \frac{(x-x_{2})(x-x_{3})(x-x_{4})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})}\, dx =\frac{-\sqrt{30}+18}{36}\approx 0.3478548451\\ c_{2}\amp =\int_{-1}^{1} \frac{(x-x_{1})(x-x_{3})(x-x_{4})}{(x_{2}-x_{1})(x_{1}-x_{3})(x_{1}-x_{4})}\, dx =\frac{\sqrt{30}+18}{36}\approx 0.6521451549\\ c_{3}\amp = c_{2} \\ c_{4}\amp = c_{1}\end{aligned} \end{equation*}
\(n=5\)
\(\displaystyle L_{5}(x) = \frac{63}{8}x^{5} - \frac{35}{4}x^{3} + \frac{15}{8}x\text{.}\) The roots of this are:
\begin{equation*} \begin{aligned}0, \pm \frac{1}{3}\sqrt{5\pm \frac{2}{7} \sqrt{70}}\end{aligned} \end{equation*}
And the weights are:
\begin{equation*} \begin{aligned}c_{1}\amp =\int_{-1}^{1} \frac{(x-x_{2})(x-x_{3})(x-x_{4})(x-x_{5})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})(x_{1}-x_{5})}\, dx = \approx 0.23692688505618906\\ c_{2}\amp =\int_{-1}^{1} \frac{(x-x_{1})(x-x_{3})(x-x_{4})(x-x_{5})}{(x_{2}-x_{1})(x_{2}-x_{3})(x_{2}-x_{4})(x_{2}-x_{5})}\, dx = \approx 0.4786286704993666\\ c_{3}\amp = \int_{-1}^{1} \frac{(x-x_{1})(x-x_{2})(x-x_{4})(x-x_{5})}{(x_{3}-x_{1})(x_{3}-x_{2})(x_{3}-x_{4})(x_{3}-x_{5})}\, dx = \approx 0.5688888888888889\\ c_{4}\amp = c_{2} \\ c_{5}\amp = c_{1}\end{aligned} \end{equation*}
\(n=9\)
\begin{equation*} \begin{aligned}L_{9}(x)\amp ={\frac{12155}{128}}\,{x}^{9}-{\frac{6435}{32}}\,{x}^{7}+{\frac{9009 }{64}}\,{x}^{5}-{\frac{1155}{32}}\,{x}^{3}+{\frac{315}{128}}\,x\end{aligned} \end{equation*}
and the roots are \(\pm 0.9681602395, \pm 0.8360311073, \pm 0.6133714327, \pm 0.3242534234, 0.\) And the weights are:
\begin{equation*} \begin{aligned}c_{9} = c_{1}\amp = 0.08127438847,\amp c_{8} = c_{2}\amp = .1806481604, \\ c_{7} = c_{3}\amp = 0.2606106962,\amp c_{6} =c_{4}\amp = 0.3123470765, \\ c_{5}\amp = 0.3302393555\end{aligned} \end{equation*}
Use Gaussian Quadrature with 9 nodes to find
\begin{equation*} \begin{aligned}\int_{-1}^{1} e^{-x^2}\, dx\end{aligned} \end{equation*}
\begin{equation*} \begin{aligned}\sum_{k=1}^{9} c_{k} e^{-x_k^2}= 1.493648265645003840335173\end{aligned} \end{equation*}
which is accurate to within \(10^{-11}\text{.}\)