Вы находитесь на странице: 1из 26

-

5
:

:
:

______________
_____

: 14

..

__________________
" ___ " ______________ 2006 .

2006

5.1. y = f (x ) [a, b] .
b

f ( x)dx

n = 1, 2,...,10 (

h =

b-a
) , :
n

) ;
) ;
) ;
D) .
A)-D)
n = 1, 2,...,10 ( h )
n = 1, 2,...,10 ( h ). .
:

.
. :
n -1

: S= h f ( xi ) ;
i =0

M 1 (b - a )
2n

R=

: S= h f ( xi ) ;
i =1

R=

M 1 (b - a )
2n

n -1

: S= h f (
i =0

R =

M 2 (b - a)
24n 2

xi + xi +1
);
2

f ( x 0 ) + f ( x n ) n -1

: S= h
+ f ( xi ) ;
2
i =1

3
M (b - a )
R = 2
12n 2
:
f ( x) :=

1
2

9-x

[2;2]

a := -2

b := 2

f ( x)

:
:

-2

x
dx = arcsin
3
9 - x2

= arcsin
-2

2
-2
- arcsin
3
3

2 - asin -2 = ( 1.45945531245393)

3
3

true := asin

A) :
IntLeftRect ( f , a , b , n) :=

b-a

n := 0 .. 9

for i 0 .. n

integraln := IntLeftRect ( f , a , b , n + 1 )

xi a + h i
0

S0
for i 0 .. n - 1

( )

S S + f xi
S hS
S

E_Leftn := true - integraln

0
0

0.329399069545899

0.10163854521265

0.048514093223115

0.028198397565906

E_Left = 4

0.01836817310573

0.012890550963647

9.5346969930636410 -3

7.3334239071438710 -3

5.8130517792942510 -3

4.7197117013022510 -3

1.78885438199983

1.56109385766658

1.50796940567705

1.48765371001984

integral = 4

1.47782348555966

1.47234586341758

1.468990009447

1.46678873636108

1.46526836423323

1.46417502415523

df ( x) :=

d
dx

f ( x)

M1 := absdf ( 2 )

absdf ( x) := df ( x)
n := 0 .. 9
absdf ( z) 0.1

M1 = 0.178885

R_Left ( f , a , b , n) :=

( b - a)

M1

2 n
2

R_Left ( f , a , b , n )
1

E_Left n

10

,
.
B)
:
Intentr ( f , a , b , n) :=

b-a

n := 0 .. 9

for i 0 .. n

integraln := Intentr ( f , a , b , n + 1 )

xi a + h i
S0
for i 1 .. n
h

S S + f xi -1 +
2

S hS
S
E_Centrn := true - integraln

0
0

1.33333333333333

1.41421356237309

1.43672232115811

1.44592376270231

integral = 4

1.45052656275081

1.45314060011584

1.45476123518253

1.45583272997773

1.45657688052445

1.45711415927405

0
0

0.126121979120599

0.045241750080838

0.022732991295821

E_Centr = 4

0.013531549751618
8.9287497031258510 -3

6.3147123380942210 -3

4.6940772713983710 -3

3.6225824762019510 -3

2.8784319294852310 -3

2.3411531798835910 -3

df2 ( x) :=

f ( x)

absdf2 ( x) := df2 ( x)

dx

M2 := absdf2 ( 2 )

0.4

n := 0 .. 9
absdf2( z) 0.2

M2 = 0.304105

R_Centr ( f , a , b , n) :=

( b - a)

M2

24 n

1
R_Centr ( f , a , b , n )
E_Centrn

0.5

10

,
.

C) :
IntRightRect ( f , a , b , n) :=

b-a

n := 0 .. 9

for i 0 .. n

integraln := IntRightRect ( f , a , b , n + 1 )

xi a + h i
S0

0
0

1.78885438199983

1.56109385766658

1.50796940567705

1.48765371001984

integral = 4

1.47782348555966

1.47234586341758

for i 1 .. n

( )

S S + f xi
S hS
S

E_Rightn := true - integraln

1.468990009447

1.46678873636108

1.46526836423323

1.46417502415523

0
0

0.329399069545899

0.10163854521265

0.048514093223115

0.028198397565906

E_Right = 4

0.01836817310573

0.012890550963647

9.5346969930636410 -3

7.3334239071436410 -3

5.8130517792942510 -3

4.7197117013020310 -3

df ( x) :=

d
dx

f ( x)

M1 := absdf ( 2 )

absdf ( x) := df ( x)
n := 0 .. 9
absdf ( z) 0.1

M1 = 0.178885

R_Right ( f , a , b , n) :=

( b - a)
2 n

0
z

M1

2
R_Right ( f , a , b , n )
1

E_Rightn

10

,
.
D) :

Trapeia ( f , a , b , n) :=

b- a

n := 0 .. 9

n
integraln := Trapeia ( f , a , b , n + 1 )

for i 0 .. n
xi a + h i
S

( )

( )

f x0 + f xn
2

for i 1 .. n - 1

( )

S S + f xi
S hS
S
E_Trapecia n := true - integraln

0
0

3.90710783354556

0.10163854521265

0.048514093223115

0.028198397565906

E_Trapecia = 4

0.01836817310573

0.012890550963647

9.5346969930636410 -3

7.3334239071438710 -3

5.8130517792942510 -3

4.7197117013022510 -3

0
0

5.3665631459995

1.56109385766658

1.50796940567705

1.48765371001984

integral = 4

1.47782348555966

1.47234586341758

1.468990009447

1.46678873636108

1.46526836423323

1.46417502415523

df2 ( x) :=

f ( x)

absdf2 ( x) := df2 ( x)

0.4

dx

M2 := absdf2 ( 2 )

n := 0 .. 9
absdf2( z) 0.2

M2 = 0.304105
0

R_Trapecia ( f , a , b , n) :=

( b - a)
2

M2

12 n
4
R_Trapecia( f , a , b , n )
2

E_Trapecia n

10

,
n.
:
n := 9
n

norma_1 ( V , n) :=

Vi

norma_2 ( V , n) :=

i =0

i = 0

( Vi ) 2

norma_c ( V , n) :=

for i 0 .. n
si Vi
max ( s)

:
max_P ( V , n) :=

s1 norma_1 ( V , n)
s2 norma_2 ( V , n)
s3 norma_c ( V , n)
max ( s)


, :
-3

max_P ( E_Left , n) = 0.56640971399775

min ( E_Left) = 4.71971170130225 10

max_P ( E_Centr , n) = 0.236407977147066

min ( E_Centr) = 2.34115317988359 10

max_P ( E_Right , n) = 0.56640971399775

min ( E_Right) = 4.71971170130203 10

max_P ( E_Trapecia , n) = 4.14411847799742

min ( E_Trapecia) = 4.71971170130225 10

-3

-3
-3

: c
n
.
b

5.2. 5.1

f ( x)dx

n = 2,4,...,20 (
b-a
h =
) .
n
n = 2,4,...,10 ( h )
n = 2,4,...,10 ( h ). ,
, 5.1.
:
Simpson ( f , a , b , n) :=

b- a

integral := 0

n := 2 , 4 .. 20

for i 0 .. n

integral

xi a + h i

( )

( )

S f x0 + f xn

n - 1

for i 1 ..

for i 1 ..

( )

S S + 2 f x2 i
S

h
3

E_Simpsonn1 := true - integraln1

:= Simpson ( f , a , b , n)

S S + 4 f x2 i - 1
n- 1

n1 := 0 .. 9

2.08145847688878

1.46317366080426

1.46047134933109

1.45983374514149

integral = 4

1.45962553702043

1.45954235454975

1.45950415993736

1.45948473210551

1.45947404176071

1.45946778090111

df4 ( x) :=

f ( x)

absdf4 ( x) := df4 ( x)

dx

M4 := absdf4 ( 2 )

n := 0 .. 9

2
absdf4( z)

M4 = 2.651082

R_Simpson ( f , a , b , n) :=

( b - a)

M4

180 n
20
R_Simpson( f , a , b , n )
E_Simpsonn

10

10

,
.

:
-3

max_P ( E_Left , 9 ) = 0.56640971399775

min ( E_Left) = 4.71971170130225 10

max_P ( E_Centr , 9 ) = 0.236407977147066

min ( E_Centr) = 2.34115317988359 10

max_P ( E_Right , 9 ) = 0.56640971399775

min ( E_Right) = 4.71971170130203 10

max_P ( E_Trapecia , 9 ) = 4.14411847799742

min ( E_Trapecia) = 4.71971170130225 10

max_P ( E_Simpson , 9 ) = 0.627482713901151

min ( E_Simpson) = 1.24684471785041 10

0
0

0.622003164434844

3.718348350324710 -3

1.016036877157910 -3

3.784326875564410 -4

E_Simpson = 4

1.702245664929610 -4

8.7042095819445110 -5

4.8847483422598310 -5

2.9419651579765110 -5

1.8729306774600810 -5

1.2468447178504110 -5

-3

-3
-3

-5


:
n := 2 , 4 .. 20

E_Centr := 0

integraln := Intentr ( f , a , b , n)
E_Centr

n - 1

:= true - integraln

-4

max_P ( E_Centr , 9 ) = 0.076141573677683

min ( E_Centr) = 5.9341029956772 10

max_P ( E_Simpson , 9 ) = 0.627482713901151

min ( E_Simpson) = 1.24684471785041 10

-5

n2 := 1 .. 9
0.015

0.01

E_Centrn2
E_Simpsonn2

0.005

10

n2

: c
.

5.3. , N (N=1,2,3,4)
m 2 N - 1 .
:
1) ( , , IntGauss( f , a , b, N ) ),

[ a, b ]
N (N=1,2,3,4).
2
m
2) Pm ( x ) = c 0 + c 1 x + c 2 x + ... + c m x

m = 0..7 .
3) ( -)
b
x2
x3
x m +1 b
I
=
P
(
x
)
dx
=
(
c
x
+
c
+
c
+
...
+
c
) |a .
m m
0
1
2
m
2
3
m
+
1
a
4)
IG m , N = IntGauss ( Pm , a , b, N ) , m = 0..7 , N=1,2,3,4.
5) N (N=1,2,3,4) I m
IG m , N . , c I m = IG m , N
m 2 N - 1 .
6) .
:
2

0
A :=

1
1
0
0

5
9
8
9
5
9
0

0.6521451549 t :=

0.6521451549

0.3478548451
0.3478548451

0 -0.5773502692 -0.7745966692

0
0 0.5773502692
0
0.7745966692
0

0
0
0

IntGauss ( f , a , b , N ) :=

-0.8611363116

-0.3399810436

0.8611363116
0.3399810436

b-a
2

S0
for i 0 .. N - 1

a + b + b - a t

i , N - 1
2
2

S S + Ai , N - 1 f
S hS
S

8 :

a := 0

b := 1

x := a , a + 0.01 .. b
0

P0 ( x) := 5 x

P1 ( x) := 11 + x
2

P2 ( x) := 5 + 9 x - x

P3 ( x) := 8 + 2 x + 9 x - 7 x
2

P4 ( x) := x + 4 x + 5 x + x

P5 ( x) := 31 - 2 x + 7 x - x + 12 x + 5 x
3

P6 ( x) := 32 x + 6 x - 3 x
2

P7 ( x) := 10 + 8 x + 4 x + 5 x + 7 x + 8 x

:
IP0 := 5 b - 5 a

- 11 a + a
2
2

IP1 := 11 b +

IP2 := 5 b + 9
IP3 := 8 b + 2

IP4 :=

2
3

- 5 a + 9 a - a
3
2
3

+ 9

- 7

2
3
4

- 8 a + 2 a + 9 a - 7 a
4
2
3
4

3
4
5 2
3
4
5
b2
+ 4 b + 5 b + b - a + 4 a + 5 a + a
3
4
5 2
3
4
5
2

IP5 := 31 b - 2

IP6 := 32

+ 7

IP7 := 10 b + 8

- 3

+ 6

+ 5

2
3
4
5
6

- 31 a - 2 a + 7 a - a + 12 a + 5 a
6
2
3
4
5
6

4
6
7

- 32 a + 6 a - 3 a
7
4
6
7

+ 4

+ 12

+ 5

+ 7

+ 8

2
3
4
7
8

- 10 a + 8 a + 4 a + 5 a + 7 a + 8 a
8
2
3
4
7
8


N m:
N := 1 .. 4
m := 0
IGm , N - 1 := IntGauss ( P0 , a , b , N )
m := 1
IGm , N - 1 := IntGauss ( P1 , a , b , N )
m := 2
IGm , N - 1 := IntGauss ( P2 , a , b , N )
m := 3
IGm , N - 1 := IntGauss ( P3 , a , b , N )

,

.

m := 4
IGm , N - 1 := IntGauss ( P4 , a , b , N )
m := 5

11.5
m := 6
9.25
IGm , N - 1 := IntGauss ( P6 , a , b , N ) IG = 10.375

2.1875
m := 7
32.53125
IGm , N - 1 := IntGauss ( P7 , a , b , N )

4.140625
IGm , N - 1 := IntGauss ( P5 , a , b , N )

11.5

11.5

11.5

9.16666666666367 9.16666666667559 9.16666666666996


10.2499999999955 10.2500000000134 10.2500000000049
3.27777777781721 3.28333333321462 3.28333333328971
35.1805555556569 35.3166666663355 35.3166666665484
8.55555555571503 8.57249999952149 8.57142857125246


, .
m := 0 .. 7
N := 1
40

IP m
IG m , N- 1

20

5
m

10

N := 2
40
IP m
IG m , N- 1

20

10

N := 3
40
IP m
IG m , N- 1

20

10

N := 4
40
IP m
IG m , N- 1

20

10


:
m := 0 .. 7

N := 1 .. 4

E m , N - 1 := IPm - IGm , N - 1

0
0

0
0

0.083333333333334 2.99493763122882 10- 12

- 12

4.49240644684323 10
0.125

E=
1.09583333333333 5.55555551612397 10- 3

0.136111111009789
2.78541666666667

0.015873015713542
4.43080357142857

0.398148148045578
2.78645833333334

0
- 12

3.29158922340866 10

- 11

4.9382720135327 10

- 10

4.36197744591027 10

- 10

1.18234311230481 10

1.07142809292071 10

-3

1.7610979341498 10

0.012500000393182

1.3245227137304 10

8.92619311798626 10
1.33884014985597 10
1.18712151220279 10
3.31148442000995 10

- 12

- 12
- 11
- 10

- 10
- 10

,
m,
, m<=2*N-1, N - .
N:
N := 1 .. 4
m N := 2 N - 1
E

( m N) , N-1 =
0
4.4924064468432310 -12
3.3114844200099510 -10
1.324522713730410 -10

: c
,

m ,
: m<=2*N-1, N - .

5.4.

f ( x)dx 5.1,
a

, , , .
. .
, , 5.1 5.2.
:
1

f ( x) :=

[2;2]

a := -2

b := 2

9-x

2 - asin -2 = ( 1.45945531245393)

3
3

true := asin
N := 1 .. 4
integral := 0

integralN - 1 := IntGauss ( f , a , b , N )
E_GaussN - 1 := true - integralN - 1

0.126121979120599

0.014825075420188
E_Gauss =
-3
1.86389303204892 10
2.4224230036074 10- 4

1.33333333333333

1.44463023703374

integral =
1.45759141942188

1.45921307015357

0.2

E_GaussN- 1 0.1

0.329399069545899

0.622003164434844

E_LeftN - 1 = 1

0.10163854521265

E_SimpsonN - 1 = 1

3.718348350324710 -3

0.048514093223115

1.016036877157910 -3

0.028198397565906

3.784326875564410 -4

0.329399069545899

0.045241750080838

E_RightN - 1 = 1

0.10163854521265

E_CentrN -1 = 1

0.013531549751618

0.048514093223115

6.3147123380942210 -3

0.028198397565906

3.6225824762019510 -3

0
0

3.90710783354556

E_Trapecia N - 1 = 1

0.10163854521265

0.048514093223115

0.028198397565906

0.126121979120599

0.014825075420188
E_Gauss =
-3
1.86389303204892 10
2.4224230036074 10- 4

: c

.
5.5. y = f (x ) [a, b] .
b

f ( x)dx e = 10

-6

) ;
) .

n .
, MathCad.
:

n .
M (b - a ) 3
(b - a) 3 M 2

ceil
(
A) : 2
12e
12n 2
B) :

M 4 (b - a ) 5
(b - a ) 5 M 4
4

e
n

ceil
(
)
180e
180n 4

:
-6

e := 10
f ( x) :=

a := 3

atan ( x)
x-2

b := 6

A)
df2 ( x) :=

absdf2 ( x) := df2 ( x)

f ( x)

dx

M2 := absdf2 ( 3 )

n := 0 .. 9
df2( z) 0.5

M2 = 0.77678432929884
0

5
z

( b - a) 3

n := ceil
M2
12 e

Trapeia ( f , a , b , n) :=

n = 1323

b- a
n

for i 0 .. n
xi a + h i
S

( )

( )

f x0 + f xn
2

for i 1 .. n - 1

( )

S S + f xi
S hS
S

integral_T := Trapeia ( f , a , b , n) integral_T = 2.67094

B)
df4 ( x) :=

f ( x)

absdf4 ( x) := df2 ( x)

dx

M4 := absdf2 ( 3 )

n := 0 .. 9
absdf4( z) 0.5

M4 = 0.77678432929884
0

(b - a) 5

n := ceil
M4
180 e

Simpson ( f , a , b , n) :=

n = 33

n := 34

b- a
n

for i 0 .. n
xi a + h i

( )

( )

S f x0 + f xn

for i 1 ..

S S + 4 f x2 i - 1
for i 1 ..

n- 1
2

( )

S S + 2 f x2 i
S

h
3

S
integral_S := Simpson ( f , a , b , n)

integral_S = 2.67094

MathCAD:
b

integral_M := f ( x) dx

integral_M = 2.67094

:
, .. 39 .

, ..

. ,
MathCAD,
,
.
5.6. y = f (x ) ( 5.1) [a, b]
b-a
a = x0 < x1 < ... < x n = b , xi = a + ih , y i = f ( xi ) , h =
.
n
,
( ) y i f ( xi ) ,
yi f ( xi ) .

, .
, .
n = 10,15,20. .
:
y = f (x )
a = x0 < x1 < ... < x n = b
y i f ( xi )

xi = a + ih

y i = f ( xi )

y i f ( xi )

yi +1 - yi -1
2h
y - 2 y i + y i +1
f ( xi ) y i = i -1
h2

h2
i = 1..n - 1

f ( xi ) yi =

- 3 y 0 + 4 y1 - y 2
2h
2 y - 5 y1 + 4 y 2 - y 3
f ( x0 ) y 0 = 0
h2
f ( x0 ) y 0 =

3 y n - 4 y n -1 + y n - 2
2h
2 y n - 5 y n -1 + 4 y n- 2 - y n -3
f ( x n ) y n =
h2
f ( x n ) y n =

[ a, b]
b-a
h=
n

y = f (x ) [a, b]
b-a
a = x0 < x1 < ... < x n = b , xi = a + ih , y i = f ( xi ) , h =
.
n
( )
y i f ( xi ) , y i f ( xi ) ( h 2 ):

( i = 1..n - 1 ):
y -y
f ( xi ) yi = i +1 i -1 ,
2h
y - 2 y i + y i +1
f ( xi ) y i = i -1
,
h2
( i = 0):
- 3 y 0 + 4 y1 - y 2
f ( x0 ) y 0 =
2h
2 y - 5 y1 + 4 y 2 - y 3
f ( x0 ) y 0 = 0
h2
( i = n):
3 y - 4 y n -1 + y n - 2
f ( x n ) y n = n
2h
2 y n - 5 y n -1 + 4 y n- 2 - y n -3
f ( x n ) y n =
h2
:
x := 0
1

f ( x) :=

[2;2]

9-x
-3

DF_DX_A ( x) := x 9 - x

-3

DF2_DX_A ( x) := 9 - x

-5
2

+ 3 x 9 - x

a := -2

b := 2

DF_DX ( f , a , b , n) :=

b- a
n

nn- 1
for i 0 .. n
xi a + h i
D0

( )

( )

( )

-3 f x0 + f x1 - f x2
2 h

for i 1 .. n - 1
Di
Dn
D

f xi +1 - f xi- 1

2 h

( )

3 f xn - 4 f xn -1 + f xn - 2
2 h

DF2_DX ( f , a , b , n) :=

b- a
n

nn- 1
for i 0 .. n
xi a + h i
D0

( )

( )

( )

( )

2 f x0 - 5 f x1 + 4 f x2 - f x3
2

h
for i 1 .. n - 1
Di

( )

f xi +1 - 2 f xi + f xi - 1
2

h
Dn

( )

2 f xn - 5 f xn -1 + 4 f xn - 2 - f xn - 3

h
D

A)

n := 10
i := 0 .. n - 1

h :=

b- a
n

h = 0.4

xi := a + h i

( )

Fi := f xi

DF_DX_ARR_1 := DF_DX ( f , a , b , n)
DF2_DX_ARR_1 := DF2_DX ( f , a , b , n)

0.2
DF_DX_A( z)
DF2_DX_A( z)

0.1

DF_DX_ARR_1i
DF2_DX_ARR_1 i

0.1

0
z , z , xi

B)

n := 15
i := 0 .. n - 1

h :=

b- a
n

h = 0.266666666666667

xi := a + h i

( )

Fi := f xi

DF_DX_ARR_2 := DF_DX ( f , a , b , n)
DF2_DX_ARR_2 := DF2_DX ( f , a , b , n)

0.2
DF_DX_A( z)
0.1

DF2_DX_A( z)
DF_DX_ARR_2i
DF2_DX_ARR_2 i

0.1

0
z , z , xi

C)

n := 20
i := 0 .. n - 1

h :=

b- a
n

h = 0.2

xi := a + h i

( )

Fi := f xi

DF_DX_ARR_3 := DF_DX ( f , a , b , n)
DF2_DX_ARR_3 := DF2_DX ( f , a , b , n)

0.2
DF_DX_A( z)
DF2_DX_A( z)

0.1

DF_DX_ARR_3i
DF2_DX_ARR_3 i

0.1

z , z , xi

: ,
, .. . ,
, . ,

, , .
,
.