Sie sind auf Seite 1von 12

# NAMA : JONATHAN SIMANJUNTAK

NPM : 15150306
MATAKULIAH : Metode Numerik

## *Jawaban Soal UAS*

4
1. Dik: ∫1 (𝑥𝑥 3 + 𝑥𝑥 2 + 1)𝑑𝑑𝑑𝑑
Dit: a. metode Trapesium banyak pias dan koreksi ujung
b. Metode Simpson
c. Metode Kuadratur Gauss-Legendre lima titik
Penyelesaian:
a. Metode Trapesium Banyak Pias Dan Koreksi Ujung
• metode Trapesium banyak pias
4 4
3 2
1 4 1 3
𝐼𝐼𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸 = � (𝑥𝑥 + 𝑥𝑥 + 1)𝑑𝑑𝑑𝑑 = � 𝑥𝑥 + 𝑥𝑥 + 𝑥𝑥� = 87,75
1 4 3 1

## 𝑛𝑛 = 3 𝑓𝑓(𝑎𝑎) = 𝑓𝑓(1) = (1)3 + (1)2 + 1 = 3

ℎ = 0,43 𝑓𝑓(𝑏𝑏) = 𝑓𝑓(4) = (4)3 + (4)2 + 1 = 81

## maka kita cari menggunakan metode trapezium dengan 3 pias :

𝑛𝑛−1
∆𝑥𝑥
𝐼𝐼𝑡𝑡3 = [𝑓𝑓(𝑎𝑎) + 𝑓𝑓(𝑏𝑏) + 2 � 𝑓𝑓(𝑥𝑥𝑖𝑖 )]
2
𝑖𝑖=1

0,43
𝐼𝐼𝑡𝑡3 = [3 + 81 + 2 (13)]
2
0,43
𝐼𝐼𝑡𝑡3 = [110]
2

𝐼𝐼𝑡𝑡3 = 23,65

• koreksi ujung

𝑛𝑛−1
∆𝑥𝑥 ∆𝑥𝑥 ′
𝐼𝐼𝑡𝑡3 = [𝑓𝑓(𝑎𝑎) + 𝑓𝑓(𝑏𝑏) + 2 � 𝑓𝑓(𝑥𝑥𝑖𝑖 )] − [𝑓𝑓 (𝑏𝑏) − 𝑓𝑓 ′ (𝑎𝑎)]
2 12
𝑖𝑖=1

0,43
𝐼𝐼𝑡𝑡3 = 23,65 − [56 − 5]
12
0,43
𝐼𝐼𝑡𝑡3 = 23,65 − [51]
12

𝐼𝐼𝑡𝑡3 = 21,8225

## maka εt3 , yaitu:

87,75 − 21,8225
εt3 = � � × 100% = 75,13%
87,75
b. Metode Simpson
n = 3 dan h = 0,43
𝑥𝑥𝑖𝑖 = 𝑥𝑥𝑖𝑖−1 + ℎ
𝑥𝑥0 = 1 + 0 = 1 𝑓𝑓(𝑥𝑥0 ) = (1)3 + (1)2 + 1 = 3

## 𝑥𝑥3 = 1,86 + 0,43 = 2,29 𝑓𝑓(𝑥𝑥3 ) = (2,29 )3 + (2,29 )2 + 1 = 18,2531

3ℎ
𝐼𝐼𝑛𝑛 (𝑓𝑓) = (𝑓𝑓0 + 3𝑓𝑓1 + 3𝑓𝑓2 + 𝑓𝑓3 )
8

3(0,43)
𝐼𝐼𝑛𝑛 (𝑓𝑓) = (3 + 3(5,0691) + 3(10,8944) + 18,2531)
8

1,29
𝐼𝐼𝑛𝑛 (𝑓𝑓) = (69,1436)
8

## 𝐼𝐼𝑛𝑛 (𝑓𝑓) =11,1494

87,75− 11,1494
% 𝜀𝜀𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = � �× 100% = 87,29
87,75

## c. Metode Kuadratur Gauss-Legendre Lima Titik

4 4
3 2
1 4 1 3
� (𝑥𝑥 + 𝑥𝑥 + 1)𝑑𝑑𝑑𝑑 = � 𝑥𝑥 + 𝑥𝑥 + 𝑥𝑥� = 87,75
1 4 3 1

(4 + 1) + (4 − 1)𝑥𝑥𝑥𝑥 5 + 3𝑥𝑥𝑥𝑥
𝑥𝑥 = =
2 2
3
𝑑𝑑𝑑𝑑 = 𝑑𝑑𝑑𝑑𝑑𝑑
2
4 1
3 2
5 + 3𝑥𝑥𝑥𝑥 3 5 + 3𝑥𝑥𝑥𝑥 2 3
� (𝑥𝑥 + 𝑥𝑥 + 1)𝑑𝑑𝑑𝑑 = � [( ) +( ) + 1] 𝑑𝑑𝑑𝑑𝑑𝑑
1 −1 2 2 2

1
81𝑥𝑥3 𝑑𝑑 + 459𝑥𝑥2 𝑑𝑑 + 815𝑥𝑥𝑥𝑥 + 549
=� 𝑑𝑑𝑑𝑑𝑑𝑑
−1 16

## Masukkan nilai x dengan:

𝑥𝑥1 = −0,906179846 → 𝑓𝑓(𝑥𝑥1 ) =7,943937
𝑥𝑥2 = −0,538469310 → 𝑓𝑓(𝑥𝑥2 ) =14,41174
𝑥𝑥3 = 0,0000000 → 𝑓𝑓(𝑥𝑥3 ) =34,3125
𝑥𝑥4 = 0,538469310 → 𝑓𝑓(𝑥𝑥4 ) =70,8491
𝑥𝑥5 = 0,9061 7984 → 𝑓𝑓(𝑥𝑥5 ) =107,7952
Luas total:
𝑰𝑰 = 𝑐𝑐1 𝑓𝑓(𝑥𝑥1 ) + 𝑐𝑐2 𝑓𝑓(𝑥𝑥2 ) + 𝑐𝑐3 𝑓𝑓(𝑥𝑥3 ) + 𝑐𝑐4 𝑓𝑓(𝑥𝑥4 ) + 𝑐𝑐5 𝑓𝑓(𝑥𝑥5 )
= 0,236926885(7,943937) + 0,478628670(14,41174) + 0,568888889(34,3125)
+ 0,478628670(70,8491) + 0,236926885(107,7952)
=87,75

87,75 − 87,75
𝜀𝜀 = � � × 100% = 0%
87,75

## Hasil Program Simpson 3/8 setelah dijalankan:

Algoritma Program Simpson 1/3

## Hasil Program Simpson 1/3 setelah dijalankan:

𝑑𝑑𝑑𝑑 1
3. Dik : = 3𝑥𝑥 2 𝑦𝑦 ; 𝑥𝑥 = 0 𝑠𝑠�𝑑𝑑 𝑥𝑥 = 1; ℎ = 0,25
𝑑𝑑𝑑𝑑
Pada saat 𝑥𝑥 = 0 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑦𝑦 = 1
Dit : hitunglah kesalahan dengan menggunakan:
a. Metode Euler
b. Metode Heun
c. Metode Deret Taylor
d. Metode Runge-Kutta

Penyelesaian:

a. Metode Euler
1
h= ; x = 0 s/d x = 1
4
𝑥𝑥0 = 0;
a. 𝑥𝑥1 = 𝑥𝑥0 + 𝑖𝑖ℎ
= 0 + 1(0,25)
= 0,25
1
𝑦𝑦1 = 𝑦𝑦0 + ℎ. 𝑓𝑓 �3(𝑥𝑥0 )2 � ��
𝑦𝑦0
1
= 1 + 0,25 �3(0)2 � ��
1
=1

## b. 𝑥𝑥2 = 𝑥𝑥0 + 𝑖𝑖ℎ

= 0 + 2(0,25)
= 0,5
1
𝑦𝑦2 = 𝑦𝑦1 + ℎ. 𝑓𝑓 �3(𝑥𝑥1 )2 � ��
𝑦𝑦1

1
= 1 + 0,25 �3(0,25)2 � ��
1

= 1,0469
c. 𝑥𝑥3 = 𝑥𝑥0 + 𝑖𝑖ℎ
= 0 + 3(0,25)
= 0,75
1
𝑦𝑦3 = 𝑦𝑦2 + ℎ. 𝑓𝑓 �3(𝑥𝑥2 )2 � ��
𝑦𝑦2
1
= 1,0625 + 0,25 �3(0,5)2 � ��
1,0469

= 1,2416

## d. 𝑥𝑥4 = 𝑥𝑥0 + 𝑖𝑖ℎ

= 0 + 4(0,25)
=1
1
𝑦𝑦4 = 𝑦𝑦3 + ℎ. 𝑓𝑓 �3(𝑥𝑥3 )2 � ��
𝑦𝑦3
1
= 1,1914 + 0,25 �3(0,75)2 � ��
1,2416

= 1,5311

Nilai Eksakta:

𝑑𝑑𝑑𝑑 1 1
= 3𝑥𝑥 2 → dy = 3𝑥𝑥 2 dx → ydy = 3𝑥𝑥 2 dx
𝑑𝑑𝑑𝑑 𝑦𝑦 𝑦𝑦
maka diperoleh:
→ 𝑦𝑦dy = 3𝑥𝑥 2 dx
𝑦𝑦. dy = 3𝑥𝑥 2 dx
→ � 𝑦𝑦. 𝑑𝑑𝑑𝑑 = � 3𝑥𝑥 2 𝑑𝑑𝑑𝑑
1 3
→ 𝑦𝑦 2 = 𝑥𝑥 3 + c
2 3
1 2
→ 𝑦𝑦 = 𝑥𝑥 3 + c
2
→ 𝑦𝑦 2 = 2(𝑥𝑥 3 + c)
→ 𝑦𝑦 = �2(𝑥𝑥 3 + c)

1
x = 0; y=1 diperoleh C = → pers: 𝑦𝑦 = �2(𝑥𝑥 3 + c)
2

## x 𝑦𝑦𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑦𝑦𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝜖𝜖𝜖𝜖

0 1 1 0%
0,25 1 1,0155 1,5263%
0,5 1,0469 1,1180 6,3596%
0,75 1,2416 1,3578 8,5579%
1 1,5311 1,7320 11,5993%

b. Metode Heun
1 1
a. x = 0,25 → 𝑦𝑦0′ = 3𝑥𝑥 2 𝑦𝑦 = 3(0)2 1 = 0 (kemiringan awal)
0
𝑦𝑦𝑖𝑖+1= 𝑦𝑦𝑖𝑖 + 𝑓𝑓(𝑥𝑥𝑖𝑖 , 𝑦𝑦𝑖𝑖 )∆𝑥𝑥
= 1 + (0)(0,25)
=1

𝑦𝑦𝑖𝑖+1 = 𝑓𝑓(𝑥𝑥𝑖𝑖+1 ; 𝑦𝑦𝑖𝑖+1 ) (kemiringan ujung akhir)
1
= 3(0,25)2
1
=0,1875

## 𝑦𝑦0′ + 𝑦𝑦1′ 0 + 0,1875

𝑦𝑦�′ = = = 0,0937
2 2
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑦𝑦�′ . ∆𝑥𝑥
= 1 + 0,0937(0,25)
= 1,0234
Nilai eksak:
𝑦𝑦1 = 𝑦𝑦(0,25) = 1,0155
Sehingga:
1,0155 − 1,0234
𝜀𝜀𝜀𝜀 = � � × 100% = 0,779%
1,0155
1 1
b. x = 0,5 → 𝑦𝑦0′ = 3𝑥𝑥 2 𝑦𝑦 = 3(0,25)2 1,0234 = 0,1832 (kemiringan ujung awal)
0
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑓𝑓(𝑥𝑥𝑖𝑖 , 𝑦𝑦𝑖𝑖 )∆𝑥𝑥
= 1,0234 + (0,1832)(0,25)
= 1,0692

𝑦𝑦𝑖𝑖+1 = 𝑓𝑓(𝑥𝑥𝑖𝑖+1 ; 𝑦𝑦𝑖𝑖+1 ) (kemiringan ujung akhir)
1
= 3(0,5)2
1,0692
= 0,7014
𝑦𝑦0′ + 𝑦𝑦1′ 0,1832 + 0,7014
𝑦𝑦�′ = = = 0,4423
2 2
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑦𝑦�′ . ∆𝑥𝑥
= 1,0692+ 0,4423 (0,25)
= 1,1798
Nilai eksak:
𝑦𝑦1 = 𝑦𝑦(0,5) = 1,1180
Sehingga:
1,1180 − 1,1798
𝜀𝜀𝜀𝜀 = � � × 100% = 5,5277%
1,1180

1 1
c. x = 0,75 → 𝑦𝑦0′ = 3𝑥𝑥 2 = 3(0, 5)2 = 0,6357 (kemiringan ujung awal)
𝑦𝑦 1,1798
0
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑓𝑓(𝑥𝑥𝑖𝑖 , 𝑦𝑦𝑖𝑖 )∆𝑥𝑥
= 1,1798 + (0,6357)(0,25)
= 1,3387

𝑦𝑦𝑖𝑖+1 = 𝑓𝑓(𝑥𝑥𝑖𝑖+1 ; 𝑦𝑦𝑖𝑖+1 ) (kemiringan ujung akhir)
1
= 3(0, 75)2
1,3387
= 1,2605
𝑦𝑦0′ + 𝑦𝑦1′ 0,6357 + 1,2605
𝑦𝑦�′ = = = 0,9481
2 2
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑦𝑦�′ . ∆𝑥𝑥
= 1,3387+0,9481(0,25)
= 1,5757
Nilai eksak:
𝑦𝑦1 = 𝑦𝑦(0,75) = 1,3578
Sehingga:
1,3578 − 1,5757
𝜀𝜀𝜀𝜀 = � � × 100% = 16,05%
1,3578
1 1
d. x = 1 → 𝑦𝑦0′ = 3𝑥𝑥 2 𝑦𝑦 = 3(0, 75)2 1,5757 = 1,0709

0
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑓𝑓(𝑥𝑥𝑖𝑖 , 𝑦𝑦𝑖𝑖 )∆𝑥𝑥

= 1,5757 + (1,0709)(0,25)
= 1,8434

𝑦𝑦𝑖𝑖+1 = 𝑓𝑓(𝑥𝑥𝑖𝑖+1 ; 𝑦𝑦𝑖𝑖+1 )
1
= 3(1)2
1,8434
= 1,6274
𝑦𝑦0′ + 𝑦𝑦1′ 1,0709 + 1,6274
𝑦𝑦�′ = = = 1,3491
2 2
𝑦𝑦𝑖𝑖+1 = 𝑦𝑦𝑖𝑖 + 𝑦𝑦�′ . ∆𝑥𝑥
= 1,8434+ 1,3491(0,25)
= 2,1807
Nilai eksak:
𝑦𝑦1 = 𝑦𝑦(0,5) = 1,7320
Sehingga:
1,7320 − 2,1807
𝜀𝜀𝜀𝜀 = � � × 100% = 25,91%
1,7320

## Tabel Hasil Hitungan dengan Metode Heun

x 𝑦𝑦𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑦𝑦𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 𝜀𝜀𝜀𝜀

0 1,000 1 -

## 𝒉𝒉 ′ 𝒉𝒉𝟐𝟐 𝒉𝒉𝟑𝟑 𝒉𝒉𝟒𝟒

𝒚𝒚(𝒙𝒙𝟏𝟏 ) = 𝒚𝒚(𝒙𝒙𝟎𝟎 ) + 𝒚𝒚 (𝒙𝒙𝟎𝟎 ) + 𝒚𝒚′′ (𝒙𝒙𝟎𝟎 ) + 𝒚𝒚′′′ (𝒙𝒙𝟎𝟎 ) + 𝒚𝒚′′′′ (𝒙𝒙𝟎𝟎 )
𝟏𝟏! 𝟐𝟐! 𝟑𝟑! 𝟒𝟒!
Sehingga:

𝑦𝑦(0) =1 𝑦𝑦(0) =1
1
𝑦𝑦 ′ (0) = 3𝑥𝑥2 𝑦𝑦 ′ (0) =0
𝑦𝑦

1
𝑦𝑦′′ (0) = 6𝑥𝑥 𝑦𝑦′′ (0) = 0
𝑦𝑦

1
𝑦𝑦′′′ (0) = 6 𝑦𝑦 𝑦𝑦′′′ (0) = 6

## Untuk 𝑥𝑥1 = 0,25 Maka diperoleh 𝑦𝑦1 , yaitu:

ℎ ′ ℎ2 ′′ ℎ3 ′′′ ℎ4 ′′′′
𝑦𝑦(𝑥𝑥1 ) = 𝑦𝑦(𝑥𝑥0 ) + 𝑦𝑦 (𝑥𝑥0 ) + 𝑦𝑦 (𝑥𝑥0 ) + 𝑦𝑦 (𝑥𝑥0 ) + 𝑦𝑦 (𝑥𝑥0 )
1! 2! 3! 4!
(0.25) (0.25)2 (0.25)3
𝑦𝑦(𝑥𝑥1 ) = 1 + (0) + (0) + (6)
1 2 6
𝑦𝑦(𝑥𝑥1 ) = 1 + 0 + 0 + (0.015625)

𝑦𝑦(𝑥𝑥1 ) = 1.015625

## Untuk 𝑦𝑦(0.50) diperoleh dengan:

𝑦𝑦(𝑥𝑥1 ) = 1.015625
1 1
𝑦𝑦 ′ (𝑥𝑥1 ) = 3𝑥𝑥2 = 3(0,25)2 1.015625 = 0,1846
𝑦𝑦

1 1
𝑦𝑦′′ (𝑥𝑥1 ) = 6𝑥𝑥 = 6(0,25) 1.015625 = 1,4769
𝑦𝑦

1 1
𝑦𝑦 ′′′ (𝑥𝑥1 ) = 6 = 6 1.015625 = 5,9077
𝑦𝑦

Maka :

ℎ ′ ℎ2 ′′ ℎ3 ′′′ ℎ4 ′′′′
𝑦𝑦2 = 𝑦𝑦�𝑥𝑥1 (𝑥𝑥 )
� + 𝑦𝑦 1 + 𝑦𝑦 (𝑥𝑥 )
1 + 𝑦𝑦 (𝑥𝑥 )
0 + 𝑦𝑦 (𝑥𝑥0 )
1 2 3! 4!
(0.25) (0.25)2 (0.25)3
𝑦𝑦(𝑥𝑥2 ) = 1.015625 + 0,1846 + 1,4769 + 5,9077
1 2 6

## 𝑦𝑦(𝑥𝑥2 ) = 1.015625 + 0,04615 + 0,046153 + 0,02645

𝑦𝑦(𝑥𝑥2 ) = 1,1344

## Untuk 𝑦𝑦(0.75) diperoleh dengan:

𝑦𝑦(𝑥𝑥2 ) = 1,1344
1 1
𝑦𝑦 ′ (𝑥𝑥2 ) = 3𝑥𝑥2 = 3(0,5)2 1,1344 = 0,6611
𝑦𝑦

1 1
𝑦𝑦′′ (𝑥𝑥2 ) = 6𝑥𝑥 = 6(0,5)
1,1344
= 2,6446
𝑦𝑦

1 1
𝑦𝑦 ′′′ (𝑥𝑥2 ) = 6 =6
1,1344
= 5,2891
𝑦𝑦

Maka :

ℎ ℎ2 ℎ3 ℎ4
𝑦𝑦3 = 𝑦𝑦�𝑥𝑥2 � + 𝑦𝑦 ′ (𝑥𝑥2 ) + 𝑦𝑦 ′′ (𝑥𝑥2 ) + 𝑦𝑦 ′′′ (𝑥𝑥2 ) + 𝑦𝑦 ′′′′ (𝑥𝑥2 )
1 2 3! 4!
(0.25) (0.25)2 (0.25)3
𝑦𝑦(𝑥𝑥3 ) = 1,1344 + 0,6611 + 2,6446 + 5,2891
1 2 6

## 𝑦𝑦(𝑥𝑥3 ) = 1,1344 + 0,1653 + 0,0826 + 0,0138

𝑦𝑦(𝑥𝑥3 ) = 1,3961

## Untuk 𝑦𝑦(0.75) diperoleh dengan:

𝑦𝑦(𝑥𝑥3 ) = 1,3961
1 1
𝑦𝑦 ′ (𝑥𝑥3 ) = 3𝑥𝑥2 = 3(0,75)2 1,3961 = 1,2087
𝑦𝑦

1 1
𝑦𝑦′′ (𝑥𝑥3 ) = 6𝑥𝑥 = 6(0,75)
1,3961
= 3,2233
𝑦𝑦
1 1
𝑦𝑦 ′′′ (𝑥𝑥2 ) = 6 =6
1,3961
= 4,2977
𝑦𝑦

Maka :

ℎ ′ ℎ2 ′′ ℎ3 ′′′ ℎ4 ′′′′
𝑦𝑦4 = 𝑦𝑦�𝑥𝑥2 (𝑥𝑥 )
� + 𝑦𝑦 2 + 𝑦𝑦 (𝑥𝑥 )
2 + 𝑦𝑦 (𝑥𝑥 )
2 + 𝑦𝑦 (𝑥𝑥2 )
1 2 3! 4!
(0.25) (0.25)2 (0.25)3
𝑦𝑦(𝑥𝑥4 ) = 1,3961 + 1,2087 + 3,2233 + 4,2977
1 2 6

## 𝑦𝑦(𝑥𝑥4 ) = 1,3961 + 0,3022 + 0,1007 + 0,0112

𝑦𝑦(𝑥𝑥4 ) = 1,8102

d. Metode Runge-kutta

## 𝑘𝑘1 = ℎ𝑓𝑓(𝑥𝑥𝑟𝑟 , 𝑦𝑦𝑟𝑟 )

1
= ℎ𝑓𝑓(3(𝑥𝑥)2 )
𝑦𝑦
1
= 0,25(3(0)2 )
1
=0
ℎ 𝑘𝑘1
𝑘𝑘2 = ℎ𝑓𝑓(𝑥𝑥𝑟𝑟 + , 𝑦𝑦𝑟𝑟 + )
2 2
ℎ 2 1
= ℎ𝑓𝑓(3 �𝑥𝑥 + � )
2 𝑦𝑦 + 𝑘𝑘1
2
0,25 2 1
= 0,25(3 �0 + � )
2 0
1+2
= 0,0117

## 𝑘𝑘3 = ℎ𝑓𝑓(𝑥𝑥𝑟𝑟 + ℎ, 𝑦𝑦𝑟𝑟 − 𝑘𝑘1 + 2𝑘𝑘2 )

1
= ℎ𝑓𝑓(3(𝑥𝑥 + ℎ)2 )
𝑦𝑦 − 𝑘𝑘1 + 2𝑘𝑘2
1
= 0,25(3(0 + 0,25)2 )
1 − 0 + 2(0,0117)
= 0,0458

Maka :
𝑘𝑘1 + 4𝑘𝑘2 + 𝑘𝑘3
𝑦𝑦𝑟𝑟+1 = 𝑦𝑦𝑟𝑟 + � �
6
0 + 4(0,0117) + 0,0458
= 1+� �
6
= 1,0154
4. Algoritma Program Heun