You are on page 1of 45

Tugas METNUM

 Nama Johan Indrianto Aruan


 NPM 1506728913
 Prodi Teknik Perkapalan
2

GAUSS QUADRATURE RULE


OF INTEGRATION

http://numericalmethods.eng.usf.edu
What is Integration?

f(x)
y
Integration

The process of measuring


the area under a curve.
b
I   f ( x )dx
a
Where:
f(x) is the integrand
a= lower limit of integration a b x

b= upper limit of integration


4

TWO-POINT GAUSSIAN
QUADRATURE RULE

http://numericalmethods.eng.usf.edu
Basis of the Gaussian Quadrature Rule
5

The four unknowns x1, x2, c1 and c2 are found by assuming that
the formula gives exact results for integrating a general third
order polynomial, f ( x )  a  a x  a x 2  a x 3 .
0 1 2 3
Hence

 f ( x )dx   a0  a1 x  a2 x  a3 x dx


b b
2 3

a a
b
 x 2
x x  3 4
 a0 x  a1  a 2  a3 
 2 3 4 a
 b2  a2   b3  a3   b4  a4 
 a0 b  a   a1    a 2    a3  
 2   3   4 
Basis of the Gaussian
Quadrature Rule
6

It follows that

   
b
 f ( x )dx  c1 a0  a1 x1  a2 x1  a3 x1  c2 a0  a1 x2  a2 x2  a3 x2
2 3 2 3

Equating Equations the two previous two expressions yield

 b2  a2   b3  a3   b4  a4 
a0 b  a   a1    a 2    a3  
 2   3   4 

 2
 
 c1 a0  a1 x1  a2 x1  a3 x1  c2 a0  a1 x2  a2 x2  a3 x2
3 2 3

 a0 c1  c2   a1 c1 x1  c x   a c x  
 c2 x2  a3 c1 x1  c2 x2 
2 2 3 3
2 2 2 1 1

http://numericalmethods.eng.usf.edu
Basis of Gauss Quadrature
7

The previous four simultaneous nonlinear Equations have


only one acceptable solution,

 b  a  1  b  a  b  a  1  b  a
x1       x2     
 2  3 2  2  3  2

ba ba
c1  c2 
2 2

http://numericalmethods.eng.usf.edu
Basis of Gauss Quadrature
8

Hence Two-Point Gaussian Quadrature Rule


b

 f ( x)dx  c1 f x1   c2 f x2 


a

ba ba  1  ba ba ba  1  ba


 f       f    
2  2  3 2  2  2  3 2 

http://numericalmethods.eng.usf.edu
9

HIGHER POINT GAUSSIAN


QUADRATURE FORMULAS

http://numericalmethods.eng.usf.edu
Higher Point Gaussian Quadrature Formulas
10

 f ( x)dx  c f ( x )  c
a
1 1 2 f ( x2 )  c3 f ( x3 )

is called the three-point Gauss Quadrature Rule.


The coefficients c1, c2, and c3, and the functional arguments x1, x2, and x3
are calculated by assuming the formula gives exact expressions for
integrating a fifth order polynomial

 a0  a1 x  a2 x  a3 x  a4 x  a5 x dx
b
2 3 4 5

General n-point rules would approximate the integral


b
 f ( x )dx  c1 f ( x1 )  c2 f ( x2 )  . . . . . . .  cn f ( xn )
a
http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for
n-point Gauss Quadrature
11
Formulas

Table 1: Weighting factors c and function


arguments x used in Gauss Quadrature
In handbooks, coefficients and Formulas.
arguments given for n-point Points Weighting Function
Factors Arguments
Gauss Quadrature Rule are
2 c1 = 1.000000000 x1 = -0.577350269
given for integrals c2 = 1.000000000 x2 = 0.577350269
3 c1 = 0.555555556 x1 = -0.774596669
1 n c2 = 0.888888889 x2 = 0.000000000
 g( x )dx   ci g( xi ) c3 = 0.555555556 x3 = 0.774596669
1 i 1
4 c1 = 0.347854845 x1 = -0.861136312
c2 = 0.652145155 x2 = -0.339981044
as shown in Table 1. c3 = 0.652145155 x3 = 0.339981044
c4 = 0.347854845 x4 = 0.861136312

http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature Formulas
12

Table 1 (cont.) : Weighting factors c and function arguments x used in


Gauss Quadrature Formulas.
Points Weighting Function
Factors Arguments
5 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
6 c1 = 0.171324492 x1 = -0.932469514
c2 = 0.360761573 x2 = -0.661209386
c3 = 0.467913935 x3 = -0.2386191860
c4 = 0.467913935 x4 = 0.2386191860
c5 = 0.360761573 x5 = 0.661209386
c6 = 0.171324492 x6 = 0.932469514

http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature13 Formulas

1
So if the table is given for  g ( x )dx integrals, how does one solve
1
a , b
b
 f ( x )dx ? The answer lies in that any integral with limits of
a
can be converted into an integral with limits  1, 1 Let

x  mt  c
If x  a, then t  1
Such that:
If x  b, then t 1

ba
m
2
http://numericalmethods.eng.usf.edu
Arguments and Weighing Factors for n-point Gauss
Quadrature Formulas
14

Then ba Hence


c
2

ba ba ba


x t dx  dt
2 2 2

Substituting our values of x, and dx into the integral gives us

ba baba
b 1


a
f ( x )dx  1  2
f t  
2  2
dt

http://numericalmethods.eng.usf.edu
Example 1
15

b
For an integral  f ( x )dx , derive the one-point Gaussian Quadrature
a
Rule.
Solution
The one-point Gaussian Quadrature Rule is
b
 f ( x )dx  c1 f  x1 
a

http://numericalmethods.eng.usf.edu
Solution
The two unknowns x1, and c1 are found by assuming that the
formula gives exact results for integrating a general first order
polynomial,

f ( x )  a0  a1 x.
b b

 f ( x)dx   a
a a
0  a1 x dx
b
 x2 
 a 0 x  a1 
 2 a

 b2  a 2 
 a0 b  a   a1  
 2 

16 http://numericalmethods.eng.usf.edu
Solution

It follows that
b

 f ( x)dx  c a
a
1 0  a1 x1 

Equating Equations, the two previous two expressions yield

 b2  a 2 
a0 b  a   a1    c1 a0  a1 x1   a0 (c1 )  a1 (c1 x1 )
 2 

17 http://numericalmethods.eng.usf.edu
Basis of the Gaussian Quadrature Rule

Since the constants a0, and a1 are arbitrary

b  a  c1

b2  a 2
 c1 x1
2
giving

c1  b  a
ba
x1 
2

18 http://numericalmethods.eng.usf.edu
Solution

Hence One-Point Gaussian Quadrature Rule

ba
b

 f ( x)dx  c1 f x1   (b  a ) f  
a  2 

19 http://numericalmethods.eng.usf.edu
Example 2
20

a) 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  2100t  

b) Find the true error, E t for part (a).

c) Also, find the absolute relative true error, a for part (a).

http://numericalmethods.eng.usf.edu
Solution
21

First, change the limits of integration from [8,30] to [-1,1]


by previous relations as follows

30
30  8 1  30  8 30  8 
 f ( t )dt   
f x  dx
8 2 1  2 2 

1
 11  f 11x  19 dx
1

http://numericalmethods.eng.usf.edu
Solution (cont)
22

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

http://numericalmethods.eng.usf.edu
Solution (cont.)
23

Now we can use the Gauss Quadrature formula

1
11  f 11x  19 dx  11c1 f 11x1  19   11c 2 f 11x 2  19 
1

 11 f 11( 0.5773503 )  19  11 f 11( 0.5773503 )  19


 11 f ( 12.64915 )  11 f ( 25.35085 )
 11( 296.8317 )  11( 708.4811 )
 11058.44 m

http://numericalmethods.eng.usf.edu
Solution (cont)
24

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
http://numericalmethods.eng.usf.edu
Solution (cont)
25

b) The true error, Et , is


Et  True Value  Approximate Value
 11061.34 11058.44
 2.9000 m
c) The absolute relative true error, t , is (Exact value = 11061.34m)

11061.34  11058.44
t   100%
11061.34

 0.0262%
http://numericalmethods.eng.usf.edu
Derivation of the Trapezoidal Rule
Method Derived From Geometry
27

 f ( x )dx
1

The area under the y


a

f(x)
curve is a trapezoid.
The integral
b

 f ( x)dx  Area of
a
trapezoid
f1(x)
1
 ( Sum of parallel sides )( height )
2
1
  f ( b )  f ( a )( b  a )
2
 f ( a )  f ( b )
 ( b  a )  a b x
 2
Figure 2: Geometric Representation
http://numericalmethods.eng.usf.edu
Algoritma Metode Integrasi Trapezoida

 Definisikan y=f(x)
 Tentukan batas bawah (a) dan batas atas integrasi (b)
 Tentukan jumlah pembagi n
 Hitung h=(b-a)/n
 Hitung
h n 1 
L   f 0  2 f i  f n 
2 i 1 
Example

The vertical distance covered by a rocket from t=8 to t=30


seconds is given by:

30
  140000  
x    2000 ln    9.8t dt
8 140000  2100t  

a) Use single segment Trapezoidal rule to find the distance covered.


b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).
Example 1

The vertical distance covered by a rocket from t=8 to t=30


seconds is given by:


30
 140000  
x    2000 ln    9.8t dt
8 140000  2100t  

a) Use single segment Trapezoidal rule to find the distance covered.


b) Find the true error, for part (a).
c) Find the absolute relative true error, for part (a).
Solution
31

 f ( a )  f ( b )
a) I  ( b  a ) 
 2
a 8 b  30
 140000 
f ( t )  2000 ln    9.8t
140000  2100t 

 140000 
f ( 8 )  2000 ln    9.8( 8 )  177.27 m / s
140000  2100( 8 )

 140000 
f ( 30 )  2000 ln    9.8( 30 )  901.67 m / s
140000  2100( 30 )

http://numericalmethods.eng.usf.edu
Solution (cont)
32

177.27  901.67 
a) I  ( 30  8 ) 
 2

 11868 m

b) The exact value of the above integral is


30
 140000  
x    2000 ln    9.8t dt  11061 m
8 140000  2100t  

http://numericalmethods.eng.usf.edu
Solution (cont)
33

b) Et  True Value  Approximate Value


 11061 11868
 807 m

c) The absolute relative true error, t , would be

11061  11868
t   100  7.2959%
11061

http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
34

In Example 1, the true error using single segment trapezoidal rule was
large. We can divide the interval [8,30] into [8,19] and [19,30] intervals
and apply Trapezoidal rule over each segment.

 140000 
f ( t )  2000 ln   9.8t
 140000  2100t 
30 19 30

 f ( t )dt   f ( t )dt   f ( t )dt


8 8 19

 f ( 8 )  f ( 19 )  f ( 19 )  f ( 30 )
 ( 19  8 )   ( 30  19 ) 
 2   2
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
35

With

f ( 8 )  177.27 m / s
f ( 30 )  901.67 m / s
f ( 19 )  484.75 m / s
Hence:

177.27  484.75   484.75  901.67 


30


8
f (t )dt  (19  8) 
 2   ( 30  19)  2 

 11266 m
http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
36

The true error is:


Et  11061 11266
 205 m

The true error now is reduced from -807 m to -205 m.

Extending this procedure to divide the interval into equal


segments to apply the Trapezoidal rule; the sum of the
results obtained for each segment is the approximate
value of the integral.

http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
37

y
f(x)
Divide into equal segments
as shown in Figure 4. Then
the width of each segment is:
ba
h
n
The integral I is:

b
I   f ( x )dx
a a
ba ba ba b x
a a2 a3
4 4 4

Figure 4: Multiple (n=4) Segment Trapezoidal Rule

http://numericalmethods.eng.usf.edu
Multiple Segment Trapezoidal Rule
38

The integral I can be broken into h integrals as:


b ah a  2h a  ( n 1 )h b

 f ( x )dx   f ( x )dx   f ( x )dx  ...   f ( x )dx   f ( x )dx


a a ah a  ( n  2 )h a  ( n 1 )h

Applying Trapezoidal rule on each segment gives:

b
ba n 1  
 f ( x )dx   f ( a )  2  f ( a  ih )  f ( b )
a 2n   i 1 

http://numericalmethods.eng.usf.edu
Example 2
39

The vertical distance covered by a rocket from to seconds is


given by:
30
 140000  
x    2000 ln    9.8t dt
8 140000  2100t  

a) Use two-segment Trapezoidal rule to find the distance covered.


b) Find the true error, E t for part (a).
c) Find the absolute relative true error, a for part (a).

http://numericalmethods.eng.usf.edu
Solution
40

a) The solution using 2-segment Trapezoidal rule is

ba n 1  
I  f ( a )  2  f ( a  ih )  f ( b )
2n   i 1  

n2 a 8 b  30

ba 30  8
h   11
n 2

http://numericalmethods.eng.usf.edu
Solution (cont)
41

Then:
30  8  2 1  
I  f ( 8 )  2  f ( a  ih )  f ( 30 )
2( 2 )   i 1  
22
  f ( 8 )  2 f ( 19 )  f ( 30 )
4

22
 177.27  2( 484.75 )  901.67
4

 11266 m

http://numericalmethods.eng.usf.edu
Solution (cont)
42

b) The exact value of the above integral is


30
 140000  
x    2000 ln    9.8t dt  11061 m
8 140000  2100t  

so the true error is

Et  True Value  Approximate Value

 11061  11266

http://numericalmethods.eng.usf.edu
Solution (cont)
43

The absolute relative true error, t , would be

True Error
t   100
True Value

11061  11266
  100
11061

 1.8534%

http://numericalmethods.eng.usf.edu
Solution (cont)
44

Table 1 gives the values n Value Et t % a %


obtained using multiple 1 11868 -807 7.296 ---
segment Trapezoidal rule 2 11266 -205 1.853 5.343
for: 3 11153 -91.4 0.8265 1.019
30 4 11113 -51.5 0.4655 0.3594
  140000  
x    2000 ln    9.8t dt 5 11094 -33.0 0.2981 0.1669
8 140000  2100 t  
6 11084 -22.9 0.2070 0.09082
7 11078 -16.8 0.1521 0.05482
8 11074 -12.9 0.1165 0.03560

Table 1: Multiple Segment Trapezoidal Rule Values

http://numericalmethods.eng.usf.edu

You might also like