Está en la página 1de 3

Diferenciacin numrica

7 de septiembre de 2017

La diferenciacin numrica consiste en encontrar alguna aproximacin a la


derivada de una funcin en algn punto. La aproximacin se calcula a partir de
datos puntuales. Las frmulas de diferenciacin numrica se encuentran a partir
de los polinomios de Lagrange que interpolan a los datos. Una vez construido
el polinomio de Lagrange se puede calcular su derivada. El nmero de trminos
de la aproximacin de la derivada depende del numero de datos que se tengan.
Como ejemplo, se utilizan dos datos para aproximar la funcin. Posterior-
mente se deriva el polinomio de Lagrange y se obtiene una aproximacin a
primer orden. El polinomio de Lagrange que interpola este par de datos es
x x2 x x1
f (x) f (x1 ) + f (x2 ).
x1 x2 x2 x1

Al derivar el polinomio se tiene


f (x1) f (x2 )
f 0 (x) + ,
x1 x2 x2 x1
reordenando lo anterior llegamos a la expresin
f (x2 ) f (x1 )
f 0 (x) .
x2 x1
Esta es la frmula de la pendiente de la recta que pasa por los datos. Para
obtener una frmua para la derivada usando tres puntos se debe construir el
correspondiente polinomio de Lagrange.
(x x2 )(x x3 ) (x x1 )(x x3 ) (x x1 )(x x2 )
f (x) f (x1 )+ f (x2 )+ f (x3 ).
(x1 x2 )(x1 x3 ) (x2 x1 )(x2 x3 ) (x3 x1 )(x3 x2 )

Para calcular la aproximacin de la derivada se deriva el polinomio de Lagrange:


(2x x2 x3 ) (2x x1 x3 ) (2x x1 x2 )
f 0 (x) f (x1 )+ f (x2 )+ f (x3 ).
(x1 x2 )(x1 x3 ) (x2 x1 )(x2 x3 ) (x3 x1 )(x3 x2 )

Para simplicar los clculos se toma un incremento constante entre los puntos:
x2 = x1 + h, x3 = x1 + 2h = x2 + h.

1
Entonces se tiene
(2x x2 x3 ) (2x x1 x3 ) (2x x1 x2 )
f 0 (x) f (x1 ) f (x2 ) + f (x3 ).
2h2 h2 2h2
Esta frmula nos da la aproximacin de la derivada en el punto x. En particular,
si x = x1 se tiene:
(2x1 x2 x3 ) (2x1 x1 x3 ) (2x1 x1 x2 )
f 0 (x1 ) 2
f (x1 ) 2
f (x2 ) + f (x3 )
2h h 2h2
(x1 x2 + x1 x3 ) (x1 x1 + x1 x3 ) (x1 x1 + x1 x2 )
f (x1 ) f (x2 ) + f (x3 )
2h2 h2 2h2
(h 2h) 2h h
f (x1 ) 2 f (x2 ) + 2 f (x3 )
2h2 h 2h
3h 2h h
f (x1 ) + 2 f (x2 ) 2 f (x3 )
2h2 h 2h
f (x1 ) + 4f (x2 ) f (x3 )
.
2h
Para x = x2 se tiene:
(2x2 x2 x3 ) (2x2 x1 x3 ) (2x2 x1 x2 )
f 0 (x2 ) f (x1 ) f (x2 ) + f (x3 )
2h2 h2 2h2
(x2 x3 ) (x2 x1 + x2 x3 ) (x2 x1 )
2
f (x1 ) 2
f (x2 ) + f (x3 )
2h h 2h2
h (h h) (h)
2
f (x1 ) 2
f (x2 ) + 2 f (x3 )
2h h 2h
f (x3 ) f (x1 )
.
2h
Esta es la frmula de diferencias centradas. Para x = x3 se tiene:
(2x3 x2 x3 ) (2x3 x1 x3 ) (2x3 x1 x2 )
f 0 (x3 ) 2
f (x1 ) 2
f (x2 ) + f (x3 )
2h h 2h2
(x3 x2 ) (x3 x1 ) (x3 x1 + x3 x2 )
f (x1 ) f (x2 ) + f (x3 )
2h2 h2 2h2
h 2h (2h h)
f (x1 ) 2 f (x2 ) + f (x3 )
2h2 h 2h2
f (x1 ) 2 f (x2 ) f (x3 )
+
2h h 2h
f (x1 ) 4f (x2 ) + f (x3 )
.
2h
Si se tienen cinco datos, el polinomio de Lagrange es
(x x2 )(x x3 )(x x4 )(x x5 ) (x x1 )(x x3 )(x x4 )(x x5 )
f (x) f (x1 ) + f (x2 ) + . . .
(x1 x2 )(x1 x3 )(x1 x4 )(x1 x5 ) (x2 x1 )(x2 x3 )(x2 x4 )(x2 x5 )
(x x1 )(x x2 )(x x4 )(x x5 ) (x x1 )(x x2 )(x x3 )(x x5 )
+ f (x3 ) + f (x4 )+ . . .
(x3 x1 )(x3 x2 )(x3 x4 )(x3 x5 ) (x4 x1 )(x4 x2 )(x4 x3 )(x4 x5 )
(x x1 )(x x2 )(x x3 )(x x4 )
f (x5 )
(x5 x1 )(x5 x2 )(x5 x3 )(x5 x4 )

2
Para simplicar se usa un incremento constante igual ah.
(x x2 )(x x3 )(x x4 )(x x5 ) (x x1 )(x x3 )(x x4 )(x x5 )
f (x) 4
f (x1 ) f (x2 ) + . . .
24h 6h4
(x x1 )(x x2 )(x x4 )(x x5 ) (x x1 )(x x2 )(x x3 )(x x5 )
+ f (x3 ) f (x4 )+ . . .
4h4 6h4
(x x1 )(x x2 )(x x3 )(x x4 )
+ f (x5 )
24h4
Despus de derivar la expresin anterior y evaluar en cada punto se tienen
las cinco frmulas para la derivada:
f 0 (x1 ) = 1
12h [25f (x1 ) + 48f (x2 ) 36f (x3 ) + 16f (x4 ) 3f (x5 )]
f 0 (x2 ) = 1
12h [3f (x1 ) 10f (x2 ) + 18f (x3 ) 6f (x4 ) + f (x5 )]
f 0 (x3 ) = 1
12h [f (x1 ) 8f (x2 ) + 8f (x4 ) f (x5 )]
f 0 (x4 ) = 1
12h [f (x1 ) + 6f (x2 ) 18f (x3 ) + 10f (x4 ) + 3f (x5 )]
f 0 (x5 ) = 1
12h [3f (x1 ) 16f (x2 ) + 36f (x3 ) 48f (x4 ) + 25f (x5 )]

También podría gustarte