Professional Documents
Culture Documents
Numrica
Integracin
Numrica
Introduccin
1
Jn ( z)
de Bessel
cos( z
0
Funcin
erf ( x )
error
2
Discretizacin
integrales
sen n ) d
t 2
dt
de ecuaciones
Conceptos bgenerales
I ( f ) f ( x ) dx
a
In ( f ) j f ( x j )
j 0
Error de integracin.
En ( f ) I ( f ) I n ( f )
Grado
de precisin: mayor n N
tal que
En(xk)=0, k=0,1,...,m
En(xm+1)0
Frmulas de
Newton-Cotes
Frmulas de cuadratura
cerradas
Dados n+1 puntos equiespaciados de
[a,b], xj=a+jh, j=0,...,n h=(b-a)/(n+2).
Entonces h ]a,b[ tal que
n par
f ( x) dx j f ( x j )
j 0
n
h n 3
( n 2)
f
( ) s 2 ( s 1) ( s n) ds
0
(n 2)!
n impar
f ( x) dx j f ( x j )
j 0
h n2
f
(n 1)!
( n 1)
( ) s ( s 1) ( s n) ds
0
h
f ( x) dx f ( x 0 ) f ( x1 )
2
h 3 ''
f ( )
x 0 x1
12
h
a f ( x) dx 3 f ( x0 ) 4 f ( x1 ) f ( x2 )
h 5 ( iv )
f ( )
x0 x 2
n=390
Regla de Simpson 3/8
b
3h
a f ( x) dx 8 f ( x0 ) 3 f ( x1 ) 3 f ( x2 ) f ( x3 )
n=4 5 Newton-Cotes (5 puntos)
3h ( iv )
f ( )
x 0 x3
80
b
2h
7 f ( x0 ) 32 f ( x1 ) 12 f ( x2 )
f ( x) dx
45
8h 5 ( vi )
32 f ( x3 ) 7 f ( x 4 )
f ( )
x0 x 4
945
Frmulas de
cuadratura abiertas
f ( x) dx j f ( x j )
j 0
n 1
h n 3
( n 2)
f
( ) s 2 ( s 1) ( s n) ds
1
(n 2)!
Si n es
f ( x ) dx j f ( x j )
j 0
h n2
f
(n 1)!
( n 1)
( )
n 1
s ( s 1) ( s n) ds
x 1 x1
3h
3h 3 ( ii )
a f ( x) dx 2 f ( x0 ) f ( x1 ) 4 f ( )
n=2
x 1 x 2
b
4h
a f ( x) dx 3 2 f ( x0 ) f ( x1 ) 2 f ( x2 )
n=3
14h 5 ( iv )
f ( )
x 1 x3
45
b
5h
11 f ( x0 ) f ( x1 ) f ( x2 ) 11 f ( x3 )
24
95h 5 (iv )
f ( )
x 1 x 4
144
f ( x) dx
xk=a+kh
k=0,1,2,...,N
N 1
h
f ( x) dx f ( x0 ) 2 f ( x k ) f ( x N )
2
k 1
h2
ET (b a) f ' ' ( )
12 de Simpson para N
Frmula
subintervalos
h=(b-a)/(2m), xk=a+kh k=0,1,2,...,2m
m 1
m
h
f ( x) dx f ( x0 ) 2 f ( x 2k ) 4 f ( x 2 k 1 ) f ( x 2 m )
3
k 1
k 1
h4
E S (b a) f (iv ) ( )
180
Integracin de
Romberg
IV
( ) Ch 4
Extrapolacin de Richardson
I I S [2h] C (2h) 4
I I S [h] Ch
Tabla de Romberg
IT [ h ]
IT [ h / 2 ]
IT [ h / 4 ]
IT [ h / 8 ]
IS [ h / 2 ]
IS [ h / 4 ]
IS [ h / 8 ]
Expresin general:
IR [ h / 4 ]
IR [ h / 8]
I kj
IQ [ h / 8 ]
4 j 1 I k , j 1 I k 1, j 1
4 j 1 1
Algoritmo ROMBERG
Frmulas de cuadratura
con paso adaptativo
Mtodos adaptativos
f ( x) dx
( iv )
( )
h
h
3h
f
(
a
)
4
f
(
a
2
f
(
a
h
)
4
f
(
a
f
(
b
)
6
2
2
h 4 (b a) (iv )
f ( )
a, b
16 180
ab
h
h
a,
f
(
a
)
4
f
(
a
f
(
a
h
)
2
6
2
ab
h
3h
, b f (a h) 4 f (a ) f (b)
2
6
2
ab
ab
f ( x) dx S a,
,b
S
2
1
ab
ab
S ( a , b ) S a,
S
,b
15
2
Si
a b
a b
S ( a , b) S a ,
S
, b 15 TOL
entonces
a b
a b
f ( x ) dx S a ,
, b TOL
S
2
2
a b
a b
y S a , 2 S 2 , b ser una buena
aproximacin a I.
En otro caso, se aplica reiteradamente a
los subintervalos [a,(a+b)/2[ y
[(a+b)/2,b[ (tolerancia TOL/2.)
Cuadratura de
Gauss
Casos particulares
Gauss-Legendre
Gauss-Chebyshev
Gauss-Laguerre
Gauss-Hermite
Cuadratura de Gauss
w( x ) f( x ) dx c1 f( x1 ) c 2 f( x 2 ) c n f( x n )
OBJETIVOS:
CONCLUSIONES:
Una frmula de cuadratura con n nodos
es exacta para polinomios de grado
la frmula es interpolatoria, y
los nodos son las raices del n-esimo polinomio
ortogonal respecto del producto escalar inducido por
w(x) en [a,b.
Frmula de cuadratura
w( x) f ( x) dx c f ( x )
i
i 1
bT (x)
1
n
ci
w( x ) dx
Tn ' ( xi ) a x xi
i = 1,2, , n
f ( 2 n )( ) b 2
E( f)
Tn ( x )w( x ) dx
a
( 2n )!
a<<b
CUADRATURA
INTERVALO
F. PESO
Gauss-Legendre
[a,b]=[-1,1]
w(x)=1
Gauss-Chebyshev
[a,b]=[-1,1]
w(x)=1/(1-x2)1/2
Gauss-Jacobi
[a,b]=[-1,1]
w(x)=(x-1)a(x+1)b
Gauss-Laguerre
[a,b]=[0,+[
w(x)=xae-x
Gauss-Hermite
[a,b]=]- , +[
w( x) e x
Gauss-Legendre
p1 ( x ) x
n 1,2 ,
1
2n 1 x p n ( x ) n p n1 ( x )
n1
k = 1,2, , n
x
j1
1 xi p n ( xi )
i
j
1
j i
i 1,2 , , n
Polinomios de Legendre
Si [a,b [-1,1, el cambio de variable
es:
ba
ba
ba
x
t
,
dx
dt
2
2
2
y la frmula de cuadratura queda:
ba n
ba
ba
f( x )dx
ci f
xi
E( f)
2 i 1
2
2
nodos
coeficientes
0.5773502692
1.0000000000
0.7745966692
0.0000000000
0.5555555556
0.8611361159
0.3478548451
0.3399810436
0.6521451549
0.8888888889
1.5
EJEMPLO:
I( f ) e
x2
dx
de variable a [-1,1
2
( t 5)
1.5
1
2
1
x
16
e
dx
e
dx
1
4 1
Gauss-Legendre n=2
cambio
I ( f)
( 0.5773 5 )2
16
Gauss-Legendre
I ( f)
0.5555556 e
0.888889 e
0.1093642
n=3
( 0.774596 5 )2
16
( 0 5 )2
16
( 0.5773 5 )2
16
0.1094003
0.555556 e
( 0.774596 5 )2
16
Gauss-Chebyshev
n
dx f ( xi )
n i 1
1 x2
f ( x)
n 2,3,
2k 1
cos
2n
k = 0,1,2, , n - 1
Gauss-Laguerre
e x f ( x )dx ci f ( xi )
ci
n!
i 1
xi
Ln 1 ( xi )
i 1,2, , n
L1 ( x ) 1 x
L n 1 ( x ) ( 2 n 1 x ) L n ( x ) n 2 Ln 1 ( x )
n 1,2 ,
xk
2
0k
1
4 n
2
2j
2
0k
1
48 n
2
-5
+
O(n
)
Gauss-Hermite
x2
f ( x)dx ci f ( xi )
i 1
H 0 ( xn) raices
1 realesHy1 ( distintas
x ) 2 xen - ,+[, y los
Hn(x) tiene
coeficientes
H n 2 son:
(x)
2 x H n 1 ( x ) 2( n 1 )H n ( x )
n 0 ,1,2 ,
ci
2 n 1 n!
n H n 1 ( xi )
2
i 1,2, , n
Integrales impropias
de variable,
desarrollo por series,
eliminacin de la
singularidad.
Integrales Impropias
f ( x )dx
lim f (x)
x b
f ( x)dx lim
0
f ( x)dx
a+
lim f (x)
x a
Si lim f( x )
xa
entonces
f ( x)dx lim
0
f ( x)dx
2
0
I tan( x )dx
EJEMPLO
=0.01
0.01
2
0
0.01
2
tan( x )dx
0.01
2
4.605187
tan( x )dx
tan( x )dx
0.01
2
0.01 1
0.01
0.01
2
0.001
2
0.01
2
tan( x )dx
0.001
2
tan( x )dx
tan( x )dx
0 , luego
2
0
no converge.
tan( x )dx
EJEMPLO
1
x
dx
=0.01
I
0.01
1
0.01 1
1
1
dx
dx
dx 1.8
0.01
0
x
x
x
0.01
1
0.01 5
dx
ci
2 i 1
x
0.184160
0.005( t i 1 )
0.01
0.0001 1
0.01
1
1
dx
dx
dx
0
0.0001
x
x
x
0.018416 0.18
1
dx 0.018416 0.18 1.8 1.9984616
x
I. Impropias I.Propias
Cambio de variable
x 1 n f( x )dx n 2
xt
x2
x 1 x dx
0.0001
2
3 x
0.0001
e dx
x
x
x e 1 x dx
0.0001
2
Eliminacin de la singularidad
1
I n t n 2 f( t n )dt
cos x
0 x dx
1
e t
0 1 t
x
Integrales Infinitas
Integrales infinitas
convergentes y divergentes.
Mtodos de aproximacin:
Descomposicin
en suma
de integrales
Cambio
de variable
Integrales Infinitas:
Mtodos de Aproximacin
f( x )dx lim
b a
f( x )dx lim
a a
f( x )dx
f( x )dx
Descomposicin
integrales
en
r1
r2
r1
suma
de
a r1 r2 r3 rn
In
rn 1
rn
f( x )dx TOL
EJEMPLO
In
rn
ex
dx
4
1 x
ex
dx
4
1 x
rn 2 n
In
0.57202582
0.62745952
0.63043990
0.63047761
0.63047766
Valor exacto
0.63047783
Cambio de variable
Depende de la funcin a integrar.
t
El cambio x e transforma el intervalo
0 t
en
EJEMPLO
cambio x log t
0 t 1
x e dx
1
dx dt
t
xe dx log t dt
x
1
log dt
t
0.01
1
1
1
1
log dt
log dt log dt
0
0.0001
0.01
t
t
t
0.000319 0.023273 0.862649 0.88624
0.0001
I x e
EJEMPLO
cambio
1
x
t
1
t t 0
5
dx
1 1t 1 32
x e dx e
t dt
0t
2
2 x2
1 1e
5 dt
2 0t 2
g( t )
x2
1 3 2
dx t dt
2
1
t
t 2
I 0.25364
aplicando Romberg.
Integracin
Indefinida
F ( x)
axb
f (t )dt
integracin
el intervalo de
y
aplicar
cuadraturas
F (a ) 0
Ejercicio
2
erf ( x)
x
t 2
dt
y ' ( x)
x2
y (0) 0
Integracin
Mltiple
Algoritmo de Integracin
Mltiple
Integracion Mltiple
sobre recintos
rectangulares
I f ( x, y )dA
R
f ( x, y )dy dx
Aplicamos la
Regla de Simpson a la
d
integral c f ( x, y )dy
considerando x
como parmetro.
k b
a c f( x , y )dydx 3 a f( x , y0 )dx
2k m1 b
4k m b
f( x , y 2 j )dx f( x , y 2 j1 )dx
3 j1 a
3 j1 a
b d
k b
( d c ) 4 b 4 f( x , )
f( x , y 2 m )dx
k
dx
4
a
3 a
180
y
n 1
h
f( x , y j )dx f( x0 , y j ) 2 f( x 2i , y j )
3
i 1
4 f( x 2i 1 , y j ) f( x 2 n , y j )
i 1
b a 4 4 f( j , y j )
h
180
x 4
n
hk
f( x , y )dydx
9
n 1
i 1
i 1
f 0 ,0 2 f 2i ,0 4 f2i 1,0
m 1
m 1 n 1
j1
j1 i 1
m 1 n
m 1
m n 1
j1
j1
j1 i 1
2 f 2 n ,2 j 4 f0 ,2 j1 8 f 2i ,2 j1
m
16 f 2i 1,2 j1 4 f 2 n ,2 j1
j1 i 1
j1
n 1
i 1
i 1
2 f 0 ,2 m 2 f 2i ,2 m 4 f 2i 1,2 m f 2 n ,2 m
( d c )( b a ) 4 4 f
4 f
, k 4 ,
E
h
4
180
x
y
, , , R
16
16
16
y2
y1
16
16
16
4
2
c=y0 1
a=x0 x1 x2
x3
x4
d=y2m
y2m-1
x2n-2 x2n-1
xi a ih
i 0 ,1,2 , ,2n
y i c jk
j 0 ,1,2 , ,2m
ba
2n
cd
2m
b=x2n
Integracin Mltiple
sobre recintos no
rectangulares
b d ( x)
a c( x)
f ( x, y )dydx
h=(b-a)/2
I
b d ( x)
a c( x)
b( x)
a( x)
f ( x, y )dxdy
k=k(x)
f ( x, y )dydx
k ( x)
3
k (a h)) f (a h, d (a h))
b
k (b)
f (b, c(b)) 4 f (b, c(b) k (b)) f (b, d (b))
3
Algoritmo de la
integral mltiple
b
d ( x)
c( x)
f ( x, y )dydx
Salida: aproximacin I
1:
dividir
subintervalos
[a,b]
PASO
en
2n
la funcin
Simpson respecto a y
Integrales de
Contorno
Casos Particulares
Mtodo de MonteCarlo
Integrales de Contorno
Llamamos integral de contorno a
una integral de la forma:
f ( x, y ) dx ,
f ( x, y )dy,
f ( x, y ) ds
ba
f ( x )dx
n i 1
ba a
Ejemplo
Calculamos el permetro de elipses de
distintas excentricidades utilizando en
todos los casos 60 puntos.
Valor aprox.
Valor exacto
1.0
0.8
1.4180830
1.4180834
1.0
0.4
1.1506554
1.1506556
1.0
0.2
1.0505019
1.0505022
1.0
0.1
1.0159888
1.0159935