You are on page 1of 35

Numerical Integration

Newton-Cotes

I ( f ) f ( x)dx
a

Newton-Leibniz
b

I ( f ) f ( x)dx F (b) F (a )
a

f(x)

f(x) F(x)


1.2 f(x) F(x)
:
sin x
sin x , cos x ,
,
x
2

1
,
ln x

1 x , e
3

x2

4 ,
( ) 1 ,
2 .
L.
f(x)=sin x
, x=0 x=48 L.
, :
48

48

L 1 ( f ( x)) dx 1 (cos x) 2 dx
0
0
,
.
'

2.

,
, .

2x 3
2

,
:
1 2
3
9
2
2
x 2x 3 x 2x 3
ln( 2 x 2 x 2 3 )
4
16
16 2

3. f ( x ) :
x
f(x)

1
4

2
4.5

3
6

4
8

5
8.5

,
, ,
.

I ( f ) f ( x)dx
a

x=a, x=b, y=0 y=f(x)


.

y=f(x)
.

, f(x) ,
[a,b] ,
b

I ( f ) f ( x)dx (b a ) f ( )
a

f() [a,b] .

. ,

f() ,

[a,b]

:
:
:
:

I(f)(b-a)f(a)
I(f)(b-a)f(b)
I(f)(b-a)f[(a+b)/2]

, :

I(f)(b-a)[f(a)+f(b)]/2
Simpson :

I(f)(b-a)[f(a)+4f((a+b)/2)+f(b)]/6
a, b, c=(a+b)/2,

[f(a)+f(b)]/2

[f(a)+4f(c)+f(b)]/6
f() .

, [a,b] n+1
{xi},(i=0,1,
2,n) {f(xi)} (i=0,1,,n)

n f(),

b
f ( x)dx (b a ) i f ( xi )

a
i 0
:

f ( x)dx A k f ( x k )

k 0

(1)

I n ( f ) Ak f ( x k )

(2)

k 0

R ( f ) I ( f ) I n ( f ) f ( x)dx Ak f ( xk ),
b

(3)

k 0

(2) ,(3)
( ).

Ak xk
(ii)
(2) ,

(i)


1 (2) m ,

:
Pm (x)
(i)
,

R( Pm ) Im
( P
)

I
(
P
)

0
m
n
m
Pm1 ( x)
(ii) m+1

,
R( Pm 1 ) I ( Pm 1 ) I n ( Pm 1 ) 0

1 (i),(ii) :

(i ) R( x ) I ( x ) I n ( x ) 0, (0 k m)
k

(ii ) R ( x

m 1

)0


[a,b] n+1 xi i=0,1,
2,,n, f(x) n
:
n

Ln ( x ) l j ( x ) f ( x j )
j 0

f ( x ) Ln ( x ) R n ( x )

f ( n 1) ( )
R( x)
wn 1 ( x)
(n 1)!

f ( x)dx Ln ( x)dx Rn ( x)dx


n

l j ( x)dx f ( x j ) R ( x)dx
a

a
j 0

b
a

f ( x )dx f ( x k ) l k ( x )dx
k 0

Ak
(4)

( x xi )
Ak
dx
a
i 0 ( xk xi )
(5)

ik
f(x)
(4)
,
Ak (5)

.
b

R[ f ] a

b
a

f ( x )dx Ak f ( xk ) [ f ( x ) Ln ( x)]dx
b

k 0

f ( n 1) ( x ) n
( x xk ) dx

(n 1)! k 0

1
Ak f ( xk )

k 0

b

Ak l k ( x )dx
a

1 : A j b a
j 0

Newton-Cotes
ba
, i 0, 1, ... , n
xi a i h, h
n

Newton-Cotes ,

x
(x xj )
Ai
dx
x ath
x
( xi x j )
ji
n

n
0

(t j ) h
( b a )( 1) n i
h dt

(i j ) h
n i ! ( n i )!
i j

Cotes n
k
f (x) [a, b]

( t j )dt
n

i j

Cotes C

(n)
k

(n)
j

n
(1) n j

0
j!(n j )!n

A j (b a )C (j n ) ,

(t k ) dt

k 0,k j

j 0,1,2, , n

(6)

(7)

(4)

f ( x)dx (b a ) C
j 0

(n)
j

f (x j )

(8)

(8) n Newton-Cotes
.

: (6) Cotes j
n , f(x) [a,b] ,
n
:
(n)

C
j 0

Newton-Cotes
:
R( f )

f ( n 1) ( )
wn 1 ( x)dx
(n 1)!

h n 2 n ( n 1)

f
( )

(n 1)! 0

j 0

(9)

(t j ) dt

, ( a, b)
x

2 n , Newton-Cotes
(8) n+1 .
n ,NewtonCotes f(x)=xn+1 .
f(x)=xn+1, f(n+1)(x)=(n+1)! . (9)
n
n

R( f ) h n 2
(t j )dt

j 0

t=u+n/2, n , n/2
n
n
,
n
n2 2
R( f ) h

(u 2 j )du

n
2

j 0

R(f)=0,

Newton-Cotes
.

n
(10)
I n ( f ) (b a) C (j n ) f ( x j )
j 0

I ( f ) f ( x)dx

, f(xaj) j (j=0,1,2,,n).
Cj(n) ,
, (10 ) , j

en (b a ) C
j 0

(n)
j

f ( x j ) (b a ) C (j n ) ( f ( x j ) j )
j 0

(b a ) C (j n ) j
j 0

max | j |
Cj(n) ,
0 j n

| en | (b a ) | C (j n ) | (b a )
j 0

en , j ,
(b-a) ,
n
(n)
(n)
|
C

j |
. n>7 ,Cj
, n ,

j 0

.
,
.

(1)
n = 1: C 0

1
,
2

C1(1)

1
2

Trapezoidal Rule

ba
a f ( x )dx 2 [ f (a ) f (b)]
= 1
b f ( )
/* x = a+th, h = ba,
x
R[ f ]
( x a )( x b) dx
a
*/
2!
1 3
ba

h f ( ) , [a , b] , h
12
1
b

1
2
1
( 2)
( 2)
n = 2: C , C1 , C 2
Simpsons Rule
6
3
6
b
ba
ab
f
(
x
)
dx

[
f
(
a
)

4
f
(
) f (b)]
2
a
= 3
6
( 2)
0

1 5 (4)
R[ f ] h f ( ) ,
90

ba
(a , b ) , h
2

n = 4: Cotes Rule, =

5,R[ f ]

8 7 (6)
h f ( )
945


Runge ,
Newton-Cotes ,
Newton-Cotes
.
[a,b] ,
,
,
.

ba
h

[ xi , xi 1 ]

, xi a i h

(i 0, ... , n)

xi 1 xi
xi f ( x)dx 2 [ f ( xi ) f ( xi 1 )] , i 0, ... , n 1
n 1
n 1
b
h
h

[ f ( xi ) f ( xi 1 )] f (a) 2 f ( xk ) f (b) = Tn
a f ( x)dx
2
i 1

i 0 2
xi 1

n 1

n 1

h
h
R[ f ] [
f (i )] (b a )
12
12
i 0
h2
(b a) f ( ), ( a, b)
12

f ( )
i

i 0

/*
*/


f(x) C2[a,b] ,
h0 Tn(f) I(f), O(h2).

f(x) C2[a,b] , f(x)


[a,b] Riemann ,

h n 1
Tn ( f ) [ f ( xi ) f ( xi 1 )]
2 i 0
n
1 n 1
( f ( xi )Vxi f ( xi )Vxi )
2 i 0
i 1
1
lim Tn ( f ) lim Tn ( f ) [ I ( f ) I ( f )] I ( f )
0
n
2

Simpson
ba
h
, xj a j h
2n
x 2 j 2

x2 j 1

( j 0,1,... , 2n)

x2j

h
I ( f ) [ f ( x2 j 2 ) 4 f ( x2 j 1 ) f ( x2 j )]
j 1 3
n

h
S n ( f ) [ f ( x2 j 2 ) 4 f ( x2 j 1 ) f ( x2 j )]
j 1 3

b
a

n
n 1
h
f ( x)dx [ f (a ) 4 f ( x2 j 1 ) 2 f ( x2 j ) f (b)]
3
j 1
j 1

Simpson

h5 (4)
ba
R j (1, f )
f ( j ), h
, x 2 j 2 j x2 j
90
2n

n 5
h

I( f ) S ( f )
n

90
j 1

f (4) ( j )

[a,b]
( 4)
1 n
(4)
f

( )

n
j 1

( j )

b a (4)
I ( f ) Sn ( f )
f ( )h 4 , a b
180
, f(x) , Simpson 4
.

sin x
f ( x)
x

sin x
I( f )
dx
0
x
1

[0,1] 8 ,

7
h

T8 f (a ) 2 f ( x k ) f (b)
2
k 1

1
k

f (0) 2 f f (1)

8 2
8
k 1

0.9456909

f (x)

1/8

0.9973978

2/8

0.9896158

3/8

0.9767267

4/8

0.9588510

5/8

0.9361556

6/8

0.9088516

7/8

0.8771925

0.8414709

Simpson ,
4
3

h
S 4 f (a ) 4 f ( x 2 j 1 ) 2 f ( x 2 j ) f (b)
3
j 1
j 1

4
3

1
2k 1
2k

f (0) 4 f
2 f
f (1)

83
8

8
k 1
k 1

0.9460832

T8 S4, 9

,
I(f)=0.9460831
,

T8=0.9456909 ,
S4=0.9460832
Simpson
.