Método de Gregory-Newton - Fórmula

Teorema: Seja a função \(y = f(x)\) definida pelos pontos \((x_i, y_i), i = 1, 2, 3 \ldots, n\) tais que \(x_{i+1} - x_i = h\) para todo \(i\):

\[\triangledown^n_{yi} = \frac{\Delta^n_{y_i}}{n! h^n} \]

Por indução, para \(n=1\) o Teorema é válido, pois:

\[\triangledown_{y_i} =\frac{y_{i+1} - y_i}{x_{i+1} - y_i} = \frac{\Delta_{y_i}}{h} = \frac{\Delta^1_{y_i}}{1! h^1} \]

Supondo-se que ele sejá válido para \(n = p -1\):

\[\triangledown^{p-1}_{y_i} = \frac{\Delta^{p-1}_{y_i}}{(p-1)! h^{(p-1)}} \]

Pode-se provar que ele é válido para \(n = p\):

\[\triangledown^{p}_{y_i} = \frac{\triangledown^{p-1}_{y_{i+1}}-\triangledown^{p-1}_{y_{i+1}}}{x_{i+p} - x_i}\]

Mas

\[\triangledown^{p-1}_{y_{i+1}} = \frac{\Delta^{p-1}_{y_{i+1}}}{(p-1)! h^{(p-1)}} \textrm{ e}\] \[\triangledown^{p-1}_{y_{i}} = \frac{\Delta^{p-1}_{y_{i}}}{(p-1)! h^{(p-1)}} \textrm{ e}\] \[x_{i+p} - x_i = ph\]

Então:

\[\triangledown^{p}_{y_{i}} = \frac {\left[ \frac{\Delta^{p-1}_{y_{i+1}}}{(p-1)! h^{(p-1)}} \right] - \left[ \frac{\Delta^{p-1}_{y_{i}}}{(p-1)! h^{(p-1)}} \right]} {ph} \]

Levando o resultado do teorema na fórmula vem:

\[P_{n-1}(x) = y_1 + h(z-0)\cdot \frac{\Delta_{y_1}}{1!h} + h^2(z-0)(z-1)\cdot \frac{\Delta^2_{y_1}}{2!h^2} + \ldots + h^n(z-0)(z-1)\ldots(z - n)\cdot \frac{\Delta^n_{y_1}}{n!h^n}\]

Ou:

\[P_{n-1}(x) = y_1+ \frac{(z-0)}{1!}\cdot \Delta_{y_1} + \frac{(z-0)(z-1)}{2!}\cdot \Delta^2_{y_1} + \ldots + \frac{(z-0)(z-1)\ldots (z-n)}{n!}\cdot \Delta^n_{y_1}\]

De forma sintética:

Exemplo de cálculo 1:

Dados os pontos:

x \( 2\) \( 3\) \( 4\)
y \(8\) \(19\) \(34\)

E a tabela de diferenças finitas:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\)
\(2\) \(8\) \(11\) \(4\)
\(3\) \(19\) \(15\)  
\(4\) \(34\)    

Valor de \(h= 3 - 2 = 1\)

O valor de \(z\) é: \(z=\frac{x - 2}{1}\)

Desenvolvendo o cálculo:

\[P_2(x) = 8 + \left(11 \times \frac{ \left( \frac{x - 2}{1}- 0 \right) }{1!}\right) + \left(4 \times \frac{ \left( \frac{x - 2}{1}- 0 \right) \left( \frac{x - 2}{1}- 1 \right) }{2!}\right)\] \[P_2(x) = 8 + \left(11 \times \frac{x - 2}{1!}\right) + \left(4 \times \frac{x^2 - 5x + 6}{2!}\right) \] \[ P_2(x) = 8 + \left( (11x - 22)\right) + \left( (2x^2 - 10x + 12)\right)\]

Resultando no polinômio:

\[P_2(x) = 2x^2 + x - 2\]

Exemplo de cálculo 2:

Os pontos:

x \( 1\) \( 1.5\) \( 2\) \( 2.5\) \( 3\)
y \(2\) \(7.5625\) \(21\) \(47.5625\) \(94\)

A tabela de diferenças finitas:

\(x\) \(f(x)\) \(\Delta^1_{y_i}\) \(\Delta^2_{y_i}\) \(\Delta^3_{y_i}\) \(\Delta^4_{y_i}\)
\(1\) \(2\) \(5.5625\) \(7.875\) \(5.25\) \(1.5\)
\(1.5\) \(7.5625\) \(13.4375\) \(13.125\) \(6.75\)  
\(2\) \(21\) \(26.5625\) \(19.875\)    
\(2.5\) \(47.5625\) \(46.4375\)      
\(3\) \(94\)        

Valores:

\[h= 1.5 - 1= 0.5\] \[z=\frac{x - 1}{0.5}\]

E o desenvolvimento do cálculo:

\[ \begin{matrix}P_4(x) = 2 + \left(5.5625 \times \frac{ \left( \frac{x - 1}{0.5}- 0 \right) }{1!}\right)\\ + \left(7.875 \times \frac{ \left( \frac{x - 1}{0.5}- 0 \right) \left( \frac{x - 1}{0.5}- 1 \right) }{2!}\right) \\ + \left(5.25 \times \frac{ \left( \frac{x - 1}{0.5}- 0 \right) \left( \frac{x - 1}{0.5}- 1 \right) \left( \frac{x - 1}{0.5}- 2 \right) }{3!}\right)\\ + \left(1.5 \times \frac{ \left( \frac{x - 1}{0.5}- 0 \right) \left( \frac{x - 1}{0.5}- 1 \right) \left( \frac{x - 1}{0.5}- 2 \right) \left( \frac{x - 1}{0.5}- 3 \right) }{4!}\right)\end{matrix} \]

ainda...

\[\begin{matrix} P_4(x) = 2 + \left(5.5625 \times \frac{2x - 2}{1!}\right)\\ + \left(7.875 \times \frac{4x^2 - 10x + 6}{2!}\right)\\ + \left(5.25 \times \frac{8x^3 - 36x^2 + 52x - 24}{3!}\right)\\ + \left(1.5 \times \frac{16x^4 - 112x^3 + 284x^2 - 308x + 120}{4!}\right) \end{matrix} \]

e...

\[ \begin{matrix}P_4(x) = 2 + \left( (11.125x - 11.125)\right)\\ + \left( (31.5x^2 - 78.75x + 47.25)\right)\\ + \left( (42x^3 - 189x^2 + 273x - 126)\right)\\ + \left( (24x^4 - 168x^3 + 426x^2 - 462x + 180)\right) \end{matrix}\]

Resultando no polinômio:

\[P_4(x) = x^4 + 2x^2 - 2x + 1 \]

Dica de programação

Para se programar o método de Gregory-Newton, pode utilizar a variável \(z\) no modo CAS, o que irá facilitar a implementação do método:

EXPORT gregoryNewton()
BEGIN
	PRINT();
  	M1 :=[[1, 1.5, 2, 2.5, 3],
	      [2, 7.5625, 21, 47.5625, 94]]; // Dados do exemplo de cálculo 2 
  	LOCAL h := M1(1, 2) - M1(1, 1);
  	LOCAL z := (CAS("x") - M1(1, 1))/h;
	PRINT("h = " + h);
	PRINT("z = " + z);
END;

Atividade

Dado os pontos e as tabelas de diferença finitas, calcule o polinômio interpolador das questões abaixo:

  • Pontos:

    \[ \begin{matrix} \textbf{x} &2 &4 &6 \\ \hline \textbf{y} &-8 &-22 &-44 \end{matrix} \]

    Tabela de diferenças divididas:

    \[ \begin{matrix} \textbf{x} & \textbf{y} & \Delta^1_{y_i} & \Delta^2_{y_i} \\ \hline 2 & -8 & -14 & -8 \\ 4 & -22 & -22 \\ 6 & -44 \end{matrix} \]
  • Pontos:

    \[ \begin{matrix} \textbf{x} &0 &1 &2 &3 \\ \hline \textbf{y} &-2 &-2 &-4 &-14 \end{matrix} \]

    Tabela de diferenças divididas:

    \[ \begin{matrix} \textbf{x} & \textbf{y} & \Delta^1_{y_i} & \Delta^2_{y_i} & \Delta^3_{y_i} \\ \hline 0 & -2 & 0 & -2 & -6 \\ 1 & -2 & -2 & -8 \\ 2 & -4 & -10 \\ 3 & -14 \end{matrix} \]
  • Pontos:

    \[ \begin{matrix} \textbf{x} &0 &1.5 &3 &4.5 &6 \\ \hline \textbf{y} &-1 &-2.3125 &38 &281.938 &1013 \end{matrix} \]

    Tabela de diferenças divididas:

    \[ \begin{matrix} \textbf{x} & \textbf{y} & \Delta^1_{y_i} & \Delta^2_{y_i} & \Delta^3_{y_i} & \Delta^4_{y_i} \\ \hline 0 & -1 & -1.3125 & 41.625 & 162 & 121.5 \\ 1.5 & -2.3125 & 40.3125 & 203.625 & 283.5 \\ 3 & 38 & 243.938 & 487.125 \\ 4.5 & 281.938 & 731.062 \\ 6 & 1013 \end{matrix} \]