Numerical Differentiation and Integration
INTEGRASI NUMERIS
http://istiarto.staff.ugm.ac.id
Integrasi Numeris
2
q
Acuan
q
Chapra, S.C., Canale R.P., 1990,
Numerical Methods for Engineers
, 2nd
Ed., McGraw-Hill Book Co., New York.
http://istiarto.staff.ugm.ac.id
Diferensial, Derivatif
3
xi xi +Δx yi
yi +Δy
Δx Δy
xi xi +Δx yi
yi +Δy
xi yi
(a) (b) (c)
(
)
( )
x
x f x x
f x
y i i
Δ − Δ
+ =
Δ
Δ
(
)
( )
x
x f x x
f x
y i i
x Δ
− Δ
+ =
→ Δ 0
lim d
d
difference approximation
f
(
x
i+
Δ
x
)
http://istiarto.staff.ugm.ac.id
Diferensial, Derivatif
4
(
)
( )
x
x f x x
f x
y i i
Δ − Δ
+ =
Δ
Δ
(
)
( )
x
x f x x
f x
y i i
x Δ
− Δ
+ =
→ Δ 0
lim d
d
pendekatan beda (hingga)
difference approximation derivatif
( )
x f y x yʹ′ = ʹ′ =
d d
derivatif = laju perubahan y
http://istiarto.staff.ugm.ac.id
Diferensial
0 40 80 120 160
0 2 4 6 8 10
y
x
slope = dy/dx
0 6 12 18 24
0 2 4 6 8 10
d
y/
d
x
x
5
5 . 1
5x
y=
5 . 0
5 . 7 d d
x x
y
http://istiarto.staff.ugm.ac.id
Integral
0 40 80 120 160
0 2 4 6 8 10
∫
y
d
x
x
6
5 . 0
5 . 7 x y=
5 . 1 5 dx x
y =
∫
∫
= xy x0
d luas
§ “kebalikan” dari proses men-diferensial-kan adalah meng-integral-kan
§ integrasi ›‹ diferensiasi 0
6 12 18 24
0 2 4 6 8 10
y
http://istiarto.staff.ugm.ac.id
Fungsi
7
q
Fungsi-fungsi yang di-diferensial-kan atau di-integral-kan
dapat berupa:
q
fungsi kontinu sederhana: polinomial, eksponensial, trigonometri
q
fungsi kontinu kompleks yang tidak memungkinkan didiferensialkan atau
dintegralkan secara langsung
http://istiarto.staff.ugm.ac.id
Cara mencari nilai integral
8
(
)
∫
+ + +2
0
5 . 0 2 3
d sin
5 . 0 1
1 cos 2
x e
x
x x
x f(x)
0.25 2.599 0.75 2.414 1.25 1.945
1.75 1.993 0
1 2 3 4
0 0.5 1 1.5 2 2.5
A1 A2 A3 A4
http://istiarto.staff.ugm.ac.id
Derivatif
9
sec tan
d d
sin cos
d d
cos sin
d log
d d
cot csc
csc d
d
tan sec
sec d
d
csc cot
http://istiarto.staff.ugm.ac.id
Integral
10
cos 1 d
sin ln
tan 1
sin 1 d
Metode Trapesium
Metode Simpson
Metode Kuadratur Gauss
Metode Integrasi Newton-Cotes
11
http://istiarto.staff.ugm.ac.id
Persamaan Newton-Cotes
12
q
Strategi
q
mengganti fungsi kompleks dan rumit atau tabulasi data dengan
yang mudah untuk diintegralkan
( )
∫
( )
∫
=
=
ba n b
a
f
x
x
f
x
x
I
d
d
( )
nn n
n
n
x
a
a
x
a
x
a
x
a
x
f
=
+
+
+
+
−1 −1+
2 2 1
0
...
http://istiarto.staff.ugm.ac.id
Persamaan Newton-Cotes
13
( )
x
f
x
a b
( )
x
f
x
a b
Garis lurus (polinomial tingkat 1) sbg fungsi pendekatan.
http://istiarto.staff.ugm.ac.id
Persamaan Newton-Cotes
14
( )
x
f
x
a b
Garis lurus (polinomial tingkat 1) sbg fungsi pendekatan.
1
2
3
Fungsi yang diintegralkan didekati dengan 3 buah garis lurus (polinomial tingkat 1).
http://istiarto.staff.ugm.ac.id
Metode Trapesium
15
q
Fungsi pendekatan untuk menghitung integral adalah
polinomial tingkat 1
q
Sebuah garis lurus dapat dinyatakan dengan persamaan
( )
∫
( )
∫
=
=
ba b
a
f
x
x
f
x
x
I
d
1d
( )
( )
( )
( )
(
x
a
)
a
b
a
f
b
f
a
f
x
f
−
−
−
+
=
http://istiarto.staff.ugm.ac.id
Metode Trapesium
16
( )
( )
( )
(
)
(
)
( )
( )
2
d
b
f
a
f
a
b
x
a
x
a
b
a
f
b
f
a
f
I
ba
+
−
≅
⎥⎦
⎤
⎢⎣
⎡
−
−
−
+
≅
∫
Metode Trapesium
( )
x
f
x
a b
http://istiarto.staff.ugm.ac.id
Metode Trapesium
17
(
)
640533 .
1 6
400 180
4 675
3 200 5 400
900 675
200 25
400 900
675 200
25
Penyelesaian eksak
Metode Trapesium
(
)
0.17282
http://istiarto.staff.ugm.ac.id
0 1 2 3 4
0 0.2 0.4 0.6 0.8
x
f
(
x
)
Metode Trapesium
q
Error atau kesalahan
q
bentuk trapesium untuk
menghitung nilai integral
mengabaikan sejumlah besar
porsi daerah di bawah kurva
q
Kuantifikasi error pada
Metode Trapesium
18
error
( )(
)
312 1
a b f
Et =− ʹ′ʹ′ ξ −
http://istiarto.staff.ugm.ac.id
Metode Trapesium
0 1 2 3 4
0 0.2 0.4 0.6 0.8
x
f
(
x
)
19
error
( 0.60)(0.8 0) 2.56 12
1 3
=
− −
−
= a
E
( ) 3 2 3
8000 10800
4050
400 x x x
x
fʹ′ʹ′ =− + − +
nilai rata-rata derivatif kedua:
( )
(
)
600 8 . 0
d 8000 10800
4050 400
8 . 0 0
3 2
3
− = −
+ −
+ −
=
ʹ′ʹ′ x
∫
x x x xf
error:
order of magnitude nilai error ini sama dengan
http://istiarto.staff.ugm.ac.id
Trapesium multi pias
20
q
Peningkatan akurasi
q
selang
ab
dibagi menjadi sejumlah
n
pias dengan lebar seragam
h
http://istiarto.staff.ugm.ac.id
0 1 2 3 4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
x
f
(
x
)
h = 0.1
Trapesium multi pias
0 1 2 3 4
0 0.2 0.4 0.6 0.8
x
f
(
x
)
h = 0.2
21
http://istiarto.staff.ugm.ac.id
Trapesium multi pias
22
Jika
0
rata -‐ rata tinggi
1
1 0
lebar 2
http://istiarto.staff.ugm.ac.id
Trapesium multi pias
23
(
)
( )
∑
=
ξ ʹ′ʹ′ −
−
=
n
i
i
t f
n a b E
1 3
3
12
Error
= jumlah
error
pada setiap pias
( )
ff n
n
i
i = ʹ′ʹ′
ξ ʹ′ʹ′
∑
=1
1
(
)
f n
a b E
Et ≈ a =− − 2 ʹ′ʹ′ 3
12
http://istiarto.staff.ugm.ac.id
Trapesium multi pias
24
( )
2 3 4 5400 900
675 200
25 2 .
0 x x x x x
x
f = + − + − +
n h I Et %Et Ea
1 0.8 0.1728 1.4677 89% 2.56
2 0.4 1.0688 0.5717 35% 0.64
4 0.2 1.4848 0.1557 9% 0.16
8 0.1 1.6008 0.0397 2% 0.04
( )
d 1.6405338 . 0
0 =
=
∫
f x x I( )
∫
≈ 0.8
0 1
dx
x f
I
(
the trapezoidal rule
)
(
exact solution
)
0 20 40 60 80 100
http://istiarto.staff.ugm.ac.id
Metode Simpson
q
Fungsi pendekatan:
polinomial tingkat 1
q
Peningkatan ketelitian dpt
dilakukan dengan
meningkatkan jumlah pias
q
Fungsi pendekatan:
polinomial:
q
tingkat 2: Simpson 1/3
q
tingkat 3: Simpson 3/8
25
http://istiarto.staff.ugm.ac.id
Metode Simpson
0 1 2 3 4
0 0.2 0.4 0.6 0.8
x
f
(
x
)
f
2(
x
)
0 1 2 3 4
0 0.2 0.4 0.6 0.8
x
f
(
x
)
f
3(
x
)
26
http://istiarto.staff.ugm.ac.id
Metode Simpson
27
q
Polinomial tingkat 2 atau 3
q
dicari dengan Metode Newton atau Lagrange (lihat materi tentang
http://istiarto.staff.ugm.ac.id
Jika
http://istiarto.staff.ugm.ac.id
http://istiarto.staff.ugm.ac.id
Jika
0
rata rata tinggi
3 2
1 0
lebar 8
http://istiarto.staff.ugm.ac.id
Simpson
⅜
31
(
)
( )
ξ −−
= 4
5
6480 f
a b Et
Error
( )
ξ −= 5 4
80 3
f h
http://istiarto.staff.ugm.ac.id
Simpson
⅓
dan
⅜
32
( )
2 3 4 5400 900
675 200
25 2 .
0 x x x x x
x
f = + − + − +
( )
d 1.6405338 . 0
0 =
=
∫
f x xI
(
exact solution
)
Metode I Et
http://istiarto.staff.ugm.ac.id
Pias tak seragam: Metode Trapesium
33
400 900
675
200 25
1.594801
I dihitung dengan Metode Trapesium di setiap pias:
http://istiarto.staff.ugm.ac.id
Pias tak seragam: Metode Simpson
34
( )
5 4
3
2
400 900
675
200 25
2 . 0
x x
x
x x
x f
+
−
+
−
+ = i xi f(xi) I
0 0 0.2
1 0.12 1.309729 2 0.22 1.305241 3 0.32 1.743393 4 0.36 2.074903
5 0.4 2.456
6 0.44 2.842985 7 0.54 3.507297 8 0.64 3.181929
9 0.7 2.363
10 0.8 0.232
I dihitung dengan Metode Simpson ⅓ dan Simpson ⅜:
http://istiarto.staff.ugm.ac.id
Metode Integrasi Numeris
35
Metode Jumlah pias Lebar pias
Trapesium 1
Trapesium multi pias n > 1 seragam atau tak-seragam
Simpson ⅓ 2 seragam
Simpson ⅓ mul( pias genap (2m, m = 2,3,…) seragam
Simpson ⅜ 3 seragam
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
36
( )
x
f
x
( )
x
f
x
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
37
Kuadratur Gauss 2 Titik: Gauss-Legendre
http://istiarto.staff.ugm.ac.id
0 0.5 1 1.5 2
-1.5 -1 -0.5 0 0.5 1 1.5 -1.5
-1 -0.5 0 0.5 1 1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Kuadratur Gauss
38
( )
x
f
x
( )
x
=
1
f
( )
x
x
f
=
2
d
1
1
1
=
∫
−x
d
0
1
1
=
∫
−x
x
( )
x
f
http://istiarto.staff.ugm.ac.id
0 1 2
-1.5 -1 -0.5 0 0.5 1 1.5
Kuadratur Gauss
39
( )
x
f
x
( )
x
x
2f
=
f
( )
x
=
x
33
2
d
1
1 2
=
∫
−x
x
d
0
1
1 3
=
∫
−x
x
( )
x
f
x
-3 -2 -1 0 1 2 3
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
41
Untuk batas integrasi dari
a
ke
b
:
§ diambil asumsi suatu variabel xd yang dapat dihubungkan dengan variabel asli
x dalam suatu relasi linear
d
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
42
( )
2 3 4 5400 900
675 200
25
I
(exact solution)
Penyelesaian dengan Metode Kuadratur Gauss:
http://istiarto.staff.ugm.ac.id
Kuadratur Gauss
43 400 4 900
4 675 4 200 4 400
900 675
200 25 516741 .
822578 .
1
305837 .