• Tetapi jika fungsi f(x) tidak diketahui secara eksplisit, tetapi kita
hanya memiliki beberapa titik data saja. Pada kasus seperti ini kita
tidak dapat menemukan nilai turunan fungsi secara analitik.
y1
y0
y = f(x)
x-1 x0 x1 x
y0 y = f(x)
y-1
x-1 x0 x1 x
y0
y = f(x)
y-1
2h
x-1 x0 x-1
f i +1 − f i
fi ' = - h/2 fi "
h
f i +1 − f i
fi ' = + O(h)
h
yang dalam hal ini, O(h) = h/2 f "(t), xi < t < xi+1
IF4058 Topik Khusus Informatika I: Metode
8
Numerik/Teknik Informatika ITB
Untuk nilai-nilai f di x0 dan x1 persamaan rumusnya menjadi:
f1 − f 0
f0 ' = + O (h)
h
yang dalam hal ini O(h) = h/2 f "(t), xi < t < xi+1 .
(xi +1 − xi ) (xi +1 − xi )2
f(xi-1) = f(xi) + f '(xi) + f "(xi) + ...
1! 2!
fi-1 = fi - hfi ' + h2/2 fi " + ...
f i − f i −1
fi ' = + O(h),
h
yang dalam hal ini, O(h) = - h/2 f "(t), xi-1 < t < xi
f 0 − f −1
f0 '= + O ( h)
h
yang dalam hal ini, O(h) = - h/2 f "(t), xi+1 < t < xi.
yang dalam hal ini, O(h2) = - h2/6 f "'(t), xi-1 < t < xi+1
f 1 − f −1
fo '= + O(h 2 )
2h
yang dalam hal ini, O(h2) = - h/6 f "'(t), xi-1 < t < xi+1.
IF4058 Topik Khusus Informatika I: Metode
12
Numerik/Teknik Informatika ITB
Rumus untuk Turunan Kedua, f ’’(x), dengan
Bantuan Deret Taylor
(a) Hampiran selisih-pusat
Jadi,
f i +1 − 2 f i + f i −1
fi" = + O(h2),
h2
yang dalam hal ini, O(h2) = - h2/12 f (4)(t), xi-1 < t < xi+1
IF4058 Topik Khusus Informatika I: Metode
13
Numerik/Teknik Informatika ITB
Untuk nilai-nilai f di x-1 , x0, dan x1 persamaan rumusnya menjadi:
f1 − 2 f 0 + f1
f0" = + O(h2)
h2
yang dalam hal ini O(h2) = - h2/12 f (4)(t), xi-1 < t < xi+1.
f i − 2 − 2 f i −1 + f i
fi" = 2
+ O(h),
h
yang dalam hal ini O(h) = h f "(t), xi-2 < t < xi
f − 2 − 2 f −1 + f 0
f0"= 2
+ O ( h) ,
h
yang dalam hal ini, O(h) = h f "(t) , xi-2 < t < xi
f 2 − 2 f1 + f 0
f0"= 2
+ O(h),
h
s∆f 0 ∆2 f 0 ∆3 f 0
f (x) ≈ pn(x) = f0 + + s(s-1) + s(s-1)(s-2) +
1! 2! 3!
∆n f 0
s(s-1)(s-2)...(s- n+1)
n!
= F(s)
− 3 f 0 + 4 f1 − f 2
f ' (x 0 ) =
2h
IF4058 Topik Khusus Informatika I: Metode
19
Numerik/Teknik Informatika ITB
(b) Hampiran selisih-mundur
f2 − f0
=
2h
f 1 − f −1
f '(x0) =
2h
IF4058 Topik Khusus Informatika I: Metode
21
Numerik/Teknik Informatika ITB
Rumus untuk Turunan Kedua, f "(x),
dengan Polinom Interpolasi
d2 f d df ds
=
dx 2 ds dx dx
= 1/h2 (∆2f 0 )
f −1 − 2 f 0 + f 1
f " ( x0 ) =
h2
f1 − f 0
f0' = + O(h) (selisih-maju)
h
f 0 − f −1
f0' = + O(h) (selisih-mundur)
h
f 1 − f −1
f0' = + O(h2) (selisih-pusat)
2h
− 3 f 0 + 4 f1 − f 2
f0' = + O(h2) (selisih-maju)
2h
− f 2 + 8 f 1 − 8 f −1 + f − 2
f0' = + O(h4) (selisih-pusat)
12h
IF4058 Topik Khusus Informatika I: Metode
24
Numerik/Teknik Informatika ITB
2. Rumus untuk turunan kedua
f 1 − 2 f 0 + f −1
f0" = 2
+ O(h2) (selisih-pusat)
h
f − 2 − 2 f −1 + f 0
f0" = 2
+ O(h) (selisih-mundur)
h
f 2 − 2 f1 + f 0
f0" = 2
+ O(h) (selisih-maju)
h
− f 3 + 4 f 2 − 5 f1 + 2 f 0
f0" = + O(h2) (selisih-maju)
12h
− f 2 + 16 f 1 − 30 f 0 + 16 f −1 − f − 2
f0" = 2
+ O(h4) (selisih-pusat)
12h
f 3 − 3 f 2 + 3 f1 − f 0
f0"' = 3
+ O(h) (selisih-maju)
h
f 2 − 2 f 1 + 2 f −1 − f − 2
f0"' = 3
+ O(h2) (selisih-pusat)
2h
f 4 − 4 f 3 + 6 f 2 − 4 f1 + f 0
f0(iv) = 4
+ O(h) (selisih-maju)
h
(iv) f 2 − 4 f 1 + 6 f 0 − 4 f −1 + f − 2
f0 = 4
+ O(h2) (selisih-pusat)
h
x f(x)
1.3 3.669
1.5 4.482
1.7 5.474
1.9 6.686
2.1 8.166
2.3 9.974
2.5 12.182
(a) Hitunglah f '(1.7) dengan rumus hampiran selisih-pusat orde O(h2) dan O(h4)
(b) Hitunglah f '(1.4)dengan rumus hampiran selisih-pusat orde O(h2)
(c) Rumus apa yang digunakan untuk menghitung f '(1.3) dan f '(2.5) ?
Ambil titik-titik x-1 = 1.5 dan x1 = 1.9, yang dalam hal ini x0 = 1.7 terletak di tengah
keduanya dengan h = 0.2.
6.686 − 4.482
f '(1.7) = = 5.510 (empat angka bena)
2(0.2 )
Orde O(h4):
− f 2 + 8 f1 − 8 f −1 + f 2
f0' =
12h
Hampiran selisih-maju :
f1 − f 0
f0' = + O(h)
h
4.482 − 3.669
f '(1.3) = = 4.065
0.2
Hampiran selisih-mundur :
f 0 − f −1
f0' = + O(h)
h
12.182 − 9.974
f '(2.5) = = 11.04
0.2
f 11 f 12 ... f 1N
f f 22 ... f 2 n
f =
21
M M M M
f M1 fM 2 ... f MN
∂f (x, y ) f (x + ∆x, y ) − f ( x, y )
D1(x) = ≈
∂x ∆x
∂f (x, y ) f (x, y + ∆y ) − f ( x, y )
D1( y) = ≈
∂y ∆y
G[f(x,y)] = max ( fx 2 | , | fy 2 |)
∂f ( x, y ) f (x + ∆x, y ) − f ( x − ∆x, y )
D2(x) = ≈
∂x 2∆x
∂f (x, y ) f (x, y + ∆y ) − f ( x, y − ∆y )
D2(y) = ≈
∂y 2∆y
∂f /∂x
∂2f /∂x2
(a) citra botol; (b) hasil pendeteksian tepi dengan operator Laplace