You are on page 1of 7

Mag.

Jube Portalatino Zevallos 1


VI. DIFERENCIACIN NUMRICA E
INTEGRACIN NUMRICA

6.1 DIFERENCIACIN NUMRICA
Si
n n
f (x) P (x) E (x) = +
n n
f (x) P (x) E (x)

= +
(k) (k) (k)
n n
f (x) P (x) E (x) = +

Consideremos un polinomio de Taylor
2
0 0 0 0
f ( )
f (x) f (x ) f (x )(x x ) (x x )
2

= + +

i) Si x x h = = = =
0

0
x x h = +

f ( )
f (x h) f (x ) f (x )h h
2

+ = + +
2
0 0 0


0 0
0
f (x h) f (x ) f ( )
f (x ) h
h 2
+
= +

0 0
0
f (x h) f (x )
f (x ) O(h)
h
+
= +


0 0
0
f (x h) f (x )
f (x )
h
+


A esta frmula se llama diferencia dividida hacia adelante.

ii) Si x x h = = = =
0
x x h = = = =
0


2
0 0 0
f ( )
f (x h) f (x ) f (x )h h
2

= +

0 0
0
f (x ) f (x h) f ( )
f (x ) h
h 2

= +

0 0
0
f (x ) f (x h)
f (x ) O(h)
h

= +

0 0
0
f (x ) f (x h)
f (x )
h



A esta frmula se llama diferencia dividida hacia atrs.

iii) Considere el polinomio de Taylor
Mag. Jube Portalatino Zevallos 2
2 3 0
0 0 0 0 0
f (x ) f ( )
f (x) f (x ) f (x )(x x ) (x x ) (x x )
2 6

= + + +

Si x x h = = = =
0
x x h = +
0

2 3 0 1
0 0 0
f (x ) f ( )
f (x h) f (x ) f (x )h h h
2 6

+ = + + + (1)

Si x x h = = = =
0
x x h = = = =
0

2 3 0 2
0 0 0
f (x ) f ( )
f (x h) f (x ) f (x )h h h
2 6

= + (2)

Restando (2) de (1)
3
0 0 0 1 2
2f ( )
h
f (x h) f (x h) 2f (x )h f ( ) f ( )
6

+ = + +



2 0 0
0
f (x h) f (x h) f ( )
f (x ) h
2h 6
+
=

2 0 0
0
f (x h) f (x h)
f (x ) O(h )
2h
+
= +

0 0
0
f (x h) f (x h)
f (x )
2h
+


A esta frmula se llama diferencia dividida central.

iv) Considere el polinomio de Taylor
(4)
2 3 4 0 0
0 0 0 0 0 0
f (x ) f (x ) f ( )
f (x) f (x ) f (x )(x x ) (x x ) (x x ) (x x )
2 6 24

= + + + +

Si x x h = +
0
x x h = = = =
0

(4)
2 3 4 0 0 1
0 0 0
f (x ) f (x ) f ( )
f (x h) f (x ) f (x )h h h h
2 6 24

+ = + + + + (3)

Si x x h = = = =
0
x x h = = = =
0

(4)
2 3 4 0 0 2
0 0 0
f (x ) f (x ) f ( )
f (x h) f (x ) f (x )h h h h
2 6 24

= + + (4)

(3) +(4)
Mag. Jube Portalatino Zevallos 3
(4)
2 4 1
0 0 0 0
f ( )
f (x h) f (x h) 2f (x ) f (x )h h
12

+ + = + + (5)

Se consider
1 2


Luego, de (5) se tiene
(4)
2 0 0 0
0
2
f (x h) 2f (x ) f (x h) f ( )
f (x ) h
12 h
+ +
=

f (x h) f (x ) f (x h)
f (x ) O(h )
h
+ +
= +
2 0 0 0
0
2
2


f (x h) f (x ) f (x h)
f (x )
h
+ +

0 0 0
0
2
2



6.2 INTEGRACIN NUMRICA
TEOREMA (Teorema del valor medio para integrales). Si f : es
continua sobre [a,b], g : integrable sobre [a, b] y g no cambia de signo
en [a, b] , c a, b < > < > < > < > /
b b
a a
f (x)g(x) dx f (c) g(x) dx =



PRESENTACIN PRELIMINAR
Sea
n n
f (x) P (x) E (x) = +

Consideraremos el polinomio interpolante de Lagrange
(n 1) n n
i i i
i 0 i 0
f ( )
f (x) f (x )L (x) (x x )
(n 1)!
+
= =

= +
+



(n 1) n n
b b b
i i i
a a a
i 0 i 0
ERROR
f ( )
f (x) dx f (x )L (x) dx (x x ) dx
(n 1)!
+
= =

= +
+


Luego tenemos
n
b b
i i
a a
i
f (x) dx f (x ) L (x)dx
=


0

ERROR DE INTEGRACIN =
(n 1) n
b
i
a
i 0
f ( )
(x x ) dx
(n 1)!
+
=


Mag. Jube Portalatino Zevallos 4
6.2.1 FRMULAS CERRADAS DE NEWTON-COTES
Elegimos puntos igualmente espaciados
i i
(x , f (x )) i 0, n = tales que
i 0
x x ih = + , i , n = == = 0
b a
h
n

= == =

Sea
0
x x sh, s = + dx hds = == =
Si x = a a=a+sh s = 0
Si x = b b = a + sh s = (b-a)/n s = n

Luego, reemplazando en la expresin:
n
b b
i i
a a
i
f (x) dx f (x ) L (x)dx
=


0
=
n n
b
k
i
a
i k i k
k i
x x
f (x ) dx
x x
= =

0 0

se tiene
n n
b n
i
a 0
i 0 k 0
k i
h(s k)
f (x)dx f (x ) ds
h(i k)
= =






n n
b n
i
a
i k
k i
s k
f (x) dx h f (x ) ds
i k
= =



0
0 0


Respecto a su ERROR (terico) se puede demostrar que:

Si n es IMPAR ERROR=
n 2 (n 1)
n
0
h f ( )
s(s 1)(s 2) (s n) ds
(n 1)!
+ +


+



Si n es PAR ERROR=
n 3 (n 2)
n
2
0
h f ( )
s (s 1)(s 2) (s n) ds
(n 2)!
+ +


+



A estas frmulas se llaman frmulas cerradas de Newton-Cotes.

6.2.2 CASOS PARTICULARES DE LAS FRMULAS CERRADAS
1) REGLA DEL TRAPECIO (n = 1)
b
3
0 1
a
h f ( )
f (x) dx [f (x ) f (x )] h
2 12
| |
= + +
|
\


o
b
3
0 1
a
h
f (x) dx [f (x ) f (x )] O(h )
2
= + +


Mag. Jube Portalatino Zevallos 5

b
0 1
a
h
f (x) dx [f (x ) f (x )]
2
+



donde h=b-a, x
0
=a, x
1
=x
0
+h=b

La frmula anterior se puede reescribir en la forma:
b
a
b a
f (x) dx [f (a) f (b)]
2



2) REGLA DE SIMPSON DE 1/3 (n = 2)

(4)
b
5
0 1 2
a
h f ( )
f (x) dx [f (x ) 4f (x ) f (x )] h
3 90
| |

= + + +
|
|
\


o
b
5
0 1 2
a
h
f (x) dx [f (x ) 4f (x ) f (x )] O(h )
3
= + + +



b
0 1 2
a
h
f (x) dx [f (x ) 4f (x ) f (x )]
3
+ +



donde
b a
h
2

= , x
0
=a, x
i
=x
0
+ih, x
2
=b

La frmula anterior se puede reescribir en la forma:
b
a
b a a b
f (x) dx f (a) 4f f (b)
6 2
+ ( | |
+ +
| (
\



3) REGLA DE SIMPSON DE 3/8 (n = 3)
(4)
b
5
0 1 2 3
a
3h 3f ( )
f (x) dx [f (x ) 3f (x ) 3f (x ) f (x )] h
8 10
| |

= + + + +
|
|
\


o
b
5
0 1 2 3
a
3h
f (x) dx [f (x ) 3f (x ) 3f (x ) f (x )] O(h )
8
= + + + +



b
0 1 2 3
a
3h
f (x) dx [f (x ) 3f (x ) 3f (x ) f (x )]
8
+ + +



donde
b a
h
3

= == = , x
0
=a, x
i
=x
0
+ih, x
3
=b

Mag. Jube Portalatino Zevallos 6
4) n = 4
(6)
b
7
0 1 2 3 4
a
2h 8f ( )
f (x) dx [7f (x ) 32f (x ) 12f (x ) 32f (x ) 7f (x )] h
45 945
| |

= + + + + +
|
|
\

o
b
7
0 1 2 3 4
a
2h
f (x) dx [7f (x ) 32f (x ) 12f (x ) 32f (x ) 7f (x )] O(h )
45
= + + + + +



b
0 1 2 3 4
a
2h
f (x) dx [7f (x ) 32f (x ) 12f (x ) 32f (x ) 7f (x )]
45
+ + + +



donde
b a
h
4

= == = , x
0
=a, x
i
=x
0
+ih, x
4
=b

6.2.3 FRMULAS ABIERTAS DE NEWTON-COTES
Sean
i 0
x x ih = + , i 1, n 1 =
b a
h
n 2

=
+

x x sh, s = +
0

0
x a h = + ,
n
x b h = = = = , x a

= == =
1
,
n 1
x b
+
=

Si x=a a=x
0
+sh=a+h+sh s=-1
Si x=b b= x
0
+sh=a+h+sh s+1=(b-a)/h=n+2 s=n+1
dx=h ds

Luego, reemplazando en
b b
n
a a
f (x) dx P (x) dx


se tiene
n n
b n
i
a
i k
k i
s k
f (x) dx h f (x ) ds
i k
+

= =



1
1
0 0


Respecto a su ERROR (terico) se puede demostrar que:
Si n es IMPAR ERROR=
n 2 (n 1)
n 1
1
h f ( )
s(s 1)(s 2) (s n) ds
(n 1)!
+ +
+


+


Si n es PAR ERROR=
n 3 (n 2)
n 1
2
1
h f ( )
s (s 1)(s 2) (s n) ds
(n 2)!
+ +
+


+



A estas frmulas se le llaman frmulas abiertas de Newton-Cotes.



Mag. Jube Portalatino Zevallos 7
6.2.4 FRMULAS COMPUESTAS

REGLA COMPUESTA DE SIMPSON DE 1/3
n=2m,
b a
h
2m

= == = ,
0 1 2m
a x x x b = < < < = = < < < = = < < < = = < < < =
j 0
x x jh = + , j 0,1, , 2m =

2 j
2 j 2
m
b x
a x
j 1
f (x) dx f (x) dx

=
=



=
m 5
(4)
2j 2 2j 1 2j j
j 1
h h
f (x ) 4f (x )f (x ) f ( )
3 90

=


( +
`


)


=
m m m m 5
(4)
2j 2 2j 1 2j j
j 1 j 1 j 1 j 1
h h
f (x ) 4 f (x ) f (x ) f ( )
3 90

= = = =
(
+ + (
(




Segn propiedad de sumatorias
=
m 1 m m m 5
(4)
2j 2j 1 2j j
j 0 j 1 j 1 j 1
h h
f (x ) 4 f (x ) f (x ) f ( )
3 90

= = = =
(
+ + (
(




Esto se transforma en
=
m 1 m m 5
(4)
0 2j 2j 1 2m j
j 1 j 1 j 1
h h
f (x ) 2 f (x ) 4 f (x ) f (x ) f ( )
3 90

= = =
(
+ + + (
(




j 2j 2 2j
[x , x ]



Consideremos
j
=
( ) ( )
j
f ( ) f ( ) =
4 4

m m
(4) (4) (4)
j
j 1 j 1
f ( ) f ( ) m f ( )
= =
= =



Tomando en cuenta esto en el paso anterior, arribamos al siguiente resultado:
m 1 m 5
b
(4)
0 2j 2j 1 2m
a
j 1 j 1
h h
f (x) dx f (x ) 2 f (x ) 4 f (x ) f (x ) mf ( )
3 90

= =
(
= + + + (
(



Pero,
b a
h
m

= == =
2

b a
m
h

= == =
2


Reemplazando esto, en el paso anterior, se obtiene la frmula deseada
Mag. Jube Portalatino Zevallos 8
m 1 m 4
b
(4)
0 2j 2j 1 2m
a
j 1 j 1
ERROR
h h
f (x) dx f (x ) 2 f (x ) 4 f (x ) f (x ) (b a) f ( )
3 180

= =
(
= + + + + (
(




m 1 m
b
0 2m 2j 2j 1
a
j 1 j 1
h
f (x) dx f (x ) f (x ) 2 f (x ) 4 f (x )
3

= =
(
+ + + (
(



6.2.5 ALGORITMO DE SIMPSON 1/3
Algoritmo de Simpson para calcular integrales del tipo:
b
a
f(x)dx


ENTRADA: a, b, f, n (es par)
b a
h
n

=
s0=f(a) + f(b)
s1=0
s2=0
para i=1,,n-1 hacer
x=a+ih
si i es par entonces
s2=s2+f(x)
sino
s1=s1+f(x)
fin de si
fin de para
s=h(s0+2*s2+4*s1) / 3
SALIDA: El valor de la integral es: s

6.2.6 CUADRATURA GAUSSIANA O INTEGRACIN GAUSSIANA
La cuadratura gaussiana consiste en hallar c
i
y x
i
tal que
n
b
i i
a
i
w(x)f (x) dx c f (x )
=

1


Como existen 2n incgnitas entre los x
i
y c
i
, entonces consideremos f una funcin
2n-veces diferenciable y {P
i
} una sucesin de polinomios ortogonales en [a, b]
relativos al peso w(x).

Luego, f se puede interpolar con un polinomio Q(x) de grado 2n-1, y se puede
escribir de la forma:
n (2n)
2
i
i 1
f ( )
f (x) Q(x) (x x )
(2n)!
=

= +

(1)
donde x
i
son los ceros de P
n
(x) y
n
x x x < < < < < < < < < < < <
1 2

Mag. Jube Portalatino Zevallos 9

Q(x
i
)=f(x
i
), <x
1
, x
n
>

De (1)
b b
a a
w(x)f (x) dx w(x)Q(x) dx = +

n (2n)
b
2
i
a
i 1
f ( )
w(x) (x x ) dx
(2n)!
=


n
b
i i
a
i
w(x)f (x) dx c f (x )
=
= +

1
n (2n)
b
2
i
a
i 1
ERROR
f ( )
w(x) (x x ) dx
(2n)!
=


donde
n
b
k
i
a
i k
k
k i
x x
c w(x) dx
x x
=

1


x
i
son los ceros del polinomio P
n
(x).

A los x
i
se le llaman abscisas de Gauss y a los c
i
la ponderacin respectiva.

OBSERVACIN. Si f es un polinomio de grado 2n-1
n
b
i i
a
i 1
w(x)f (x) dx c f (x )
=
=


Pues, ERROR=0 porque
(2n)
f ( ) 0 =

FRMULAS PARTICULARES

1) CUADRATURA DE GAUSS-LEGENDRE. w(x)=1, [a,b]=[-1,1]
n
1
i i
1
i 1
f (u) du c f (x ) ERROR

=
+

o
n
1
i i
1
i 1
f (u) du c f (x )


donde
[ ]
2
i
i
2 2
n 1 i
2(1 x )
c
n P (x )

=

x
i
son los ceros de los polinomios de Legendre P
n
(x) que son soluciones de la
ecuacin diferencial:
2
(1 x )y 2xy n(n 1)y 0 + + =
Estos polinomios se pueden determinar de la frmula:
n
2 n
n
n n
1 d
P (x) [(x 1) ]
2 n! dx
=
o de la frmula de recurrencia:
n 1 n n 1
2n 1 n
P xP P
n 1 n 1
+
+
=
+ +


Los primeros polinomios de Lagrange estn calculados en la siguiente tabla:
Mag. Jube Portalatino Zevallos 10
n P
n
(x)
0 1
1 x
2 (3x
2
-1)/2
3 (5x
3
-3x)/2
4 (35x
4
-30x
2
+3)/8
5 (63x
5
-70x
3
+15x)/8
[ ]
n 1 4 (2n)
3
2 (n!) f ( )
ERROR
(2n 1) (2n)!
+

=
+
<-1,1>

TABLA TABULADA DE LOS x
i
y c
i

n x
i
c
i

1 0 2
2 0.5773503 1
3 0.7745967
0
0.5555556
0.8888889
4 0.8611363
0.3399810
0.3478548
0.6521452
5 0.9061798
0.5384693
0
0.2369269
0.4786287
0.5688889
6 0.93246951
0.66120939
0.23861919
0.17132449
0.36076157
0.46791393
8 0.96028986
0.79666648
0.52553241
0.18343464
0.10122854
0.22381034
0.31370665
0.36268378

OBSERVACIN. Cuando el intervalo [a, b][-1, 1], se realiza un cambio de
variable:
: [a, b] [ 1,1]
x t (x) cx d

= = +

1 ac d
1 bc d
= +
= +

2 b a
c , d
b a a b
+
= =


2 a b
t x
b a a b
+
= +


b a b a
x t
2 2
+
= +

Luego, se tiene:
Mag. Jube Portalatino Zevallos 11
b 1
a 1
b a b a b a
g(x) dx g t dt
2 2 2

+ (
= +
(




2) CUADRATURA DE GAUSS-LAGUERRE. w(x)=e
-x
, [a,b]=[0,>
n
x
i i
i
e f (x) dx c f (x ) ERROR

=
= +

0
1
o
n
x
i i
i
e f (x) dx c f (x )

0
1

donde:
i
i n i
(n!)
c
x [P (x )]
2
2
= == =



x
i
son los ceros de los polinomios de Laguerre P
n
(x) que son soluciones de la
ecuacin diferencial: xy (1 x)y ny 0 + + =
Estos polinomios se pueden determinar de la frmula:
n
x n x
n
n
d
P (x) e [x e ]
dx

=
o de la frmula de recurrencia:
2
n 1 n n 1
P (1 2n x)P n P
+
= +

Los primeros polinomios de Lagrange estn calculados en la siguiente tabla:
n P
n
(x)
0 1
1 1-x
2 2-4x+x
2

3 6-18x+9x
2
- x
3

4 24-96x+72x
2
-16x
3
+ x
4

5 120-600x+600x
2
-200x
3
+25x
4
- x
5

2 (2n)
(n!) f ( )
ERROR
(2n)!

=

TABLA TABULADA DE LOS x
i
y c
i

n x
i
c
i

1 1 1
2 0.5857864
3.4142136
0.8535534
0.1464466
3 0.4157746
2.2942804
6.2899451
0.7110930
0.2785177
0.0103893
4 0.3225479
1.7457611
4.5366203
9.3950709
0.6031541
0.3574187
0.0388879
0.0005393
5 0.2635608
1.4134031
0.5217556
0.3986668
Mag. Jube Portalatino Zevallos 12
3.5964258
7.0858100
12.6408008
0.0759424
0.0036118
0.0000234

3) CUADRATURA DE GAUSS-HERMITE.
x
w(x) e

= == =
2
, [a,b]=<-, >
n
x
i i
i
e f (x) dx c f (x ) ERROR

=
= +

2
1
o
n
x
i i
i
e f (x) dx c f (x )

2
1


n 1
i
2
n i
2 n!
c
P (x )
+

=
(



x
i
son los ceros del polinomio de Hermite P
n
(x) que son soluciones de la ecuacin
diferencial: y 2xy 2ny 0 + =
Estos polinomios se pueden determinar de
2 2
n
n x x
n
n
d
P (x) ( 1) e [e ]
dx

=
o de la frmula de recurrencia:
n 1 n n 1
P 2xP 2nP
+
=

Los primeros polinomios de Lagrange estn calculados en la siguiente tabla:
n P
n
(x)
0 1
1 2x
2 4x
2
-2
3 8x
3
-12x
4 16x
4
-48x
2
+12
5 32x
5
-160x
3
+5x
(2n)
n
n!
ERROR f ( )
2 (2n)!

=

TABLA TABULADA DE LOS x
i
y c
i

n x
i
c
i

1 0 07724539
2 0.7071068 0.8862269
3 1.2247449
0
0.2954100
1.1816359
4 0.5246476
1.6506801
0.8049141
1.1816359
5 0
0.9585725
2.02011829
0.9453087
0.3936193
0.0199532
Mag. Jube Portalatino Zevallos 13
4) CUADRATURA DE GAUSS-CHEBYSHEV:
2
1
w(x)
1 x
=

, [a,b]=[-1, 1]
( ) ( )
n
1
2i 1
2n
2 1
i 1
1
f (x) dx f cos ERROR
n
1 x

= +



(2n)
2n
2
ERROR f ( )
2 (2n)!

= , <-1,1>
i
i
n
x cos( )

=
2 1
2
,
i
c
n

=


































Mag. Jube Portalatino Zevallos 14

You might also like