Skip to main content
Mathematics LibreTexts

7.05: Gauss Quadrature Rule of Integration

  • Page ID
    126424

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Lesson 1: Theory of Gauss Quadrature Rule

    Learning Objective

    After successful completion of this lesson, you should be able to:

    1) derive the Gauss quadrature method for integration.

    Introduction

    The two-point Gauss quadrature rule is an extension of the trapezoidal rule approximation where the arguments of the function are not predetermined. In single-segment trapezoidal rule for approximating the integral \[\displaystyle \int_{a}^{b} f(x) \ dx, \nonumber\]the end-points \(a\) and \(b\) are chosen as the quadrature points, but in the two-point Gaussian quadrature rule, two points \(x_{1}\) and \(x_{2}\) somewhere between the end-points \(a\) and \(b\) are chosen. How we find these quadrature points is a question, and so is why we wish to find these points. The answer to the “why” question is to gain more accuracy for the same order of computational time over the trapezoidal rule. The derivation and the example following will answer both these questions.

    Before we derive the two-point Gaussian quadrature rule, we derive the trapezoidal rule from the method of undetermined coefficients. Why? Because that is the method used to derive the two-point Gaussian quadrature rule as well.

    Trapezoidal Rule Derivation Using Method of Undetermined Coefficients

    Choose the integral \(\displaystyle \int_{a}^{b} f(x) \ dx\) approximated as follows.

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(a) + c_{2}f(b)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.1}) \nonumber\]

    The coefficients \(c_{1}\) and \(c_{2}\) are undetermined. We find these coefficients such that right-hand side is exact for integrals of first-order polynomial \(a_{0} + a_{1}x\).

    From exact integration

    \[\begin{split} \int_{a}^{b} \left( a_{0} + a_{1}x \right) \ dx &= \left\lbrack a_{0}x + a_{1}\frac{x^{2}}{2} \right\rbrack_{a}^{b}\\ &= a_{0}\left( b - a \right) + a_{1}\left( \frac{b^{2} - a^{2}}{2} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.2}) \end{split}\]

    But we want the right-hand side of Equation \((\PageIndex{1.1})\) to give the same result as Equation \((\PageIndex{1.2})\) for \(f(x) = a_{0} + a_{1}x\), which gives

    \[\begin{split} c_{1}f(a) + c_{2}f(b) &= c_{1}(a_{0} + a_{1}a) + c_{2}(a_{0} + a_{1}b)\\ &= a_{0} \left( c_{1} + c_{2} \right) + a_{1}\left( c_{1}a + c_{2}b \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3}) \end{split}\]

    Hence from Equations \((\PageIndex{1.2})\) and \((\PageIndex{1.3}\)),

    \[a_{0}\left( b - a \right) + a_{1}\left( \frac{b^{2} - a^{2}}{2} \right) = a_{0}\left( c_{1} + c_{2} \right) + a_{1}\left( c_{1}a + c_{2}b \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.4}) \nonumber\]

    Since \(a_{0}\) and \(a_{1}\) are arbitrary constants for the chosen general straight line, the coefficients of \(a_{0}\) and \(a_{1}\) need to be equal. That gives

    \[c_{1} + c_{2} = b - a\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.5a}) \nonumber\]

    \[c_{1}a + c_{2}b = \frac{b^{2} - a^{2}}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.5b}) \nonumber\]

    Multiplying Equation \((\PageIndex{1.5a})\) by \(a\) and subtracting the result from Equation \((\PageIndex{1.5b})\) gives

    \[c_{2} = \frac{b - a}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.6a}) \nonumber\]

    Substituting the value of \(c_{2}\) from Equation \((\PageIndex{1.6a})\) in Equation \((\PageIndex{1.5a})\) gives

    \[c_{1} = \frac{b - a}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.6b}) \nonumber\]

    Therefore

    \[\begin{split} \int_{a}^{b}f(x) \ dx &\approx c_{1}f(a) + c_{2}f(b)\\ &= \frac{b - a}{2}f(a) + \frac{b - a}{2}f(b)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.7}) \end{split}\]

    Audiovisual Lecture 

    Two-point Gaussian Quadrature Rule Using Method of Undetermined Coefficients

    In the two-point Gauss quadrature rule, an integral instead of Equation \((\PageIndex{1.1})\) is approximated as

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}) + c_{2}f(x_{2})\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.8}) \nonumber\]

    The quadrature points are the two additional unknowns. There are four unknowns in Equation \((\PageIndex{1.8})\) – the two quadrature points \(x_{1}\) and \(x_{2}\), and the two weights \(c_{1}\) and \(c_{2}\). Hence, these are found by assuming that the formula gives exact results for integrating a general third-order polynomial, \(f(x) = a_{0} + a_{1}x + a_{2}x^{2} + a_{3}x^{3}\).

    \[\begin{split} \int_{a}^{b} f(x) \ dx &= \int_{a}^{b} (a_0+a_1x+a_2x^2+a_3x^3) \ dx\\ &= \begin{bmatrix}\displaystyle a_0x+a_1\frac{x^2}{2}+a_2\frac{x^3}{3}+a_3\frac{x^4}{4} \end{bmatrix}_{a}^{b}\\ &= a_{0}\left( b - a \right) + a_{1}\left( \frac{b^{2} - a^{2}}{2} \right) + a_{2}\left( \frac{b^{3} - a^{3}}{3} \right) + a_{3}\left( \frac{b^{4} - a^{4}}{4} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.9})\end{split}\]

    But we want the right-hand side of Equation \((\PageIndex{1.8})\) to give the same result as Equation \((\PageIndex{1.9})\) for \(f(x) = a_{0} + a_{1}x + a_{2}x^{2} + a_{3}x^{3}\) which is

    \[c_{1}f(x_{1}) + c_{2}f(x_{2})= c_{1}\left( a_{0} + a_{1}x_{1} + a_{2}x_{1}^{2} + a_{3}x_{1}^{3} \right) + c_{2}\left( a_{0} + a_{1}x_{2} + a_{2}x_{2}^{2} + a_{3}x_{2}^{3} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.10}) \nonumber\]

    Equating Equations \((\PageIndex{1.9})\) and \((\PageIndex{1.10})\) gives

    \[\begin{split} &a_0(b-a)+a_1(\frac{b^2-a^2}{2})+a_2(\frac{b^3-a^3}{3})+a_3(\frac{b^4-a^4}{4}) \\ &= c_1(a_0+a_1x_1+a_2x_1^2+a_3x_1^3) + c_2(a_0+a_1x_2+a_2x_2^2+a_3x_2^3)\\ &= a_0(c_1+c_2)+a_1(c_1x_1+c_2x_2)+a_2(c_1x_1^2+c_2x_2^2)+a_3(c_1x_1^3+c_2x_2^3)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.11})\end{split}\]

    Since in Equation \((\PageIndex{1.11})\), the constants \(a_{0},\) \(a_{1},\) \(a_{2},\) and \(a_{3}\) are arbitrary, in the equation \(f(x) = a_{0} + a_{1}x + a_{2}x^{2} + a_{3}x^{3}\), the coefficients of \(a_{0},\) \(a_{1},\) \(a_{2},\) and \(a_{3}\) must be equal. This equating gives us four equations as follows.

    \[\begin{aligned} & b - a = c_{1} + c_{2} \\ & \frac{b^2 - a^2}{2} = c_{1}x_{1} + c_{2}x_{2} \\ & \frac{b^3 - a^3}{3} = c_{1}{x_{1}}^{2} + c_{2}{x_{2}}^{2} \\ & \frac{b^4 - a^4}{4} = c_{1} {x_{1}}^{3} + c_{2} {x_{2}}^{3} \quad\quad (\PageIndex{1.12}\text{a-d}) \end{aligned}\]

    Without proof, we can find that the above four simultaneous nonlinear equations have only one acceptable solution

    \[c_{1} = \frac{b - a}{2} \nonumber\]

    \[c_{2} = \frac{b - a}{2} \nonumber\]

    \[x_{1} = \left( \frac{b - a}{2} \right)\left( - \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2} \nonumber\]

    \[x_{2} = \left( \frac{b - a}{2} \right)\left( \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.13}) \nonumber\]

    Hence from Equations \((\PageIndex{1.1})\) and \((\PageIndex{1.13})\),

    \[\begin{split} \int_{a}^{b} f(x) \ dx &\approx c_{1}f\left( x_{1} \right) + c_{2}f\left( x_{2} \right)\\ &= \frac{b - a}{2}f\left( \frac{b - a}{2}\left( - \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2} \right)\\ \ \ \ &+ \frac{b - a}{2}f\left( \frac{b - a}{2}\left( \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.14}) \end{split}\]

    Audiovisual Lecture

    Title: Gaussian Quadrature Rule: Two Point Rule

    Summary: Learn how to derive the 2-pt Gauss quadrature rule using undetermined coefficients.

    Audiovisual Lecture

    Title: Multiple Gauss Quadrature: Rule Two Point Rule - Complete Derivation

    Summary: This video discusses how the two point Gauss quadrature rule is derived for approximating a definite integral.

    One-point Gaussian Quadrature Rule Using Method of Undetermined Coefficients

    Since we derived the two-point Gaussian quadrature rule without showing complete proof because of its length, we show the complete proof of the one-point Gauss quadrature rule. The derivation is based on approximating the integral by using the function value at a single point \(x_1\) and giving it some weight \(c_1\) and is given by

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f\left( x_{1} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.15}) \nonumber\]

    To derive the values of \(c_{1}\) and\(\ x_{1}\), we assume the formula in Equation \((\PageIndex{1.15})\) gives exact values for an integral of a linear polynomial of the form \(a_{0} + a_{1}x\).

    \[\begin{split} \int_{a}^{b} (a_{0} + a_{1}x) dx &= \left\lbrack a_{0}x + \frac{a_{1}x^{2}}{2} \right\rbrack\begin{matrix} b \\ \\ a \\ \end{matrix}\\ &= a_{0}(b\ - \ a) + a_{1}\left( \frac{b^{2} - a^{2}}{2} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.16}) \end{split}\]

    From the assumed formula

    \[\begin{split} c_{1}f(x_{1}) &= c_{1}{(a}_{0} + a_{1}x_{1})\\ &= c_{1}a_{0} + c_{1}{a_{1}x}_{1}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.17}) \end{split}\]

    Equating Equations \((\PageIndex{1.16})\) and \((\PageIndex{1.17})\) gives

    \[a_{0}(c_{1}) + a_{1}(c_{1}x_{1}) = a_{0}(b\ - \ a) + a_{1}\left( \frac{b^{2} - a^{2}}{2} \right) \nonumber\]

    Since \(a_{0}\) and \(a_{1}\) are arbitrary, we can equate the coefficients of \(a_{0}\) and \(a_{1}\), giving

    \[c_{1} = b - a\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.18}) \nonumber\]

    \[c_{1}x_{1} = \left( \frac{b^{2} - a^{2}}{2} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.19}) \nonumber\]

    Using Equation \((\PageIndex{1.18})\) in Equation \((\PageIndex{1.19})\) gives

    \[(b - a)x_{1} = \frac{b^{2} - a^{2}}{2} \nonumber\]

    \[x_{1} = \frac{b + a}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.20}) \nonumber\]

    Therefore, one-point Gauss quadrature rule can be expressed as

    \[\begin{split} \int_{a}^{b} f\left( x \right)dx &\approx c_{1}f\left( x_{1} \right)\\ &=(b-a)f(\frac{b+a}{2})\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.21}) \end{split}\]

    Audiovisual Lecture

    Title: Gaussian Quadrature Rule: One Point Rule

    Summary: Learn how to derive the 1-pt Gauss quadrature rule using undetermined coefficients, and use it in an example.

    Lesson 2: Applications of Gauss Quadrature Rule

    Learning Objectives

    After successful completion of this lesson, you should be able to:

    1) use the Gauss quadrature rule to approximate definite integrals.

    Recap

    In the previous lesson, you learned the theory of the Gauss quadrature rule. In this lesson, we apply the formulas of the rule to approximate definite integrals.

    Example \(\PageIndex{2.1}\)

    The following integral is given

    \[\int_{0.1}^{1.3} 5xe^{- 2x} \ dx \nonumber\]

    a) Use the two-point Gauss quadrature rule to estimate the value of the integral.

    b) Find the true error for part (a).

    c) Find the absolute relative true error for part (a).

    Solution

    a) The two-point Gauss quadrature rule is given by

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f\left( x_{1} \right) + c_{2}f\left( x_{2} \right) \nonumber\]

    where

    \[c_{1} = \frac{b - a}{2} \nonumber\]

    \[x_{1} = \frac{b - a}{2}\left( - \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2} \nonumber\]

    \[c_{2} = \frac{b - a}{2} \nonumber\]

    \[x_{2} = \frac{b - a}{2}\left( \frac{1}{\sqrt{3}} \right) + \frac{b + a}{2} \nonumber\]

    For this example

    \[f\displaystyle (x) = 5xe^{- 2x},\ a = 0.1,\ b = 1.3 \nonumber\]

    So

    \[c_{1} = \frac{1.3 - 0.1}{2} = 0.6 \nonumber\]

    \[x_{1} = \frac{1.3 - 0.1}{2}\left( - \frac{1}{\sqrt{3}} \right) + \frac{1.3 + 0.1}{2} = 0.35359 \nonumber\]

    \[c_{2} = \frac{1.3 - 0.1}{2} = 0.6 \nonumber\]

    \[x_{2} = \frac{1.3 - 0.1}{2}\left( \frac{1}{\sqrt{3}} \right) + \frac{1.3 + 0.1}{2} = 1.0461 \nonumber\]

    Then

    \[\begin{split} \int_{0.1}^{1.3} f(x) \ dx &\approx c_{1}f\left( x_{1} \right) + c_{2}f\left( x_{2} \right)\\ &= 0.6f(0.35359) + 0.6f(1.04641) \end{split}\]

    Finding the values of the function at the two quadrature points

    \[\begin{split} f(0.35359) &= 5(0.35359)e^{- 2(0.35359)}\\ &= 0.87166 \end{split}\]

    \[\begin{split} f(1.04641) &= 5(1.04641)e^{- 2(1.04641)}\\ &= 0.64531 \end{split}\]

    we get

    \[\begin{split} \int_{0.1}^{1.3}{f(x)dx} &\approx 0.6 \times 0.87166 + 0.6 \times 0.64531\\ &= 0.91018 \end{split}\]

    b) The exact value of the above integral can be found as

    \[\int_{0.1}^{1.3} 5xe^{- 2x} \ dx = 0.89386 \nonumber\]

    The true error

    \[\begin{split} E_{t} &= \text{True Value} - \text{Approximate Value}\\ &= 0.89386\ -\ 0.91018\\ &= - 0.01632 \end{split}\]

    c) The absolute relative true error \(\left| \varepsilon_{t} \right|\) is

    \[\begin{split} \left| \varepsilon_{t} \right| &= \left| \frac{\text{True Value} - \text{Approximate Value}}{\text{True Value}} \right| \times 100\\ &=\left|\frac{\mathrm{0.89386\ }-0.91018}{\mathrm{0.89386\ }}\right|\times100\\ &= 1.8258\% \end{split}\]

    Example \(\PageIndex{2.2}\)

    The following integral is given

    \[\int_{0.1}^{1.3} {5xe}^{- 2x} \ dx \nonumber\]

    a) Use the one-point Gaussian quadrature rule to estimate the value of the integral.

    b) Find the true error for part (a).

    c) Find the absolute relative true error, \(\left| \epsilon_{t} \right|\), for part (a).

    Solution

    a)

    \[\int_{a}^{b} f(x) \ dx \approx (b - a)f\left( \frac{a + b}{2} \right) \nonumber\]

    where

    \[a = 0.1 \nonumber\]

    \[b = 1.3 \nonumber\]

    \[\begin{split} \int_{0.1}^{1.3} f(x) \ dx &\approx (1.3 - 0.1)f\left( \frac{1.3 + 0.1}{2} \right)\\ &= \left( 1.2 \right)f\left( 0.7 \right)\\ &= \left( 1.2 \right)\left( {5\left( 0.7 \right)e}^{- 2\left( 0.7 \right)} \right)\\ &= 1.0357 \end{split}\]

    b) The true value is

    \[\begin{split} E_{t} &= \text {True value} - \text{Approximate value}\\ &= 0.89386 - 1.0357\\ &= - 0.14183 \end{split}\]

    c) The absolute relative true error, \(\left| \epsilon_{t} \right|\), would be

    \[\begin{split} \left| \epsilon_{t} \right| &= \left| \frac{\text{True error}}{\text{True value}} \right| \times 100\\ &= \left| \frac{- 0.14183}{0.89386} \right| \times 100 \\ &= 15.86\% \end{split}\]

    Example \(\PageIndex{2.3}\)

    Use two-point Gauss quadrature rule to approximate the distance covered by a rocket from \(t = 8\) to \(t = 30\) seconds as given by

    \[x = \int_{8}^{30} \left( 2000\ln\left\lbrack \frac{140000}{140000 - 2100t} \right\rbrack - 9.8t \right) \ dt \nonumber\]

    Also, find the absolute relative true error.

    Solution

    First, change the limits of integration from \(\left\lbrack 8,30 \right\rbrack\) to \(\left\lbrack - 1,1 \right\rbrack\) then

    \[\begin{split} \int_{8}^{30} f(t) \ dt &= \frac{30 - 8}{2}\int_{- 1}^{1} f\left( \frac{30 - 8}{2}x + \frac{30 + 8}{2} \right) \ dx\\ &= 11\int_{- 1}^{1} f\left( 11x + 19 \right) \ dx \end{split}\]

    The weighting factors and function argument values for the two point rule are,

    \[c_{1} = 1.000000000 \nonumber\]

    \[x_{1} = - 0.577350269 \nonumber\]

    \[c_{2} = 1.000000000 \nonumber\]

    \[x_{2} = 0.577350269 \nonumber\]

    Now we can use the Gauss quadrature formula

    \[\begin{split} 11\int_{- 1}^{1} f\left( 11x + 19 \right) \ dx &\approx 11\left\lbrack c_{1}f\left( 11x_{1} + 19 \right) + c_{2}f\left( 11x_{2} + 19 \right) \right\rbrack\\ &= 11\left\lbrack f\left( 11( - 0.5773503) + 19 \right) + f\left( 11(0.5773503) + 19 \right) \right\rbrack\\ &= 11\left\lbrack f(12.64915) + f(25.35085) \right\rbrack\\ &= 11\left\lbrack (296.8317) + (708.4811) \right\rbrack\\ &= 11058.44\ \text{m}\end{split}\]

    where

    \[\begin{split} f(12.64915) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(12.64915)} \right\rbrack - 9.8(12.64915)\\ &= 296.8317 \end{split}\]

    \[\begin{split} f(25.35085) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(25.35085)} \right\rbrack - 9.8(25.35085)\\ &= 708.4811 \end{split}\]

    The absolute relative true error, \(\left| \epsilon_{t} \right|\), is (True value = \(11061.34\ \text{m}\))

    \[\begin{split} \left| \epsilon_{t} \right| &= \left| \frac{11061.34 - 11058.44}{11061.34} \right| \times 100\\ &= 0.0262\% \end{split}\]

     

    Lesson 3: Higher-Point Gauss Quadrature Rule

    Learning Objectives

    After successful completion of this lesson, you should be able to:

    1) apply higher-point Gauss quadrature formulas to estimate integrals

    2) use a table of abscissas and weights to apply the Gauss quadrature rule.

    Introduction

    We have discussed one-point and two-point Gauss quadrature rules in a previous lesson. So, how do higher-point Gauss quadrature rules work? For example, the three-point Gauss quadrature rule is given by

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}) + c_{2}f(x_{2}) + c_{3}f(x_{3})\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.1}) \nonumber\]

    The coefficients (also called weighting factors) \(c_{1}\), \(c_{2}\), and \(c_{3}\), and the function arguments \(x_{1}\), \(x_{2}\) and \(x_{3}\) are calculated by assuming the formula gives exact expressions for integrating a fifth-order polynomial

    \[\int_{a}^{b} \left( a_{0} + a_{1}x + a_{2}x^{2} + a_{3}x^{3} + a_{4}x^{4} + a_{5}x^{5} \right) \ dx \nonumber\].

    General \(n\)-point rules would approximate an integral as

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}) + c_{2}f(x_{2}) + ....... + c_{n}f(x_{n})\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.2}) \nonumber\]

    Audiovisual Lecture

    Title: Gauss Quadrature Rule: n-Point Rule

    Summary: This video discusses the general n-point Gauss quadrature rule to estimate an integral.

    Arguments and weighing factors for n-point Gauss quadrature rules

    In handbooks (see Table \(\PageIndex{3.1.1})\), coefficients and arguments for \(n\)-point Gauss quadrature rule are given not for integrals of the form \(\displaystyle \int_{a}^{b} f(x) \ dx\) but for integrals of the form \(\displaystyle \int_{- 1}^{1} g(x) \ dx\), that is,

    \[\int_{- 1}^{1} g(x) \ dx \approx \sum_{i = 1}^{n} c_{i}g(x_{i}) \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.3}) \nonumber\]

    Table \(\PageIndex{3.1}\). Weighting factors \(c\) and function arguments \(x\) used in Gauss quadrature formulas.
    Points Weighting Factors Function Arguments
    \(1\) \(c_{1} = 2.000000000\) \(x_{1} = 0.000000000\)
    \(2\)

    \(c_{1} = 1.000000000\)

    \(c_{2} = 1.000000000\)

    \(x_{1} = - 0.577350269\)

    \(x_{2} = 0.577350269\)

    \(3\)

    \(c_{1} = 0.555555556\)

    \(c_{2} = 0.888888889\)

    \(c_{3} = 0.555555556\)

    \(x_{1} = - 0.774596669\)

    \(x_{2} = 0.000000000\)

    \(x_{3} = 0.774596669\)

    \(4\)

    \(c_{1} = 0.347854845\)

    \(c_{2} = 0.652145155\)

    \(c_{3} = 0.652145155\)

    \(c_{4} = 0.347854845\)

    \(x_{1} = - 0.861136312\)

    \(x_{2} = - 0.339981044\)

    \(x_{3} = 0.339981044\)

    \(x_{4} = 0.861136312\)

    \(5\)

    \(c_{1} = 0.236926885\)

    \(c_{2} = 0.478628670\)

    \(c_{3} = 0.568888889\)

    \(c_{4} = 0.478628670\)

    \(c_{5} = 0.236926885\)

    \(x_{1} = - 0.906179846\)

    \(x_{2} = - 0.538469310\)

    \(x_{3} = 0.000000000\)

    \(x_{4} = 0.538469310\)

    \(x_{5} = 0.906179846\)

    \(6\)

    \(c_{1} = 0.171324492\)

    \(c_{2} = 0.360761573\)

    \(c_{3} = 0.467913935\)

    \(c_{4} = 0.467913935\)

    \(c_{5} = 0.360761573\)

    \(c_{6} = 0.171324492\)

    \(x_{1} = - 0.932469514\)

    \(x_{2} = - 0.661209386\)

    \(x_{3} = - 0.238619186\)

    \(x_{4} = 0.238619186\)

    \(x_{5} = 0.661209386\)

    \(x_{6} = 0.932469514\)

    So if the table is given for integrals with [-1,1] integration limits, how does one solve for integrals with [a,b] integration limits.

    The answer lies in that any integral with limits of \(\left\lbrack a,b \right\rbrack\) can be converted into an integral with limits \(\left\lbrack - 1,1 \right\rbrack\). Let

    \[x = mt + c\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.4}) \nonumber\]

    If \(x = a,\) then \(t = - 1\)

    If \(x = b,\) then \(t = + 1\)

    such that

    \[\begin{split} &a = m( - 1) + c\\ &b = m(1) + c\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.5a,b}) \end{split}\]

    Solving the two Equations \((\PageIndex{3.5a})\) and \((\PageIndex{3.5b})\) simultaneously gives

    \[\begin{split} &m = \frac{b - a}{2}\\ &c = \frac{b + a}{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.6a,b}) \end{split}\]

    Hence from Equations \((\PageIndex{3.4})\), \((\PageIndex{3.6a})\), \((\PageIndex{3.6b})\),

    \[\begin{split} &x = \frac{b - a}{2}t + \frac{b + a}{2}\\ &dx = \frac{b - a}{2}{dt} \end{split}\]

    Substituting values of \(x\) and \(dx\) into the integral gives us

    \[\begin{split} \int_{a}^{b} f(x) \ dx &= \int_{- 1}^{1} f\left( \frac{b - a}{2}t + \frac{b + a}{2} \right)\frac{b - a}{2} \ dt\\ & =\int_{-1}^{1} f\left(\frac{b-a}{2}x + \frac{b+a}{2} \right)\frac{b-a}{2} \ dx\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.7})\end{split}\]

    Hence, any integral of the form \(\displaystyle \int_{a}^{b} f(x) \ dx\) can be converted to an \(\displaystyle \int_{- 1}^{1} g(x) \ dx\), and Table \(\PageIndex{3.1}\) can be used to estimate integrals.

    Audiovisual Lecture

    Title: Gauss Quadrature Rule: Converting Limits of Integration

    Summary: This video discusses To apply the argument and weight data given in handbooks for Gauss quadrature rule to estimate a definite integral, one needs to convert the integral to an integral with limits of integration as -1 to +1.

    Example \(\PageIndex{3.1}\)

    Use two-point Gauss quadrature rule to approximate the distance in meters covered by a rocket from \(t = 8\ \text{s}\) to \(t = 30\ \text{s}\) as given by

    \[x = \int_{8}^{30} \left( 2000\ln\left\lbrack \frac{140000}{140000 - 2100t} \right\rbrack - 9.8t \right) \ dt \nonumber\]

    Change the limits so that one can use the weights and abscissas given in Table \(\PageIndex{3.1}\). Also, find the absolute relative true error. The true value is given as \(11061.34\ \text{m}\)

    Solution

    First, change the limits of integration from \(\left\lbrack 8,30 \right\rbrack\) to \(\left\lbrack - 1,1 \right\rbrack\) using Equation \((\PageIndex{3.7})\) gives

    \[\begin{split} \int_{8}^{30} f(t) \ dt &= \frac{30 - 8}{2}\int_{- 1}^{1} f\left( \frac{30 - 8}{2}x + \frac{30 + 8}{2} \right) \ dx \\ &= 11\int_{- 1}^{1} f\left( 11x + 19 \right) \ dx \end{split}\]

    Next, get weighting factors and function argument values from Table \(\PageIndex{3.1}\) for the two-point rule,

    \[\begin{split} c_{1} &= 1.000000000\\ x_{1} &= - 0.577350269\\ c_{2} &= 1.000000000\\ x_{2} &= 0.577350269 \end{split}\]

    Now we can use the Gauss quadrature formula

    \[\begin{split} 11\int_{- 1}^{1} f\left( 11x + 19 \right) \ dx &\approx 11\left\lbrack c_{1}f\left( 11x_{1} + 19 \right) + c_{2}f\left( 11x_{2} + 19 \right) \right\rbrack\\ &= 11\left\lbrack f\left( 11( - 0.5773503) + 19 \right) + f\left( 11(0.5773503) + 19 \right) \right\rbrack\\ &= 11\left\lbrack f(12.64915) + f(25.35085) \right\rbrack\\ &= 11\left\lbrack (296.8317) + (708.4811) \right\rbrack\\ &= 11058.44\ \text{m} \end{split}\]

    since

    \[\begin{split} f(12.64915) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(12.64915)} \right\rbrack - 9.8(12.64915)\\ &= 296.8317\\ f(25.35085) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(25.35085)} \right\rbrack - 9.8(25.35085)\\ &= 708.4811 \end{split}\]

    The absolute relative true error, \(\left| \epsilon_{t} \right|\), is \((\text{True value} = 11061.34 \ \text{m})\):

    \[\begin{split} \left| \epsilon_{t} \right| &= \left| \frac{11061.34 - 11058.44}{11061.34} \right| \times 100\\ &= 0.0262\% \end{split}\]

    Example \(\PageIndex{3.2}\)

    Use three-point Gauss quadrature rule to approximate the distance in meters covered by a rocket from \(t = 8\) to \(t = 30\) as given by

    \[x = \int_{8}^{30} \left( 2000\ln\left\lbrack \frac{140000}{140000 - 2100t} \right\rbrack - 9.8t \right) \ dt \nonumber\]

    Change the limits so that one can use the weights and abscissas given in Table 1. Also, find the absolute relative true error. The true value is given as \(11061.34\ \text{m}\)

    Solution

    First, change the limits of integration from \(\left\lbrack 8,30 \right\rbrack\) to \(\left\lbrack - 1,1 \right\rbrack\) using Equation \((\PageIndex{3.7})\) gives

    \[\begin{split} \int_{8}^{30} f(t) \ dt &= \frac{30 - 8}{2}\int_{- 1}^{1} f\left( \frac{30 - 8}{2}x + \frac{30 + 8}{2} \right) \ dx\\ &= 11\int_{- 1}^{1}f\left( 11x + 19 \right) \ dx \end{split}\]

    The weighting factors and function argument values are

    \[\begin{split} c_{1} &= 0.555555556\\ x_{1} &= - 0.774596669\\ c_{2} &= 0.888888889\\ x_{2} &= 0.000000000\\ c_{3} &= 0.555555556\\ x_{3} &= 0.774596669 \end{split}\]

    and the formula is

    \[\begin{split} 11\int_{- 1}^{1} f\left( 11x + 19 \right) \ dx &\approx 11\left\lbrack c_{1}f\left( 11x_{1} + 19 \right) + c_{2}f\left( 11x_{2} + 19 \right) + c_{3}f\left( 11x_{3} + 19 \right) \right\rbrack\\ &= 11\begin{bmatrix} \& 0.5555556f\left( 11( - .7745967) + 19 \right) + 0.8888889f\left( 11(0.0000000) + 19 \right) \\ + 0.5555556f\left( 11(0.7745967) + 19 \right) \\ \end{bmatrix}\\ &= 11\left\lbrack 0.55556f(10.47944) + 0.88889f(19.00000) + 0.55556f(27.52056) \right\rbrack\\ &= 11\left\lbrack 0.55556 \times 239.3327 + 0.88889 \times 484.7455 + 0.55556 \times 795.1069 \right\rbrack\\ &= 11061.31\ \text{m} \end{split}\]

    since

    \[\begin{split} f(10.47944) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(10.47944)} \right\rbrack - 9.8(10.47944)\\ &= 239.3327\\ f(19.00000) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(19.00000)} \right\rbrack - 9.8(19.00000)\\ &= 484.7455\\ f(27.52056) &= 2000\ln\left\lbrack \frac{140000}{140000 - 2100(27.52056)} \right\rbrack - 9.8(27.52056)\\ &= 795.1069 \end{split}\]

    The absolute relative true error, \(\left| \epsilon_{t} \right|\), is \((\text{True value} = 11061.34 \ \text{m})\):

    \[\begin{split} \left| \epsilon_{t} \right| &= \left| \frac{11061.34 - 11061.31}{11061.34} \right| \times 100\\ &= 0.0003\% \end{split}\]

     

    So does Gaussian quadrature require that the integral must be transformed to the integral limit of [-1,1]?

    No, the limits do not need to be transformed. Gaussian quadrature rule can be written for any limits of integration.

    It is just the weights and abscissas are given for the limits of integration of \([-1,1]\). So if the \(n\)-point Gaussian quadrature rule for \([-1,1]\) limits is given as

    \[\int_{- 1}^{1} g(x) \ dx \approx \sum_{i = 1}^{n} c_{i}g(x_{i}) \nonumber\]

    and we also know that

    \[\int_{a}^{b} f\left( x \right) \ dx = \frac{b - a}{2}\int_{- 1}^{1} f\left( \frac{b - a}{2}x + \frac{b + a}{2} \right) \ dx \nonumber\]

    then the n-point Gaussian quadrature rule for \([a,b]\) limits of integration can also be found.

    \[\begin{split} \int_{a}^{b}{f\left( x \right)dx} &= \frac{b - a}{2}\int_{- 1}^{1} f\left( \frac{b - a}{2}x + \frac{b + a}{2} \right) \ dx \\ &\approx \frac{b - a}{2}\sum_{i = 1}^{n} c_{i}f\left( \frac{b - a}{2}x_{i} + \frac{b + a}{2} \right) \\ &= \sum_{i = 1}^{n} C_{i}f(X_{i}) \end{split}\]

    where

    \[\begin{split} &C_{i} = \frac{b - a}{2}c_{i}\\ &X_{i} = \frac{b - a}{2}x_{i} + \frac{b + a}{2} \end{split}\]

    Audiovisual Lecture

    Title: Gauss Quadrature Rule: Example

    Summary: After watching this video, via an example, you will be able to use the Gaussian quadrature formula to approximate an integral.

    Appendix

    Example \(\PageIndex{3.A.1}\)

    For an integral \(\int_{- 1}^{1} f(x) \ dx\), derive the two-point Gauss quadrature rule

    \[\int_{- 1}^{1} f(x) \ dx \approx c_{1}f(x_{1}) + c_{2}f(x_{2}) \nonumber\]

    Solution

    Assuming the formula

    \[\int_{- 1}^{1} f(x) \ dx = c_{1}f\left( x_{1} \right) + c_{2}f\left( x_{2} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.1}) \nonumber\]

    gives exact values for integrals \(\displaystyle \int_{- 1}^{1}1 \ dx\), \(\displaystyle \int_{- 1}^{1}x \ dx\), \(\displaystyle \int_{- 1}^{1}x^{2} \ dx\), and \(\displaystyle \int_{- 1}^{1}x^{3} \ dx\) . Then

    \[\begin{split} &\int_{- 1}^{1} 1 \ dx = 2 = c_{1} + c_{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.2})\\ &\int_{- 1}^{1} x \ dx = 0 = c_{1}x_{1} + c_{2}x_{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.3})\\ &\int_{- 1}^{1} x^{2} \ dx = \frac{2}{3} = c_{1}{x_{1}}^{2} + c_{2}{x_{2}}^{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.4})\\ &\int_{- 1}^{1} x^{3} \ dx = 0 = c_{1}{x_{1}}^{3} + c_{2}{x_{2}}^{3}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.5}) \end{split}\]

    Multiplying Equation \((\PageIndex{3.A1.3})\) by \({x_{1}}^{2}\) and subtracting from Equation \((\PageIndex{3.A1.5})\) gives

    \[c_{2}x_{2}\left( {x_{1}}^{2} - {x_{2}}^{2} \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.6}) \nonumber\]

    The solution to the above equation is

    \[\begin{split} c_{2} &= 0 \text{, or/and}\\ x_{2} &= 0\text{, or/and}\\ x_{1} &= x_{2}\text{, or/and}\\ x_{1} &= - x_{2}. \end{split}\]

    I. \(c_{2} = 0\) is not acceptable as Equations \((\PageIndex{3.A1.2} \text{-} 3.A1.5)\) reduce to \(c_{1} = 2,\) \(c_{1}x_{1} = 0,\) \(\displaystyle c_{1}x_{1}^{2} = \frac{2}{3},\) and \(c_{1}x_{1}^{3} = 0\). But since \(c_{1} = 2\), then \(x_{1} = 0\) from \(c_{1}x_{1} = 0\), but \(x_{1} = 0\) conflicts with \(\displaystyle c_{1}x_{1}^{2} = \frac{2}{3}\).

    II. \(x_{2} = 0\) is not acceptable as Equations \((\PageIndex{3.A1.2} \text{-} 3.A1.5)\) reduce to \(c_{1} + c_{2} = 2\), \(c_{1}x_{1} = 0,\) \(\displaystyle c_{1}x_{1}^{2} = \frac{2}{3},\) and \(c_{1}x_{1}^{3} = 0\). Since \(c_{1}x_{1} = 0\), then \(c_{1}\) or \(x_{1}\) has to be zero, but this violates \(\displaystyle c_{1}x_{1}^{2} = \frac{2}{3} \neq 0\).

    III. \(x_{1} = x_{2}\) is not acceptable as Equations \((\PageIndex{3.A1.2} \text{-} 3.A1.5)\) reduce to \(c_{1} + c_{2} = 2\), \(c_{1}x_{1} + c_{2}x_{1} = 0,\) \(\displaystyle c_{1}x_{1}^{2} + c_{2}{x_{1}}^{2} = \frac{2}{3},\) and \(c_{1}x_{1}^{3} + c_{2}x_{1}^{3} = 0\). If \(x_{1} \neq 0\), then \(c_{1}x_{1} + c_{2}x_{1} = 0\) gives \(c_{1} + c_{2} = 0\), and that violates \(c_{1} + c_{2} = 2\). If \(x_{1} = 0\), then that violates \(\displaystyle c_{1}x_{1}^{2} + c_{2}{x_{1}}^{2} = \frac{2}{3} \neq 0\).

    That leaves the solution of \(x_{1} = - x_{2}\) as the only possible acceptable solution, and in fact, it does not have violations (see it for yourself)

    \[x_{1} = - x_{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.7}) \nonumber\]

    Substituting \((\PageIndex{3.A1.7})\) in Equation \((\PageIndex{3.A1.3})\) gives

    \[c_{1} = c_{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.8}) \nonumber\]

    From Equations \((\PageIndex{3.A1.2})\) and \((\PageIndex{3.A1.8})\),

    \[c_{1} = c_{2} = 1\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.9}) \nonumber\]

    Equations \((\PageIndex{3.A1.4})\) and \((\PageIndex{3.A1.9})\) gives

    \[{x_{1}}^{2} + {x_{2}}^{2} = \frac{2}{3}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.10}) \nonumber\]

    Since Equation \((\PageIndex{3.A1.7})\) requires that the two results be of opposite sign, we get

    \[\begin{split} &x_{1} = -\frac{1}{\sqrt{3}}\\ &x_{2} = \frac{1}{\sqrt{3}} \end{split}\]

    or

    \[\begin{split} &x_{1} = \frac{1}{\sqrt{3}}\\ &x_{2} = -\frac{1}{\sqrt{3}} \end{split}\]

    Both these solutions though lead to a unique solution as

    \[ \begin{split} \int_{- 1}^{1}f(x) \ dx &= c_{1}f(x_{1}) + c_{2}f(x_{2})\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A1.11})\\ &= 1f\left( - \frac{1}{\sqrt{3}} \right) + 1f\left( \frac{1}{\sqrt{3}} \right)\\ &= f\left( - \frac{1}{\sqrt{3}} \right) + f\left( \frac{1}{\sqrt{3}} \right) \end{split}\]

    Example \(\PageIndex{3.A.2}\)

    What would be the formula for

    \[\int_{a}^{b} f(x) \ dx =c_{1} f(a)+c_{2} f(b) \nonumber\]

    if you want the above formula to give you exact values of integral \(\displaystyle \int_{a}^{b} \left( a_{0}x + b_{0}x^{2} \right) \ dx,\) that is, a linear combination of \(x\) and \(x^{2}\)?

    Solution

    If the formula is exact for a linear combination of \(x\) and \(x^{2}\), then

    \[\begin{split} &\int_{a}^{b} x \ dx=\frac{b^{2}-a^{2}}{2}=c_{1} a+c_{2} b\\ &\int_{a}^{b} x^{2} \ dx = \frac{b^{3} - a^{3}}{3} = c_{1}a^{2} + c_{2}b^{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A2.1}) \end{split}\]

    Solving the two Equations \((\PageIndex{3.A2.1})\) simultaneously gives

    \[\left[\begin{array}{cc} a & b \\ a^{2} & b^{2} \end{array}\right]\left[\begin{array}{l} \mathrm{c}_{1} \\ \mathrm{c}_{2} \end{array}\right]=\left[\begin{array}{l} \frac{b^{2}-a^{2}}{2} \\ \frac{b^{3}-a^{3}}{3} \end{array}\right] \nonumber\]

    \[\begin{split} c_{1} &=-\frac{1}{6} \frac{-a b-b^{2}+2 a^{2}}{a}\\ c_{2} &= - \frac{1}{6}\frac{a^{2} + {ab} - 2b^{2}}{b}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A2.2}) \end{split}\]

    So

    \[\int_{a}^{b} f(x) \ dx = - \frac{1}{6}\frac{- {ab} - b^{2} + 2a^{2}}{a}f(a) - \frac{1}{6}\frac{a^{2} + {ab} - 2b^{2}}{b} f(b) \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{3.A2.3}) \nonumber\]

    Let us see if the formula works.

    Evaluate \(\displaystyle \int_{2}^{5} \left( 2x^{2} - 3x \right) dx\) using Equation \((\PageIndex{3.A2.3})\)

    \[\begin{split} \int_{2}^{5}{\left( 2x^{2} - 3x \right){dx}} &\approx c_{1}f(a) + c_{2}f(b)\\ &= - \frac{1}{6}\frac{- (2)(5) - 5^{2} + 2(2)^{2}}{2}\left\lbrack 2(2)^{2} - 3(2) \right\rbrack - \frac{1}{6}\frac{2^{2} + 2(5) - 2(5)^{2}}{5}\lbrack 2(5)^{2} - 3(5)\rbrack\\ &= 46.5 \end{split}\]

    The exact value of \(\displaystyle \int_{2}^{5} \left( 2x^{2} - 3x \right) dx\) is given by

    \[\begin{split} \int_{2}^{5}\left( 2x^{2} - 3x \right) dx &= \left\lbrack \frac{2x^{3}}{3} - \frac{3x^{2}}{2} \right\rbrack_{2}^{5}\\ &= 46.5 \end{split}\]

    Any surprises?

    Now evaluate \(\displaystyle \int_{2}^{5} 3 \ dx\) using Equation \((\PageIndex{3.A2.3})\)

    \[\begin{split} \int_{2}^{5} 3 \ dx &\approx c_{1}f(a) + c_{2}f(b)\\ &= - \frac{1}{6}\frac{- 2(5) - 5^{2} + 2(2)^{2}}{2}(3) - \frac{1}{6}\frac{2^{2} + 2(5) - 2(5)^{2}}{5}(3)\\ &= 10.35 \end{split}\]

    The exact value of \(\displaystyle \int_{2}^{5} 3 \ dx\) is given by

    \[\begin{split} \int_{2}^{5} 3 \ dx &= \left\lbrack 3x \right\rbrack_{2}^{5}\\ &= 9 \end{split}\]

    Because the formula will only give exact values for linear combinations of \(x\) and \(x^{2}\), it does not work exactly even for a simple integral of \(\displaystyle \int_{2}^{5} 3 \ dx\).

    Do you see now why we chose \(a_{0} + a_{1}x\) as the integrand for which the formula

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(a) + c_{2}f(b) \nonumber\]

    gives us exact values?

     

    Multiple Choice Test

    (1). \(\displaystyle \int_{5}^{10} f(x) \ dx\) is exactly

    (A) \(\displaystyle \int_{- 1}^{1} f(2.5x + 7.5) \ dx\)

    (B) \(\displaystyle 2.5\int_{- 1}^{1} f(2.5x + 7.5) \ dx\)

    (C) \(\displaystyle 5\int_{- 1}^{1} f(5x + 5) \ dx\)

    (D) \(\displaystyle 5\int_{- 1}^{1} (2.5x + 7.5)f(x) \ dx\)

    (2). For a definite integral of any third order polynomial, the two-point Gauss quadrature rule will give the same results as the

    (A) \(1\)-segment trapezoidal rule

    (B) \(2\)-segment trapezoidal rule

    (C) \(3\)-segment trapezoidal rule

    (D) Simpson’s \(1/3\) rule

    (3). The estimated value of \(\displaystyle \int_{0.2}^{2.2}{xe^{x}{dx}}\) by using the two-point Gauss quadrature rule is most nearly

    (A) \(11.672\)

    (B) \(11.807\)

    (C) \(12.811\)

    (D) \(14.633\)

    (4). A scientist uses the one-point Gauss quadrature rule based on getting exact results of integration for functions \(f(x) = 1\) and \(x\). The one-point Gauss quadrature rule approximation for \(\displaystyle \int_{a}^{b} f(x) \ dx\) is

    (A) \(\displaystyle \frac{b - a}{2}\left\lbrack f(a) + f(b) \right\rbrack\)

    (B) \(\displaystyle (b - a)f\left( \frac{a + b}{2} \right)\)

    (C) \(\displaystyle \frac{b - a}{2}\left\lbrack f\left( \frac{b - a}{2}\left\{ - \frac{1}{\sqrt{3}} \right\} + \frac{b + a}{2} \right) + f\left( \frac{b - a}{2}\left\{ \frac{1}{\sqrt{3}} \right\} + \frac{b + a}{2} \right) \right\rbrack\)

    (D) \((b - a)f(a)\)

    (5). A scientist develops an approximate formula for integration as

    \[\displaystyle \int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}),\ \text{where}\ a \leq x_{1} \leq b \nonumber\]

    The values of \(c_{1}\) and \(x_{1}\) are found by assuming that the formula is exact for functions of the form \(a_{0}x + a_{1}x^{2}\). The resulting formula would therefore be exact for integrating

    (A) \(f(x) = 2\)

    (B) \(f(x) = 2 + 3x + 5x^{2}\)

    (C) \(f(x) = 5x^{2}\)

    (D) \(f(x) = 2 + 3x\)

    (6). You are asked to estimate the water flow rate in a pipe of radius \(2 \ \text{m}\) at a remote area location with a harsh environment. You already know that velocity varies along the radial location, but you do not know how it varies. The flow rate \(Q\) is given by

    \[\displaystyle Q = \int_{0}^{2} 2\pi rV \ dr \nonumber\]

    To save money, you are allowed to put only two velocity probes (these probes send the data to the central office in New York, NY via satellite) in the pipe. Radial location \(r\) is measured from the center of the pipe, that is, \(r = 0\). Radial location \(r = 2 \ \text{m}\) is at the pipe radius. The radial locations you would suggest for the two velocity probes for the most accurate calculation of the flow rate are

    (A) \(0\ \text{m}, 2\ \text{m}\)

    (B) \(1\ \text{m}, 2\ \text{m}\)

    (C) \(0\ \text{m}, 1\ \text{m}\)

    (D) \(0.42\ \text{m}, 1.58\ \text{m}\)

    For the complete solution, go to

    http://nm.mathforcollege.com/mcquizzes/07int/quiz_07int_gaussquadrature_solution.pdf

    Problem Set

    (1). Find the value of the integral \(\displaystyle \int_{1}^{5} 7e^{- 2t} \ dt\) using

    a) 2-point Gaussian quadrature rule,

    b) 3-point Gaussian quadrature rule.

    Answer

    \(a)\ 0.35285\)
    \(b)\ 0.45812\)

    (2). The upward velocity of a rocket is given by

    \[v(t) = 200\ln(t + 1) - 10t,\ t > 0 \nonumber\]

    where \(t\) is given in seconds and \(v\) is given in \(\text{m}/\text{s}\).

    a) Use 2-point Gauss quadrature rule to calculate the distance covered by the rocket from \(t = 0\ \text{s}\) to \(t = 5\ \text{s}\).

    b) What is the true value of the distance covered by the rocket from \(t = 0\ \text{s}\) to \(t = 5\ \text{s}\)?

    c) What is the true error in part (a)?

    d) What is the relative true error in part (a)?

    e) What is the absolute relative true error in percentage for part (a)?

    f) Use 3-point Gauss quadrature rule to calculate the distance covered by the rocket from \(t = 0\ \text{s}\) to \(t = 5\ \text{s}\).

    Answer

    \(a)\ 1034.6\ \text{m}\)
    \(b)\ 1025.1\ \text{m}\)
    \(c)\ -9.4458\ \text{m}\)
    \(d)\ -0.0092144\)
    \(e)\ 0.92144\%\)
    \(f)\ 1026.2\ \text{m}\)

    (3). The velocity of a body is given by

    \[v(t) = t + 1,\ 0 < t < 2, \nonumber\] \[ = 33,\ 2 < t < 5 \nonumber\]

    where the velocity, \(v(t)\) is given in \(\text{m}/\text{s}\) and \(t\) is in seconds.

    a) Find the distance covered by the body between \(1 < t < 1.9\ \text{s}\) by using the two-point Gauss quadrature rule. Find the absolute relative true error.

    b) Find the distance covered by the body between \(1 < t < 3.9\ \text{s}\) by using the four-point Gauss quadrature rule. Find the absolute relative true error.

    Answer

    \(a)\ 2.2049,\ 0\%\)
    \(b)\ 51.75,\ 20.62\% (\text{exact}=65.2)\)

    (4). The one-point Gauss quadrature rule is defined as

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}),\ a \leq x_{1} \leq b \nonumber\]

    The values of \(c_{1}\) and \(x_{1}\) are found by assuming that the one-point formula is exact for any first order polynomial. Find \(c_{1}\) and \(x_{1}\) in the above one-point Gauss quadrature rule.

    Answer

    \(c_1 = b-a,\ x_1 = \displaystyle \frac{b+a}{2}\)

    (5). A scientist develops an approximate formula for integration as

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(x_{1}),\ \text{where}\ a \leq x_{1} \leq b \nonumber\]

    The values of \(c_{1}\) and \(x_{1}\) are found by assuming that the formula is exact for the functions of the form \(a_{0}x + a_{1}x^{2}\) polynomial. Find \(c_{1}\) and \(x_{1}\).

    Answer

    \(x_1 = \displaystyle \frac{2(b^2+a^2+ab)}{3(b+a)}\)

    \(c_1 = \displaystyle \frac{3(b-a)(b+a)^2}{4(b^2+a^2+ab)}\)

    (6). A scientist develops an approximate formula for integration as

    \[\int_{a}^{b} f(x) \ dx \approx c_{1}f(a) + c_{2}f(b). \nonumber\]

    The values of \(c_{1}\) and \(c_{2}\) are found by assuming that the formula is exact for the functions of the form \(a_{0}x + a_{1}x^{2}\) polynomial.

    a) Find the values of \(c_{1}\) and \(c_{2}\).

    b) Verify the formula works exactly for the integral \[\int_{2}^{7} (3x^{2} + 5x) \ dx \nonumber\]

    c) Verify the formula does not work exactly for the integral of \[\int_{2}^{7} 2 \ dx \nonumber\]

    Answer

    \(a)\ \displaystyle c_1 = -\frac{1}{6}\frac{-ab-b^2+2a^2}{a},\ c_2 = -\frac{1}{6}\frac{a^2+ab-2b^2}{b}\)

    b) \(447.50\) by formula as well as exact method

    c) \(12.976\) by formula; \(10\) by exact method


    This page titled 7.05: Gauss Quadrature Rule of Integration is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Autar Kaw via source content that was edited to the style and standards of the LibreTexts platform.