Anda di halaman 1dari 9

Maisy Amelia Silvani

11160940000066
Matematika B (Metode Numerik)

6. Gunakan polinomial Lagrange derajat satu, dua dan tiga untuk mengaproksimasi fungsi
berikut:

a. f ( 0.43 ) jika f ( 0 )=1, f ( 0.25 )=1.64872, f ( 0.5 )=2.17828, f ( 0.75 )=4.48169


b.
f ( 0 ) jika f (−0.5 )=1.93750, f (−0.25 )=1.33203, f ( 0.25 ) =0.800781, f ( 0.5 )=0.687500
c.
f ( 0.18 ) jika f ( 0.1 )=−0.29004986, f ( 0.2 )=−0.56079734, f ( 0.3 )=−0.81401972, f ( 0.4 )=−1.0526302
d.
f ( 0.25 ) jika f (−1 ) =0.86199480, f (−0.5 )=0.95802009, f ( 0 )=1.0986123, f ( 0.5 )=¿ 86123,, simasi fungsi b

Penyelesaian:

a. Derajat satu : misal f ( x 0 )=f ( 0.25 ) f ( x 1 )=f ( 0.5 ) maka ambil x0 = 0.25, x1 = 0.5
x−x 1 x−0.5
L0 ( x )= =
x 0−x 1 0.25−0.5

x −x 0 x −0.25
L1 ( x )= =
x 1−x 0 0.5−0.25

0.43−0.5
untuk x = 0.43, maka L0 ( 0.43 )= =0.28
0.25−0.5

0.43−0.25
L1 ( 0.43 ) = =0. 72
0.5−0.25

Masukkan f ( 0.25 )=1.64872 dan f ( 0.5 )=2.17828 sehingga

p(0.43) =
Li ( x ) f ( xi )=¿ ( 0.28 ) ( 1.64872 )+ ( 0.72 ) (2.17828 )=0.4616416+1.5683616=2.0300032
n

∑¿
i =0

Derajat dua : misal f ( x 0 )=f ( 0 ) f ( x 1 )=f ( 0.25 ) , f ( x 2 )=f ( 0.5 ) maka ambil x0 =
0, x1 = 0.25, x2 = 0.5

( x−x 1)(x−x 2) (x−0.25)(x−0.5)


L0 ( x )= =
( x 0−x 1)(x 0−x 2) (0−0.25)(0−0.5)

( x−x 0)( x−x 2) ( x−0)(x−0.5)


L1 ( x )= =
( x 1−x 0)( x 1−x 2) (0.25−0)(0.25−0.5)
(x−x 0)(x −x 1) (x−0)( x−0.25)
L2 ( x )= =
( x 2−x 0)(x 2−x 1) (0.5−0)(0.5−0.25)

( 0.43−0.25 )( 0.43−0.5 )
untuk x = 0.43, maka L0 ( 0.43 )= =−0.1008
(0−0.25)(0−0.5)

(0.43−0)(0.43−0.5)
L1 ( 0.43 ) = =0.4816
(0.25−0)(0.25−0.5)

(0.43−0)(0.43−0.25)
L2 ( 0.43 ) = =0.6192
(0.5−0)(0.5−0.25)

Masukkan f ( 0 )=1, f ( 0.25 )=1.64872 dan f ( 0.5 )=2.17828 sehingga

p(0.43) =
Li ( x ) f ( xi )=¿ ( 1 ) (−0.1008 )+ ( 0.4816 ) (1.64872 ) + ( 0.6192 ) ( 2.17828 )=−0.1008+ 0.794023552+1.34879
n

∑¿
i=0

Derajat tiga : misal f ( x 0 )=f ( 0 ) f ( x 1 )=f ( 0.25 ) , f ( x 2 )=f ( 0.5 ) ,


f ( x 3 )=f ( 0.75 ) maka ambil x0 = 0, x1 = 0.25, x2 = 0.5, x2 = 0.75

( x−x 1)( x−x 2)( x−x 3) (x−0.25)( x−0.5)(x−0.75)


L0 ( x )= =
( x 0−x 1)(x 0−x 2)(x 0−x 3) (0−0.25)(0−0.5)(0−0.75)

(x−x 0)(x−x 2)( x−x 3) (x−0)(x−0.5)(x−0.75)


L1 ( x )= =
( x 1−x 0)(x 1−x 2)( x 0−x 3) (0.25−0)(0.25−0.5)(0.25−0.75)

( x−x 0 )( x−x 1 )( x−x 3 ) ( x−0 )( x−0.25 )( x−0.75 )


L2 ( x )= =
( x 2−x 0 ) ( x 2−x 1 ) ( x 2−x 3) ( 0.5−0 )( 0.5−0.25 ) ( 0.5−0.75 )

( x−x 0 ) ( x−x 1 ) ( x−x 2 ) (x−0)( x−0.25)(x −0.5)


L3 ( x )= =
( x 3−x 0 )( x 3−x 1 ) (x 3−x 2) (0.75−0)( 0.75−0.25)(0.75−0.5)

untuk x = 0.43, maka


(0.43−0.25)(0.43−0.5)( 0.43−0.75)
L0 ( 0.43 )= =−0.043008
(0−0.25)(0−0.5)(0−0.75)

(0.43−0)(0.43−0.5)(0.43−0.75)
L1 ( 0.43 ) = =0.308224
(0.25−0)(0.25−0.5)(0.25−0.75)

( 0.43−0 ) ( 0.43−0.25 ) ( 0.43−0.75 )


L2 ( 0.43 ) = =0.792576
( 0.5−0 ) ( 0.5−0.25 ) ( 0.5−0.75 )

(0.43−0)(0.43−0.25)( 0.43−0.5)
L3 ( 0.43 )= =−0.057792
(0.75−0)(0.75−0.25)( 0.75−0.5)
Masukkan f ( 0 )=1,
f ( 0.25 )=1.64872 dan f ( 0.5 )=2.17828 , f ( 0.75 )=4.48169 sehingga

p(0.43) =
Li ( x ) f ( xi )=¿ ( 1 ) (−0.043008 ) + ( 0.308224 ) ( 1.64872 )+ ( 0.792576 )( 2.17828 )+ (−0.057792 ) ( 4.48169 ) =2
n

∑¿
i=0

b. Derajat satu : misal f ( x 0 )=f (−0.25 ) f ( x 1 )=f ( 0.25 ) maka ambil x0 = - 0.25, x1
= 0.25
x−x 1 x−0.25
L0 ( x )= =
x 0−x 1 −0.25−0.25

x −x 0 x −(−0.25)
L1 ( x )= =
x 1−x 0 0.25−(−0.25)

0−0.25
untuk x = 0, maka L0 ( 0 )= =0.5
−0.25−0.25

0−(−0.25)
L1 ( 0 ) = =0.5
0.25−(−0.25)

Masukkan , f (−0.25 )=1.33203, dan f ( 0.25 )=0.800781 sehingga

p(0) =
Li ( x ) f ( xi )=¿ ( 0.5 ) ( 1.33203 ) + ( 0.5 ) ( 0.800781 )=0.666015+ 0.4003905=1.0664055
n

∑¿
i=0

Derajat dua : misal f ( x 0 )=f (−0.5 ) , f ( x 1 )=f (−0.25 ) , f ( x 2 ) =f ( 0.25 ) maka


ambil x0 = - 0.5, x1 = - 0.25, x2 = 0.25

(x−(−0.25))( x−0.25)
( x−x 1)( x−x 2) ¿
L0 ( x )= =¿
(x 0−x 1)( x 0−x 2) (−0.5−(−0.25))(−0.5−0.25)

(x−(−0.5))(x−0.25)
(x−x 0)(x−x 2) ¿
L1 ( x )= =¿
( x 1−x 0)(x 1−x 2) (−0.25−(−0.5))(−0.25−0.25)

(x−x 0)(x −x 1) ( x−(−0.5))( x−(−0.25))


L2 ( x )= =
( x 2−x 0)(x 2−x 1) (0.25−(−0.5))(0.25−(−0.25))
untuk x = 0, maka
(0−(−0.25))(0−0.25)
¿ −0.0625
L0 ( 0 )=¿ = =0.3333333333
(−0.5−(−0.25))(−0.5−0.25) 0.1875

( 0−(−0.5))(0−0.25)
¿ −0.125
L1 ( 0 ) =¿ = =1
(−0.25−(−0.5))(−0.25−0.25) −0.125

(0−(−0.5))( 0−(−0.25)) 0.125


L2 ( 0 ) = = =0.3333333333
(0.25−(−0.5))( 0.25−(−0.25)) 0.375

Masukkan f (−0.5 )=1.93750, f (−0.25 ) =1.33203, f ( 0.25 )=0.800781 sehingga

p(0) =
Li ( x ) f ( xi )=¿ ( 0.3333333333 ) ( 1.93750 )+ ( 1 )( 1.33203 ) + ( 0.3333333333 )( 0.800781 )=0.6458333333+ 0
n

∑¿
i=0

Derajat tiga : misal ( x 0 )=f (−0.5 ) , f ( x 1 )=f (−0.25 ) , f ( x 2 ) =f ( 0.25 ) ,


f ( x 3 )=f ( 0.5 ) maka ambil x0 = -0.5, x1 = -0.25, x2 = 0.25, x2 = 0.5

( x−x 1)( x−x 2)( x−x 3) (x−(−0.25))( x−( 0.25))( x−0.5)


L0 ( x )= =
( x 0−x 1)(x 0−x 2)(x 0−x 3) (−0.5−(−0.25))(−0.5−0.25)(0−0.5)

(x−x 0)( x−x 2)( x−x 3) ( x−(−0.5))( x−0.25)(x −0.5)


L1 ( x )= =
( x 1−x 0)(x 1−x 2)( x 0−x 3) (−0.25−(−0.5))(−0.25−0.25)(−0.25−0.5)

( x−x 0 )( x−x 1 )( x−x 3 ) ( x−(−0.5)) ( x−(−0.25) ) ( x−0.5 )


L2 ( x )= =
( x 2−x 0 ) ( x 2−x 1 ) ( x 2−x 3) ( 0.25−0 ) ( 0.25−(−0.25) ) ( 0.25−0.5 )

( x−x 0 ) ( x−x 1 ) ( x−x 2 ) (x−(−0.5))(x−(−0.25))(x−0.25)


L3 ( x )= =
( x 3−x 0 )( x 3−x 1 ) (x 3−x 2) (0.5−(−0.5))(0.5−(−0.25))(0.5−0.25)

untuk x = 0, maka

(0−(−0.25))(0−(0.25))(0−0.5) 0.03125
L0 ( 0 )= = =−0.3333333333
(−0.5−(−0.25))(−0.5−0.25)(0−0.5) −0.09375
(0−(−0.5))(0−0.25)( 0−0.5) 0.0625
L1 ( 0 ) = = =0.6666666667
(−0.25−(−0.5))(−0.25−0.25)(−0.25−0.5) 0.09375

( 0−(−0.5) ) ( 0−(−0.25) ) ( 0−0.5 ) −0.0625


L2 ( 0 ) = = =2
( 0.25−(−0.5) ) ( 0.25−(−0.25) ) ( 0.25−0.5 ) −0.03125

(0−(−0.5))( 0−(−0.25))(0−0.25) −0.03125


L3 ( 0 )= = =−0.166666667
(0.5−(−0.5))(0.5−(−0.25))(0.5−0.25) 0.1875
Masukkan
f (−0.5 )=1.93750, f (−0.25 ) =1.33203, f ( 0.25 )=0.800781 , f ( 0.5 ) =0.687500 sehingga

p(0) =
Li ( x ) f ( xi )=¿ (−0.3333333333 )( 1.93750 )+ ( 0.6666666667 )( 1.33203 ) + ( 2 ) ( 0.800781 ) + (−0.166666667
n

∑¿
i=0

c. Derajat satu : misal f ( x 0 )=f ( 0.1 ) ,dan f ( x 1 )=f ( 0.2 ) maka ambil x0 = 0.1, x1 =
0.2
x−x 1 x−0.2
L0 ( x )= =
x 0−x 1 0.1−0.2

x −x 0 x−0.1
L1 ( x )= =
x 1−x 0 0.2−0.1

0.18−0.2
untuk x = 0.18, maka L0 ( 0.18 )= =0.2
0.1−0.2

0.18−0.1
L1 ( 0.18 ) = =0.8
0.2−0.1

Masukkan , f ( 0.1 )=−0.29004986, f ( 0.2 ) =−0.56079734 sehingga

p(0.18) =
Li ( x ) f ( xi )=¿ ( 0.2 ) (−0.29004986 )+ ( 0.8 ) (−0.56079734 )=−0.058009972−0.448637872=−0.506647
n

∑¿
i=0

Derajat dua : misal misal f ( x 0 )=f ( 0.1 ) , f ( x 1 )=f ( 0.2 ) , f ( x 2 )=f (0.3) maka
ambil x0 = 0.1, x1 = 0.2, x2 = 0.3

( x−x 1)(x−x 2) (x−0.2)(x−0.3)


L0 ( x )= =
( x 0−x 1)(x 0−x 2) (0.1−0.2)(0.1−0.3)

(x−x 0)(x−x 2) ( x −0.1)(x −0.3)


L1 ( x )= =
( x 1−x 0)(x 1−x 2) (0.2−0.1)(0.2−0.3)

(x−x 0)(x −x 1) (x−0.1)(x−0.2)


L2 ( x )= =
( x 2−x 0)(x 2−x 1) (0.3−0.1)(0.3−0.2)

(0.18−0.2)(0.18−0.3)
untuk x = 0.18, maka L0 ( 0.18 )= =0.12
( 0.1−0.2)(0.1−0.3)

(0.18−0.1)(0.18−0.3)
L1 ( 0.18 ) = =0.96
(0.2−0.1)(0.2−0.3)
(0.18−0.1)(0.18−0.2)
L2 ( 0.18 ) = =−0.08
(0.3−0.1)(0.3−0.2)

Masukkan
f ( 0.1 ) =−0.29004986, f ( 0.2 ) =−0.56079734, f ( 0.3 )=−0.81401972 sehingga

p(0.43) =
Li ( x ) f ( xi )=¿ ( 0.12 ) (−0.29004986 )+ ( 0.96 ) (−0.56079734 ) + (−0.08 ) (−0.81401972 )=−0.034805983−
n

∑¿
i=0

Derajat tiga : misal f ( x 0 )=f ( 0.1 ) , f ( x 1 )=f ( 0.2 ) , f ( x 2 )=f ( 0.3 ) , f ( x 3 )=f (0.4)
maka ambil x0 = 0.1, x1 = 0.2, x2 = 0.3, x3 = 0.4
( x−x 1)( x−x 2)( x−x 3) ( x −0.2)(x −0.3)( x−0.4)
L0 ( x )= =
( x 0−x 1)(x 0−x 2)(x 0−x 3) (0.1−0.2)(0.1−0.3)(0.1−0.4)

(x−x 0)(x−x 2)( x−x 3) ( x−0.1)( x−0.3)(x−0.4)


L1 ( x )= =
( x 1−x 0)(x 1−x 2)( x 0−x 3) (0.2−0.1)(0.2−0.3)( 0.2−0.4)

( x−x 0 )( x−x 1 )( x−x 3 ) ( x −0.1)( x −0.2)(x −0.4)


L2 ( x )= =
( x 2−x 0 ) ( x 2−x 1 ) ( x 2−x 3) (0.3−0.1)(0.3−0.2)(0.3−0.4)

( x−x 0 ) ( x−x 1 ) ( x−x 2 ) ( x−0.1)(x−0.2)( x−0.3)


L3 ( x )= =
( x 3−x 0 )( x 3−x 1 ) (x 3−x 2) (0.4−0.1)(0.4−0.2)(0.4−0.3)

untuk x = 0.18, maka

(0.18−0.2)(0.18−0.3)( 0.18−0.4 )
L0 ( 0.18 )= =0.088
( 0.1−0.2)(0.1−0.3)( 0.1−0.4)
(0.18−0.1)(0.18−0.3)(0.18−0.4)
L1 ( 0.18 ) = =1.056
(0.2−0.1)(0.2−0.3)(0.2−0.4)

(0.18−0.1)(0.18−0.2)(0.18−0.4)
L2 ( 0.18 ) = =−0.176
(0.3−0.1)( 0.3−0.2)(0.3−0.4)

(0.18−0.1)(0.18−0.2)(0.18−0.3)
L3 ( 0.18 )= =0.032
(0.4−0.1)( 0.4−0.2)( 0.4−0.3)

Masukkan
f ( 0.1 ) =−0.29004986, f ( 0.2 ) =−0.56079734, f ( 0.3 )=−0.81401972, f ( 0.4 ) =−1.0526302 sehingga

p(0.43) =
Li ( x ) f ( xi )=¿ ( 0.088 ) (−0.29004986 ) + ( 1.056 ) (−0.56079734 ) + (−0.176 ) (−0.81401972, ) + ( 0.032 ) (−1.0
n

∑¿
i=0
d. Derajat satu : misal f ( x 0 )=f ( 0 ) , dan f ( x 1 )=f ( 0.5 ) maka ambil x0 = 0, x1 = 0.5
x−x 1 x−0.5
L0 ( x )= =
x 0−x 1 0−0.5

x −x 0 x −0
L1 ( x )= =
x 1−x 0 0.5−0

0.25−0.5
untuk x = 0.25, maka L0 ( 0.25 )= =0.5
0−0.5

0.25−0
L1 ( 0.25 ) = =0.5
0.5−0

Masukkan
, f ( 0 ) =1.0986123, f ( 0.5 )=¿ 86123,, simasi fungsi berikut :75 ¿=4.48169 dua dantiga untuk mengapro

p(0.18) =
Li ( x ) f ( xi )=¿ ( 0.5 ) ( 1.0986123 ) + ( 0.5 ) ( 1.2943767 )=0.54930615+ 0.64718835=1.1964945
n

∑¿
i=0

Derajat dua : misal f ( x 0 )=f (−0.5 ) , f ( x 1 )=f ( 0 ) , f ( x 2 )=f (0.5) maka ambil x0
= -0.5, x1 = 0, x2 = 0.5

( x−x 1)(x−x 2) ( x−0)(x −0.5)


L0 ( x )= =
( x 0−x 1)(x 0−x 2) (−0.5−0)(−0.5−0.5)

(x−x 0)(x−x 2) ( x−(−0.5))( x−0.5)


L1 ( x )= =
( x 1−x 0)(x 1−x 2) ( 0−(−0.5))(0−0.5)

(x−x 0)(x −x 1) (x−(−0.5))(x−0)


L2 ( x )= =
( x 2−x 0)(x 2−x 1) (0.5−(−0.5))(0.5−0)

(0.25−0)(0.25−0.5)
untuk x = 0.25, maka L0 ( 0.18 )= =−0.125
(−0.5−0)(−0.5−0.5)

(0.25−(−0.5))(0.25−0.5)
L1 ( 0.18 ) = =0.75
(0−(−0.5))(0−0.5)

(0.25−(−0.5))( 0.25−0)
L2 ( 0.18 ) = =0.375
(0.5−(−0.5))( 0.5−0)

Masukkan
f (−0.5 )=0.95802009, f ( 0 )=1.0986123, f ( 0.5 ) =¿ 86123,, simasi fungsi berikut :75 ¿=4.48169 dua da
p(0.43) =
Li ( x ) f ( xi )=¿ (−0.125 ) ( 0.95802009 )+ ( 0.75 ) (1.0986123 )+ ( 0.375 ) (1.2943767 )=−0.119752511+ 0.823
n

∑¿
i=0

Derajat tiga : misal f ( x 0 )=f (−0.5 ) , f ( x 1 )=f ( 0 ) , f ( x 2 )=f ( 0.5 ) , f ( x 3 )=f (−1)
maka ambil x0 = -0.5, x1 = 0, x2 = 0.5, x3 = -1
−0.5−(−1)
(−0.5−0)(−0.5−0.5)¿
( x−x 1)( x−x 2)( x−x 3) (x−0)(x−0.5)(x−(−1 ))
L0 ( x )= =
( x 0−x 1)(x 0−x 2)(x 0−x 3) ¿

x−(−1)
¿
( x−(−0.5))( x−0.5)¿
(x−x 0)(x−x 2)( x−x 3)
L1 ( x )= =¿
( x 1−x 0)(x 1−x 2)( x 0−x 3)

( x−x 0 )( x−x 1 )( x−x 3 ) ( x −(−0.5))( x −0)( x−(−1 ))


L2 ( x )= =
( x 2−x 0 ) ( x 2−x 1 ) ( x 2−x 3) (0.5−(−0.5))(0.5−0)( 0.5−(−1 ) )

( x−x 0 ) ( x−x 1 ) ( x−x 2 ) ( x−(−0.5))( x−0)( x−0.5)


L3 ( x )= =
( x 3−x 0 )( x 3−x 1 ) ( x 3−x 2) (−1−(−0.5))(−1−0)(−1−0.5)

untuk x = 0.25, maka

−0.5−(−1)
¿
(−0.5−0)(−0.5−0.5)¿
(0.25−0)(0.25−0.5)(0.25−(−1 ) )
L0 ( 0.25 )= ¿
0.25−(−1)
¿
(0.25−(−0.5))( 0.25−0.5)¿
L 1 ( 0.25 )=¿

(0.25−(−0.5))(0.25−0)(0.25−(−1 ))
L2 ( 0.25 ) = =0.3125
(0.5−(−0.5))(0.5−0)(0.5−(−1 ))

(0.25−(−0.5))( 0.25−0)(0.25−0.5)
L3 ( 0.25 )= =0.0625
(−1−(−0.5))(−1−0)(−1−0.5)

Masukkan
f (−1 )=0.86199480, f (−0.5 )=0.95802009, f ( 0 )=1.0986123, f ( 0.5 )=¿ 86123,, simasi fungsi berikut : 7
p(0.43) =
Li ( x ) f ( xi )=¿ ( 0.1041666667 ) ( 0.95802009 ) + ( 0.9375 ) ( 1.0986123 ) + ( 0.3125 ) ( 1.2943767 ) + ( 0.0625 ) ( 0.8
n

∑¿
i=0