05
Gauss Quadrature Rule of Integration
1. derive the Gauss quadrature method for integration and be able to use it to solve
problems, and
2. use Gauss quadrature method to solve examples of approximate integrals.
What is integration?
Integration is the process of measuring the area under a function plotted on a graph. Why
would we want to integrate a function? Among the most common examples are finding the
velocity of a body from an acceleration function, and displacement of a body from a velocity
function. Throughout many engineering fields, there are (what sometimes seems like)
countless applications for integral calculus. You can read about some of these applications in
Chapters 07.00A-07.00G.
Sometimes, the evaluation of expressions involving these integrals can become daunting, if
not indeterminate. For this reason, a wide variety of numerical methods has been developed
to simplify the integral.
Here, we will discuss the Gauss quadrature rule of approximating integrals of the form
b
I = ∫ f ( x )dx
a
where
f (x) is called the integrand,
a = lower limit of integration
b = upper limit of integration
07.05.1
07.05.2 Chapter 07.05
∫ f ( x)dx ≈ c
a
1 f (a ) + c 2 f (b) (1)
Let the right hand side be exact for integrals of a straight line, that is, for an integrated form
of
b
∫ (a
a
0 + a1 x )dx
So
b b
x2
(
∫a 0 1
a + a x )dx = a
0 x + a1
2 a
b2 − a2
= a 0 (b − a ) + a1 (2)
2
But from Equation (1), we want
b
∫ (a
a
0 + a1 x )dx = c1 f (a ) + c 2 f (b) (3)
∫ (a
a
0 + a1 x )dx = c1 (a 0 + a1 a ) + c 2 (a 0 + a1b )
∫ f ( x)dx ≈ c
a
1 f (a) + c 2 f (b)
b−a b−a
= f (a) + f (b) (7)
2 2
≈ c1 f ( x1 ) + c 2 f ( x 2 )
There are four unknowns x1 , x 2 , c1 and c 2 . These are found by assuming that the formula
gives exact results for integrating a general third order polynomial,
f ( x) = a 0 + a1 x + a 2 x 2 + a3 x 3 . Hence
b b
∫ (
f ( x)dx = ∫ a 0 + a1 x + a 2 x 2 + a3 x 3 dx )
a a
b
x2 x3 x4
= a 0 x + a1 + a2 + a3
2 3 4 a
b2 − a2 b3 − a3 b4 − a4
= a 0 (b − a ) + a1 + a 2 + a3 (8)
2 3 4
The formula would then give
b
∫ f ( x)dx ≈ c
a
1 f ( x1 ) + c 2 f ( x 2 ) =
Since in Equation (10), the constants a 0 , a1 , a 2 , and a3 are arbitrary, the coefficients of
a 0 , a1 , a 2 , and a3 are equal. This gives us four equations as follows.
b − a = c1 + c 2
b2 − a2
= c1 x1 + c 2 x 2
2
b3 − a3 2 2
= c1 x1 + c 2 x 2
3
b − a4
4
3 3
= c1 x1 + c 2 x 2 (11)
4
Without proof (see Example 1 for proof of a related problem), we can find that the above
four simultaneous nonlinear equations have only one acceptable solution
b−a
c1 =
2
b−a
c2 =
2
b − a 1 b + a
x1 = − +
2 3 2
b − a 1 b + a
x2 = + (12)
2 3 2
Hence
b
∫ f ( x )dx ≈ c f (x ) + c f (x )
a
1 1 2 2
Method 2:
We can derive the same formula by assuming that the expression gives exact values for the
b b b b
individual integrals of ∫ 1dx, ∫ xdx, ∫ x dx, and
2
∫ x dx .
3
The reason the formula can also be
a a a a
Gauss Quadrature Rule 07.05.5
derived using this method is that the linear combination of the above integrands is a general
third order polynomial given by f ( x) = a 0 + a1 x + a 2 x 2 + a3 x 3 .
These will give four equations as follows
b
∫ 1dx = b − a = c
a
1 + c2
b
b2 − a 2
∫a xdx = 2 = c1 x1 + c2 x2
b
b3 − a 3
∫ x dx =
2 2 2
= c1 x1 + c2 x2
a
3
b
b4 − a 4
∫a x dx = 4 = c1 x1 + c2 x2
3 3 3
(14)
These four simultaneous nonlinear equations can be solved to give a single acceptable
solution
b−a
c1 =
2
b−a
c2 =
2
b − a 1 b + a
x1 = − +
2 3 2
b − a 1 b + a
x2 = + (15)
2 3 2
Hence
b
b−a b−a 1 b+a b−a b−a 1 b+a
∫ f ( x)dx ≈
a
2
f
2
−
3
+
2
+
2
f
2
3
+
2
(16)
Since two points are chosen, it is called the two-point Gauss quadrature rule. Higher point
versions can also be developed.
∫ f ( x)dx ≈ c
a
1 f ( x1 ) + c 2 f ( x 2 ) + c3 f ( x3 ) (17)
is called the three-point Gauss quadrature rule. The coefficients c1 , c 2 and c3 , and the
function arguments x1 , x 2 and x3 are calculated by assuming the formula gives exact
expressions for integrating a fifth order polynomial
b
∫ (a
a
0 + a1 x + a 2 x 2 + a3 x 3 + a 4 x 4 + a5 x 5 dx . )
General n -point rules would approximate the integral
07.05.6 Chapter 07.05
∫ f ( x)dx ≈ c
a
1 f ( x1 ) + c 2 f ( x 2 ) + . . . . . . . + c n f ( x n ) (18)
∫ g ( x)dx ≈ ∑ ci g ( xi )
−1 i =1
(19)
Table 1 Weighting factors c and function arguments x used in Gauss quadrature formulas
Weighting Function
Points Factors Arguments
c1 = 1.000000000 x1 = −0.577350269
c 2 = 1.000000000 x 2 = 0.577350269
2
c1 = 0.555555556 x1 = −0.774596669
c 2 = 0.888888889 x 2 = 0.000000000
3
c3 = 0.555555556 x3 = 0.774596669
c1 = 0.347854845 x1 = −0.861136312
c 2 = 0.652145155 x 2 = −0.339981044
4
c3 = 0.652145155 x3 = 0.339981044
c 4 = 0.347854845 x 4 = 0.861136312
c1 = 0.236926885 x1 = −0.906179846
c 2 = 0.478628670 x 2 = −0.538469310
5
c3 = 0.568888889 x3 = 0.000000000
c 4 = 0.478628670 x 4 = 0.538469310
c5 = 0.236926885 x5 = 0.906179846
c1 = 0.171324492 x1 = −0.932469514
c 2 = 0.360761573 x 2 = −0.661209386
6
c3 = 0.467913935 x3 = −0.238619186
c 4 = 0.467913935 x 4 = 0.238619186
Gauss Quadrature Rule 07.05.7
c5 = 0.360761573 x5 = 0.661209386
c6 = 0.171324492 x6 = 0.932469514
1 b
So if the table is given for ∫ g ( x )dx integrals, how does one solve
−1
∫ f ( x)dx ?
a
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 (20)
If x = a, then t = −1
If x = b, then t = + 1
such that
a = m(−1) + c
b = m(1) + c (21)
Solving the two Equations (21) simultaneously gives
b−a
m=
2
b+a
c= (22)
2
Hence
b−a b+a
x= t+
2 2
b−a
dx = dt
2
Substituting our values of x and dx into the integral gives us
b 1
b−a b+ab−a
∫a f ( x ) dx = ∫−1 f 2 x + 2 2 dx (23)
Example 1
1
For an integral ∫ f ( x)dx, show that the two-point Gauss quadrature rule approximates to
−1
1
∫ f ( x)dx ≈ c
−1
1 f ( x1 ) + c 2 f ( x 2 )
where
c1 = 1
c2 = 1
1
x1 = −
3
07.05.8 Chapter 07.05
1
x2 =
3
Solution
Assuming the formula
1
∫ f ( x)dx = c f (x ) + c f (x )
−1
1 1 2 2 (E1.1)
1 1 1 1
gives exact values for integrals ∫ 1dx, ∫ xdx, ∫ x dx, and
2
∫ x dx
3
. Then
−1 −1 −1 −1
1
∫ 1dx = 2 = c
−1
1 + c2 (E1.2)
1
∫ xdx = 0 = c x
−1
1 1 + c2 x2 (E1.3)
1
2
∫x
2 2 2
dx = = c1 x1 + c 2 x 2 (E1.4)
−1
3
1
∫ x dx = 0 = c x
3 3 3
1 1 + c2 x2 (E1.5)
−1
2
Multiplying Equation (E1.3) by x1 and subtracting from Equation (E1.5) gives
( 2
c 2 x 2 x1 − x 2 = 0
2
) (E1.6)
The solution to the above equation is
c 2 = 0, or/and
x 2 = 0, or/and
x1 = x2 , or/and
x1 = − x 2 .
I. c 2 = 0 is not acceptable as Equations (E1.2-E1.5) reduce to c1 = 2, c1 x1 = 0,
2
c1 x12 = , and c1 x13 = 0 . But since c1 = 2 , then x1 = 0 from c1 x1 = 0 , but x1 = 0
3
2
conflicts with c1 x12 = .
3
II. x 2 = 0 is not acceptable as Equations (E1.2-E1.5) reduce to c1 + c 2 = 2 , c1 x1 = 0,
2
c1 x12 = , and c1 x13 = 0 . Since c1 x1 = 0 , then c1 or x1 has to be zero but this violates
3
2
c1 x12 = ≠ 0 .
3
III. x1 = x2 is not acceptable as Equations (E1.2-E1.5) reduce to c1 + c 2 = 2 ,
2 2
c1 x1 + c 2 x1 = 0, c1 x12 + c 2 x1 = , and c1 x13 + c2 x13 = 0 . If x1 ≠ 0 , then c1 x1 + c2 x1 = 0
3
Gauss Quadrature Rule 07.05.9
∫ f ( x)dx = c
−1
1 f ( x1 ) + c 2 f ( x 2 ) (E1.11)
1 1
= f − + f
3 3
Example 2
b
For an integral ∫ f ( x)dx, derive the one-point Gauss quadrature rule.
a
Solution
The one-point Gauss quadrature rule is
b
∫ f ( x )dx ≈ c f (x )
a
1 1 (E2.1)
1 1
Assuming the formula gives exact values for integrals ∫ 1dx, and ∫ xdx
−1 −1
b
∫ 1dx = b − a = c
a
1
b
b2 − a2
∫ xdx =
a
2
= c1 x1 (E2.2)
b2 − a2
(b − a ) x1 =
2
b+a
x1 = (E2.3)
2
Therefore, one-point Gauss quadrature rule can be expressed as
b
b+a
∫a f ( x )dx ≈ (b − a ) f 2 (E2.4)
Example 3
What would be the formula for
b
∫ f ( x)dx = c
a
1 f (a) + c 2 f (b)
b
if you want the above formula to give you exact values of ∫ (a
a
0 )
x + b0 x 2 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
b
b2 − a2
∫a xdx =
2
= c1 a + c 2 b
b
b3 − a3
∫a x dx = 3 = c1a + c2 b
2 2 2
(E3.1)
∫ (2 x )
2
Evaluate − 3 x dx using Equation(E3.3)
2
Gauss Quadrature Rule 07.05.11
∫ (2 x )
2
− 3 x dx ≈ c1 f (a ) + c 2 f (b)
2
=−
1 − (2)(5) − 5 2 + 2(2) 2
6 2
2(2) 2 − 3(2) −
6
[ 5
]
1 2 2 + 2(5) − 2(5) 2
[2(5) 2 − 3(5)]
= 46.5
5
∫ (2 x )
2
The exact value of − 3 x dx is given by
2
5 5
2 x 3 3x 2
∫2 2 (
x − 32
x d x = ) −
3 2 2
= 46.5
Any surprises?
5
Now evaluate ∫ 3dx using Equation (E3.3)
2
5
∫ 3dx ≈ c
2
1 f (a ) + c 2 f (b)
∫ 3dx = [3x ]
5
2
2
=9
Because the formula will only give exact values for linear combinations of x and x 2 , it does
5
not work exactly even for a simple integral of ∫ 3dx .
2
Do you see now why we choose a 0 + a1 x as the integrand for which the formula
b
∫ f ( x)dx ≈ c
a
1 f (a ) + c 2 f (b)
Example 4
Use two-point Gauss quadrature rule to approximate the distance covered by a rocket from
t = 8 to t = 30 as given by
30
140000
x = ∫ 2000 ln − 9 . 8t dt
8 140000 − 2100 t
Also, find the absolute relative true error.
07.05.12 Chapter 07.05
Solution
First, change the limits of integration from [8, 30] to [− 1, 1] using Equation(23) gives
30 1
30 − 8 30 − 8 30 + 8
∫
8
f (t )dt = ∫ f
2 −1 2
x+
2
dx
1
= 11∫ f (11x + 19 )dx
−1
Next, get weighting factors and function argument values from Table 1 for the two point rule,
c1 = 1.000000000 .
x1 = −0.577350269
c 2 = 1.000000000
x 2 = 0.577350269
Now we can use the Gauss quadrature formula
1
11∫ f (11x + 19 )dx ≈ 11[c1 f (11x1 + 19 ) + c 2 f (11x 2 + 19 )]
−1
Example 5
Use three-point Gauss quadrature rule to approximate the distance covered by a rocket from
t = 8 to t = 30 as given by
30
140000
x = ∫ 2000 ln − 9.8t dt
8 140000 − 2100t
Also, find the absolute relative true error.
Gauss Quadrature Rule 07.05.13
Solution
First, change the limits of integration from [8, 30] to [− 1, 1] using Equation (23) gives
30 1
30 − 8 30 − 8 30 + 8
∫
8
f (t )dt = ∫ f
2 −1 2
x+
2
dx
1
= 11∫ f (11x + 19 )dx
−1
The weighting factors and function argument values are
c1 = 0.555555556
x1 = −0.774596669
c 2 = 0.888888889
x 2 = 0.000000000
c3 = 0.555555556
x3 = 0.774596669
and the formula is
1
11∫ f (11x + 19 )dx ≈ 11[c1 f (11x1 + 19 ) + c 2 f (11x 2 + 19 ) + c3 f (11x3 + 19 )]
−1
INTEGRATION
Topic Gauss quadrature rule
Summary These are textbook notes of Gauss quadrature rule
Major General Engineering
Authors Autar Kaw, Michael Keteltas
Date August 11, 2010
Web Site http://numericalmethods.eng.usf.edu