ING. EDGAR H.
MEDINA TAPIA METODOS NUMERICOS I
Tema 3. - Interpolación Polinomial
Ejemplos
3.2.– Polinomio Interpolador
1 1
Ejemplo.- Dado el siguiente conjunto discreto de puntos �(1,1), �2, 2� , �3, 3��, obtenga:
(a) El Polinomio Interpolador General
(b) El Polinomio Interpolador de Newton por Diferencias Divididas y Diferencias Finitas
(c) El Polinomio Interpolador de Lagrange
5
Estime para cada caso 𝑓𝑓 �2�
Resolución
3.2.1.- Polinomio Interpolador General
(a).- El Polinomio de Interpolación será de Segundo Grado, es decir
𝑃𝑃𝐺𝐺 (𝑥𝑥) = 𝑎𝑎0 𝑥𝑥 2 + 𝑎𝑎1 𝑥𝑥 + 𝑎𝑎2
Calculamos los valores de los coeficientes 𝑎𝑎0 , 𝑎𝑎1 𝑦𝑦 𝑎𝑎2 empleando el siguiente sistema matricial
𝑥𝑥02 𝑥𝑥0 1 𝑎𝑎0 𝑓𝑓(𝑥𝑥0 ) 1
1 1 1 𝑎𝑎0 1�
�𝑥𝑥12 𝑥𝑥1 𝑎𝑎 𝑎𝑎
1� � 1 � = �𝑓𝑓(𝑥𝑥1 )� ⇒ �4 2 1� � 1 � = � 2�
𝑥𝑥22 𝑥𝑥2 1 𝑎𝑎2 𝑓𝑓(𝑥𝑥2 ) 9 3 1 𝑎𝑎2 1�
3
1 11
Resolviendo el sistema anterior se obtienen 𝑎𝑎0 = 6 , 𝑎𝑎1 = −1 , 𝑎𝑎2 = 6
. El Polinomio Interpolador General será
igual a
1 11
𝑃𝑃𝐺𝐺 (𝑥𝑥) = 𝑥𝑥 2 − 𝑥𝑥 +
6 6
5 5 9
Por lo tanto, 𝑓𝑓 �2� ≈ 𝑃𝑃𝐺𝐺 �2� = 24
3.2.2.- Polinomio Interpolador de Newton
(b1) Por Diferencias Divididas.- El Polinomio Interpolador de Newton por Diferencias Divididas, tiene la forma
𝑛𝑛 𝑛𝑛 𝑘𝑘−1
𝑘𝑘
𝑃𝑃𝑁𝑁 (𝑥𝑥) = � 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 , ⋯ , 𝑥𝑥𝑘𝑘 ]𝜔𝜔𝑘𝑘 = 𝑓𝑓[𝑥𝑥0 ] + � ⍋ 𝑓𝑓(𝑥𝑥0 ) ��(𝑥𝑥 − 𝑥𝑥0 )�
𝑘𝑘=0 𝑘𝑘=1 𝑖𝑖=1
En este caso, para 𝑛𝑛 = 2, se tiene
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 𝑓𝑓[𝑥𝑥0 ] + 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 ](𝑥𝑥 − 𝑥𝑥0 ) + 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 , 𝑥𝑥2 ](𝑥𝑥 − 𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥1 )
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 𝑓𝑓(𝑥𝑥0 ) + ⍋𝑓𝑓(𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥0 ) + ⍋2 𝑓𝑓(𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥1 )
13
ING. EDGAR H. MEDINA TAPIA METODOS NUMERICOS I
Calculando las Diferencias Divididas con respecto al punto inicial, se tienen
Diferencias Dividas de Orden Cero
𝑓𝑓[𝑥𝑥0 ] = 𝑓𝑓(𝑥𝑥0 ) = 1
1
𝑓𝑓[𝑥𝑥1 ] = 𝑓𝑓(𝑥𝑥1 ) =
2
1
𝑓𝑓[𝑥𝑥2 ] = 𝑓𝑓(𝑥𝑥2 ) =
3
Diferencias Dividas de Primer Orden
1
𝑓𝑓(𝑥𝑥1 ) − 𝑓𝑓(𝑥𝑥0 ) 2 − 1 1
⍋𝑓𝑓(𝑥𝑥0 ) = 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 ] = = =−
𝑥𝑥1 − 𝑥𝑥0 2−1 2
1 1
𝑓𝑓(𝑥𝑥2 ) − 𝑓𝑓(𝑥𝑥1 ) 3 − 2 1
⍋𝑓𝑓(𝑥𝑥1 ) = 𝑓𝑓[𝑥𝑥1 , 𝑥𝑥2 ] = = =−
𝑥𝑥2 − 𝑥𝑥1 3−2 6
Diferencias Dividas de Segundo Orden
1 1
2
𝑓𝑓[𝑥𝑥1 , 𝑥𝑥2 ] − 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 ] − 6 − �− 2� 1
⍋ 𝑓𝑓(𝑥𝑥0 ) = 𝑓𝑓[𝑥𝑥0 , 𝑥𝑥1 , 𝑥𝑥2 ] = = =
𝑥𝑥2 − 𝑥𝑥0 3−1 6
Obteniendo la Tabla de Diferencias Divididas, resulta
𝑛𝑛 𝑥𝑥𝑛𝑛 𝑓𝑓[𝑥𝑥𝑛𝑛 ] = 𝑓𝑓(𝑥𝑥𝑛𝑛 ) ⍋𝑓𝑓(𝑥𝑥𝑛𝑛 ) = 𝑓𝑓[𝑥𝑥𝑛𝑛 , 𝑥𝑥𝑛𝑛+1 ] ⍋2 𝑓𝑓(𝑥𝑥𝑛𝑛 ) = 𝑓𝑓[𝑥𝑥𝑛𝑛 , 𝑥𝑥𝑛𝑛+1 , 𝑥𝑥𝑛𝑛+2 ]
0 1 1 − 1�2 1�
6
1 2 1�
2 − 1�6 —
2 3 1� — —
3
Sustituyendo los resultados obtenidos, en el polinomio interpolador de Newton por diferencias divididas:
1 1 1 11
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 1 + �− � (𝑥𝑥 − 1) + � � (𝑥𝑥 − 1)(𝑥𝑥 − 2) = 𝑥𝑥 2 − 𝑥𝑥 +
2 6 6 6
5 5 9
Además, 𝑓𝑓 �2� ≈ 𝑃𝑃𝑁𝑁 �2� = 24
(b2) Por Diferencias Finitas.- Como los datos de las abscisas son equidistantes (ℎ = 1), entonces se puede
emplear el polinomio Interpolador de Newton por Diferencias Finitas, es decir
𝑛𝑛 𝑘𝑘−1
𝛥𝛥𝑘𝑘 𝑓𝑓(𝑥𝑥0 )
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 𝑓𝑓(𝑥𝑥0 ) + � ��(𝑥𝑥 − 𝑥𝑥0 )�
𝑘𝑘! ℎ𝑘𝑘
𝑘𝑘=1 𝑖𝑖=1
Desarrollando para 𝑛𝑛 = 2, resulta
𝛥𝛥𝛥𝛥(𝑥𝑥0 ) 𝛥𝛥2 𝑓𝑓(𝑥𝑥0 )
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 𝑓𝑓(𝑥𝑥0 ) + (𝑥𝑥 − 𝑥𝑥0 ) + (𝑥𝑥 − 𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥1 )
ℎ 2! ℎ2
14
ING. EDGAR H. MEDINA TAPIA METODOS NUMERICOS I
Calculando las Diferencias Finitas con respecto al punto inicial, se tienen
Diferencias Finitas de Orden Cero
1 1
𝑓𝑓(𝑥𝑥0 ) = 1 , 𝑓𝑓(𝑥𝑥1 ) = , 𝑓𝑓(𝑥𝑥2 ) =
2 3
Diferencias Finitas de Primer Orden
1 1
𝛥𝛥𝛥𝛥(𝑥𝑥0 ) = 𝑓𝑓(𝑥𝑥1 ) − 𝑓𝑓(𝑥𝑥0 ) = −1=−
2 2
1 1 1
𝛥𝛥𝛥𝛥(𝑥𝑥1 ) = 𝑓𝑓(𝑥𝑥2 ) − 𝑓𝑓(𝑥𝑥1 ) = − = −
3 2 6
Diferencias Finitas de Segundo Orden
1 1 1
𝛥𝛥2 𝑓𝑓(𝑥𝑥0 ) = 𝛥𝛥𝛥𝛥(𝑥𝑥1 ) − 𝛥𝛥𝛥𝛥(𝑥𝑥0 ) = − − �− � =
6 2 3
Obteniendo ahora la Tabla de Diferencias Finitas
𝑛𝑛 𝑥𝑥𝑛𝑛 𝑓𝑓(𝑥𝑥𝑛𝑛 ) 𝛥𝛥𝛥𝛥(𝑥𝑥𝑛𝑛 ) 𝛥𝛥2 𝑓𝑓(𝑥𝑥𝑛𝑛 )
0 1 1 − 1�2 1�
3
1 2 1� − 1�6 —
2
2 3 1� — —
3
Sustituyendo los resultados obtenidos, en el polinomio interpolador de Newton por Diferencias Finitas, con ℎ = 1,
Resulta
1 1
�− � � � 1 11
𝑃𝑃𝑁𝑁 (𝑥𝑥) = 𝑓𝑓(𝑥𝑥0 ) + 2 (𝑥𝑥 − 1) + 3 2 (𝑥𝑥 − 1)(𝑥𝑥 − 2) = 𝑥𝑥 2 − 𝑥𝑥 +
1 2! 1 6 6
5
Estimando 𝑓𝑓 �2�, se obtiene
5 5 9
𝑓𝑓 � � ≈ 𝑃𝑃𝑁𝑁 � � =
2 2 24
3.2.3.- Polinomio Interpolador de Lagrange
(c) Este polinomio tiene la forma
𝑛𝑛 𝑛𝑛 𝑛𝑛
(𝑥𝑥 − 𝑥𝑥𝑖𝑖 )
𝑃𝑃𝐿𝐿 (𝑥𝑥) = � 𝑓𝑓(𝑥𝑥𝑘𝑘 ) �� � = � 𝑓𝑓(𝑥𝑥𝑘𝑘 ) 𝐿𝐿𝑘𝑘 (𝑥𝑥)
(𝑥𝑥𝑘𝑘 − 𝑥𝑥𝑖𝑖 )
𝑘𝑘=1 𝑖𝑖=1 𝑘𝑘=1
𝑖𝑖≠𝑘𝑘
Desarrollando la fórmula para 𝑛𝑛 = 2, se obtiene
𝑃𝑃𝐿𝐿 (𝑥𝑥) = 𝑓𝑓(𝑥𝑥0 )𝐿𝐿0 (𝑥𝑥) + 𝑓𝑓(𝑥𝑥1 )𝐿𝐿1 (𝑥𝑥) + 𝑓𝑓(𝑥𝑥2 )𝐿𝐿2 (𝑥𝑥)
15
ING. EDGAR H. MEDINA TAPIA METODOS NUMERICOS I
Cálculo de las funciones 𝐿𝐿𝑘𝑘 (𝑥𝑥)
(𝑥𝑥 − 𝑥𝑥1 )(𝑥𝑥 − 𝑥𝑥2 ) (𝑥𝑥 − 2)(𝑥𝑥 − 3) 1
𝐿𝐿0 (𝑥𝑥) = = = (𝑥𝑥 2 − 5𝑥𝑥 + 6)
(𝑥𝑥0 − 𝑥𝑥1 )(𝑥𝑥0 − 𝑥𝑥2 ) (1 − 2)(1 − 3) 2
(𝑥𝑥 − 𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥2 ) (𝑥𝑥 − 1)(𝑥𝑥 − 3)
𝐿𝐿1 (𝑥𝑥) = = = −1(𝑥𝑥 2 − 4𝑥𝑥 + 3)
(𝑥𝑥1 − 𝑥𝑥0 )(𝑥𝑥1 − 𝑥𝑥2 ) (2 − 1)(2 − 3)
(𝑥𝑥 − 𝑥𝑥0 )(𝑥𝑥 − 𝑥𝑥1 ) (𝑥𝑥 − 1)(𝑥𝑥 − 2) 1
𝐿𝐿2 (𝑥𝑥) = = = (𝑥𝑥 2 − 3𝑥𝑥 + 2)
(𝑥𝑥2 − 𝑥𝑥0 )(𝑥𝑥2 − 𝑥𝑥1 ) (3 − 1)(3 − 2) 2
Sustituyendo las funciones 𝐿𝐿𝑘𝑘 (𝑥𝑥) obtenidas en el Polinomio Interpolador de Lagrange, resulta
1 1 1 1 1 11
𝑃𝑃𝐿𝐿 (𝑥𝑥) = 1 � (𝑥𝑥 2 − 5𝑥𝑥 + 6)� + [−1(𝑥𝑥 2 − 4𝑥𝑥 + 3)] + � (𝑥𝑥 2 − 3𝑥𝑥 + 2)� == 𝑥𝑥 2 − 𝑥𝑥 +
2 2 3 2 6 6
5
Estimando 𝑓𝑓 �2�, se obtiene
5 5 9
𝑓𝑓 � � ≈ 𝑃𝑃𝐿𝐿 � � =
2 2 24
16