the purpose of chapter 5 is to develop the basic principles of numerical integration usefule words...
DESCRIPTION
The solution can not be found directly. A Real Problem Find the length of the curve from to.TRANSCRIPT
The purpose of Chapter 5 is to develop the basic principles of numerical integration
Usefule Words
integrate, integral积分(的) , integration积分(法) ,
quadrature求积分 , integrand 被积函数 definite integral定积分 , indefinite integral不定积分 , tra
pezoidal梯形(的) ,
composite trapezoidal quadrature复合求积公式algebraic accuracy 代数精度
The solution can not be found directly.
x dxx
dx
dy
22 )()( dydxds
2022 )()( dydxs
dxy 2021 )(
dxx 2021 sin
A Real ProblemFind the length of the curve from to .xy cos 0x
2
x
8961.1
2
2
4
2
4
2
0
2 sin1sin1()sin1sin1(2
4
xxxx
xxxx
)sin1sin1(2
2 2
2
0
2
xx
xx
9100.1
Definition Suppose that . A formula
with the property that
is called a numerical integration or a quadrature formula.
bxxxa M 10
M
jjj xffQ
0)(][
][][)( fEfQdxxfba
ba
)(xfy This definition implies that
a quadrature formula is dependent on the choice of and .jx j
Question arises:
(1) How to choose and ? jx j
(2) How to evaluate a quadrature formula?
5.1 Introduction to quadrature
Degree of Precision ( accuracy of formula)
Definition The degree of precision of a quadratrue formula is apositive integer such that for all polynomials of degree but for some polynomials ofdegree .
0][ iPE01 ][ nPEni
)(xPi
)(xPn 11n
n
][][)( fEfQdxxfba
If the degree of precision of a quadratrue formula is n, then
(1) The formula produces exact results for all with .
)(xPi ni
(2) The error term is of the form where k is a suitable constant and c is dependent on x.
][ fE )(][ )( cfkfE n 1
Example Prove that the degree of precision of the formula
)()()( bfafabdxxfba
2is only one.
Example Find constants and so that the formula)()()()( hfAhfAfAdxxfh 20 210
30
,0A 2A1A
has the highest possible degree of precision. Determine the the degree n.
(See Ex. 5.4 (P209))
49,0,
4 210h
AAh
A
Suppose that and are in [a,b], and and
Two useful theorems
Weighted Mean value Theorem for Integrals Suppose
],,[ baCf
the Riemann integral of g exists on [a,b], and g(x) does not
change sign on [a,b]. Then there exists a number c in (a,b) with
.)()()()( b
a
b
adxxgcfdxxgxf
1x 2x 1c 2c
are positive constants. Then a number exists between and 1x 2x
with .)()()(21
2211
ccxfcxfc
f
Derivation of Quadrature formulas
],,[ baCf
Let are M+1 equidistant nodes on the interval
and is the Mth Lagrange interpolating polynomial for .
Mxxx ,,, 10 ],[ ba
with truncation error
M
k
ba kMk
ba M
ba dxxLxfdxxPdxxf
0)()()()( ,
ba
M
ii
Mba M dxxxxf
MdxxPxffE
0
1
11 )())((
!)()()(][ )(
.)()()( ,
M
kkMkM xLxfxP
0
)(xf)(xPM
)]()([
)]()([)(
bfafab
xfxfhdxxfba
2
2 10
M=1 Trapezoidal Rule
)()()( fab
fE
12
3
M=2 Simpson’s rule
)(][ )( 45
90fhfE
)()(
)()()()(
bfba
fafab
xfxfxfhdxxfba
24
6
43 210
That is Then
See Th.5.1 and Cor.5.1, page 204
(Newton--Cotes formulas)
),(12
][2
)(3
10 cfh
ffh
dxxfb
a
M=1 Trapezoidal Rule
abh
)( 01
10
01
01
10
101 )()()()( xx
hf
xxh
fxxxx
xfxxxx
xfxP
))((2
)()(
))((2
)()()(
101
01
10
101
1
xxxxcf
xxhf
xxh
f
xxxxcf
xPxf
)(
1
0
1
0
1
0
))((2
)()()( 101
01
10 x
x
x
x
x
xdxxxxx
cfdxxx
hf
xxh
fdxxf )(
03
10 12)()(
2h
cfff
h
M=2 Simpson’s rule
),(90
)()(4)(3
)( )4(5
210 fh
xfxfxfh
dxxfb
a 2
abh
))(())(()(
))(())(()(
))(())(()()(
1202
102
2101
201
2010
2102 xxxx
xxxxxf
xxxxxxxx
xfxxxx
xxxxxfxP
))()((!3
)()( 2101
2 xxxxxxcf
xE
Integrating P2(x) on [x0, x2] directly provides only an error term involving f (3). By approaching the problem in another way, a higher-order term involving f (4) can be derived.
Expand f(x) about x1 in the third Taylor polynomial.
41
1)4(
21
121
1111 )(
!4)()(
!3)()(
!2)())(()()( xx
cfxx
xfxx
xfxxxfxfxf
Integrating f(x) on [x0, x2] gives
2
0
2
0
21
121
1111 )(
!3)()(
!2)())(()()(
x
x
x
xdxxx
xfxx
xfxxxfxfdxxf
,)()(4)(3
),( 210 xfxfxfh
hfT
)(12
)()(2)()( 2)4(
2
2210
1 cfh
hxfxfxf
xf
).(90
][ )4(5
cfh
fE
Then (Simpson’s rule)
))((2
)()()( 101
01
10 xxxx
cfxx
hf
xxh
fxf
)(
Differentiating f(x) and evaluating f(x0) give the forward-difference formulah
cfh
ffxf
2)()( 01
0
Interpolating f(x) with nodes x0 and x1
Expand f(x) in the 3rd Taylor polynomial about x1, evaluate f(x0) and f(x2), and then add them.
.)(!4
)(2
0
41
1)4(
x
xdxxx
cf
and
Example Use quadrature formulas (5.4) to (5.7) to approximate the integral .))sin((
10 41 dxxe x
Solution ).sin()( xexf x 41 Let The result of using the trapezoidal rule with h=1 is
..))()(()()( 8607901021
2 1010 ffffhdxxf
Using Simpson’s rule with h=1/2, we have ..))().()(()()( 32128115040
614
3 21010 ffffffhdxxf
For Simpson’s 3/8 rule with h=1/3, we obtain
..))()/()/()(( /
)()(
3144011323313081
3383
321010
ffff
ffffhdxxf
The result of using the Boole’s rule with h=1/4 is
..))()/()/()/()(( /
)()(
3085911743322112413207901
73212327452
4321010
fffff
fffffhdxxf
30825060461.
1
0 41 dxxe x ))sin((30825060461.
860790.T
321281.S
2062.1)1()5.0(2)0(25.0
2 fffT
2836.1)1()75.0(2)5.0(2)25.0(2)0(225.0
4 fffffT
Composite
Quadratrue Formulas
))1()875.0(2)75.0(2)625.0(2
)5.0(2)375.0(2)25.0(2)125.0(2)0((2125.0
8
ffff
fffffT
5.2 Composite Trapezoidal and Simpson’s Rule
. ,and ,, , Where. with],[
lssubinterva tequidistan into devided is],[ that Suppose
bxa xMkM
abhxx
Mba
Mkk
01 10
)(),( and )()()( ) ,( fhabhfEbfxfafhhfT TM
jj
21
1 122
2
Then the composite trapezoidal rule is expressed as follows:
. ,and 2 ,, , Where. with],[
lssubinterva tequidistan 2 into devided is],[ that Suppose
bxa xMkM
abhxx
Mba
Mkk
201 102
)(),( and
)()( )()(),(
)( 44
112
1
12
180
423
fhabhfE
bfxfxfafhhfS
S
M
kk
M
kk
Then the composite Simpson’s rule is expressed as follows:
Example2 Approximate using the given entries .
a. Use the Composite Trapezoidal rule .
b. Use the Composite Simpson’s rule .
94569080210281
8187
1
10 .)()()(sin
,,.
k
ixfffdxx
xhMa
dxx
x
10
sin
0.841470910.87719257/80.90885163/40.93615565/80.95885101/20.97672673/80.98961581/40.99739781/81.00000000f(x)=sinx/xx
94608320
4210381
81824
112
3
12
10
.
)()()()(sin,,.
i
ii
i xfxfffdxx
xhMb
Solution
Example3 Determine the values M and h such that the
truncation error Es(f, h) is less than when the
composite Simpson’s rule is used to approximate .dxx
72
1
9105
Solution
)(),( )( 44
180fhabhfES
.)(x
xf 1Let
.)( and )(,)( ,)( )(5
4432
24621x
xfx
xfx
xfx
xf
The first four derivatives of f are
),(),( )( 44
180fhabhfES
According to we have
.),( 94
54
54 105
48224
1802724
18027
hhx
hhfES
So h< 0.0221336 and M=(b-a)/2h> 112.95.In consideration of M being a positive integer, the result is M= 113 and h=1/2M.
5.3 Recursive Rules and Romberg IntegrationRecursive Quadrature RulesRecursive Trapezoidal Rules
J
abh
2
a b
.2
Where.2
)0( 010ab
abhffh
T
Let
.2
where,2
)0( 2
2 2
)1( 11120210ab
hhfT
hfffh
fffh
T
)222(2
)( 212210 MM fffffh
JT
)()22(2
221
123122220 MMM fffhffffh
M
kkfh
JT1
122)1(
Then,
,2
)1(
2 2
222 2
)2(
31
3142043210
ffhT
ffhfffh
fffffh
T
.2
where 2
abh
Example1 Approximate using 51
1 dxx . (3) and )(, )(),( TTTT 210
ln 5≈1.6094379124
.4000002 ])5()1([2
)0(,15,0 .ffhThJ
.866666.1 )3(2
)0()1(,2
15,1 1
fhT
ThJ
.683333.1 )]4()2([2
)1()2(,12
15,2 2
ffhT
ThJ
.628968.1 )]5.4()5.3()5.2()5.0([2
)2()3(
,5.02
15,3 3
ffffhT
T
hJ 1 5
Recursive Simpson Rules
MMM ffffffffh
JTJT
2224212310 )(2)(43
3)1()(4
)(JS
Recursive Boole Rules
15)1()(16)(
JSJS
JB
)222(2
)1( 222420 MM fffffh
JT
)222(2
)( 212210 MM fffffh
JT
Richardson’s Improvement
. ])()([)(, 4000002512
015 .ffhTh
..1 )()()(, 866666320
12 fhT
Th
.. )]()([)()(, 68333314221
21 ffhT
Th
.. )].().().().([)()(,. 62896815453525022
350 ffffhT
Th
1
Example1 Approximate using 51
1 dxx . (3) and )(, )(),( TTTT 210
5
ln 5≈1.6094379124
The results are as follows:
3)1()(4)(
JTJT
JS
15)1()(16)(
JSJS
JB
k T(J) S(J) B(J)
0 2.4
1 1.866666 1.688888
2 1.683333 1.622222 1.617778
3 1.628968 1.610846 1.610088
(1))()( ),()( 263
42
21 hOJThahahahfTdxxfQ
b
a
Example
then (2))()1( 64164)2,( 263
42
21 hOJThahahahfTQ
If
Subtract (2) from 4×(1) (i.e 4(1)-2):
).()2,(),(4 6012),(4)2,(3 463
42 hOhfThfThahahfThfTQ
Thus,).(
3)2,(),(4 4hO
hfThfTQ
Recursive Simpson Rule
)()()(3
)1()(4 44 hOJShOJTJT
Q
That is,
Similarly, ),()( ),( 483
62
41 hOJShbhbhbhfSQ if
we obtain )()()(15
)1()(16 66 hOJBhOJSJS
Q
Recursive Boole Rule
(Richardson’s Improvement)
for all ,NTheorem If ],[ baCf N then
. ),()( 6
34
22
1 hahahahfTdxxfb
a
)()( 2hOJT
15)1()()(
JSJS
JB16
Define ,, all for ),()( 21 JhfSJS
3)1()()(
JTJT
JS4
Theorem .,, all for ),()( 32 JhfBJB Then
and
and
3,2,3
)1()(4)(
JJTJT
JS
4,3,15
)1()(16)(
JJSJS
JB
,5,4,63
)1()(64)(
JJBJB
dxxfb
a
.,2,1 allfor )( 2
)1()(1
12
JxfhJT
JTM
kk
First improvement
Second improvement
Third improvement
Give preliminary approximations using the Composite Trapezoidal rule firstly and then improve them by Richardson’s extrapolation process
(2) ),( 4223
2212
21 44412 KKKKKK hchchcKhRQ
Richardson’s Improvement
Jabh 2/)(
a b122 Jabh /)(
Suppose that . (1) ),( 423
222
211 KKK hchchcKhRQ
. )(),( KhOKhRQ 21 ThenThat is
Subtract (2) from 4×(1). Then
)(),(),( 22
141214
K
K
KhO
KhRKhRQ
K=1
),( 0hR),( 02hR
30204 ),(),( hRhR
K=2),( 12hR),( 1hR 15
12116 ),(),( hRhR
K=3),( 22hR
),( 2hR 6322264 ),(),( hRhR
)( 4hO )( 8hO)( 6hO
)0,(JR )1,(JR )2,(JR )3,(JR),( 00R),( 01R),( 02R),( 03R
),( 11R),( 12R),( 13R
),( 22R),( 22R )3,3(R
)(0T)(1T)(2T)(3T
)(1S)(2S)(3S
)(2B)(3B
t)Improvemen Third(63
)2()3(64 BB
Romberg Integration Tabuleau
)(14
)1,2()1,(4 22
K
K
K
hOKhRKhR
Q
14)1,1()1,(4
K
K KJRKJR
Example2 Approximate using Romberg integration.51
1 dxx
2.400000
1.866667 1.688888
1.683334 1.622222 1.617778
1.628968 1.610846 1.610088 1.609490
4.2511
24)0()0,0(
TR
3)0,1()0,(4)1,(
JRJR
JR
866667.1)3(22
)0()1()0,1( fT
TR
683334.1)4()2(12
)1()2()0,2( ffT
TR
,628969.1)5.4()5.3()5.2()5.1(5.02
)2()3()0,3( ffffT
TR
15)1,1()1,(16)2,(
JRJR
JR
63)2,1()2,(64)3,(
JRJR
JR
R(J,0) R(J,1) R(J,2) R(J,3)
Solution We use J=3. The Romberg table is given as follows:
Where and
ln 5≈1.6094379124
Example2 Approximate using R(5,5).
0
sin dxx
Solution Compute R(J,k) where J=0,1,2,3,4,5 and k=0,1,2,3,4,5. The results are listed in the following table.
0 0
1 1.57079633 2.09439511
2 1.89611890 2.00455976 1.99857073
3 1.97423160 2.00026917 1.99998313 2.00000555
4 1.99357034 2.00001659 1.99999975 2.00000001 1.99999999
5 1.99839336 2.00000103 2.00000000 2.00000000 2.00000000 2.00000000
J R(J,0) R(J,1) R(J,2) R(J,3) R(J,4) R(J,5)
.00000000.2)5,5(sin0
Rdxx
Therefore,
ba
)(xfy
5.4 Gauss-Legendre IntegrationGaussian quadrature choose the points for evaluation in an optimal , rather than equally spaced way .
Definition Choose the parameters of the quadrature formula
properly such that it is likely of degree of
precision 2N-1 . This formula is called Gaussian formula .
)()(1
N
iii
b
axfcdxxf
)()(1
1
1N
iii xfcdxxf
1
1
1
1
22)(
22)
22()( dttg
abdt
abbat
abfdxxf
batabxb
a
322211
2
1
1
1,,,1)(,)()()()(,2 xxxxfxfcxfcxfcdxxfN
iii
,21,1)( 21
11 ccdxxf
,0,)( 221111 xcxcdxxxxf
,32,)( 2
22211
11
22 xcxcdxxxxf
,0,)( 322
311
11
33 xcxcdxxxxf
33,
33
,1,1
21
21
xx
cc
)33()
33()()(
2
1
11 ffxfcdxxf
iii
xxfxfcdxxfN ,1)(,)()(,1 11
1
1
0,021,2)(
,21,1)(
1111
111
xxdxxf
cdxxf)0(2)(1
1 fdxxf
Gaussian nodes
is likely of degree of precision 2N-1.
Nxxx ,,, 21 are the zeros of the Nth Legendre polynomial.
31
23)()(1)( 2
210 xxPxxPxP
,2,11!2
1)(1)( 20
Nx
dxd
NxPxP N
N
N
NN
353
76
835)(,
53
25)( 24
42
3 xxxPxxxP
Theorem Suppose that are the roots of the NthLegendre polynomial . For each , the numbers are defined by
Nxxx ,,, 21 )(xPN Ni ,,2,1
iw .1
11
dx
xxxx
wN
ijj ji
ji
If is any polynomial of degree less than 2N, then)(xP
N
iii xPwdxxP
1
1
1)()(
)0()()( 111
1
1fcxfcdxxf
has the degree of precision 1.
Midpoint Rule
two-point Gaussian formula
)515(
95)0(
98)
515(
95)(1
1 fffdxxf
Three-point Gaussian formula
.2,11
11 dxwN
.,
,21
1
1
112
12
21
21
dxxxxx
wdxxxxx
w
N
)33()
33()(1
1 ffdxxf has the degree of precision 3.
31
23)( 2
2 xxP
xxP )(1
53
25)( 2
3 xxxP
,))((
))((1
13121
321
dx
xxxxxxxx
w ,))((
))((1
13212
312
dx
xxxxxxxx
w .))((
))((1
12313
213
dx
xxxxxxxx
w
)()()( )2(
1
1
1N
N
iii kfxfwdxxf
Truncation errors for Gaussian formulas
?),()0(2)( 11
1
1
kfkfdxxf
),()33()
33()( )4(
2
1
1fkffdxxf
Example
Let .)( 2xxf We have .31
1 k
For
.135
12 k See Table 5.8, P240Let .)( 4xxf We have
Change of variables
1
1
1
1)(
22)
22()( dttg
abdt
abbat
abfdxxf
b
a
22ba
tab
x
Example Approximate the integral using Gaussian
quadrature with n=2 and n=3.
5.11
2
dxe x
1
125.125.0
25.2
25.0
5.11
22
25.0 dtedxe ttx
x
094003.125.0
,2 222 25.15773502692.025.025.15773502692.025.05.1
1
eedxe
nx
)33()
33()(1
1 ffdxxf
093642.1]5555555556.0
8888888889.0
5555555556.0[25.0
,3
2
2
22
25.15773502692.025.0
25.1025.0
25.15773502692.025.05.11
e
e
edxe
nx
)515(
95)0(
98)
515(
95)(1
1 fffdxxf