7.05: Gauss Quadrature Rule of Integration
( \newcommand{\kernel}{\mathrm{null}\,}\)
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 ∫baf(x) dx,the end-points a and b are chosen as the quadrature points, but in the two-point Gaussian quadrature rule, two points x1 and x2 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 ∫baf(x) dx approximated as follows.
∫baf(x) dx≈c1f(a)+c2f(b)(7.5.1.1)
The coefficients c1 and c2 are undetermined. We find these coefficients such that right-hand side is exact for integrals of first-order polynomial a0+a1x.
From exact integration
∫ba(a0+a1x) dx=[a0x+a1x22]ba=a0(b−a)+a1(b2−a22)(7.5.1.2)
But we want the right-hand side of Equation (7.5.1.1) to give the same result as Equation (7.5.1.2) for f(x)=a0+a1x, which gives
c1f(a)+c2f(b)=c1(a0+a1a)+c2(a0+a1b)=a0(c1+c2)+a1(c1a+c2b)(7.5.1.3)
Hence from Equations (7.5.1.2) and (7.5.1.3),
a0(b−a)+a1(b2−a22)=a0(c1+c2)+a1(c1a+c2b)(7.5.1.4)
Since a0 and a1 are arbitrary constants for the chosen general straight line, the coefficients of a0 and a1 need to be equal. That gives
c1+c2=b−a(7.5.1.5a)
c1a+c2b=b2−a22(7.5.1.5b)
Multiplying Equation (7.5.1.5a) by a and subtracting the result from Equation (7.5.1.5b) gives
c2=b−a2(7.5.1.6a)
Substituting the value of c2 from Equation (7.5.1.6a) in Equation (7.5.1.5a) gives
c1=b−a2(7.5.1.6b)
Therefore
∫baf(x) dx≈c1f(a)+c2f(b)=b−a2f(a)+b−a2f(b)(7.5.1.7)
Audiovisual Lecture
Two-point Gaussian Quadrature Rule Using Method of Undetermined Coefficients
In the two-point Gauss quadrature rule, an integral instead of Equation (7.5.1.1) is approximated as
∫baf(x) dx≈c1f(x1)+c2f(x2)(7.5.1.8)
The quadrature points are the two additional unknowns. There are four unknowns in Equation (7.5.1.8) – the two quadrature points x1 and x2, and the two weights c1 and c2. Hence, these are found by assuming that the formula gives exact results for integrating a general third-order polynomial, f(x)=a0+a1x+a2x2+a3x3.
∫baf(x) dx=∫ba(a0+a1x+a2x2+a3x3) dx=[a0x+a1x22+a2x33+a3x44]ba=a0(b−a)+a1(b2−a22)+a2(b3−a33)+a3(b4−a44)(7.5.1.9)
But we want the right-hand side of Equation (7.5.1.8) to give the same result as Equation (7.5.1.9) for f(x)=a0+a1x+a2x2+a3x3 which is
c1f(x1)+c2f(x2)=c1(a0+a1x1+a2x21+a3x31)+c2(a0+a1x2+a2x22+a3x32)(7.5.1.10)
Equating Equations (7.5.1.9) and (7.5.1.10) gives
a0(b−a)+a1(b2−a22)+a2(b3−a33)+a3(b4−a44)=c1(a0+a1x1+a2x21+a3x31)+c2(a0+a1x2+a2x22+a3x32)=a0(c1+c2)+a1(c1x1+c2x2)+a2(c1x21+c2x22)+a3(c1x31+c2x32)(7.5.1.11)
Since in Equation (7.5.1.11), the constants a0, a1, a2, and a3 are arbitrary, in the equation f(x)=a0+a1x+a2x2+a3x3, the coefficients of a0, a1, a2, and a3 must be equal. This equating gives us four equations as follows.
b−a=c1+c2b2−a22=c1x1+c2x2b3−a33=c1x12+c2x22b4−a44=c1x13+c2x23(7.5.1.12a-d)
Without proof, we can find that the above four simultaneous nonlinear equations have only one acceptable solution
c1=b−a2
c2=b−a2
x1=(b−a2)(−1√3)+b+a2
x2=(b−a2)(1√3)+b+a2(7.5.1.13)
Hence from Equations (7.5.1.1) and (7.5.1.13),
∫baf(x) dx≈c1f(x1)+c2f(x2)=b−a2f(b−a2(−1√3)+b+a2) +b−a2f(b−a2(1√3)+b+a2)(7.5.1.14)
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 x1 and giving it some weight c1 and is given by
∫baf(x) dx≈c1f(x1)(7.5.1.15)
To derive the values of c1 and x1, we assume the formula in Equation (7.5.1.15) gives exact values for an integral of a linear polynomial of the form a0+a1x.
∫ba(a0+a1x)dx=[a0x+a1x22]ba=a0(b − a)+a1(b2−a22)(7.5.1.16)
From the assumed formula
c1f(x1)=c1(a0+a1x1)=c1a0+c1a1x1(7.5.1.17)
Equating Equations (7.5.1.16) and (7.5.1.17) gives
a0(c1)+a1(c1x1)=a0(b − a)+a1(b2−a22)
Since a0 and a1 are arbitrary, we can equate the coefficients of a0 and a1, giving
c1=b−a(7.5.1.18)
c1x1=(b2−a22)(7.5.1.19)
Using Equation (7.5.1.18) in Equation (7.5.1.19) gives
(b−a)x1=b2−a22
x1=b+a2(7.5.1.20)
Therefore, one-point Gauss quadrature rule can be expressed as
∫baf(x)dx≈c1f(x1)=(b−a)f(b+a2)(7.5.1.21)
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.
The following integral is given
∫1.30.15xe−2x dx
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
∫baf(x) dx≈c1f(x1)+c2f(x2)
where
c1=b−a2
x1=b−a2(−1√3)+b+a2
c2=b−a2
x2=b−a2(1√3)+b+a2
For this example
f(x)=5xe−2x, a=0.1, b=1.3
So
c1=1.3−0.12=0.6
x1=1.3−0.12(−1√3)+1.3+0.12=0.35359
c2=1.3−0.12=0.6
x2=1.3−0.12(1√3)+1.3+0.12=1.0461
Then
∫1.30.1f(x) dx≈c1f(x1)+c2f(x2)=0.6f(0.35359)+0.6f(1.04641)
Finding the values of the function at the two quadrature points
f(0.35359)=5(0.35359)e−2(0.35359)=0.87166
f(1.04641)=5(1.04641)e−2(1.04641)=0.64531
we get
∫1.30.1f(x)dx≈0.6×0.87166+0.6×0.64531=0.91018
b) The exact value of the above integral can be found as
∫1.30.15xe−2x dx=0.89386
The true error
Et=True Value−Approximate Value=0.89386 − 0.91018=−0.01632
c) The absolute relative true error |εt| is
|εt|=|True Value−Approximate ValueTrue Value|×100=|0.89386 −0.910180.89386 |×100=1.8258%
The following integral is given
∫1.30.15xe−2x dx
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, |ϵt|, for part (a).
Solution
a)
∫baf(x) dx≈(b−a)f(a+b2)
where
a=0.1
b=1.3
∫1.30.1f(x) dx≈(1.3−0.1)f(1.3+0.12)=(1.2)f(0.7)=(1.2)(5(0.7)e−2(0.7))=1.0357
b) The true value is
Et=True value−Approximate value=0.89386−1.0357=−0.14183
c) The absolute relative true error, |ϵt|, would be
|ϵt|=|True errorTrue value|×100=|−0.141830.89386|×100=15.86%
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=∫308(2000ln[140000140000−2100t]−9.8t) dt
Also, find the absolute relative true error.
Solution
First, change the limits of integration from [8,30] to [−1,1] then
∫308f(t) dt=30−82∫1−1f(30−82x+30+82) dx=11∫1−1f(11x+19) dx
The weighting factors and function argument values for the two point rule are,
c1=1.000000000
x1=−0.577350269
c2=1.000000000
x2=0.577350269
Now we can use the Gauss quadrature formula
11∫1−1f(11x+19) dx≈11[c1f(11x1+19)+c2f(11x2+19)]=11[f(11(−0.5773503)+19)+f(11(0.5773503)+19)]=11[f(12.64915)+f(25.35085)]=11[(296.8317)+(708.4811)]=11058.44 m
where
f(12.64915)=2000ln[140000140000−2100(12.64915)]−9.8(12.64915)=296.8317
f(25.35085)=2000ln[140000140000−2100(25.35085)]−9.8(25.35085)=708.4811
The absolute relative true error, |ϵt|, is (True value = 11061.34 m)
|ϵt|=|11061.34−11058.4411061.34|×100=0.0262%
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
∫baf(x) dx≈c1f(x1)+c2f(x2)+c3f(x3)(7.5.3.1)
The coefficients (also called weighting factors) c1, c2, and c3, and the function arguments x1, x2 and x3 are calculated by assuming the formula gives exact expressions for integrating a fifth-order polynomial
∫ba(a0+a1x+a2x2+a3x3+a4x4+a5x5) dx.
General n-point rules would approximate an integral as
∫baf(x) dx≈c1f(x1)+c2f(x2)+.......+cnf(xn)(7.5.3.2)
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 7.5.3.1.1), coefficients and arguments for n-point Gauss quadrature rule are given not for integrals of the form ∫baf(x) dx but for integrals of the form ∫1−1g(x) dx, that is,
∫1−1g(x) dx≈n∑i=1cig(xi)(7.5.3.3)
Points | Weighting Factors | Function Arguments |
---|---|---|
1 | c1=2.000000000 | x1=0.000000000 |
2 |
c1=1.000000000 c2=1.000000000 |
x1=−0.577350269 x2=0.577350269 |
3 |
c1=0.555555556 c2=0.888888889 c3=0.555555556 |
x1=−0.774596669 x2=0.000000000 x3=0.774596669 |
4 |
c1=0.347854845 c2=0.652145155 c3=0.652145155 c4=0.347854845 |
x1=−0.861136312 x2=−0.339981044 x3=0.339981044 x4=0.861136312 |
5 |
c1=0.236926885 c2=0.478628670 c3=0.568888889 c4=0.478628670 c5=0.236926885 |
x1=−0.906179846 x2=−0.538469310 x3=0.000000000 x4=0.538469310 x5=0.906179846 |
6 |
c1=0.171324492 c2=0.360761573 c3=0.467913935 c4=0.467913935 c5=0.360761573 c6=0.171324492 |
x1=−0.932469514 x2=−0.661209386 x3=−0.238619186 x4=0.238619186 x5=0.661209386 x6=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 [a,b] can be converted into an integral with limits [−1,1]. Let
x=mt+c(7.5.3.4)
If x=a, then t=−1
If x=b, then t=+1
such that
a=m(−1)+cb=m(1)+c(7.5.3.5a,b)
Solving the two Equations (7.5.3.5a) and (7.5.3.5b) simultaneously gives
m=b−a2c=b+a2(7.5.3.6a,b)
Hence from Equations (7.5.3.4), (7.5.3.6a), (7.5.3.6b),
x=b−a2t+b+a2dx=b−a2dt
Substituting values of x and dx into the integral gives us
∫baf(x) dx=∫1−1f(b−a2t+b+a2)b−a2 dt=∫1−1f(b−a2x+b+a2)b−a2 dx(7.5.3.7)
Hence, any integral of the form ∫baf(x) dx can be converted to an ∫1−1g(x) dx, and Table 7.5.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.
Use two-point Gauss quadrature rule to approximate the distance in meters covered by a rocket from t=8 s to t=30 s as given by
x=∫308(2000ln[140000140000−2100t]−9.8t) dt
Change the limits so that one can use the weights and abscissas given in Table 7.5.3.1. Also, find the absolute relative true error. The true value is given as 11061.34 m
Solution
First, change the limits of integration from [8,30] to [−1,1] using Equation (7.5.3.7) gives
∫308f(t) dt=30−82∫1−1f(30−82x+30+82) dx=11∫1−1f(11x+19) dx
Next, get weighting factors and function argument values from Table 7.5.3.1 for the two-point rule,
c1=1.000000000x1=−0.577350269c2=1.000000000x2=0.577350269
Now we can use the Gauss quadrature formula
11∫1−1f(11x+19) dx≈11[c1f(11x1+19)+c2f(11x2+19)]=11[f(11(−0.5773503)+19)+f(11(0.5773503)+19)]=11[f(12.64915)+f(25.35085)]=11[(296.8317)+(708.4811)]=11058.44 m
since
f(12.64915)=2000ln[140000140000−2100(12.64915)]−9.8(12.64915)=296.8317f(25.35085)=2000ln[140000140000−2100(25.35085)]−9.8(25.35085)=708.4811
The absolute relative true error, |ϵt|, is (True value=11061.34 m):
|ϵt|=|11061.34−11058.4411061.34|×100=0.0262%
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=∫308(2000ln[140000140000−2100t]−9.8t) dt
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 m
Solution
First, change the limits of integration from [8,30] to [−1,1] using Equation (7.5.3.7) gives
∫308f(t) dt=30−82∫1−1f(30−82x+30+82) dx=11∫1−1f(11x+19) dx
The weighting factors and function argument values are
c1=0.555555556x1=−0.774596669c2=0.888888889x2=0.000000000c3=0.555555556x3=0.774596669
and the formula is
11∫1−1f(11x+19) dx≈11[c1f(11x1+19)+c2f(11x2+19)+c3f(11x3+19)]=11[&0.5555556f(11(−.7745967)+19)+0.8888889f(11(0.0000000)+19)+0.5555556f(11(0.7745967)+19)]=11[0.55556f(10.47944)+0.88889f(19.00000)+0.55556f(27.52056)]=11[0.55556×239.3327+0.88889×484.7455+0.55556×795.1069]=11061.31 m
since
f(10.47944)=2000ln[140000140000−2100(10.47944)]−9.8(10.47944)=239.3327f(19.00000)=2000ln[140000140000−2100(19.00000)]−9.8(19.00000)=484.7455f(27.52056)=2000ln[140000140000−2100(27.52056)]−9.8(27.52056)=795.1069
The absolute relative true error, |ϵt|, is (True value=11061.34 m):
|ϵt|=|11061.34−11061.3111061.34|×100=0.0003%
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
∫1−1g(x) dx≈n∑i=1cig(xi)
and we also know that
∫baf(x) dx=b−a2∫1−1f(b−a2x+b+a2) dx
then the n-point Gaussian quadrature rule for [a,b] limits of integration can also be found.
∫baf(x)dx=b−a2∫1−1f(b−a2x+b+a2) dx≈b−a2n∑i=1cif(b−a2xi+b+a2)=n∑i=1Cif(Xi)
where
Ci=b−a2ciXi=b−a2xi+b+a2
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
For an integral ∫1−1f(x) dx, derive the two-point Gauss quadrature rule
∫1−1f(x) dx≈c1f(x1)+c2f(x2)
Solution
Assuming the formula
∫1−1f(x) dx=c1f(x1)+c2f(x2)(7.5.3.A1.1)
gives exact values for integrals ∫1−11 dx, ∫1−1x dx, ∫1−1x2 dx, and ∫1−1x3 dx . Then
∫1−11 dx=2=c1+c2(7.5.3.A1.2)∫1−1x dx=0=c1x1+c2x2(7.5.3.A1.3)∫1−1x2 dx=23=c1x12+c2x22(7.5.3.A1.4)∫1−1x3 dx=0=c1x13+c2x23(7.5.3.A1.5)
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}
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