You are on page 1of 18

The Islamic University of Gaza

Faculty of Engineering
Civil Engineering Department

Numerical Analysis
ECIV 3306

Chapter 22

Integration of Equations
Gauss Quadrature
• Gauss quadrature implements a strategy of
positioning any two points on a curve to define
a straight line that would balance the positive
and negative errors.
• Hence, the area evaluated under this straight
line provides an improved estimate of the
integral.
Two points Gauss-Legendre Formula
• Assume that the two Integration points are xo and x1 such that:
ba
2
I  f ( x).dx c f ( x )  c
ba
1 1 2 f ( x2 )

2

• The object of Gauss quadrature is to determine the equations of the


form:

I  c0 f ( x0 )  c1 f ( x1 )
• c0 and c1 are constants, the function arguments x0 and x1 are
unknowns…….(4 unknowns)
Two points Gauss-Legendre Formula

• Thus, four unknowns to 1

be evaluated require four c0 f ( x0 )  c1 f ( x1 )   1 dx  2


1
conditions. 1
c0 f ( x0 )  c1 f ( x1 )   x dx  0
1
• If this integration is exact 1
2
1st
for a constant, order, c0 f ( x0 )  c1 f ( x1 )   x dx 
2

3
2nd order, and 3rd order 1
1
functions: c0 f ( x0 )  c1 f ( x1 )   x 3 dx  0
1
Two points Gauss-Legendre Formula

• Solving these 4 equations, we can determine c1, c2,


x1 and x2.
The weighting factors are : c0  c1  1
The Integratio n points are :
1
x0    0.5773503
3
1
x1   0.5773503
3
 1   1 
I  f  f 
 3  3
Two points Gauss-Legendre Formula
• Since we used limits for the previous integration from –1 to 1
and the actual limits are usually from a to b, then we need
first to transform both the function and the integration from
the x-system to the xd-system

x  b   1 f(x) f()
f(x1)

x  a    1 f(xo)
ba ba
x  
2 2
ba x
dx  d xo x1
2 a b 
-1 1
Higher-Points Gauss-Legendre Formula

1
I   f ( )d
1
i using n Gauss points :

n
I   ci f (i )  c1 f (1 )  c2 f ( 2 )  .....  cn f ( n )
i 1
Multiple Points Gauss-Legendre
Points Weighting factor Function argument Exact for
2 1.0 -0.577350269 up to 3rd
1.0 0.577350269 degree

3 0.5555556 -0.774596669 up to 5th


0.8888889 0.0 degree
0.5555556 0.774596669

4 0.3478548 -0.861136312 up to 7th


0.6521452 -0.339981044 degree
0.6521452 0.339981044
0.3478548 0.861136312

6 0.1713245 -0.932469514 up to 11th


0.3607616 -0.661209386 degree
0.4679139 -0.238619186
0.4679139 0.238619186
0.3607616 0.661209386
0.1713245 0.932469514
Gauss Quadrature - Example

Find the integral of:


f(x) = 0.2 + 25 x – 200 x2 + 675 x3 – 900 x4 + 400 x5
Between the limits 0 to 0.8 using:

– 2 points integration points (ans. 1.822578)


– 3 points integration points (ans. 1.640533)
Improper Integral
• Improper integrals can be evaluated by making a change
of variable that transforms the infinite range to one that
is finite,
1
b 1/ a
1

a
f ( x)dx   2
1/ b
t
f  dt
t 
ab  0

b A b

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


  A

A
1
0
1 Can be evaluated by
 f ( x)dx  1/ A t 2 f  dt
t 
Newton-Cotes closed
formula
Improper Integral - Examples

• .  dx
 
0.5 1
(t )
1
dt  
0.5 1
dt
2 x( x  2) 0 t 2
1/ t  2 0 1  2t
 
• . 0
e y
sin y dy 
2

2

0
e y
sin y dy 
2
 2
e  y sin 2 y dy
 1/ 2 1 1 / t
 
y
e sin y dy 
2
2
e sin 2
(1 / t ) dt
2 0 t
 
• . 2
ye y
dy   2
2
ye y
dy   2
ye y dy

 1/ 2 1 1 / t
 
y
ye dy  3
e dt
2 0 t
Multiple Integration

• Double integral:

d b
I   f ( x, y ) dx dy
y c x a
Multiple Integration using Gauss
Quadrature Technique
.  1
x •b  & x  a    1
ba ba ba
x   & dx  d
2 2 2
• .
y  d   1 & x  c    1
d c d c d c
y   & dy  d
2 2 2
• .
d c ba
d b 1 1
I    f ( x, y ) dx dy    f ( , ) d d
y c x a
2 2 1 1
Multiple Integration using Gauss Quadrature
Technique
Now we can use the Gauss Quadrature technique:
d c ba n n
I 
2

2 j 1 i 1
c j ci f (i , j )

If we use two points Gauss Formula:


d c ba 2 2
I
2

2 j 1 i 1
c j c j f (i , j )
d c ba 2 1 1
I
2

2 j 1
c j [c1 f ( 
3
, j )  c2 f ( , j )]
3
d c ba 1 1 1 1
I [c1{c1 f (  , )  c2 f ( , )} 
2 2 3 3 3 3
1 1 1 1
c2 {c1 f (  , )  c2 f ( , )}]
3 3 3 3
Double integral - Example

• Compute the average temperature of a rectangular heated


plate which is 8m long in the x direction and 6 m wide in the y
direction. The temperature is given as:

T ( x, y)  2 xy  2 x  x 2  2 y 2  72

• (Use 2 segment applications of the trapezoidal rule in each


dimension)
Double integral - Example

6 8
I   (2 xy  2 x  x 2  2 y 2  72)dxdy
0 0

Multiple Trapezoida l rule (n  2)  I  2688, Tavg  2688 /( 6  8)  56


Simpson 1 / 3 rule  I  2816, Tavg  2816 /( 6  8)  58.6667

HW: Use two points Gauss formula to solve the problem

You might also like