࣭ࣚ࢞ ᮥઝᵋ⍶/* Interpolation

*/
Interpolation_introduction
§1 ⁼⋇ᮣ౛²౞ᴌ᭝ᬂ
problem formulation-----function approximation
ρ
Interpolation_introduction
౞ᴌ᭝ᬂӮᵋ⍶Ṟ៷ኑॺ৬ዠTaylorௐᴌॺ
FourierௐᴌॺṞ⃗தᵋ⍶੐᫬Ϡதᵋ⍶ॺᔙ
⎂౧Ộࣴॺኚᒇ߇ท᭝ᬂᝐੑ
Ṿࣇ᜾ᝐᬏఖ౞ᴌӮ᭝ᬂॺ࢜ᕴब௶ᮥઝ⍶
(chapter 2)຦ṗ৔ࡡՄ᭝ᬂ੐ṗᔙᜂᵋ᭝ᬂ
޴ᴀᴌᭉ᫋ะ(chapter 3)
Interpolation_introduction
ᮥઝ༷⛯
ᮥઝậॗ
ᮥઝ⁼⋇
ኑ⊨ឍᮥઝᶭᴌઝ౧ỘӮᆝṾᚍ௘ॺᛑρằ᜷शᒶᮥ౞ᴌ
Ӯᬂঝ౞ᴌઝॺ⅟੐Ọ⛯ॺᔉᴌ੐ߝ౧ॶࣚႴ࢞ ᴌઝߝ
౧຦ᴌઝ᠝౧ॷॺᗅ᠝౧ᵋ߱ॶࣚࣵ࢞ॷ੐ߝ౧ᵋ߱
ᮥઝ
ኑ⊨ឍᮥઝ----polynomial interpolation
Problem I. ంᒴy=f(x)Ӯ౞ᴌᑾ, x
i
c[a,b]
n i y x P
i
i
n
, ... , 0 , ) (
= =
⋱⇺ᴌ࡮ᣲ᫸n Ӯኑ⊨ឍ
ৠ᠆
n
n n
x a x a a x P + + + = .
1 0
) (
ậॗঈᵫ᲻ะ༷⛯ॺඵ
j i
x x =
j i =
Interpolation
interval
Interpolation
condition
Interpolation
polynomial
Interpolation points
Interpolation polynomial
(2.1)
(2.2)
x
0
x
1
x
2
x
3
x
4
x
Pn(x) < f(x)
ኑ⊨ឍᮥઝӮుশ᥉ࢪ
Interpolation polynomial

ᮥઝኑ⊨ឍӮ༾ࡡᢂ
‡ ᮣ⁼ঈProblem I ࢎӮP
n
(x)ᶭํᑻჭ঍
ྑᑻჭॺᶭํ༾ࡡ঍ዠশ⋱঍
Interpolation polynomial
Interpolation polynomial
ዠশ⋱঍ᗅ௨ᢂᵋ߱
௭ॶ2.3ॷ----៴ᒴ੝
ᴌ⍶
U
Interpolation polynomial
§2 ᪷έṬᵯኑ⊨ឍ /* Lagrange Polynomial */
n i y x P
i i n
, ... , 0 , ) (
= =
⋱n ⇺ኑ⊨ឍ ৠ᠆
n
n n
x a x a a x ! .
1 0
) (
ậॗঈᵫ᲻ะ༷⛯ॺඵ j i
x x {
j i {
n = 1
ᚚؚx
0
, x
1
; y
0
, y
1
ॺ⋱ x a a x P
1 0 1
) ( + = ৠ᠆
1 1 1 0 0 1
) ( , ) ( y x P y x P
= =
ปᖥP
1
(x) ᶭ᫸( x
0
, y
0
) ຦( x
1
, y
1
) ࢅ⛯ӮՄ௨ੑ
) ( ) (
0
0 1
0 1
0 1
x x
x x
y y
y x P

+ =
1 0
1
x x
x x

0 1
0
x x
x x

= y
0
+ y
1
l
0
(x) l
1
(x)
L
=
=
1
0
) (
i
i i
y x l
ߞ࢛᪷⋁ᆝ౞ᴌ /* Lagrange Basis */ॺ
╏ᤖậॗl
i
(x
j
)=o
ij
/* Kronecker Delta */
§2 Lagrange Polynomial
n > 1
ᚮṯ᩷ಏl
i
(x)ॺi = 0, «, n ৠ᠆l
i
(x
j
)=o
ij
উOึॅ
ॺ౹ᶺOṞP
n
(x
i
) = y
i

l
i
(x) ⊆ࢋl
i
Ṟn ࢋὰx
0
« x
i
« x
n
= =
j
i
C
0
H
=

n
j = i
j
x x ) (

i n
x x
i
x x x x C
0
) )...( )...( (
i
x l ) (
H

=
j = i
j x
i
x
i
C
) (
1
=
i
i
x
l 1 ) (
¦
=
=

=
n
j
i j
j i
j
i
x x
x x
x l
0
) (
) (
) (
¯
=
=
n
i
i i n
y x l x L
0
) ( ) (
Lagrange
Polynomial
࡯༷⛯Ṟ௔ॺഡ࡯fᵫ௔
L
=
=
n
i
i n
x l x P
0
)
( ) ( y
i
ᆝ౞ᴌ⍶ॶn=1ᤅ្Ӯ᭽ᜎॷ
§2 Lagrange Polynomial
ᒴˇ
(༾ࡡᢂ) ╏ᤖ Ӯn ₿ᮥઝኑ
⊨ឍᶭ༾ࡡᑻჭӮੑ
n i y x P
i i
, ... , 0 , ) ( = =
᝗ᶓঈ( ಫ↾ᚚಉρVandermonde ᑧ౷ឍᝐ᝗)
฀᝗ঈྑ࡮༾ࡡॺ౹⃦ࣧL
n
(x) ኎ᬉṞณࡡn ₿ኑ⊨
ឍP
n
(x) ╏ᤖP
n
(x
i
) = y
i

ചᓯ ౹Q
n
Ӯ₿ᴌ
, ) ( ) ( ) ( x x x Q
n n n
!
e n
ഡQ
n
Ṟ ࢋ࡮ิӮὰ n + 1 x
0
« x
n
⎆ঈྑ࡮ᔐኑ⊨ឍ⇺ᴌ⃗ಕ࢛n ॺ౹ᮥઝኑ⊨ឍ࡮༾ࡡੑ
৬ዠ ࣀᶭࡡࢋᮥઝ
ኑ⊨ឍॺௗࢎ ปॆᶭड़᥉ኑ⊨ឍੑ
¦
=
+ =
n
i
i n
x x x p x L x P
0
) ( ) ( ) ( ) (
) ( x p
§2 Lagrange Polynomial
ᮥઝ঺⊨/* Remainder */
᝔༷⛯
) 1 ( n
f
ჭ[a , b]௦ᑻჭ, ചᓯᨰᵁចᚖ ) ( ) ( ) ( x x f x R
n n
!
] , [ b a C f
n

b x x x a
n
e e .
1 0
ॺࡵf ╏ᤖậॗ ,
Rolle¶s Theorem: ྑ ஦౧ப┿ॺ ॺ౹
ᑻჭ ৠ᠆ ੑ
) ( x o
0 ) ( ) (
1 0
! ! x x o o
) , (
1 0
x x  \
0 ) ( !
d
\ o
᭽ᜎঈྑ
0 ) ( ) ( ) (
2 1 0
! ! ! x x x o o o ) , ( ), , (
2 1 1 1 0 0
x x x x   \ \
ৠ᠆ 0 ) ( ) (
1 0
= ' = ' \ N \ N ) , (
1 0
\ \ \ 
ৠ᠆
0 ) ( ! d d\ o
0 ) ( ) (
0
! ! !
n
x x N N .
ᑻჭ ) , ( b a  \ ৠ᠆
0 ) (
) (
= \ N
n
R
n
(x) ຸᔛṞ ࢋὰ n+1
H
=
=
n
i
i n
x
x x K x R
0
) ( ) ( ) (
ड़᥉჊ᒴx = x
i
(i = 0, «, n), ചᓯ
H
=

=
n
i
i
x t x K t
R
n
t
0
) ( ) ( ) (
) (
N
N(x)Ṟn+2 ࢋ࡮ิӮὰx
0
« x
n
x ) , ( , 0 ) (
) 1 (
b a
x x
n
 !

\ \ o
! ) 1 ( ) ( ) (
) 1 (

n x K R
x
n
n
\
⎆᥉ᬊᲺᶭᔆt ⋱ᔉ
= +
+ +
! ) 1 )( ( ) ( ) (
) 1 ( ) 1 (
n x K L f
x
n
n x
n
\ \
! ) 1 (
) (
) (
) 1 (
+
=
+
n
f
x K
x
n
\
—
!

!
n
i
i
x
n
n
x x
n
f
x R
0
) 1 (
) (
! ) 1 (
) (
) (
\
§2 Lagrange Polynomial
§1 Lagrange Polynomial
⎆ঈ ᭃᛑ࡮෥ڕᒴ\
x
, ഡᶭ঑᜷ , x(a,b)
ᔐ ঽ࢛ចᚖ঑᜷࡫⃗ੑ
1
) 1 (
) (

n
n
M x f
—
!

n
i
i
n
x x
n
M
0
1
| |
)! 1 (
ោf(x) ࢛ड़ࡡࢋ⇺ᴌe n Ӯኑ⊨ឍᵾॺ ,
ปؚ ॺඵᮥઝኑ⊨ឍᔆ࣯⇺ᴌe n Ӯኑ⊨ឍ
ᶭਫڕӮੑ
0 ) (
) 1 (
|
+
x f
n
0 ) ( | x R
n
Quiz: ంᒴx
i
= i +1, i = 0, 1, 2, 3, 4, 5. ࡬↾༃ࢋᶭl
2
(x)ӮჍର঍
y
0
-
-
- 1
0.5
-0.5
1 2 3 4 5 6
x
y
0
-
-
- 1
0.5
-0.5
1 2 3 4 5 6
x
y
0
-
-
- 1
0.5
-0.5
1 2 3 4 5 6
x
A B C

§1 Lagrange Polynomial
৬ঈᚚؚ
2
3
3
sin ,
2
1
4
sin ,
2
1
6
sin = = =
z z z
౧ಋಉρsin x Ӯ1⇺੐2⇺Lagrange ᮥઝ᜷शsin 50r
ᜅ঑᜷ចᚖੑ
ᗅঈ
0
x
1
x
2
x
18
5
50
0
z
=
n = 1
౧ಋಉρx
0
, x
1
ॆ෽x
1
, x
2
᜷श
4
,
6
1 0
z z
= = x x ಉρ
2
1
6 / 4 /
6 /
2
1
4 / 6 /
4 /
) (
1
v

+ v

=
z z
z
z z
z x x
x L
ᬊᲺ
)
3
,
6
( , si ) ( , si ) (
) 2 ( T T
\ \ \  ! !
x x x
f x x f
ഡ )
4
)(
6
(
! 2
) (
) ( ,
2
3
si
2
1
) 2 (
1
T T
\
\ ! x x
f
x R
x
x
00762 . 0 )
18
5
( 01319 . 0
1

z
R
­
sin 50
r
= 0.7660444«
)
18
5
( 50 sin
1
0
< <
z
L 0.77614
኎᭽/* extrapolation */ Ӯᒸ⃌ចᚖ< 00l00l
3
,
4
2 1
z z
= = x x ಉρ
sin 50r < 0.76008,
00660 . 0
18
5
~
00538 . 0
1
·
¦
'
+

'

·
T
R
௦ᮥ/* interpolation */ Ӯᒸ⃌ចᚖ< 000ª7o
௦ᮥᭃᛑॹ࣯኎᭽ੑᬵ᫓
ᕴ᜷शӮx ᩀჭӮඃ₂Ӯ
ࢪ⛯ॺᮥઝᳫỢ᪻ዛੑ
§1 Lagrange Polynomial
n = 2
2
3
) )( (
) )( (
2
1
) )( (
) )( (
2
1
) )( (
) )( (
) (
4 3 6 3
4 6
3 4 6 4
3 6
3 6 4 6
3 4
2
v


v


v


!
T T T T
T T
T T T T
T T
T T T T
T T
x x x x x x
x
)
18
5
( 50 sin
2
0
< <
z
L 0.76543
2
3
cos
2
1
; )
3
)(
4
)(
6
(
! 3
cos
) (
2
· ·

!
x
x
x x x x R \
T T T
\
00077 . 0
18
5
00044 . 0
2

¦
'
+

'

z
R
­
sin 50
r
= 0.7660444«
2⇺ᮥઝӮᒸ⃌ចᚖ< 0000ol
Ⓥ⇺ᮥઝᭃᛑॹ࣯
য⇺ᮥઝ ধఆᔆ࡮ᶭ⇺ᴌᣴ
Ⓥᔶᣴዛॺု
ု««
When you start writing the program,
you will find how easy it is to calculate
the Lagrange polynomial.
Oh yeah? What if I find
the current interpolation
not accurate enough?
Then you might want to take
more interpolating points into account.
Right. Then all
the Lagrange basis, l
i
(x),
will have to be re-calculated.
Excellent point !
We will come to discuss this problem
next time.
§3 ᬻ⇺௨ᢂᮥઝ /* Lagrange Polynomial */












0,1 0 1
0 0 1 1
1 0
0,1 0 0
1 0
0,2 0 2
2 0
0,2 0 0
2 0
0,2 0,1
0,1 2 0,1 1
2 1
: 1 Lagrange
,
;
: 1 Lagrange
I x x x
x f x x f x
f x f x
I x f x x x
x x
I x x x
f x f x
I x f x x x
x x
I x I x
I x I x x x
x x

= +

= +

= +

ƥ
м ƥϛᗩဿሇ๐ ఠӖԚਭƥ
ँᰂκ೤᧼ ƥ ƥ ဿሇርᐰƥ᫑ᅶဿಧਭ
м ƥϛᗩဿሇ๐ ఠӖԚਭ, ٌᄮണ
щκƥл
೙᡺










0,2 0 0,1 0
0,1 2 0 0,1 0 0 1 0,1 0 0
2 1
0,2 1 0,1 1
0,1 2 1 0,1 1 1 1 0,1 1 1
2 1
0,2 2 0,1 2
0,1 2 2 0,1 2 2 1 0,2 2 2
2 1
0,1 2 0 1 2
2
I x I x
I x I x x x I x f x
x x
I x I x
I x I x x x I x f x
x x
I x I x
I x I x x x I x f x
x x
I x x x x

! ! !

! ! !

! ! !

ƥ
ƥ
ƥ
ƥ
ᅽఠӖԚਭሇ۪δપቹƥ ೤м ƥ, ϛᗩဿሇ ๐Lagr angeఠӖ࠰ᲇਭˊ
м๢



0,1 2, 0,1 1
0,1 0,1 1 1
1
0 1
k k k
k k k
k k
k
I x I x
I x I x x x
x x
x x x k

!

L L
L L
L
ƥƥ ƥƥ
ƥƥ ƥƥ
Ꮪఋƥ
೤м ƥ, , ϛᗩဿሇ๐Lagr angeఠӖ࠰ᲇਭˊ

1
0,1 0,1 1 0,1 2,
1 1
k k
k k k k
k k k k
x x x x
I x I x I x
x x x x

!

L L L ƥƥ ƥƥ ƥƥ
ᒸ⃌࡫ॺ
ᶭᔆࢅࢋয⇺ᮥઝӮ௨ᢂᮥઝॺᬊ߄ᭃ᫸য⇺ᮥઝ௮ঽ
௨ᢂᮥઝμ᨜Ⓥ⇺ᮥઝӮᵋ⍶ߞ࢛ᬻ⇺௨ᢂᮥઝੑ
Aitken⍶(᫯࡬ᑾ᜷श)



0,1 2, 0,1 1
0,1 0,1 1 1
1
k k k
k k k
k k
I x I x
I x I x x x
x x

!

L L
L L
ƥƥ ƥƥ
ƥƥ ƥƥ
௨ᢂᮥઝᆝ౞ᴌ




0, 0,1, 0,1,2, 0,1,2,3,
0 0
1 1 0,1 0
2 2 0,2 0,1,2




k k k k k k
x f x I x I x I x I x
x f x
x f x I x x x
x f x I x I x

1
3 3 0,3 0,1,3 0,1,2,3 2
4 4 0,4 0,1,4 0,1,2,4 0,1,2,3,4 3




x x
x f x I x I x I x x x
x f x I x I x I x I x x x

0 1 2 3
x x x x x x x x
ሪ೻
ዠỢਫᜰ࡮Ỏॺሪ೻༷⛯x
4
ิᵾᑾࢎሪ೻ࡡᑧॺࡪᖶ
្ᴲ᫬࡫ඵ࢛ᩀᕴ⋱Ӯอ⇺ᮥઝኑ⊨ឍੑ
k>1 k>0 k>2 k>3 k>4
Neville⍶(᫯࡬ᑾ᜷श)




1, 1, , 1 1, , 1 1, , 1, 2
0 0
1 1 0,1 0
2 2 1,2 0,1,2




k k k k k k k k k k k k k k
x f x I x I x I x I x
x f x
x f x I x x x
x f x I x I x
+ + + +

0
3 3 2,3 1,2,3 0,1,2,3 0
4 4 3,4 2,3,4 0,1,2,4 0,1



x x
x f x I x I x I x x x
x f x I x I x I x I

,2,3,4 0
1 1 1 1


k k k k
x x x
x x x x x x x x

ሪ೻
ዠỢਫᜰ࡮Ỏॺሪ೻༷⛯x
4
ิᵾᑾࢎሪ೻ࡡᑧॺࡪᖶ្ᴲ᫬࡫
ඵ࢛ᩀᕴ⋱Ӯอ⇺ᮥઝኑ⊨ឍੑ
k>1 k>0 k>1 k>1 k>1



1 1, 0,1 1
0,1 0,1 1 0
0
k k k
k k
k
I x I x
I x I x x x
x x

= +

L L
L L
ƥƥ ƥƥ
ƥƥ ƥƥ
HW: ρ৲ঝ࣯ಫ↾Ӯᵋ⍶
ỎᭉNeville᜷श்ឍ
⎆ঈAtkinᵋ⍶຦Nevilleᵋ⍶࡯Lagrange்ឍՈ⊋ॺោ
Ⅸᕴሪ೻༷⛯ᵾॺ៷ᓐᶘϊয⇺ᮥઝỎᭉⓋ⇺ᮥઝॺഡ
Lagrangeᮥઝ்ឍࢎॺ⊆ࢋᆝ౞ᴌ᯾Ⅸᕴঽᬯោจ൦ੑ
ចᚖ঑᜷ঈ
ϊᮥઝኑ⊨ឍӮᑻჭ༾ࡡᢂؚॺमṞ
—
!

!
n
i
i
x
n
n
x x
n
f
x R
0
) 1 (
) (
! ) 1 (
) (
) (
\
ধᬊᲺปᲵρࡡ߄ṌतਠӮᵋ⍶ੑោf
(n+1)
(x)ჭᮥ
ઝඃ₂จ൦࡮ኚᵾॺ᝔f
(n+1)
(x)<Lॺ౹Ṟ


0,1 1 0 -1
0,1 2, 0 -2
- -
!
- - -
!
k k
k k k k
L
f x I x x x x x
k
L
f x I x x x x x x x
k

<
<
L
L
L
L
ƥƥ
ƥƥ


1
0,1 1 0,1 2, 0,1 1
1
0,1 2, 0,1 1
if
k
k k k k
k k
k k k
x x
f x I x I x I x
x x
I x I x I

}

@
L L L
L L
ƥƥ ƥƥ ƥƥ
ƥƥ ƥƥ
<
ป᜺࢛ ╏ᤖਫᜰᕴ⋱ੑ


0,1 1
-1
0,1 2,
-
-
k
k
k k k
f x I x
x x
f x I x x x

÷ <

L
L
ƥƥ
ƥƥ
ὰᭉಫ↾Ӯ᜷श௼Ợ঑᜷ោಫ
Ӯចᚖঈ࣬ึចᚖ঑᜷ॶᒸ
ρॷॺಫ↾ం౛Ӯចᚖ঑᜷
ॶ࣬னចᚖ঑᜷ॷ࡮ᒸρ
HW: p.58-59
#1-8
§4 ʼn⊮ᮥઝ /* Newton¶s Interpolation */
Lagrange ᮥઝዊOᶘशॺধྑᕴሪ೻ࡡࢋ༷⛯ᵾॺ
௉ᯬᆝ౞ᴌl
i
(x) ᯾Ⅸ᲻ᵄश᫸ੑ்ឍ࡮௘Ṟఐ᩸ᢂॺ
࡮ಉ࣯ి߱ੑ
ᔐL
n
(x) ᳢௺᨜
... ) )( ( ) (
1 0 2 0 1 0
x x x x a x x a a
) )...( (
1 0
+
n n
x x x x a
Ӯ្ឍॺᚮṯ⊆೻ࡡࢋ༷⛯ᵾॺ
ถ⃋೻ࡡ⊨࡫෱ඵปੑ
? ? ?
?
ᚖདྷइߞᄆᚖ /* divided difference */
) , (
) ( ) (
] , [
j i
j i
j i
j i
x x j i
x x
x f x f
x x f { {

!
1₿ᚖདྷ/* the 1st
divided difference of f
w.r.t. x
i
and x
j
*/
) (
] , [ ] , [
] , , [ k i
x x
x x f x x f
x x x f
k i
k j j i
k j i
=

= 2₿ᚖདྷ
f(x
0
)
1 0
1 0
( ) ( ) f x f x
x x

2 0 1 0
2 0 1 0
2 1
( ) ( ) ( ) ( ) f x f x f x f x
x x x x
x x

1₿ᚖདྷӮుশ
᥉ࢪঈហᨰ௨
Ӯᴲɏ
§4 Newton¶s Interpolation
§4 Newton¶s Interpolation
1
1 1 0 1 0
1 0
1 1 1 0
1 0
] , , ... , [ ] , , ... , [
] , , ... , [ ] , ... , , [
] , ... , [
+
+
+
+
+

=

=
k k
k k k k
k
k k k
k
x x
x x x f x x x f
x x
x x x f x x x f
x x f
(k+1)₿ᚖདྷঈ
§
!

d
!
k
i
i k
i
k
x
x f
x x f
0
1
0
) (
) (
] , ... , [
[
࣬ᒸ࡫
ௗࢎ , ) ( ) (
0
1 —
!

!
k
i
i k
x x x [
—
{
!

! d
k
i j
j
j i i k
x x x
0
1
) ( ) ( [
Warning: my head is exploding«
What is the point of this formula?
ᚖདྷӮઝ࡯x
i
Ӯ⊩᜜ᵫ௔९
௨ᢂঈ
1 2 0 1 0 2 0
( ) ( ) ( ) [ , , ] [ , , ] [ , , ]
k k k
f x af x bf x f x x af x x bf x x ! ! L L L
ᚖདྷปॆᑾܾ࢛౞ᴌઝӮ௨ᢂ௭ะঈ

0
0 0
0 -1 1 1
( ) ( )
[ , ... , ]
( )
k k
i i
k
i i
i i i i i i k k i
f x f x
f x x
x x x x x x x x x [
= =
+ +
= =
'

¯ ¯
L L
, ) ( ) (
0
1 —
!

!
k
i
i k
x x x [
—
{
!

! d
k
i j
j
j i i k
x x x
0
1
) ( ) ( [
ᔆߞᢂঈϊؚॺᚖདྷӮઝ࡯༷⛯Ӯ⊩᜜ᵫ௔९
ᚖདྷӮณࡡ߄ᒴࢪঈϊ2ॺ3෽ᄆᚖᒴࢪป᠆
1 0 1
0
0
[ , ... , ] [ , ... , ]
[ , ... , ]
k k
k
k
f x x f x x
f x x
x x

!

§4 Newton¶s Interpolation
6.
ᚖདྷ࡯ᔉᴌӮ௔੝ঈf(x)C
k
[a,b],౹\  [a,b], s.t.

0
[ , ... , ]
!
k
k
f
f x x
k
\
!
HW: ᝗ᶓᚖདྷӮᢂᢛ2ॺ4
§4 Newton¶s Interpolation
§4 Newton¶s Interpolation
ʼn⊮ᮥઝ /* Newton¶s Interpolation */
] , [ ) ( ) ( ) (
0 0 0
x x f x x x f x f + =
] , , [ ) ( ] , [ ] , [
1 0 1 1 0 0
x x x f x x x x f x x f !
] , ... , , [ ) ( ] , ... , [ ] , ... , , [
0 0 1 0 n n n n
x x x f x x x x f x x x f !

) )...( ( ... ) )( ( ) ( ) (
1 0 1 0 2 0 1 0
!
n n n
x x x x a x x x x a x x a a x N
« « « «
... ) )( ]( , , [ ) ]( , [ ) ( ) (
1 0 2 1 0 0 1 0 0
! x x x x x x x f x x x x f x f x f
) )...( ]( , ... , [
1 0 0
+
n n
x x x x x x f
) )( )...( ]( , ... , , [
1 0 0 n n n
x x x x x x x x x f +

N
n
(x)²n⇺ኑ
⊨ឍॺ╏ᤖঈ
N
n
(x
i
)= f(x
i
)
R
n
(x)²ᮥઝ঺⊨ॺ
╏ᤖR
n
(x
i
)=0ॺ
i=0,«,n
a
i
= f [ x
0
, «, x
i
]
(1)
(2)
(n)
(n)p(n-1) p« p(2) p(1)
§4 Newton¶s Interpolation
⎆ঈ ϊ༾ࡡᢂปؚN
n
(x) | L
n
(x)ॺถᶭश⍶࡮ิॺᑾ᫱
្ឍ࡮ิॺᳩௗ঺⊨ࣀՈิॺඵ
( 1)
0 1 1
( )
[ , , ... , ] ( ) ( )
( 1) !
n
x
n n n
f
f x x x x x
n
\
[ [

!

) , ( ,
!
) (
] , ... , [
ma mi
) (
0
x x
k
f
x x f
k
k
 ! \
\
ᒸ⃌᜷श᫸࢛߱
f (x
0
)
f (x
1
)
f (x
2
)
«
f (x
n1
)
f (x
n
)
f [x
0
, x
1
]
f [x
1
, x
2
]
« «
« «
f [x
n1
, x
n
]
f [x
0
, x
1
, x
2
]
« «
« «
f [x
n2
, x
n1
, x
n
] f [x
0
, «, x
n
]
f (x
n+1
) f [x
n
, x
n+1
] f [x
n1
, x
n
, x
n+1
] f [x
1
, «, x
n+1
] f [x
0
, «, x
n+1
]
ሪ೻
ዠỢਫᜰ࡮Ỏॺሪ೻༷⛯x
n+1
ิᵾᑾࢎሪ೻ࡡᑧॺࡪᖶ្ᴲ᫬
࡫ඵ࢛ᩀᕴ⋱Ӯอ⇺⊨੝ᴌੑ
§4 Newton¶s Interpolation
᤻༷ࣴ⛯்ឍ /* Formulae with Equal Spacing */
ูಫᚖ౧
/* forward
difference */
i i i
f f f
= A
+1
i
k
i
k
i
k
i
k
f f f f
1
1
1 1
) (

+

A A = A A = A
ูึᚖ౧
/* backward
difference */
1
1 1

\

\
=
\
i
k
i
k
i
k
f f f
i1 i i
f f f
= \
ࢎᠲᚖ౧
/* centered
difference */
2
1
2
1
1 1

+

=
i
k
i
k
i
k
f f f o o o
ௗࢎ
) (
2
2
1
h
i
i
x f f s !
s
ោ༷⛯᤻ࣴ౧ᚦᵾ:
) , ... , 0 (
0
n i h i x x
i
= + =
f
i
= f(x
i
)
ᚖ౧᜷शปᭃ᫸Ỏᭉᚖ౧ᑾ᠆ಏ

2 3 4
2 3 4 5
0 0 0 0 0 0 0
2 3 4
1 1 1 1 1 1
2 3
2 2 2 2 2
3 3





k k k k k k k
x f x f f f f f
x f f f f f f
x f f f f f
x f f f f
x f
( ( ( (
( ( ( ( (
( ( ( (
( ( (
2
3 3
4 4 4
5 5




f f
x f f
x f
( (
(
ሪ೻

2 3 4 5
0 0
1 1 1
2
2 2 2 2
3 3 3
=




k k k k k k k k
x f x f f f f f f
x f
x f f
x f f f
x f f
\ \ \ \ \
\
\ \
\
2 3
3 3
2 3 4
4 4 4 4 4 4
2 3 4 5
5 5 5 5 5 5 5




f f
x f f f f f
x f f f f f f
\ \
\ \ \ \
\ \ \ \ \
1 1
1
2 2
1 1 1 1
2 2
1 1
1
2 2
identity calculus
translation calculus :
- - ,
k k
k k k k k k
k k
If f
Ef f E f f E f f E f f
E I I E E E o

+
+

=
= = = =
A = \= =
Ƴ
ƥ ƥ ƥ
ƥ
ᚖ౧Ӯ᲻ᕴᢂᢛঈ

௨ᢂঈ৬ዠ g b f a x g b x f a A + A = + A )) ( ) ( (

อ₿ᚖ౧ปρ౞ᴌઝᑾܾঈ
!
) 1 )...( 1 (
j
j n n n
j
n
+
=
¦
¦
'
+

'

ௗࢎ
/* binomial coefficients */
§4 Newton¶s Interpolation

0 0
1 1
n n
n j j
n n j
k k k n k j
j j
n n
f E I f E f f
j j

+
= =
+ +
A = = =
¦ ¦
' ' ' '
¯ ¯


-1 ( )
0 0
1 1
n n
n
n j n j
n n j
k k k k j n
j j
n n
f I E f E f f
j j


+
= =
+ +
\ = = =
¦ ¦
' ' ' '
¯ ¯

౞ᴌઝปρอ₿ᚖ౧ᑾܾঈ

0
e.g. E
n
n
n j
n k k k k
j
n
f f I f f
j
+
=
+
= = + A = A
¦
' '
¯

ᚖདྷ࡯ᚖ౧Ӯ௔੝ঈ
? A
? A
? A ? A
? A
? A
1
1
1
1 2 1 2
1
1 2
2 2
2
1
1
- 1
,
-
, - ,
1
, ,
- 2 2
,
1
, ,
!
1 1
, ,
! !
k k k
k k k
k k k
k k k k
k k
k k k k
k k
m
k k k m k
m
m m
k k k m k m k
m m
f f f
f x x f
x x x h
f x x f x x
f f
f x x x f
x x h h
generally we have
f x x x f
m h
f x x x f f
m h m h
+
+
+
+ + +
+
+ +
+
+ +

A
= = = A
A
A A
= = = A
= A
= A = \
L
L

ྑf (x)ᶭn ⇺ኑ⊨ឍॺ౹ ᶭ ⇺ኑ
⊨ឍॺഡ
( ) (0 )
m
f x m n A e e n m
( ) 0 ( )
m
f x m n ( ! "

ᚖ౧࡯ᔉᴌӮ௔੝ϊᚖ౧࡯ᚖདྷ੐ᚖདྷ࡯ᔉᴌӮ௔੝᠆ॷঈ

? A

( )
1
( )
1
, ,
! !
m
m
k k k m k
m
m
m
k
m
f
f x x x f
m m h
f
f
h
\
\
+ +
= = A
A
÷ =
L
§4 Newton¶s Interpolation
᤻༷ࣴ⛯ʼn⊮்ឍ
ʼn⊮ಫᚖ்ឍ/* Newton¶s forward-difference formula */


? A ? A

0 0
1
1
0
0 0 1 0 0 1 0 -1
2
0 0 0 0
0 1
( ) ( ) ( )
, 0 1, , ,
( ) ( - ) 1
( ) ( ) , ( - ) , , ( - ) ( - )
1 1
1 1 ( -1)
2! !
( ) , , ,
n n
j j
n
n
n j
j
n n n
n
n
f x N x R x
x x th t x x jh x x t j h
x x x h t t t n
N x f x f x x x x f x x x x x x x
f f t f t t f t t t n
n
R x f x x x x
[
+
+
=
= +
= + = + =
= =
= + +
= + A + A + + A
=
¦
L
L L L
L L
L
? A

0
1 ( 1)
( - ) ( - )
1
( )
( 1)!
n n
n n
x x x x
t t t n
h f
n
\
+ +

=
+
L
L
⎆ঈࡡ໨ោx ↼ᬂx
0
ᵾρಫᮥॺ↼ᬂx
n
ᵾρึᮥॺᳩࢅ
߄்ឍइߞ࢛ᑾ౽்ឍ຦ᑾṽ்ឍੑ
ʼn⊮ึᚖ்ឍ/* Newton¶s forward-difference formula */


? A ? A

? A
n n
1
1
0
n n n 1 n n n 1 0 n 1
2 n
n n n n
n n 1 0
, 1 0, , ,
( ) ( - ) 1
( ) ( ) , ( - ) , , ( - ) ( - )
1 1
1 1 ( -1)
2! !
( ) , , , ( -
j j
n
n
n j
j
n
n
x x th t x x jh x x t j h
x x x h t t t n
N x f x f x x x x f x x x x x x x
f f t f t t f t t t n
n
R x f x x x x x x
[

!

! · · ! !
! !
!
! “ “ “
!
—
L
L L L
L L
L
ᗩဿӅఃƥ

n 0
1 ( 1)
) ( - )
1
( )
( 1)!
n n
x x
t t t n
h f
n
L


!

L
L
HW: p. 59
#9-16
§5 ස৬ᮥઝ /* Hermite Interpolation */
࡮दᕴ⋱౞ᴌઝ᲻ะॺഡࡵᕴ⋱ྑᜁ₿ᔉᴌࣀ᲻ะੑ
ඵঈᕴ⋱ᮥઝ౞ᴌN (x) ╏ᤖN (x
i
) = f (x
i
), N¶ (x
i
) = f ¶ (x
i
),
«, N
(mi)
(x
i
) = f
(mi)
(x
i
).
⎆ঈ N ࢋậॗปॆڕᒴ ₿ኑ⊨ឍੑ N 1
ᕴ⋱ჭ1ࢋ༷⛯x
0
ኀՄಏm
0
₿ᔉᴌ᯾᲻ะӮᮥઝ
ኑ⊨ឍඵ࢛Taylorኑ⊨ឍ
0
0
) (
!
) (
... ) )( ( ) ( ) (
0
0
0
) (
0 0 0
m
m
x x
m
x f
x x x f x f x + + ' + = N
ௗ঺⊨࢛
) 1 (
0
0
) 1 (
0
0
) (
)! 1 (
) (
) ( ) ( ) (

! !
m
m
x x
m
f
x x f x R
\
o
ࡡ໨ถചኦf ࡯f ' Ӯઝੑ
ස৬ᮥઝ
§3 Hermite Interpolation
৬ঈ᝔x
0
= x
1
= x
2
, ᚚؚf(x
0
)੐f(x
1
)੐f(x
2
) ຦f ¶(x
1
), ⋱ኑ⊨ឍP(x)
╏ᤖP(x
i
) = f (x
i
)ॺi = 0, 1, 2ॺࡵP¶(x
1
) = f ¶(x
1
), ᜅ঑᜷ចᚖੑ
ℤॠLagrange ኑ⊨ឍӮ᡹᤮ॺ᝔ ᗅঈ⎮னॺP Ӯ₿ᴌ= 3
L
+ =
2
1 3
) ( ) ( ) ( ) ( ) (
=0 i
i i
x h x
1
f ¶ x h x f x P
›
h
0
(x)
Ṟὰx
1
, x
2
ॺࡵh
0
¶(x
1
) = 0 ÷x
1
ᶭ᲻ὰੑ ) ( ) ( ) (
2
2
1 0 0
x x x x C x h
=
෻: h
0
(x
0
) = 1 ÷ C
0
) ( ) (
) ( ) (
) (
2 0
2
1 0
2
2
1
0
x x x x
x x x x
x h


!
h
2
(x)
h
1
(x)
Ṟὰx
0
, x
2
÷
) )( )( ( ) (
2 0 1
x x x x B Ax x h
+ =
ϊ঺࡬ậॗh
1
(x
1
) = 1 ຦h
1
¶(x
1
) = 0 ปᗅੑ
࡯h
0
(x) ᒨ௉৲ঝੑ
(x)
›
h
1
Ṟὰx
0
, x
1
, x
2
÷
›
h
1
) )( )( ( ) (
2 1 0 1
x x x x x x C x
=
›
h
1
෻: ¶(x
1
) = 1 ÷ C
1
ปᗅੑ
ௗࢎh
i
(x
j
) = o
ij
, h
i
¶(x
1
) = 0, (x
i
) = 0, ¶(x
1
) = 1
›
h
1
›
h
1
), ( ) )( )( ( ) ( ) ( ) (
2
2
1 0 3 3
x x x x x x x K x P x f x R = =
! 4
) (
) (
) 4 (
x
f
x K
\
=
࡯Lagrange
౧Ộᒨ௉৲

§3 Hermite Interpolation
ࡡ໨ჴॺᚚؚx
0
, «, x
n
ኀṞy
0
, «, y
n
຦y
0
¶ , «, y
n
¶ ॺ⋱H
2n+1
(x)
╏ᤖH
2n+1
(x
i
) = y
i
ॺH¶
2n+1
(x
i
) = y
i
¶ੑ
ᗅঈ᝔
L
+
=
n
i
) ( ) (
) (
=0 i
i
x F x E
y
i
x
H
2n+1 L
n
=0 i
y
i

ௗࢎE
i
(x
j
) = o
ij
, E
i
¶(x
j
) = 0, (x
j
) = 0, ¶(x
j
) = o
ij
F
i
E
i
(x)
Ṟὰx
0
, «, x
i
, «, x
n
ࡵ᯾ᶭ2᲻ὰ ÷
›
—
{

!
i j
j i
j
i
x x
x x
x l
) (
) (
) (
ϊ঺࡬ậॗE
i
(x
i
) = 1 ຦E
i
¶(x
i
) = 0 ปᗅA
i
຦B
i
÷
2
( ) [1 2 ( )( )] ( )
i i i i i
x l x x x l x E
d
!
(x)
F
i
Ṟὰx
0
, «, x
n
, ⃦ࣧx
i
኎᯾ᶭ2᲻ὰ ÷ F
i
) ( ) (
i i
l
i
2
(x) x x C x
=
෻F
i
(x
i
) = 1 ÷ C
i
= 1
F
i
) (x ) (
i
l
i
2
(x) x x
=

] , [ , ...
2
1 0
b a C f b x x x a
n
n
 = =

2
0
) 2 2 (
) (
)! 2 2 (
) (
) (
¼
½
»
¬
­
«

+
=
¦
=
+ n
i
i
x
n
n
x x
n
f
x R
\
ᬊὮӮHermite ᮥઝ༾

F
i
) ( ) ( ) (
2
x l B x A x
i i i
+ =
E
i
৲ঝӮॺ
7K᝔f(x)C
2n+2
[a,b],౹\  [a,b], s.t. ╏ᤖ࡬↾ᮥઝậॗ
§3 Hermite Interpolation
Quiz: ంᒴx
i
= i +1, i = 0, 1, 2, 3, 4, 5. ࡬↾༃ࢋᶭF
i
(x)ӮჍର঍
x
0
-
- 1
0.5
1 2 3 4 5 6
y
x
y
0
-
-
- 1
0.5
1 2 3 4 5 6
ᴲɏ=1

⋱Hermiteኑ⊨ឍӮᆝṾ∲⒠ঈ
௺౛Ոᜡ࣯ậॗӮE
i
(x)੐F
i
(x) Ӯ௭ะ្ឍউ
ᔆ⊆ࡡࢋE
i
(x)੐F
i
(x)᩷౛ᕀป෥ኑӮậॗం౛Ӯὰউ
ὰᭉኑ⊨ឍӮᢓ₿ᴌ຦ὰӮࢋᴌ௺౛ᑾ᫱ឍউ
ὰᭉᔣṼಉρӮậॗᗅ౛ᑾ᫱ឍࢎӮ៴ᒴ੝ᴌউ
ṗึᒨᴏ௺౛H
2n+1
(x)ੑ
HW: p.59
#17-19
⎆ঈ៴ᒴ੝ᴌ⍶मᬯρॺধᮥઝ༷⛯ኑ
ᵾ⊋᪻Ġੑ
§4 ౧≱য⇺ᮥઝ /* piecewise polynomial approximation */
Remember what I have said?
Increasing the degree of interpolating polynomial
will NOT guarantee a good result,
since high-degree polynomials are
oscillating.
৬ঈჭ[5, 5]࡫ചᓯ ӮL
n
(x)ੑฆ
2
1
1
) (
x
x f

!
) , ... , 0 (
10
5 n i i
n
x
i
= + =
-5 -4 -3 -2 -1 0 1 2 3 4 5
-0.5
0
0.5
1
1.5
2
2.5
n ᣴኚॺ
ࢪ⛯⃋ᬂ᪍ഃ
ᣴኚॺߞ࢛
Runge ɵ៭
L
n
(x) pf (x)
v
౧≱য⇺ᮥઝ
§4 Piecewise Polynomial Approximation
౧≱௨ᢂᮥઝ /* piecewise linear interpolation */
ჭ⊆ࢋඃ₂ ࡫ॺρ1₿ኑ⊨ឍ(Մ௨) ᭝ᬂf (x):
] , [
1 + i i
x x
1
1 1
1
1
) ( ) (

! }
i
i i
i
i
i i
i
y
x x
x x
y
x x
x x
x x f
] , [ for
1 +

i i
x x x
ᝆ ॺᶘ᝗ঈោ ᵾॺ
| | max
1 i i
x x h =
+
0 p h
) ( ) (
1
x f x
h
p
ࡡູ
ኢ෱ࣧො౞ᴌӮப┿ᢂੑ
౧≱Hermiteᮥઝ /* Hermite piecewise polynomials */
ంᒴ
n n n
y y y y x x
' '
, ... , ; , ... , ; , ... ,
0 0 0
ჭ ࡫ಉρࢅ⛯Ӯy ෽y¶ Ỏᭉ3⇺Hermite౞ᴌ
] , [
1 + i i
x x
ᔉᴌࡡ໨࡮ᶘ᠆ಏੑ
How can we make a smooth
interpolation without asking
too much from f ?
Headache «
§5 ࡪ⇺Ὦậ /* Cubic Spline */
ᒴࢪ
᝔ ੑࡪ⇺Ὦậ౞ᴌ ,
ࡵჭ⊆ࢋ ࡫࢛ࡪ⇺ኑ⊨ឍ/* cubic polynomial */ੑྑᒡิ
ᵾᬉ╏ᤖ ॺ౹ߞ࢛f Ӯࡪ⇺Ὦậᮥઝ౞
ᴌ/* cubic spline interpolant */.
b x x x a
n
! ! ...
1 0
] , [ ) (
2
b a C x S 
] , [
1 i i
x x
) , ... , 0 ( ), ( ) ( n i x f x S
i i
! !
⎆ঈࡪ⇺Ὦậ࡯౧≱Hermite ᮥઝӮὰṾඃಋჭ࣯S(x)າ
᧼ப┿ॺ࡮Ⅸᕴؚ᭯f Ӯᔉᴌઝॶ⃦ࣧჭ2ࢋࢪ⛯ป෥Ⅸ
ᕴॷউഡHermiteᮥઝ৾ᣉ࣯f ჭᩀṞᮥઝ⛯Ӯᔉᴌઝੑ
f(x)
H(x)
S(x)
§5 Cubic Spline
Ỏᭉࡪ⇺Ὦậᮥઝ౞ᴌӮࡪឧ؞⍶
/* method of bending moment */
ჭ ࡫ॺᝆ
] , [
1 j j
x x

,
1
!
j j j
x x h
] , [ for ) ( ) (
1
] [
j j
j
x x x x S x S

 =
ᔆ⊆ࢋj, ∱࢛3⇺ኑ⊨ឍ
౹S
[j]
´(x) ࢛ ⇺ኑ⊨ឍॺⅨ ࢋ⛯Ӯઝڕᒴࢬੑ 1 2
᝔S
[j]
´(x
j1
) = M
j1
ॺS
[j]
´(x
j
) = M
j
ᔆᜡ೶ᒇࢎӮᾰឧ؞ॺᳩี
ᔆ࣯x [x
j1
, x
j
] ป᠆ಏ
S
[j]
´(x) =
j
j
j
j
j
j
h
x x
M
h
x x
M
1
1

+

ߝ౧2⇺ॺป᠆S
[j]
¶(x) ຦S
[j]
(x) ঈ
j
j
j
j
j
j
j
A
h
x x
M
h
x x
M
+

+

2
) (
2
) (
2
1
1
2
1
S
[j]
¶(x) =
j j
j
j
j
j
j
j
B x A
h
x x
M
h
x x
M
+ +

+

6
) (
6
) (
3
1
3
1
S
[j]
(x) =
ಉρᚚؚ
S
[j]
(x
j1
) = y
j1
S
[j]
(x
j
) = y
j
ปᗅ
§5 Cubic Spline
j
j j
j
j j
j
h
M M
h
y y
A
6
1 1

=
j
j
j
j
j
j
j
j
j
j j j
h
x x
h
M
y
h
x x
h
M
y B x A
1 2 2 1
1
)
6
( )
6
(

+

= +
࡬↾ᗅఔM
j
ঈ ಉρS¶ ჭx
j
Ӯᬏఖᢂ
[x
j1
, x
j
]: S
[j]
¶(x) =
j
j j
j j
j
j
j
j
j
j
h
M M
x x f
h
x x
M
h
x x
M
6
] , [
2
) (
2
) (
1
1
2
1
2
1

+

+

1
1
1
1
2
1
1
2
1
6
] , [
2
) (
2
) (
+
+
+
+
+
+
+

+

+

j
j j
j j
j
j
j
j
j
j
h
M M
x x f
h
x x
M
h
x x
M
[x
j
, x
j+1
]: S
[j+1]
¶(x) =
ಉρS
[j]
¶(x
j
) = S
[j+1]
¶(x
j
)ॺะᜅ௔࣯M
j1
੐M
j
੐M
j+1
Ӯิ৲⊨ॺᜅ
ᝆ , , , ᴏˇ
ึ᠆ಏঈ
1
1
j j
j
j
h h
h
+
+
+
= ´
1
j j
= ´ µ
]) , [ ] , [ (
6
1 1
1
j j j j
j j
j
x x f x x f
h h
g
+
+

+
=
2
1 1
g M M M
j j j j j j
= + +
+
´ µ
e j e
1 n1
ඵঈṞ ࢋṼؚᴌॺ ࢋᵋ߱ੑ
n1 n+1
¼
¼
¼
¼
½
»
¬
¬
¬
¬
­
«
=
¼
¼
¼
¼
¼
¼
¼
¼
¼
½
»
¬
¬
¬
¬
¬
¬
¬
¬
¬
­
«
¼
¼
¼
¼
½
»
¬
¬
¬
¬
­
«
1
1
0
1 1
1 1
2
2
n
n
n n
g
g
M
M
´ µ
´ µ
ᬉⅨ2ࢋ᫬Ϡậॗ/* boundary conditions */
§5 Cubic Spline
ࣚ1৲᫬ậॗ/* clamped boundary */ঈS¶(a) = y
0
¶ॺS¶(b) = y
n

[a , x
1
]: S
[1]
¶(x) =
1
0 1
1 0
1
2
1
1
2
1
0
6
] , [
2
) (
2
) (
h
M M
x x f
h
a x
M
h
x x
M

+

+

0 1 0
1
1 0
) ] , [ (
6
2 g
y
0

x x f
h
M M
= = +
n n n
n
n n
g x x f y
n

h
M M
= = +

]) , [ (
6
2
1 1
৲ঝჴಉρ[ x
n1
, b ]
࡫ӮS
[n]
¶(x)
ࣚ2৲᫬ậॗঈS´(a) = y
0
´ = M
0
ॺS´(b) = y
n
´ = M
n
ᬊᵾঈ
n n n
y g y g
' '
= =
' '
= = 2 , 0 ; 2 , 0
0 0 0
µ ´
šಋჴॺM
0
= M
n
= 0 ߞ࢛າϊ᫬Ϡ/* free boundary */ॺᔆᜡӮ
Ὦậ౞ᴌߞ࢛າOὮậ/* Natural Spline */ੑ
ࣚ3৲᫬ậॗ/* periodic boundary */ ঈ
ោf ࢛ຆṲ౞ᴌᵾॺ
y
n
= y
0
ॺS¶(a
+
) = S¶(b

)
÷ M
0
= M
n
¼
¼
¼
¼
¼
¼
¼
¼
½
»
¬
¬
¬
¬
¬
¬
¬
¬
­
«
=
¼
¼
¼
¼
¼
¼
¼
¼
½
»
¬
¬
¬
¬
¬
¬
¬
¬
­
«
¼
¼
¼
¼
¼
¼
¼
¼
½
»
¬
¬
¬
¬
¬
¬
¬
¬
­
«

n n n n
n n
g
g
M
M
1 1
1 1
2 2
1 1
2
2
2
2
µ ´
´ µ
´ µ
µ ´
§5 Cubic Spline
⎆ঈณṞࡪ᪤ᖶ⍶(p.49-53)᠆ಏὮậ౞ᴌॺඵ᝔S
[j]
¶(x
j
) =
m
j
ॺ౹ᶘؚ[x
j1
, x
j
]࡫ӮS
[j]
(x) ᔶᶭHermite౞ᴌੑ௮
ಉρS´Ӯᬏఖᢂॺปᔉ౛௔࣯m
j
Ӯᵋ߱௭ॺ೻࡫᫬
Ϡậॗඵปᗅੑ
Cubic Spline ϊboundary conditions ༾ࡡڕᒴੑ
᳟᳹ᢂঈྑ ॺࡵ ॺ౹ ] , [ b a C f 
g e C
h
h
i
i
min
max
ࡡູ
S(x) pf(x) 0 max p
i
h as
ඵ:ᮣⓋਫᜰถ⊪ሪ೻༷⛯, ഡᵫ⊪ᮣⓋὮậ₿ᴌੑ
ࠑᒴᢂঈถᕴ᫬ậॗਾ᝗| µ
0
|, | ´
0
|, | µ
n
|, | ´
n
| < 2ॺ
౹ᵋ߱௭੝ᴌ₾࢛SDD₾ॺਾ᝗ᴌઝࠑᒴੑ
HW: p.59-60,#19-25
§5 Cubic Spline
Sketch of the Algorithm: Cubic Spline
ͺ
᜷शµ
j
, ´
j
, g
j
;
ͻ
᜷शM
j
(ᬪᣧ⍶ࣴ) ;
ͼ
᩷ಏx ᩀჭඃ₂( ඵ᩷ಏՈᜡӮj ) ;
ͽ
ϊ᝻ඃ₂࡫ӮS
[j]
(x) श౛f(x) Ӯᬂঝઝੑ
ᮥઝ⍶ᔙ௼
j Lagrange : ం౛y
0
«y
n
ॺᬵᆝ౞ᴌl
i
(x)ॺௗ⇺ᴌ࢛
༷⛯ᴌ±1ੑ
j Newton | L
n
(x)ॺถᶭ្ឍ࡮ิউ༷⛯᤻ࣴᨡ⒒ሪ༷⛯
ᵾᵋਠኀˇੑ
j Hermiteঈ ం౛y
i
෽y
i
¶ॺᬵE
i
(x) ෽F
i
(x) ੑ
j Splineঈ౧≱য⇺, າ᧼ப┿, f Ӯᔉᴌถჭ᫬Ϡం౛ੑ
›
§6 ᡏᭈ૦࢐มจᬾ /* Fast Fourier Transform */
⁼⋇Ӯයᷣ /* background */
૦࢐มจᬾ²²౞ᴌᕗ᝾࢛ࡪᖶௐᴌ
᝔f(x) ຆṲ࢛2zॺჭ[0, 2z ] ࡫ᕗ᝾࢛ࡪᖶௐᴌ ॺ
ௗࢎC
j
࢛ኇ੝ᴌॺ ॺ౹ᒸ⃌᜷शᵾᕴฆ
ௐᴌӮಫN ⊨ॺᜅᕴ⋱ჭඃ₂ӮN ࢋࣴ౧⛯࡫࡯f(x)᲻ะੑ
¯
g
=0
) (
j
jx i
j
e C
x j i x j e
jx i
si cos
) (
!
ඵঈంᒴ[0, 2z ] ࡫N ࢋࣴ౧⛯ ࡫Ӯ౞
ᴌઝ ॺॅ ╏ᤖᮥઝậॗ ੑ
) 1 , ... , 1 , 0 (
2
! ! N k k
N
x
k
T
) (
k k
x f f !
¯

!
!
1
0
) (
) (
N
j
jx i
j
e C x S
k k
f x S ! ) (
N ࢋṼؚᴌ
N ࢋᵋ߱
) 1 , ... , 1 , 0 (
1
1
0
2
! !
§

!
¦
'
+

'

N j e f
N
C
N
k
k
N
j i
k j
T Discrete
Fourier
Transform
) 1 , ... , 1 , 0 (
1
0
2
= =
¯

=
¦
'
+

'

N k e C f
N
j
k
N
j i
j k
z
Inverse of
DFT
ᢓࢬᕴᬌᑧ្ዠ
Ӯ᜷शॺௗࢎ ᚚؚॺ
¯

=
=
1
0
N
k
j k
k j
W x C
_ a
k
x
¦
'
+

'

s
!
N
i
e W
T 2
§6 Fast Fourier Transform
Fast Fourier Transform
§

!
!
1
0
N
k
j k
k j
x C
¦
'
+

'

s
!
N
i
e W
T 2
ᡏᭈ᜷श ( j = 0, 1, «, N1)ॺௗࢎ
Մ᭻᜷शⅨኇᴌࢹ⍶ ⇺ N
2
⃔ಏN · logN
ϊ࣯W ӮຆṲᢂW
qN+s
= W
s
, W
k j
ᒸ⃌࡫ถṞ
ᬊ ࢋ࡮ิӮઝੑྑN ࢛૗ᴌॺ౹W
k j
ถṞ ࢋ
࡮ิઝੑ
1 0
...

N
W W
N N / 2
னะᜅิ৲⊨ॺ௮઻ࢹ⍶ੑ
I¶m gonna need
some magic here «
§6 Fast Fourier Transform
৬ঈN = 2
3
= 8, ᜷श ॺj = 0, 1, 2, 3, 4, 5, 6, 7
¯
=
=
7
0 k
k j
k j
W x C
᩹ᚏঈᔐk , j னᝆ࢛࣭ᬌಕᴌ/* binary numbers */
= v + v + v =
= v + v + v =
) ( 2 2 2
) ( 2 2 2
0 1 2
0
0
1
1
2
2
0 1 2
0
0
1
1
2
2
j j j j j j j
k k k k k k k
k j
W
) 2 2 2 ( ) 2 2 2 (
0
0
1
1
2
2
0
0
1
1
2
2
v + v + v v v + v + v
=
k k k j j j
W
) ( ) 2 2 2 ( ) 2 2 2 (
0 1 2 0
1
0
2
1
3
2 1
2
0
3
1
4
2 2
k k k j k k k j k k k j
W
+ v + v + v + v + v + v
=
) ( ) 0 ( ) 0 0 (
0 1 2 0 0 1 1 0 2
k k k j k k j k j
W
+ +
=
§ § §
= = =

)

`
¦

|

´
|
¼
½
»
¬
­
«
=
1
0
) 0 0 (
1
0
) 0 (
1
0
) (
) ( ) (
0
0 2
1
0 1 1
2
0 1 2 0
0 1 2 0 1 2
k
k j
k
k k j
k
k k k j
k k k j j j
W W W x C
) (
0 1 2 0
k k k A
) (
0 0 1 1
j k k A
) (
0 1 0 2
j j k A
) (
0 1 2 3
j j j A
2v3⇺ࢹ

௉ᯬ᜷शⅨᕴ2v3 v8⇺ࢹ⍶
ࡡ໨ჴঈฆN = 2
p

⊆ࢋC
j
ρ2p ⇺ࢹ⍶ॺ௒ρ
2N log
2
N ⇺ࢹ⍶ੑ
ಉρ ॺᬉปॆᬌ
ࡡ∲൦तಏN(p1)/2 ⇺ࢹ⍶ੑ
0
1
0
) 1 (
2 j j
p
W =

HW:
p.138 #1