Gauss Quadrature Rule of Integration

advertisement
Chapter 07.05
Gauss Quadrature Rule of Integration
After reading this chapter, you should be able to:
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
Figure 1 Integration of a function.
Gauss Quadrature Rule
Background:
To derive the trapezoidal rule from the method of undetermined coefficients, we
approximated
b
 f ( x)dx  c
1
f (a)  c2 f (b)
(1)
a
Let the right hand side be exact for integrals of a straight line, that is, for an integrated form
of
b
 a
0
 a1 x dx
a
So
b

x2 


a

a
x
dx

a
x

a
1
 0

a 0 1
2 a

 b2  a2 

 a0 b  a   a1 
 2 
But from Equation (1), we want
b
b
 a
0
 a1 x dx  c1 f (a)  c2 f (b)
(2)
(3)
a
to give the same result as Equation (2) for f ( x)  a0  a1 x .
b
 a
0
 a1 x dx  c1 a0  a1a   c2 a0  a1b 
a
 a0 c1  c2   a1 c1a  c2 b 
Hence from Equations (2) and (4),
 b2  a2 
  a0 c1  c2   a1 c1a  c2 b 
a0 b  a   a1 
 2 
(4)
Gauss Quadrature Rule
07.05.3
Since a 0 and a1 are arbitrary constants for a general straight line
c1  c2  b  a
b2  a2
2
Multiplying Equation (5a) by a and subtracting from Equation (5b) gives
ba
c2 
2
Substituting the above found value of c2 in Equation (5a) gives
ba
c1 
2
Therefore
c1a  c2 b 
(5a)
(5b)
(6a)
(6b)
b
 f ( x)dx  c
1
f (a)  c2 f (b)
a

ba
ba
f (a) 
f (b)
2
2
(7)
Derivation of two-point Gauss quadrature rule
Method 1:
The two-point Gauss quadrature rule is an extension of the trapezoidal rule approximation
where the arguments of the function are not predetermined as a and b , but as unknowns x1
and x2 . So in the two-point Gauss quadrature rule, the integral is approximated as
b
I   f ( x)dx
a
 c1 f ( x1 )  c2 f ( x2 )
There are four unknowns x1 , x 2 , c1 and c2 . These are found by assuming that the formula
gives exact results for integrating a general third order polynomial,
f ( x)  a0  a1 x  a 2 x 2  a3 x 3 . Hence
b

b


f ( x)dx   a0  a1 x  a 2 x 2  a3 x 3 dx
a
a

x2
 a 0 x  a1
 a2
2

 b2
 a0 b  a   a1 

The formula would then give
b
x3
x4 
 a3 
3
4 a
 b3  a3 
 b4  a4 
 a2 
  a 2 
  a3 

2 
3
4




(8)
b
 f ( x)dx  c f ( x )  c f ( x
c a  a x  a x
1
1
2
2
a
1
0
1 1
2
2 1
)
 a3 x13   c2 a0  a1 x2  a 2 x22  a3 x23 
(9)
07.05.4
Chapter 07.05
Equating Equations (8) and (9) gives
 b2  a 2 
 b3  a 3 
 b4  a 4 
  a 2 
  a3 

a0 b  a   a1 
 2 
 3 
 4 

 
 c x   a c x
 c1 a0  a1 x1  a 2 x1  a3 x1  c2 a0  a1 x2  a 2 x2  a3 x2
2
 a0 c1  c2   a1 c1 x1
3
2
2
2
1 1
2
2


3

 c2 x2  a3 c1 x1  c2 x2
2
3
3

(10)
Since in Equation (10), the constants a 0 , a1 , a 2 , and a 3 are arbitrary, the coefficients of
a 0 , a1 , a 2 , and a 3 are equal. This gives us four equations as follows.
b  a  c1  c2
b2  a2
 c1 x1  c 2 x 2
2
b3  a3
2
2
 c1 x1  c 2 x 2
3
4
b  a4
3
3
 c1 x1  c2 x2
4
(11)
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  
 

2
 2  3 
(12)
Hence
b
 f ( x)dx  c f x   c f x 
1
1
2
2
a

ba
2
ba  1  ba ba

f 


2 
2
3
 2 
ba  1  ba

f 


2 
 2  3
(13)
Method 2:
We can derive the same formula by assuming that the expression gives exact values for the
b
individual integrals of  1dx,
a
b
b
b
 xdx,
2
 x dx, and
 x dx .
a
a
a
3
The reason the formula can also be
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)  a0  a1 x  a 2 x 2  a3 x 3 .
These will give four equations as follows
b
1dx  b  a  c
1
 c2
a
b2  a 2
a xdx  2  c1 x1  c2 x2
b
b
2
 x dx 
a
b3  a 3
2
2
 c1 x1  c2 x2
3
b4  a 4
3
3
(14)
a x dx  4  c1 x1  c2 x2
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
3
 b  a  1  b  a
x2  
 

2
 2  3 
(15)
Hence
ba ba 1  ba ba ba 1  ba


(16)
f 
 
 
f 

 


2
2
2
2
2
2
3
3








a
Since two points are chosen, it is called the two-point Gauss quadrature rule. Higher point
versions can also be developed.
b
 f ( x)dx 
Higher point Gauss quadrature formulas
For example
b
 f ( x)dx  c
1
f ( x1 )  c2 f ( x2 )  c3 f ( x3 )
(17)
a
is called the three-point Gauss quadrature rule. The coefficients c1 , c2 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
 a
b
0

 a1 x  a2 x 2  a3 x 3  a4 x 4  a5 x 5 dx .
a
General n -point rules would approximate the integral
07.05.6
Chapter 07.05
b
 f ( x)dx  c
1
f ( x1 )  c2 f ( x2 )  . . . . . . .  cn f ( xn )
(18)
a
Arguments and weighing factors for n-point Gauss quadrature rules
In handbooks (see Table 1), coefficients and arguments given for n -point Gauss quadrature
rule are given for integrals of the form
1
n
1
i 1
 g ( x)dx   ci g ( xi )
(19)
Table 1 Weighting factors c and function arguments x used in Gauss quadrature formulas
Weighting
Function
Points Factors
Arguments
2
3
4
5
6
c1  1.000000000
x1  0.577350269
c2  1.000000000
x2  0.577350269
c1  0.555555556
x1  0.774596669
c2  0.888888889
x2  0.000000000
c3  0.555555556
x3  0.774596669
c1  0.347854845
x1  0.861136312
c2  0.652145155
x2  0.339981044
c3  0.652145155
x3  0.339981044
c4  0.347854845
x4  0.861136312
c1  0.236926885
x1  0.906179846
c2  0.478628670
x2  0.538469310
c3  0.568888889
x3  0.000000000
c4  0.478628670
x4  0.538469310
c5  0.236926885
x5  0.906179846
c1  0.171324492
x1  0.932469514
c2  0.360761573
x2  0.661209386
c3  0.467913935
x3  0.238619186
c4  0.467913935
x4  0.238619186
Gauss Quadrature Rule
07.05.7
c5  0.360761573
x5  0.661209386
c6  0.171324492
x6  0.932469514
1
So if the table is given for
 g ( x)dx integrals, how does one solve
1
b
 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
(20)
x  mt  c
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a
ba
(23)
f
(
x
)
dx

a
1 f  2 x  2  2 dx
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
where
c1  1
c2  1
x1  
1
3
f ( x1 )  c 2 f ( x 2 )
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
2
(E1.1)
2
1
1
gives exact values for integrals  1dx,
1
1
 xdx,
1
1
2
 x dx, and
1
1
 x dx
3
. Then
1
1
 1dx  2  c
1
 c2
(E1.2)
1
1
 xdx  0  c x
1 1
 c2 x2
(E1.3)
1
1
x
2
dx 
1
2
2
2
 c1 x1  c 2 x 2
3
(E1.4)
1
 x dx  0  c x
3
1 1
3
 c2 x2
3
(E1.5)
1
2
Multiplying Equation (E1.3) by x1 and subtracting from Equation (E1.5) gives


c 2 x 2 x1  x 2  0
(E1.6)
The solution to the above equation is
c2  0, or/and
x2  0, or/and
x1  x2 , or/and
x1   x2 .
I. c2  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. x2  0 is not acceptable as Equations (E1.2-E1.5) reduce to c1  c2  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  c2  2 ,
2
2
c1 x1  c2 x1  0, c1 x12  c 2 x1  , and c1 x13  c2 x13  0 . If x1  0 , then c1 x1  c2 x1  0
3
2
2
Gauss Quadrature Rule
07.05.9
gives c1  c2  0 and that violates c1  c2  2 . If x1  0 , then that violates
2
2
c1 x12  c2 x1   0 .
3
That leaves the solution of x1   x2 as the only possible acceptable solution and in fact, it
does not have violations (see it for yourself)
(E1.7)
x1   x2
Substituting (E1.7) in Equation (E1.3) gives
(E1.8)
c1  c2
From Equations (E1.2) and (E1.8),
(E1.9)
c1  c2  1
Equations (E1.4) and (E1.9) gives
2
2
2
x1  x 2 
(E1.10)
3
Since Equation (E1.7) requires that the two results be of opposite sign, we get
1
x1  
3
1
x2 
3
Hence
1
 f ( x)dx  c
1
f ( x1 )  c 2 f ( x 2 )
(E1.11)
1
 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 
1
(E2.1)
1
a
1
Assuming the formula gives exact values for integrals  1dx, and
1
1
 xdx
1
b
1dx  b  a  c
1
a
b
 xdx 
a
b2  a2
 c1 x1
2
Since c1  b  a, the other equation becomes
(E2.2)
07.05.10
Chapter 07.05
b2  a2
2
ba
x1 
2
Therefore, one-point Gauss quadrature rule can be expressed as
b
ba
a f ( x)dx  (b  a) f  2 
(b  a) x1 
(E2.3)
(E2.4)
Example 3
What would be the formula for
b
 f ( x)dx  c
1
f (a)  c2 f (b)
a
 a x  b x dx,
b
if you want the above formula to give you exact values of
2
0
0
that is, a linear
a
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
xdx

 c1 a  c2 b
a
2
b3  a3
2
2
a x dx  3  c1a  c2b
Solving the two Equations (E3.1) simultaneously gives
b2  a 2 
 a b   c1   2 
 a 2 b 2  c    b 3  a 3 

  2 

 3 
b
2
1  ab  b 2  2a 2
6
a
2
1 a  ab  2b 2
c2  
6
b
(E3.1)
c1  
(E3.2)
So
1  ab  b 2  2a 2
1 a 2  ab  2b 2
f (a) 
f (b)
a f ( x)dx   6
a
6
b
Let us see if the formula works.
b
 2 x
5
Evaluate
2
2

 3 x dx using Equation(E3.3)
(E3.3)
Gauss Quadrature Rule
 2 x

5
2
07.05.11
 3 x dx  c1 f (a)  c2 f (b)
2


1  (2)(5)  5 2  2(2) 2
1 2 2  2(5)  2(5) 2
2(2) 2  3(2) 
[2(5) 2  3(5)]
6
2
6
5
 46.5

 2 x
5
The exact value of
2

 3 x dx is given by
2
5
 2 x 3 3x 2 




2
x

3
x
dx


2
2 2
 3
 46.5
Any surprises?
5
2
5
Now evaluate  3dx using Equation (E3.3)
2
5
 3dx  c
1
f (a )  c 2 f (b)
2
1  2(5)  5 2  2(2) 2
1 2 2  2(5)  2(5) 2
(3) 
(3)
6
2
6
5
 10.35

5
The exact value of  3dx is given by
2
5
 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 a0  a1 x as the integrand for which the formula
b
 f ( x)dx  c
1
f (a)  c2 f (b)
a
gives us exact values?
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
.
8
t
dt

140000

2100
t



8
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

8
30  8  30  8
30  8 
f (t )dt 
f
x
dx

2 1  2
2 
1
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
c2  1.000000000
x2  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
 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


140000
f (12.64915)  2000 ln 
  9.8(12.64915)
140000  2100(12.64915) 
 296.8317


140000
f (25.35085)  2000 ln 
  9.8(25.35085)
140000  2100(25.35085) 
 708.4811
The absolute relative true error, t , is (True value = 11061.34 m)
11061.34  11058.44
 100
11061.34
 0.0262%
t 
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

140000  2100t 

8
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

8
30  8  30  8
30  8 
f (t )dt 
f
x
dx

2 1  2
2 
1
1
 11 f 11x  19dx
1
The weighting factors and function argument values are
c1  0.555555556
x1  0.774596669
c2  0.888888889
x2  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
0.5555556 f 11(.7745967)  19  0.8888889 f 11(0.0000000)  19
 11

 0.5555556 f 11(0.7745967)  19

 110.55556 f (10.47944)  0.88889 f (19.00000)  0.55556 f (27.52056)
 110.55556  239.3327  0.88889  484.7455  0.55556  795.1069
 11061.31 m
since


140000
f (10.47944)  2000 ln 
  9.8(10.47944)
140000  2100(10.47944) 
 239.3327


140000
f (19.00000)  2000 ln 
  9.8(19.00000)
140000  2100(19.00000) 
 484.7455


140000
f (27.52056)  2000 ln 
  9.8(27.52056)
140000  2100(27.52056) 
 795.1069
The absolute relative true error, t , is (True value = 11061.34 m)
11061.34  11061.31
 100
11061.34
 0.0003%
t 
07.05.14
INTEGRATION
Topic
Gauss quadrature rule
Summary These are textbook notes of Gauss quadrature rule
Major
General Engineering
Authors
Autar Kaw, Michael Keteltas
Date
February 6, 2016
Web Site http://numericalmethods.eng.usf.edu
Chapter 07.05
Download