MODUL PERKULIAHAN
Metode Numerik
Abstrak Sub-CPMK
=0
Polinom gambar
Newton-Gregory derajat 09.1
2 yang melalui ketiga titik tersebut adalah
x x( x − h) 2 x x( x − h) 2
p2 ( x) = NG2 ( x) = f ( x0 ) + f ( x0 ) + 2
f ( x0 ) = f 0 + f 0 + f0
1!h 2!h h 2!h 2
Luas hampiran kurva y = f (x) adalah luas daerah yang diarsir (gambar 09.1), yaitu
x ( x − h) 2
x2 2h 2h
x
f ( x)dx p
x0 0
2 ( x)dx = ( f 0 +
0
h
f 0 +
2!h 2
f 0 )dx
2h
1 2 x3 x2 2 4h 2 8h 3 4h 2 2
= f0 x + x f 0 + ( 2 − ) f 0 = 2hf 0 + f 0 + ( 2 − ) f 0
2h 6h 4h 0
2h 6h 4h
4h h
= 2hf 0 + 2hf 0 + ( − h)2 f 0 = 2hf 0 + 2hf 0 + 2 f 0
3 3
x ( x − h) 2
2h 2h
x h
p2 ( x)dx = ( f 0 +
0 0
h
f 0 +
2!h 2
f 0 )dx = 2hf 0 + 2h( f1 − f 0 ) + ( f 2 − 2 f1 + f 0 )
3
h 2 1 h
= 2hf 0 + 2hf1 − 2hf 0 + f 2 − hf1 + hf 0 = ( f 0 + 4 f1 + f 2 ) ...............................(09.1)
3 3 3 3
(metode Simpson 1/3 gabungan ) dapat dijelaskan dengan gambar 09.2 seperti berikut,
Gambar 09.2
xn xn x2 x4 x6 x8
f ( x)dx x p
x0
2 ( x)dx = p
x0
2 ( x)dx + p
x2
2 ( x ) dx + p
x4
2 ( x)dx + p
x6
2 ( x)dx +
0
x10 xn
h h
+ p 2 ( x)dx + ... + p 2 ( x)dx = ( f 0 + 4 f1 + f 2 ) + ( f 2 + 4 f 3 + f 4 ) +
x8 xn −2 3 3
h h
... + ( f n−4 + 4 f n−3 + f n−2 ) + ( f n−2 + 4 f n−1 + f n )
3 3
h h
= ( f 0 + 4 f1 + f 2 + f 2 + 4 f 3 + f 4 + f 4 + ... + f n −2 + f n − 2 + 4 f n −1 + f n ) = ( f 0 + f n ) +
3 3
h h
(4 f1 + 4 f 3 + 4 f 5 + ... + 4 f n −1 ) + (2 f 2 + 2 f 4 + 2 f 6 + ... + 2 f n − 2 )
3 3
h h n −1 h n−2
= ( f 0 + f n ) + ( 4 f i ) + ( 2 f i )
3 3 i =1 3 i =2
xn n −1 n−2
h h h
Jadi f ( x)dx ( f 0 + f n ) + (4 f i ) + (2 f i )
x0 3 3 i =1,3,5,.... 3 i =2, 4,6,....
Untuk itu diperlukan 4 titik , yaitu (0, f (0)) , (h, f (h)) , (2h, f (2h) dan (3h, f (3h) . Pada
dimana x1 = h , x2 = 2h , dan x3 = 3h
Gambar 09.3
Luas hampiran kurva y = f (x) adalah luas daerah yang diarsir (gambar 09.3), yaitu
x ( x − h) 2 x 3 − 3x 2 h + 2 xh 2 3
x3 3h 3h
x
x0
f ( x)dx p3 ( x)dx = ( f 0 +
0 0
h
f 0 +
2h 2
f 0 +
6h 3
f 0 )dx
3h
1 4
3 2 x − x3h + x 2h 2
1 2 x x
= f0 x + x f 0 + ( 2 − ) f 0 + 4
2
3
3 f 0
2h 6h 4h 6h
0
81h 4
2 3 − 27 h 4 + 9h 4 )
2 (
9h 27 h 9h 2
= 3hf 0 + f 0 + ( 2 − ) f 0 + 4 3
3 f 0
2h 6h 4h 6h
9h 18h 2 9h 2
= 3hf 0 + ( f1 − f 0 ) + ( − )(( f 2 − f1 ) − ( f1 − f 0 )) +
2 4h 4h
81h 4 72h 4
( − )
+ 4 4 (( f 2 − f1 ) − (f1 − f 0 ))
6h 3
9h 9h
= 3hf 0 + ( f1 − f 0 ) + ( )(( f 2 − f1 ) − ( f1 − f 0 )) +
2 4
9h 4
( )
+ 4 3 (( f 3 − f 2 ) − ( f 2 − f1 ) − ( f 2 − f1 ) + ( f1 − f 0 ))
6h
9h 9h 9h (9h 4 )
= 3hf 0 + f1 − f 0 + ( )( f 2 − 2 f1 + f 0 ) + ( f 3 − 3 f 2 + 3 f1 − f 0 )
2 2 4 24h 3
9h 9h 9h 9h 9h 3h 9h 9h 3h
= 3hf 0 + f1 − f0 + f2 − f1 + f0 + f3 − f2 + f1 − f0
2 2 4 2 4 8 8 8 8
3h 9h 9h 3h 3
= f0 + f1 + f2 + f 3 = h ( f 0 + 3 f1 + 3 f 2 + f 3 )
8 8 8 8 8
(metode Simpson 3/8 gabungan ) dapat dijelaskan dengan gambar 09.4 seperti berikut,
Gambar 09.4
xn
3h 3h
... +
x
p ( x)dx =
3
8
( f 0 + 3 f1 + 3 f 2 + f 3 ) +
8
( f 3 + 3 f 4 + 3 f 5 + f 6 ) + ...
n −3
3h
. ( f n−3 + 3 f n−2 + 3 f n−1 + f n )
8
3h
= ( f 0 + 3 f1 + 3 f 2 + f 3 + f 3 + 3 f 4 + 3 f 5 + f 6 + ... + f n −3 + f n −3 + 3 f n −2 + 3 f n −1 + f n )
8
3h 3h 3h
= ( f 0 + f n ) + (3 f1 + 3 f 2 + 3 f 4 + 3 f 5 + ... + 3 f n − 2 + 3 f n −1 ) + (2 f 3 + 2 f 6 + ... + 2 f n −3 )
8 8 8
n −1 n −3
3h 3h 3h
= ( f 0 + f n ) + (3 f i ) + (2 f i ) .
8 8 i =1 8 i =3, 6,9,...
i 3, 6 , 9 ,...
xn n −1 n −3
3h 3h 3h
Jadi f ( x)dx ( f 0 + f n ) + (3 f i ) + (2 f i )
x0 8 8 i =1 8 i =3,6,9,...
i 3, 6 , 9 ,...
Contoh:
e xCos x
1. Diketahui tabel nilai f ( x) = seperti dibawah ini,
x +1
i xi f ( xi ) i xi f ( xi )
a) Trapesium
1
b) Simpson
3
3
c) Simpson
8
Jawab
a) Metode Trapesium
h h
L Trap = ( f 0 + f n ) + h( f1 + f 2 + f 3 + ... + f n−1 ) = ( f 0 + f12 ) + h( f1 + f 2 + f 3 + ... + f11 )
2 2
0.1
= (1 + 0,811110 ) + 0,1(1,048475 + 1,092758 + 1,131027 + ... + 0,940337 ) = 1,3134438
2
h h h
L Simp 1/3 = ( f 0 + f n ) + (4 f1 + 4 f 3 + 4 f 5 + ... + f n −1 ) + (2 f 2 + 2 f 4+2 f 6 + ... + 2 f n − 2 )
3 3 3
h 4h 2h
= ( f 0 + f12 ) + ( f1 + f 3 + f 5 + ... + f11 ) + ( f 2 + f 4 + f 6 + ... + f10 )
3 3 3
0.1 4 0,1
= (1 + 0,811110 ) + (1,048475 + 1,131027 + 1,181360 + ... + 0,940337 ) +
3 3
2 0,1
(1,092758 + 1,161294 + 1,188905 + ... + 1,038523 )
3
0.1 0,4
= (1 + 0,811110 ) + (1,048475 + 1,131027 + 1,181360 + ... + 0,940337 ) +
3 3
0,2
(1,092758 + 1,161294 + 1,188905 + ... + 1,038523 ) = 1,3150753
3
3h 3h 3h
L Simp 3/8 = ( f 0 + f n ) + (3 f 1 + 3 f 2 + 3 f 4 + 3 f 5 + ... + f n −1 ) + (2 f 3 + 2 f 6+2 f 9 + ... + 2 f n −3 )
8 8 8
3h 3h
= ( f 0 + f 12 ) + (3 f 1 + 3 f 2 + 3 f 4 + 3 f 5 + 3 f 7 + 3 f 8 + 3 f 10 + 3 f 11 ) +
8 8
3h
(2 f 3 + 2 f 6 + 2 f 9 )
8
3h 3 3h 3 2h
= ( f 0 + f12 ) + ( f1 + f 2 + f 4 + f 5 + f 7 + f 8 + f10 + f11 ) + ( f3 + f6 + f9 )
8 8 8
3 0.1 9 0,1
= (1 + 0,811110 ) + (1,048475 + 1,092758 + 1,161294 + 1,181360 +
8 8
6 0,1
+ 1,181282 + 1,155711 + 1,038523 + 0,940337 ) + (1,131027 + 1,188905 +
8
1,109191)
0.3 0,9
= (1 + 0,811110 ) + (1,048475 + 1,092758 + 1,161294 + 1,181360 +
8 8
0,6
+ 1,181282 + 1,155711 + 1,038523 + 0,940337 ) + (1,131027 + 1,188905 +
8
1,109191) = 1,315078
r Xr Fr r Xr fr r Xr fr
e x Cos x
y = f ( x) = tidak terdefinisi untuk x = 0 (ujung bawah selang). Fungsi yang tidak
x
terdefinisi di x = t untuk a t b disebut fungsi singular. Singularitas harus dihilangkan
dengan cara memanipulasi persamaan fungsi sedemikian sehingga fungsi tersebut tidak
singular lagi.
Contoh:
1
e x Cos x
Ubahlah fungsi
0 x
dx sehingga tidak menjadi fungsi singular lagi.
Jawab :
e x Cos x
Kita tahu fungsi y = f ( x) = tidak terdefinsi untuk x = 0 . Misalkan x = u 2 ,
x
dx = 2u du . Batas-batas integrasinya adalah sebagai berikut:
1 u2 1
e xCos x e Cos(u 2 )
x = 0 → u = x = 0 dan x = 1 → u = x = 1 ,mk dx = 2u du
0 x 0
u
1
= 2eu Cos (u 2 )du …………………………………………………..(09.2).
2
Pers.(09.2) merupakan fungsi yang non singular, sehingga bisa diselesaikan dengan
menggunakan pendekatan yang dikehendaki.
n
Q f = wi f ( xi ) = w0 f ( x0 ) + w1 f ( x1 ) + ... + wn f ( x n ) ………………(09.3),
i =0
sedemikian sehingga,
b
a f ( x)dx = Q f + E f ……………………………………………………(09.4)
kuadratur dan nilai-nilai wi i =0 disebut weigt function atau fungsi bobot . Simpul-simpul
n
dipilih secara berbeda-beda. Misalnya untuk aturan trapesium dan aturan Simpson
simpul-simpul dipilih sedemikian sehingga simpul –simpul tersebut berjarak sama satu
sama lain. Untuk kuadratur Gauss-Legendre simpul-simpul dipilih yang merupakan
pembuat-pembuat nol polinomial Legendre. Apabila rumus integrasi digunakan untuk
mengembangkan suatu rumus prediktor dalam penyelesaian suatu persamaan differensial,
semua simpul dipilih yang nilainya kurang dari b .
Dari polinom interpolasi yang telah kita pelajari, dapat diturunkan rumus-rumus kuadratur
Newton – Cotes sebagai berikut:
x1
h
➢ x f ( x)dx T ( f ) = 2 ( f
2 0 + f1 ),.......................................( Aturan Trapesium)(09.5)
0
x2
h
f ( x)dx S
1
➢ 3 (f)= ( f 0 + 4 f1 + f 2 ),..............................( Aturan Simpson )(09.6)
x 3 3
0
x4
h
➢ x f ( x)dx B ( f ) = 2 (7 f
5 0 + 32 f1 + 12 f 2 + 32 f 3 + 7 f 4 ),......(Aturan Boole)(09.8)
0
y = f(x)
h1 h2 h2 h2
h1
x5
Turunkan f ( x)dx
x0
dengan metode Simpson dan metode trapesium , perhatikan
bahwa x0 0
1
dx
6. Ubah fungsi integral 0 ( Sin x)(1 − x 2 )
ini sehingga menjadi non singular, kemudian
hitung dengan pendekatan yang saudara pahami. (metode segi empat, metode titik
tengah, metode trapezium, metode Simpson 1/3 dan metode Simpson 3/8)