Deret Taylor Dan Analisis Galat
Deret Taylor Dan Analisis Galat
x0
Misalkan x - x0 = h, maka:
h h2 h3 h
f ( x) = f ( x 0 ) + f ' ( x 0 ) + f " ( x0 ) + f ' ' ' ( x 0 ) + ... f (m)
( x 0 ) + ...
1! 2! 3! m!
Rinaldi Munir - Topik Khusus Informatika I 3
Contoh 1: Hampiri fungsi f(x) = sin(x) ke dalam deret Taylor di
sekitar x0 = 1.
Penyelesaian:
f(x) = sin(x), f’(x) = cos(x), f ‘’x) = -sin(x),
f ‘’’(x) = -cos(x), f (4)(x) = sin(x), …
( x − 1) ( x − 1) 2 ( x − 1) 3 ( x − 1) 4
sin( x) = sin(1) + cos(1) + (− sin(1)) + (− cos(1)) + sin(1) + ...
1! 2! 3! 4!
+ ( − ( 0 + 1) − 2 ) + 2 ( 0 + 1) − 3
2! 3!
( x − 0)4
+ ( − 6 ( 0 + 1) − 4 ) + ...
4!
x 2 x3 x 4
= x − + − + ...
2 3 4
Rinaldi Munir - Topik Khusus Informatika I 6
• Karena suku-suku deret Taylor tidak berhingga
banyaknya, maka -untuk alasan praktis- deret Taylor
dipotong sampai suku orde tertentu.
( x − x0 ) ( x − x0 ) 2 ( x − x0 ) n (n)
f ( x) ≈ f ( x0 ) + f ' ( x0 ) + f " ( x0 ) + ...+ f ( x0 ) + Rn ( x)
1! 2! n!
( x − x0 ) ( n +1) ( n +1)
Rn ( x) = f (c), x0 < c < x
(n + 1)!
Galat/residu/sisa
Rinaldi Munir - Topik Khusus Informatika I 7
• Deret Taylor terpotong di sekitar x0 = 0 disebut deret
Maclaurin terpotong.
Contoh 3: 6
x
sin(x) = x - x3/3! + x5/5! + R5(x); R5 ( x) = 6! cos(c)
5
x
x 2 3 4
e = 1 + x + x /2! + x /3! + x /4! + R4(x); R 4 ( x ) = e c
57!
x
2 4 6
cos(x) = 1 - x /4! + x /6! - x /6! + R6(x); 6 R ( x ) = cos(c )
75!
x
2 3 4
ln(x+1) = x - x /2 + x /3 - x /4; + R4(x); 4 R ( x ) = ( c + 1) −5
5!
• Galat mutlak: ε = a − aˆ
Rinaldi Munir - Topik Khusus Informatika I 10
ε ε
• Galat relatif: ε R = atau ε R = ×100%
a a
ε
• Galat relatif hampiran: ε RA =
aˆ
x2 x4 x6 x 8 x 10
cos( x) ≈ 1 − + − + − +...
1424 !4244
! 446!
3 1484! 24104
!3
nilai hampiran galat pemotongan
pemotongan
Rinaldi Munir - Topik Khusus Informatika I 12
• Galat pembulatan: galat yang timbul akibat
keterbatasan komputer dalam merepresentasikan
bilangan riil.
a = ± m × B p = ± 0.d1d2d3d4d5d6 ...dn × Bp
dn , jika d n +1 < 5
d + 1 , jika d > 5
n
d̂ˆn =
n +1
, jika d n +1 = 5 dan n genap
dn
d n + 1 , jika d n +1 = 5 dan n ganjil
= 0.160081 × 101
in-rounding → 0.1601 × 101
chopping → 0.1600 × 101
Penyelesaian:
3.1415926536 = 0.31415926536 × 101
3.1415957341 = 0.31415957341 × 101 -
= 500(22.3830 - 22.3607)
= 500(0.0223)
= 11.15 ( empat angka bena)
(solusi eksaknya adalah 11.174755300747198..)
Hasil yang tidak akurat ini disebabkan adanya operasi
pengurangan dua bilangan yang hampir sama besar, yaitu
22.3830 - 22.3607.
f ( x) = x( x + 1 − x )
( x +1 + x)
= x( x + 1 − x )
( x +1 + x)
x[( x + 1) 2 − ( x ) 2 ]
=
( x +1 + x)
x
= = p( x)
x +1 + x
500 500
p(500) = = = 11.1748
501 + 500 22.3830 + 22.3607
Rinaldi Munir - Topik Khusus Informatika I 31
• Soal Latihan. Carilah cara yang lebih baik untuk
menghitung:
(i) f(x) = (x - sin(x))/tan(x) untuk x mendekati nol
(ii) f(x) = x - √(x2 - a) untuk x yang jauh lebih
besar dari a
(iii) f(x) = cos2(x) - sin2(x) untuk x di sekitar π/4
(iv) f(x) = log(x + 1) - log(x) untuk x yang besar
(v) (1 + α )1/2 - 1, α ≤ 0.01 sampai enam angka bena
(vi) sin(α + x) - sin(α) untuk x yang kecil
(vii) (a + x)n - an untuk x yang kecil
(viii) ((x3 - 3x2) + 3x) - 1 untuk x = 2.72
(ix) √(1 + cos x)/2 untuk x ≈ π/4
f ( x + h2 ) + ε 2 f ( x + h1 ) + ε 1
c x