Você está na página 1de 16

ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1 of 6- 16

NUMERICAL INTEGRATION (C&C 4


th
ed. PART 6
!"s#c Issues #$ I$te%r"t#o$
What does an integral represent?
b
a
f (x dx

! AREA
d b
c a
g(x" # dx d#


! VOLUME
$asic definition of an integral:
b
a
f (x dx

!
n
%
n
% 1
lim f (x x

sum of &e#%ht x '#dth


O()ect#*e+
&'aluate I !
b
a
f (x dx

(ithout doing calculation anal#ticall#)


When (ould (e (ant to do this?
1) Integrand is too complicated to integrate anal#ticall#" e)g)"

* +cos(1+ x
1 ++),x
e
+),x
dx
+
*

*) Integrand is not precisel# defined b# an e-uation"


i)e)" (e are gi'en a set of data (x
i
".(x
i
" i!1")))"n)
/ll methods are applicable to integrands that are functions)
Some are applicable to tabulated 'alues)
,e- co$ce.ts+
1) Integration is a summing process) 0hus 'irtuall# all numerical approximations
can be represented b#
I !

f(xdx
a
b
!

(
i
f(x
i
+&
t
i+
n


where: w
i
= weights
x
i
= sampling points
E
t
= truncation error
*) 1losed 2 3pen forms:
1losed forms include the end points a 2 b in x
i
)
3pen forms do not)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-* of 6- 16
Ne/to$0Cotes I$te%r"t#o$ (C&C 4
th
ed.1 Ch".. 211 .. 234+
0o e'aluate:
+
f(xdx
n
x
x

1) 4i'ide 5x
o
" x
n
6 into n segments (n 1
*) Within each segment approximate .(x b# an m
th
order pol#nomial"
p
m
(x ! a
+
7a
1
x 7 a
*
x
*
7 8 7 a
m
x
m
The polynomial order need not be the same for all segments. Then:

f(xdx
+
x
n
x

!

p
m
1
(xdx
+
x
1
x

7

p
m
*
(xdx
+
x
*
x

7 8 7

p
m
n
(xdx
+
x
n
x

the m
i
's may be the same or different. Integrate each polynomial exactly.
Order m of polynomial p
m
(x) determines Ne/to$0Cotes 4or5u6"s+
m Polynomial Formula Error
1 linear Trapezoid O(h
2
)
2 quadratic Simpson's 1/3 O(h
4
)
3 cubic Simpson's 3/8 O(h
4
)
4 quartic Boole's Rule O(h
6
)
5 quintic Boole's Rule O(h
6
)
Tr".e7o#d Ru6e (C&C 4
th
ed.1 8ec. 21.11 .. 236+
9or each segment (or one segment" let .(x p
1
(x ! a
+
7a
1
x
a) 4etermine a
+
7 a
1
x from Ne(ton 44 Pol#nomial:
i i 1
1 i-1 i-1
i i 1
f(x f(x
p (x !f(x (x x
x x


b) Integrating 5use trape:oid area formula" 121 ;
th
ed)" $ox *1)16:
i
i 1
x
i i 1
1 i i 1
x
f (x f (x
p (xdx (x x
*

c) 0runcation &rror 5121 ;


th
ed)" $ox *1)*6:
i
i 1
x
< i i 1
i i 1 i i 1
x
f (x f (x 1
(xdx (x x (x x f =(
* 1*

Integrates a linear function correctl#: f =( ! +)


&asil# deri'ed b# considering 0a#lor Series)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-< of 6- 16
Co5.os#te Tr".e7o#d Ru6e (C&C 4
th
ed.1 8ec. 21.1.21 .. 233+
9or multiple segments" sum segment areas to approximate integral:
I !
x
n
x
+
f (xdx


!
n
i i 1
i i 1 ti
i 1
f(x f(x
(x x &
*

+ 1
+
1
]


(here &
ti
is truncation error in i
th
inter'al)
If data are e'enl# spaced" i)e)" x
i
> x
i-1
!

x
n
x
+
n
! h for i!1")))"n
I (x
n
> x
+

n 1
+ i n
i 1
f(x * f(x f(x
*n

_
+ +

,


or: I
n 1
+ i n
i 1
1 1
h f(x f(x f(x
* *

1
1 + +
1
]


It can be sho(n that
n
i
i !1
f (

( ) nf
so the error is
&
t
! >

nh
<
1*
f
! >

(x
n
x
+
h
*
1*
f
NOTE: C&C notation is different
h = (x
n
-x
0
)/n ==> (b-a)/n and
< <
t
*
nh (b a
& = =
1*
1*n


8#5.so$ 19: Ru6e (C&C 4
th
ed.1 8ec. 21.2 .. 2;6+
Improving the estimate of the integral
fit Lagrange polynomials to three points (a pair of segments)
integrate those polynomials to obtain a general formula for integrals.
the resulting function must correctly integrate quadratic polynomials.
&'aluate
n n
+ +
x x
*
x x
f (xdx p (xdx

9or each pair of segments use ?agrange Interpolating Pol#nomial:
i i 1 i 1 i 1 i 1 i
* i 1 i i 1
i 1 i i 1 i 1 i i 1 i i 1 i 1 i 1 i 1 i
(x x (x x (x x (x x (x x (x x
p (x f (x f (x f (x
(x x (x x (x x (x x (x x (x x
+ +
+
+ + + +

+ +

If points are evenly spaced" integrating #ields:

i 1
i 1
x
i 1 i i 1 i 1 i i 1
i 1 i 1
x
f (x ;f (x f (x f (x ;f (x f (x
f (xdx (x x h
6 <
+

+ +
+
+ + + +

Note: If n is
doubled" h h@*
and &
t
&
a
@;
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-; of 6- 16
Simpson's 1/3 Rule Alternative derivation
1hoose (eights in
0
f (-1) +
1
f (0) +
2
f (1)
so that o'er 5 -1" 716:
a)
1
+ 1 *
1
1 dx * (1 (1 (1
+

+ +

1
+ 1 *
1
x dx + ( 1 (+ ( 1
+

+ + +

1
* * *
+ 1 *
1
*
x dx ( 1 (+ ( 1
<
+

+ + +


from *nd e-uation:
+
!
*
A from <rd:
+
7
*
! *@<A
hence
+
!
*
! 1@< and from 1st e-uation
1
! ;@<
b) Beneral formula for e'enl# spaced points (note inter'al abo'e had (idth of *:
( ) ( ) ( )
i 1
i 1
x
i 1 i i 1
* i 1 i 1
x
f x ;f x f x
p (xdx (x x
6
+

+
+
+ +

c) &rror:
; (;
* * +
x x
i71 i 1
x x
i-1 i-1
1
f (x dx p (x dx (x x h f (
1C+

+



Integrates a cubic exactl#: .
(;
( ! +)
$ecause (x
*
x
+
! *h" the error term becomes (121 ;
th
ed)" 0able *1)*" p) 6+;:

,
, (; (; i71 i-1
1 (x x
h f ( ! f (
D+ *CC+


Der#*"t#o$ o4 8#5.so$ 19: Ru6e error ter5
?et: x ! -h" +" 7h
h *
o o o
-h
x
! f(xdx ! (f 7 xf 7 f 7 dx
*E
I

K

! *hf
o
7
*h
<
6
f
o
7
*h
,
,E
f
o
5;6
7 ) ) ) (onl# odd po(ers of h sur'i'e

S !
h
<
f -h ( ) 7 ;f(+ 7 f(7h
[ ]

h
<
6f
o
++ +
*h
*
*
f
o
++ +
*h
;
;E
f
o
;
[ ]
+K



1
]
1
< ,
5;6
+ +
*h *h
*hf f f
6 <(;E
+ + +L
$oth ha'e onl# odd terms) I - S ! 0runcation &rror:
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-, of 6- 16
!

(*hh
;
1C+
f
5;6
7 *h +(h
6
!
, (;
1
h f (
D+

Co5.os#te 8#5.so$ 19: Ru6e (C&C 4
th
ed.1 8ec. 21.2.21 .. 2;;
Sum pairs of segment areas to approximate the gi'en integral:
I !

f(xdx
x
+
x
n

!

(x
i+1
x
i1

f(x
i 1
+;f(x
i
+f(x
i+1

6
+&
ti



_
,
i1"<",
n 1


If all data are evenly spaced" i)e)" x
i
> x
i-1
! h for i!1")))"n:
n 1 n *
+ i F n
i 1"<", F *";"6
h
I f (x ; f (x * f (x f (x
<


1
1
+ + +
1
]

It can also be sho(n that

f
; ( )
(
i

i !1
n


(;
nf
so:

; , ,
(; (; (; n + n +
t ;
(x x h (x x nh
& f f f
1C+ 1C+ 1C+n


Note: If n is doubled, h--> h/2 and E
t
--> E
t
/16
8#5.so$ :93 Ru6e (C&C 4
th
ed.1 8ec. 21.2.:1 .. 6<1+
9or each triple of segments" let .(x p
<
(x ! a
+
7 a
1
x 7 a
*
x
*
7 a
<
x
<
a) Geplace a
+
7 a
1
x 7 a
*
x
*
7 a
<
x
<
(@ ?agrange Pol#nomials and integrate
b) 9or e'enl# spaced points:
<
+ 1 * < + 1 * <
< < +
+
x
x
f(x <f(x <f(x f(x f(x <f(x <f(x f(x
p (xdx (x x <
C C
h
+ + + + + +


c) &rror:

f(xdx
x
+
x
<
!

p
<
(xdx
x
+
x
<

C+
1
(x
<
x
+
h
;
f
(;
(
,
; (; , (; (; < +
< +
( 1 <
( ( ( (
C+ C+ 6;C+
t
x x
E x x h f h f f


ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-6 of 6- 16
Notes: 1) 1omposite Simpson 1@< Gule and Simpson <@C Gule errors are
; (; ; (; n + n +
(x x (x x
h f 's) h f
1C+ C+


Simpson 1@< rule is slightl# more accurate o'er the inter'al 5x
+
" x
n
6 (hen
the t(o methods use the same 'alue of h)
$ut both methods ha'e the s"5e order of accurac#)
*) Simpson <@C Gule re-uires multiples of three segments)
Simpson 1@< Gule re-uires e*e$ number of segments)
<) 1an use a combination of 0" S 1@<" and@or S <@C (hen number of
segments is neither e'en nor di'isible b# < or (hen data in une'enl#
spaced)
Higher order does not always yield higher accuracy.
E="5.6e+ I !

c e
x
*
dx
+)*
1),

! 1)+++++
n 0rap) Simp) 1@< Simp) <@C
1 1)+,1D1
* 1)++;DDH +)DCD<,
< 1)++1CIH +)DD,61
; 1)+++DD +)DDD6,
6 1)+++;* +)DDDD;H +)DDDC,
C 1)+++*< +)DDDDCH
D 1)+++1D +)DDDDCH
1* 1)+++11 1)+++++H 1)+++++H
1, 1)++++C 1)+++++H
16 1)++++6 1)+++++H
<* 1)++++1
6; 1)+++++ /steris% (H denotes more accurate ans(er for each n)
Ne/to$0Cotes I$te%r"t#o$ 00 Other C"ses+
1) N1 formulas can be deri'ed for an# number of segments and spacing)
Just integrate ?agrange Pol#nomial to get (eight on each 'alue of function:
f(x
i
" i ! +")))"nA
9ormula can be open or closed)
*) 1an al(a#s use multiple-application 0rape:oidal Gule)
1an use a Simpson Gule (hen adFacent segments ha'e e-ual hKs)
<) Integrate interpolating spline)
See C&C 4
th
ed.,able !".! Cl#sed f#$%&las, p. '(4, and able !".4 Open f#$%&las, p. '().
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-I of 6- 16
R#ch"rdso$ E=tr".o6"t#o$ (C&C 4
th
ed.1 8ec. 22.2.11 .. 612
Bi'en t(o numerical estimates obtained using different hLs" compute a higher-order
estimate)
8che5e+
Starting (ith a step si:e h
1
" the exact 'alue of some operation / is:
A ! /(h
1
7 O (h
1
n

Suppose (e reduce step si:e to h


*
A ! /(h
*
7 O (h
*
n

Multipl#ing the second e-uation b# r ! (h


1
@h
*

n
and then subtracting the
first e-uation #ields [where the bracketed error terms tend to cancel]:
(r-1) A = r A(h
2
) A(h
1
) + [r O(h
2
n
) O(h
1
n
)]
A !
n
1
* 1
*
n
1
*
h
/(h /(h
h
h
1
h
_


,
_


,
7 3(h
1
m
m n71
R#ch"rdso$ E=tr".o6"t#o$ E="5.6e 00 Nu5er#c"6 D#44ere$t#"t#o$ (C&C 4
th
ed.1 8ec. 2:.21 .. 6:2+
4 !
n
1
* 1
*
n
1
*
h
4(h 4(h
h
h
1
h
_


,
_


,
Start (ith 3(h
*
centered first difference approx) from 0able *<)<:
i i 1 1
i
f(x h f(x h f f
f (x 4(h
*h *h

+

Substituting h
*
! h and h
1
! *h" Gichardson &xtrapolation #ields the next highest
order centered first-difference formula in 0able *<)<:
f L(x
i
! (1@< 5 ; 4(h > 4(*h 6 7 O (h
;
!
!
1 1 * *
1 1 1
; (f f (f f
< *h ;h

1

1
]
7 O (h
;
!
!
* 1 1 *
(-f Cf Cf f
1*h

+ +

7 O (h
;

ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-C of 6- 16


Richardson Extrapolation Example -- Numerical Integration
(C&C 4
th
ed.1 E="5.6e 22.11 .. 61:+
Suppose (e use the 0rape:oidal Gule to integrate) If (e use step si:e h
I ! 0(*h 7 O(;h
*
)
0o impro'e estimate" $ed&ce step si:e:
I ! 0(h 7 O(h
*
)
1ombining to eliminate error of order h
*
#ields
*
;
*
* 0(h 0(*h
I 3(h
* 1

! 5 ; 0(h > 0(*h 6 7 O(h


;

1) Breater (eight is placed on the more accurate estimate
*) Weighting coefficients sum to unit#" i) e) (; > 1@< ! 1
<) /ctuall# SimpsonKs 1@< rule: (h@<5.(x
i-1
7 ;.(x
i
7 .(x
i71
6
Ro5(er% I$te%r"t#o$ (C&C 4
th
ed.1 8ec. 22.21 .. 612
S#stematic application of Gichardson extrapolation (ith: h
i71
! h
i
@*
!e$e4#t: Bet a high-order Ne(ton-1otes formula easil#)
1an (atch con'ergence)
Ge$er"6 4or5u6"1 C&C E>. (22.3+
F"% 1
% 1
F 1"% 1
F"%
% 1
; I I
I
; 1


F"% 1 F 1"% 1
F 1"% 1
% 1
I I
I
; 1
+
+

+
(here: F ! le'el of subdi'ision
% ! le'el of integration 3(h
*%

T"(u6"r Or%"$#7"t#o$ o4 Ro5(er% I$te%r"t#o$


I
F"%
! I
F71"%-1
7
F 1"% 1 F"% 1
% 1
I I
; 1
+

F N 0rap)
segs)
n
% ! 1
3(h
*

0rap
% ! *
3(h
;

Simp 1@<
% ! <
3(h
6

$oole ,
% ! ;
3(h
C

% ! ,
3(h
1+

1 1 I
1"1
I
1"*
I
11:
* * I
*"1
I
212
< ; I
:11
; C
, 16
% 1
1
; 1

! 1@< 1@1, 1@6< 1@*,,


ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-D of 6- 16
Ro5(er% I$te%r"t#o$+ 1ontinuation of earlier integration example)
E="5.6e 1+ I !
*
1),
x
1)*
ce dx

! 1)+++++++
Tr". Tr". 8#5.so$ !oo6e
$ O(h
2
O(h
4
O(h
6
O(h
3

1 1)+,1D+D6 +)DCD<;CD 1)+++<;+< +)DDDDDI+
* 1)++;DCD1 +)DDD6,<< 1)+++++*; 1)+++++++
; 1)+++DCI< +)DDDDC+6 1)+++++++ 1)+++++++
C 1)+++*<** +)DDDDDCC 1)+++++++ 1)+++++++
16 1)++++,I* +)DDDDDDD 1)+++++++
<* 1)++++1;* 1)+++++++
6; 1)+++++<6
E="5.6e 2+
1
a
+
I (a71x dx

" ? 6
Tr". Tr".e7o#d 8#5. 19: !oo6e 20.t
$
O(h
2
O(h
4
O(h
6
O(h
3
O(h
1<

1 <),+++++ 1)*<D,C< 1)++*6+; 1)++++++ 1)++++++
* 1)C+;6CC 1)+1I;1, 1)++++;1 1)++++++
; 1)*1;*<< 1)++11*I 1)+++++1
C 1)+,;;+< 1)++++I1
16 1)+1<6,;
Example 3:
1
a
+
I (a71x dx

a = 1.5
Tr". Tr".e7o#d 8#5. 19: !oo6e 20.t
$
O(h
2
O(h
4
O(h
6
O(h
3
O(h
1<

1 1)*,++++ 1)++,D** 1)+++I,I 1)+++1*; 1)++++**
* 1)+66D;* 1)++1+C+ 1)+++1<; 1)++++**
; 1)+1I,;, 1)+++1D< 1)++++*;
C 1)++;,<1 1)++++<;
16 1)++11,D
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1+ of 6- 16
G"uss @u"dr"ture (C&C 4
th
ed.1 8ec. 22.:1 .. 62<
Re*&+$es, .(x to be explicitl# %no(n so (e can pic% an# x
i
App$#ach,
1
n 1
i i n
i +
1
f(xdx f(x G
+

(here:
i
! (eighting factors
x
i
! sampling points selected optimall#
G
n
! truncation error
Pick points & weights cleverly to integrate a polynomial of order (2n - 1) exactly.
For n = 2 Gauss Quadrature will be accurate for cubics.
Trapezoidal Rule is accurate for linear functions.
For
$?: exact result for pol#nomials of order up to and including ,
With < points (e (ant exact results for pol#nomials of order , o'er the inter'al 5-1"
716)
1
1
1dx
+

! * !
+
1 7
1
1 7
*
1
1
1
xdx
+

! + !
+
x
+
7
1
x
1
7
*
x
*
1
*
1
x dx
+

!

*
<
!
+
x
+
*
7
1
x
1
*
7
*
x
*
*
1
<
1
x dx
+

! + !
+
x
+
<
7
1
x
1
<
7
*
x
*
<
1
;
1
x dx
+

!

*
,
!
+
x
+
;
7
1
x
1
;
7
*
x
*
;
1
,
1
x dx
+

! + !
+
x
+
,
7
1
x
1
,
7
*
x
*
,
With s+x e-uations there are s+x un%no(ns"
i)e)" < un%no(n (eights (
+
"
1
"
*
and
< un%no(n sampling points (x
+
" x
1
" x
*
)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-11 of 6- 16
Sol'ing these six e-uations for the six un%no(ns results in:

+
! +),,,,,,,,6
1
! +)CCCCCCCCD
*
! +),,,,,,,,6
x
+
! >+)II;,D666D x
1
! +)+++++++++ x
*
! 7+)II;,D666D

I
+
f(x
+
7
1
f(x
1
7
*
f(x
*

See C&C able !!.", p. '!', f#$ -a&ss.Le/end$e f#$%&las, n 0 !, 1, 4, 2, and '.
G"uss @u"dr"ture Tru$c"t#o$ Error (C&C 4
th
ed.1 8ec. 22.:.41 .. 62A
In general" n sampling points (ill pro'ide an exact solution for a *n>1 order
pol#nomial) With n ! N of sampling points
G
n
!
[ ] ( )
[ ]
*n 1 ;
<
*(b a nE
(*n 1 (*nE
+

+
f
(*n
(
(similar to 121 except their n ! N pts)>1
$ecause (b-a ! h" the error (ith the composite Bauss rule is O (h
*n
globall# (ith n
! N of pts))
0his sho(s a superiorit# of order o'er the Ne(ton-1otes formulas)
3+/he$ #$de$ need n#t al4ays %ean h+/he$ acc&$acy.
Ar(#tr"r- #$ter*"6s+ Bauss Ouadrature: When the limits of integration are 5a"b6
instead of 5>1"716 (121" p) 6*1
We ha'e a solution for the integral
1
1
f(xdx
+

)
/ssume that there is a 'ariable x (hich is linearl# related to x
d
such that:
# ! a
+
7 a
1
x
If # ! a" corresponds to x

! 1 and # ! b" corresponds to x ! 1" then
a ! a
+
7 a
1
(1 and b ! a
+
7 a
1
(+ 1
Sol'ing these t(o e-uations #ields:
a
+
! (b7a@* and a
1
! (ba@*
(hich gi'es the change of 'ariables:
# !
*
a b +
7 x and d# !
b a
*

dx
0hus"
b
a
f(#d#

!
1
-1
(b a (b-ax b a
f dx
* *
+
+ + _

,


n 1
i i
i +
b a
f(#5x 6
*


(he x
i
are the tabulated Gauss points (Table 22.1) in C&C)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1* of 6- 16
E="5.6e 1+ &'aluate

2
1.2
-
<.2
e d- using <-pt Bauss Ouad:
1) 1hange of 'ariables: # !
(1), +)* (1, +)*x
*
+ +
! +)6, x 7 +)C,
d# !
*
* ) + , ) 1
dx ! +)6, dx
*) With
*
1),
#
+)*
e d#

! +)6,
*
1
5+)6,x +)C,6
1
e dx
+
+

I +)6,P
+
e
>5+)6,x
+
7+)C,6
*
7
1

e
>5+)6,x
1
7+)C,6
*
7
*

e
>5+)6,x
*
7+)C,6
*
Q
(here:
+
! +),,,,,,,,6 x
+
! >+)II;,D666D

1
! +)CCCCCCCCD x
1
! +)+++++++++

*
! +),,,,,,,,6 x
*
! 7+)II;,D666D
I
true
= 0.65882
I
gauss
0.65860, e
t
= 0.03%
Note: with 3 points, i.e., 2 segments: I
trap
= 0.66211, e
t
= 0.50%
I
Simp.1/3
= 0.65181, e
t
= 1.06%
E="5.6e 2+
1
+
cd#
* cos( #@* +

$ .ts Ro5(er% G"uss @u"d


1 * 1)+C*,<1I+ +)DDD,,1,I
* < 1)+++66++C 1)+++++C1*
; , +)DDDDD11; 1)++++++++
C D +)DDDDDDCI 1)++++++++
$ .ts Ro5(er% G"uss @u"d
1 * 3(h
*
3(h
;

* < 3(h
;
3(h
6

; , 3(h
6
3(h
1+

C D 3(h
C
3(h
1C

n ! number of panelsA pts ! number of points


ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1< of 6- 16
G"uss @u"dr"ture Bor5u6"s 4or 8.ec#"6 I$te%r"6s
In each of these schemes, f(x) is a well behaved function, that is,
continuously differentiable. Also each of these schemes has its own
tabulated sampling points and weighting factors (not in C&C).
Gauss-Legendre Gauss-Hermite
( )
1
1
f x dx
+

( )
*
x
e f x dx
+

Gauss-Laguerre log-weighted
( )
x
+
e f x dx
+

( ) ( )
1
+
ln x f x dx

Gauss-Chebyshev
( )
1
*
1
f x
dx
1 x
+

Ad*"$t"%es (A "$d D#s"d*"$t"%es (D o4 G"uss @u"dr"ture


/1 With n points obtain a formula that integrates pol#nomials 1" x" x
*
" )))" x
*n-1
because of *n free parameters: 'er# high order)
&xcellent for (ell-beha'ed functionsE
/* Special formulas are a'ailable and can be deri'ed for special (eighting
functions" and infinite and semi-infinite inter'als)
41 &rrors can depend upon f
(*n
( so the method is onl# dependable if high
order deri'ati'es are (ell beha'ed)
4* When composite Bauss formulas are applied (Bauss Ouadrature applied to
separate panels" endpoints cannot be reused as the# are (ith 0rape:oid"
Simpson and Gomberg)
4< With an adapti'e strateg# that selecti'el# subdi'ides inter'als (here
truncation error ma# be large" cannot reuse points as one can (ith 0rape:oid
and Simpson) Bauss also fails to pro'ide an estimate of local error as do
0rape:oid" Simpson" and Gomberg b# cle'er use of the same function 'alues
(ith different (eights)
4; Incon'enient to remember special Bauss points and Bauss (eights)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1; of 6- 16
Improper Integrals (C&C 4
th
ed., Sec. 22.4, p. 627)
1) Rse Bauss Ouadrature for that special inter'al)
*) 0ransform 'ariables on the outer portion of the inter'al) ($e(are of singularities at (hat
(as infinit#) 9or an# function that approaches :ero at least as fast as 1@x
*
as x
approaches infinit#" perform change of 'ariables:
x !
t
1
and dx ! >dt@t
*
b
x a
f(xdx

!
t 1@a
*
t 1@b
1 1
f ( dt
t
t

(**)*I
which is valid for ab > 0. For integration limits that pass through zero, implement the
integration in two (or three) steps:
b a b
a
f (x dx f (x dx f (x dx


+

where a > 0. 0he first integral ma# be e'aluated using e-uation (**)*I and the second
ma# be e'aluated using a Ne(ton-1otes formula or Bauss Ouadrature)
9or a detailed example (on the cumulative normal distribution), see C&C Example
22.6, page 629-630.
Multiple Integrals (C&C 4
th
ed., Sec. 21.5, page 608)
I !
b d
a c
f(x"#d#dx


Rse Ne(ton-1otes or Bauss -uadrature formulas in each dimension)
I !
b d b
n
F F
F 1
a c a
f(x"# d# dx (x f(x"# dx

1
1

1
]

m n
i iF i F
i 1 F 1
f(x "#



!
m n
i iF i F
i 1 F 1
f(x "#

If d ! d(x or c ! c (x" then 'alues of


iF

(ill depend upon x
i
)
A$other Ide"+ Monte 1arlo methods for multi'ariate integration) Gandoml# selected
points from (ithin the range of integration and a'erage function 'alues used) Sampling
error is

n (here n random points are generated)
ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-1, of 6- 16
I$te%r"t#o$ /he$ the I$te%r"$d co$t"#$s " s#$%u6"r#t- ($ot co*ered #$ C&C
In the following, the function f(x) is well behaved, i.e., it is continuously differentiable in the
neighborhood of the singularity of the integrand or its derivative. Here is an integral with a singularity at
the lower limit:
1
+
f (x
I dx problem at the singular point x ! +
x

In addition" if the deri'ati'e of the integrand goes to infinit#" it is possible that the error goes to
infinit# as (ell) /n example of this situation is:
u
+
I x f (xdx

0o integrate" (e need to control error near the singularit#)


4i'ide the integration region to isolate singularit#, then-------
A..ro"ch 1"+ 0r# to subtract out singularit# and numericall# integrate onl# the
remainder)
1onsider the case
u
+
x f (xdx


(here f(x is continuousl# differentiable at x ! +)
a Subtract out the singularit# at x ! +" and integrate numericall#:
u
+
5f(x - f(+6 x dx

Sere the brac%eted term in the integrand 'anishes at the singularit#


b Integrate the singularit# separatel#:
1),
u
+
u
1),
f (+ x dx f (+

c /dd the singularit# bac% in: I


1),
u
+
u
1),
5f(x - f(+6 x dx f (+ +

ENGRD 241 Lecture Notes Section 6: Numerical Integration Page 6-16 of 6- 16


A..ro"ch 1(+ &'en better" include the first deri'ati'e (hen isolating the singularit#" i)e)":
a Subtract out the singularit# at x ! +" and integrate numericall#:
u
+
5f (x - f (+ - xf L(+6 x dx

b Integrate the singularity separately:


[ ]
1), *),
u
+
u u
1), *),
f (+ xf (+ x dx f (+ f (+ + +

c Add the singularity back in:


1), *),
u
+
u u
1), *),
I 5f(x - f(+- x f (+6 x dx f (+ f (+ + +

A..ro"ch 2+ 0r# a change of 'ariables for part of inter'al near singularit#


u
a
+
x f (x dx

?et x ! #
*
" then dx ! *#d# !!T x
a

f(x dx ! *

#
*a71

f(#
*


d# 9or + U a U 1"
1 U *a71 so the singularit# is eliminated)
4oes not entirel# sol'e the problem" but ma%es it less se'ere)
Rse 0rape:oid or Simpson rule near the problem) 9or a ! V:
u u u
* * *
+ + +
f (x x dx f (# #(*#d# * f (# # d#

A..ro"ch :+ Integrate b# parts:
a a 1 a 1
x f(xdx x f(x x f L(xdx
+ +


A..ro"ch 4+ Rse the appropriate Bauss Ouadrature approaches speciali:ed for
the particular singular function (see abo'e)

Você também pode gostar