Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Contents
1 INTRODUCCION.
6 DIFERENCIACION
NUMERICA
INTEGRACION
14
23
8 INTERPOLACION DE FUNCIONES II
37
INTRODUCCION.
El presente documento es el libro de problemas donde se
encuentran resueltos todos los problemas presentes en el
libro de Anlisis Numrico publicado por los mismos autores. Nunca se insistir lo suciente sobre la necesidad de
hacer problemas para comprender correctamente cualquier
teora y sus aplicaciones. Adems la manera de afrontar
el estudio de los problemas debe ser bien distinta a la
forma de estudiar teora. Primero se debe intentar hacer
los problemas sin mirar en absoluto la solucin y despus
de reexionar e intentar resolverlo de diferentes formas,
muchas de las cuales nos llevarn a callejones sin salida,
se mirar la solucin. Es un hecho fcilmente constatable,
que se aprende mucho ms de un problema que no se ha
conseguido resolver, pero al que se ha dedicado suciente
esfuerzo, que de un problema del cual se mira directamente
la solucin sin ninguna fase de reexin previa. Adems
se tiende a olvidar con facilidad la tcnica de resolucin
de un problema sobre el cual no se ha reexionado sucientemente. De todo ello se deduce que el estudio correcto de los problemas de una asignatura va reido con las
= 10
t
X
an 2tn
n=1
P
ahora bien, como el nmero m = tn=1 an 2tn es entero,
de la desigualdad anterior obtenemos
2te = 5 2m
pero esta igualdad implica que el nmero 2te es divisible
por 5 lo cual es imposible.
1
X
an
n=1
2n
e=0
e=1
1
0:0 703 125 2e < 1
2
e=2
para e = 3 obtenemos
e = 1
e=0
e=1
e=2
1
X
1
an
+
2 n=2 2n
0:5625 <
0:5625 <
0:5625 =
1
1
+
2 24
2
1.75
1.5
1.25
y
1
0.75
0.5
0.25
0
-0.25
-0.5
-0.75
-1
-1.25
-1.5
-1.75
-2
xmax
1
2
2t+1
1
2
0.250.5 0.751
1.251.5 1.752
2.252.5 2.753
3.253.5 3.754
xmin
1
1
+ 2 = 0:75 ) a2 = 0
2 2
1
1
+ 3 = 0:625 ) a3 = 0
2 2
1
1
+ 4 = 0:5625 ) a4 = 1
2 2
por tanto
1 1
1 1
1
1
1 1
;
+ ;
+ ;
+
+
22 22 24 22 23 22 23 24
1 1
1 1
1 1
1
1
; + ; + ; +
+
2 2 23 2 22 2 22 23
1
1
1
1
1; 1 + 2 ; 1 + ; 1 + + 2
2
2
2 2
1
1
2; 2 + ; 2 + 1; 2 + 1 +
2
2
e = 1
1
= 2emax 1 t
2
1
1
1
2
+ t = 1 + t1
2 2
2
1
2
1
2t+1
1
=1 t
1
2
1 2
1
23
1
24
1
23
1
24
1
25
=
2
2n
2t
2n
n=1
n=1
Consideremos primero el caso de sumar 1=2t . Si ak =
1 para todo k; entonces
!
t
X 1
1
1
e
+ t = 2e+1
2
n
2
2
2
n=1
Si por el contrario existe un k0 tal que ak0 = 0, y tal que
ak = 1 para todo k0 < k t entonces basta tomar a0k = ak
si 1 k < k0 ; a0k0 = 1 y a0k = 0 si k0 < k t
Consideremos ahora el caso de restar 1=2t : Si el nico
elemento ak distinto de 0 es a1 ; entonces
e
1
1
2 2t
= 2e1
P
Problema 9 Dado un nmero ze = 2e tn=1 a2nn ; en una
aritmtica de precisin nita. Calcular el nmero inmediatamente inferior y superior a l en dicha aritmtica.
i=1
donde m es un nmero entero. Ahora bien esta igualdad es imposible porque resultara que 3 divide a 2:
ze = 2e
1
2
1
25
1
26
Problema
7 Sean
A
=
2 12 + 213 +
+
1
25
1
27
+
B
1
28
+
=
t
X
1
n
2
n=1
1
9:
1
24
1
M enor = 231
210
Solucin:
Problema 8 Sean emin , emax ; los valores mnimo y mximo del exponente e: Demostrar que si emin < e < emax ;
entonces los nmeros:
t
!
X an
1
e
t
2
2n
2
n=1
1
32 1
N aN = 2
+
2 22
5. 2 21 2110 : Solucin:
1. B A = 22
1
2 1
Si guiente = 2
+
2 210
10
!
1
1
X 1
2 211
Anterior = 2
=
2
1
2i
2
i=1
4.
B + A = 23
1
29
ze + 2e
y el inmediato inferior es
2e1
1
2t
t
X
1
n
2
n=1
Solucin:
Solucin:
x1
x2
=
=
2+
x =
4 0:04
= 1:995
2
f(2) >
N uevo Intervalo =
0:01
1:995
x =
f(2) >
N uevo Intervalo =
Problema 11 Escribir el cdigo en fortran 77 para implementar el clculo de las races reales de ax2 + bx + c = 0
evitando los errores de cancelacin y teniendo en cuenta
las diferentes opciones que aparecen cuando a 6= 0 y a = 0:
0 + (2)
= 1
2
0; f(0) < 0; f (1) < 0
[2; 1]
1 + (2)
= 1:5
2
0; f(1) < 0; f(1:5) > 0
[1:5; 1]
Solucin:
Solucin:
PRINT *,METODO DE LA BISECCION
PRINT
*,INTRODUCIR
EL
EXTREMO
IZQUIERDO DEL INTERVALO
READ *,A
PRINT *,INTRODUCIR EL EXTREMO DERECHO DEL INTERVALO
READ *,B
IF (A.GT.B) THEN
PRINT *, INTERVALO INCORRECTO
EXIT
ENDIF
PRINT *,INTRODUCIR LA PRECISION
READ *,TOL
IF (F(A)*F(B).GT.0) THEN
PRINT *,NO HAY CAMBIO DE SIGNO EN EL
INTERVALO
EXIT
ENDIF
1 X=(A+B)/2
IF (F(X).EQ.0).OR.((B-A).LT.TOL) THEN
PRINT *,LA RAIZ DE LA FUNCION ES: ,X
EXIT
ENDIF
IF((F(A)*F(X)).LE.0) THEN
B=X
ELSE
A=X
ENDIF
GOTO 1
END
FUNCTION F(X)
F=COS(X)
4
END
Solucin:
x1 = 1
Solucin:
2
f (0) = 1
f (2) f(0)
f (2) > 0; f(0) < 0; f (1) < 0
N uevo Intervalo = [1; 2]
1
4
x = 1
f (1) =
f (2) f(1)
3
4
f (2) > 0; f(1) < 0; f ( ) < 0
3
4
N uevo Intervalo = [ ; 2]
3
Problema 15 Escribir el cdigo en fortran 77 para implementar el mtodo de la Regula-falsi
2
5
=
3
3
x = 0
Problema 17 Calcular una iteracin del mtodo de la secante para calcular un cero de la funcin f (x) = x3 3
partiendo de x0 = 0; x1 = 1
Solucin:
x1 = 1
Solucin:
2(3)
10
=3
Solucin:
IMPLICIT DOUBLE PRECISION (X)
PRINT *,METODO DE LA SECANTE
PRINT *,INTRODUCIR X0
READ *,X0
PRINT *,INTRODUCIR X1
READ *,X1
IF (X0.EQ.X1) THEN
PRINT *, LAS DOS APROXIMACIONES INICIALES COINCIDEN
EXIT
ENDIF
PRINT *,INTRODUCIR LA PRECISION
READ *,XTOL
PRINT *,INTRODUCIR NUMERO MAXIMO DE
ITERACIONES
READ *,NMAX
DO 1 K=1,NMAX
IF(ABS(X1-X0).LT.TOL) THEN
PRINT *,LA RAIZ DE LA FUNCION ES: ,X1
EXIT
ENDIF
IF(XF(X1).EQ.XF(X0)) THEN
PRINT *,METODO NO CONVERGE
EXIT
ENDIF
X2=X1-XF(X1)*(X1-X0)/(XF(X1)-XF(X0))
X0=X1
X1=X2
FUNCTION F(X)
F=COS(X)
END
Problema 22 Aislar en intervalos las races del polinomio P (x) = 20x3 45x2 + 30x 1.
1 CONTINUE
PRINT *,NUMERO MAXIMO DE ITERACIONES
EXCEDIDO
END
FUNCTION XF(X)
IMPLICIT DOUBLE PRECISION (X)
F=COS(X)
END
1+
45
65
maxk=0;::;n1 j ak j
=1+
=
j an j
20
20
65
todas las races estn en el intervalo [ 65
20 ; 20 ]: Para aislar las races calculamos los ceros de la derivada P 0 (x) =
60x2 90x + 30, dichas races son 1 y 1=2: Por otro lado
tenemos
65
)
20
1
P( )
2
P (1)
65
P( )
20
P (
Solucin:
2 + 3(x 1) + 3(x 1)2 = 0
p
3 + 33
x1 = 1 +
6
= 1260: 4
21
4
= 4
= 307: 75
1
por tanto hay una nica raz en el intervalo [ 65
20 ; 2 ]:
Problema 23 Aislar en intervalos las races del polinomio P (x) = 2x3 + 3x2 12x + 1
Solucin:
Solucin:
P 0 (x) = 6x2 + 6x 12
P (x)
P (2)
P (2)
P 0 (x)
P 0 (2)
=
=
=
=
=
INTERPOLACION DE FUNCIONES I
Problema 21 Calcular el nmero mximo de races positivas y negativas del polinomio x5 35x3 + 30x2 + 124x
120; y localizarlas en un intervalo.
Problema 24 Calcular el polinomio interpolador de Lagrange P3 (x) de la funcin f (x) = sen(x) en los puntos
0; 2 ; y 3
2 .
ra{ces x = 1; 2
maxk=0;::;n1 j ak j
= 125
j an j
por tanto el nmero de races positivas es 1 3: Para estimar el nmero de races negativas cambiamos x por x y
miramos los signos de los coecientes que en este caso son:
Solucin: Puesto que sen(0) = sen() = 0 slo necesitamos los polinomios base de Lagrange centrados en 2 y
3
2 :
x (x ) x 3
2
3
P 2 (x) =
2
2 2
2
x (x ) x 2
P 3
(x)
=
3 3
3
2
2
2
2 2
++
P (x) = P 2 (x) P 3
(x)
2
Problema 25 Calcular la expresin del error interpolacin al aproximar la funcin f(x) = sen(x) en el intervalo [0; 2] interpolando en los puntos 0; 2 ; , 3
2 : y acotarlo superiormente.
Problema 28 Calcular el polinomio interpolador de Lagrange P3 (x) de la funcin f (x) = sen(x) en los puntos
0; 2 ; y 3
2 utilizando las diferencias divididas de Newton.
Solucin: Las diferencias divididas son: f[0] = 0; f [ 2 ] =
1; f[] = 0, f[ 3
2 ] = 1;
sen()
3
f (x) PN (x) =
x x
(x ) x
4!
2
2
2
f[0; ] =
2
2
f [ ; ] =
2
3
2
f[; ] =
2
4
f[0; ; ] = 2
2
3
f [ ; ; ] = 0
2
2
3
8
f [0; ; ; ] =
2
2
3 3
por tanto, el polinomio interpolador es
2
4
P (x) = x 2 x x
+ 3x x
(x )
2
3
2
3
jf (x) PN (x)j 2 2
(2 ) 2
4!
2
2
Problema 29 Calcular el polinomio interpolador de Lagrange P3 (x) de la funcin f(x) = 2x en los puntos
0; 1; 3; 4 utilizando las diferencias divididas de Newton.
Expresar el polinomio tomando en primer lugar x0 = 0;
x1 = 1; x2 = 3 y x3 = 4; y en segundo lugar x0 = 4;
x1 = 3; x2 = 1; y x3 = 0:
6
1
= 6: 78 107
2
f [x0 ; x1 ] = 1
f [x1 ; x2 ] = 3
f [x2 ; x3 ] = 8
2
f [x0 ; x1 ; x2 ] =
3
5
f [x1 ; x2 ; x3 ] =
3
1
f[x0 ; x1 ; x2 ; x3 ] =
4
y el polinomio interpolador es:
2
1
P (x) = 1 + x + x(x 1) + x(x 1)(x 3)
3
4
Si tomamos ahora los puntos en orden inverso: f [x0 ] = 16;
f [x1 ] = 8; f[x2 ] = 2; f [x3 ] = 1:
-1
0
0
-1
-3
2!2
f [x0 ; x1 ] = 8
f [x1 ; x2 ] = 3
f [x2 ; x3 ] = 1
5
f [x0 ; x1 ; x2 ] =
3
2
f [x1 ; x2 ; x3 ] =
3
1
f[x0 ; x1 ; x2 ; x3 ] =
4
j Pn (x) sen(x) j
224 = 5: 96 108
sen(x)
como puede observarse, al cambiar el orden de los puntos de interpolacin, el polinomio de Lagrange expresado
a travs de las diferencias divididas cambia totalmente,
salvo el ltimo coeciente 14 que es el mismo en mbos casos pues como se haba demostrado en teora el valor de
f [x0 ; x1 ; x2 ; x3 ] no depende del orden en que se toman los
puntos de interpolacin.
por tanto:
2n+2
j Pn (x) sen(x) j
4
sen(x)
(2n + 2)!
Problema 30 Dada una funcin f(x); y una secuencia de valores xn , aproximar f(x) por la parbola que
pasa por los puntos (xn1 ; f (xn1 )) ; (xn2 ; f (xn2 )) y
(xn3 ; f(xn3 )), calcular posteriormente las derivadas del
polinomio, y comprobar que coinciden con las frmulas dadas en el mtodo de Muller para el clculo de las
derivadas f 00 (xn1 ) y f 0 (xn1 ):
Solucin: Si utilizamos las diferencias divididas para interpolar obtenemos f [xn1 ] = f (xn1 )
2n+2
4
(2n + 2)!
f (xn1 ) f (xn2 )
xn1 xn2
f (xn2 ) f (xn3 )
xn2 xn3
f [xn1 ; xn2 ] f [xn2 ; xn3 ]
xn1 xn3
f [xn1 ; xn2 ] =
f [xn2 ; xn3 ] =
f [xn1 ; xn2 ; xn3 ] =
cos
x [0; 8 ] (x)2
x si x 8
cos[0; 4 ] (x) =
2
cos[0; ] 2 sin[0; 8 ] 2
si x > 8
El polinomio interpolador es
sen[0; 4 ] (x) =
sen(x) u Pn (x) = x
Solucin: En primer lugar, la funcin cos(x) la desarrollamos por serie de Taylor como
Problema 33 Calcular los polinomios necesarios para interpolar las funciones trigonomtricas cos(x) y sen(x) en
el intervalo [0; 8 ] en una aritmtica de 32 bits
Problema 31 Aproximar la funcin sen(x) en el intervalo [0; 4 ] utilizando el desarrollo de Taylor, y calcular el
valor de n a partir del cual la aproximacin es la mejor
posible dentro de una aritmtica de 32 bits.
= 2: 46 108
cos(x) u Pn (x) = 1
2n+1
x
x
x
+
+ :::: + (1)n
3!
5!
(2n + 1)!
x2 x4
x2n
+
+ :::: + (1)n
2!
4!
(2n)!
2n+1
(x)
j Pn (x) cos(x) j sen( )
8 (2n + 1)!
2n+2
(x)
j Pn (x) sen(x) j sen( )
4 (2n + 2)!
8
j Pn (x) cos(x) j
224 = 5: 96 108
cos(x)
por tanto:
2n+1
j Pn (x) cos(x) j
8
tan( )
cos(x)
8 (2n + 1)!
x3 x5
x2n+1
+
+ :::: + (1)n
3!
5!
(2n + 1)!
por tanto:
2n+2
j Pn (x) sen(x) j
8
sen(x)
(2n + 2)!
un2 =
un3 =
..
.
Sumas
n1
..
.
Multiplic:
n1
..
.
Divisiones
1
..
.
T otal
2n 1
..
.
3
2
1
0
3
2
1
0
1
1
1
1
7
5
3
1
bn1 an1;n un
an1;n1
j Pn (x) sen(x) j
224 = 5: 96 108
sen(x)
(2n + 2)!
un1 =
Sumas = 0 + 1 + 2 + 3 + : : : + n 1 =
(n1)n
2
M ultiplicac: = 0 + 1 + 2 + 3 + : : : + n 1 =
(n1)n
2
Divisiones = 1 + 1 + 1 + 1 + : : : + 1 = n
Total = 1 + 3 + 5 + 7 + : : : + 2n 1 =
= Sumas + M ultiplicac: + Divisiones =
yx = ex ln y
(n1)n
2
(n1)n
2
+ n = n2
Problema
36 Resolver
por el
mtodo
de Gauss el sistema
1 2
x
3
=
2 1
y
0
Solucin:
1 2
x
3
=
!
2
1
y
0
2 1
x
0
=
!
1
2
y
3
2 1
x
0
=
! 23 y = y ! y = 2 !
0 23
y
3
x = 22 = 1
Divisiones = 1 + 1 + : : : + 1 = n 1
M ultiplicac: = n + n + : : : + n = n(n 1)
Sumas = n + n + : : : + n = n(n 1)
2a Iteracin:
Divisiones = 1 + 1 + : : : + 1 = n 2
M ultiplicac: = (n 1) + (n 1) + : : : + (n 1) =
=(n 1)(n 2)
Sumas = (n1)+(n1)+: : :+(n1) = (n1)(n2)
..
.
1
1
1
k2 = M 3 M 2 + M
3
2
6
(n-1)a Iteracin:
Divisiones = 1
Solucin:
a11
B a21
B
A=B .
@ ..
an;1
a12
a22
..
.
..
.
a1n
a2n
..
.
an;2
an;n
M ultiplicac: = 2
Sumas = 2
C
C
C
A
Total operaciones1 :
Divisiones = (n1)+(n2)+(n3)+: : :+1 =
aji
aii
= 2n
: : : ajn ain
aji
aii
1a
2a
..
.
(n 1)a
3n2 +n
6
(n1)n
2
n3 n
3
Fila
2a
3a
..
.
Division.
1
1
..
.
Multiplic.
n
n
..
.
Sumas
n
n
..
.
na
3a
4a
..
.
1
1
1
..
.
n
n1
n1
..
.
n
n1
n1
..
.
na
..
.
1
..
.
n1
..
.
n1
..
.
na
n3 n
3
n(n1)
2
n3 n
3
n(n1)
2
= 23 n3 + 21 n2 67 n
3
10
+ 22 + 32 + ::: + (n 1)2 =
2n3 3n2 +n
6
Solucin:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
1. Simtrica:
t
Como jBj 6= 0; si B
x = 0 =) x
=0
Una matriz se dice denida positiva si se cumple que
8
x 6= 0; x
t A
x > 0 =)
=) x
t A
x=x
t BB t x
= (B t x
) B t x
=
1
2 1 0 1
1 2 1 0 A
0 1 2 1
A = B Bt =
0
b11 0
= @ b21 b22
b31 b32
u1 =
1+u2
2
=1
=
=
2
2
1
1
1
1 4
5 6 A
6 26
12u3
1
A = B Bt;
j1
filaj f ila2 aa11
;j > 2 :
0
1
0
1
2 1 0 1
2 1 0 1
! @ 0 3 2 1 A
@ 0 3 2 1 A
ceros
0 1 2 1
0 0
4 4
u2 =
yi2 > 0
la primera:
j1
filaj f ila1 aa11
;j > 1 :
0
1
0
1
2 1 0 1
2 1 0 1
! @ 0 3 2 1 A
@ 1 2 1 0 A
ceros
0 1 2 1
0 1 2 1
4
4
Problema 41 Descomponer
mtodo de Cholesky
0
1
A=@ 1
4
u3 =
2. Denida positiva:
= yt y =
At = (B B t ) = (B B t ) = (B t ) B t = B B t = A
b211
@
b11 b21
=
b11 b31
=1
10
0
b11
0 A@ 0
b33
0
b11 b21
b221 + b222
b21 b31 + b22 b32
b21
b22
0
1
b31
b32 A =
b33
1
b11 b31
b21 b31 + b22 b32 A
b231 + b232 + b233
=1
11
b211 = 1
b11 = 1
Iteraci
on
b11 b21 = 1
b21 =
1
b11
=1
i=1
Sumas
0
0
..
.
M ultiplic:
0
0
..
.
b11 b31 = 4
b31 =
4
b11
1
n1
=4
1
1
..
.
i=2
b221 + b222 = 5
p
p
b22 = (5 b221 ) = (4) = 2
6b21 b31
b22
64
2
n1
n2
2
2
..
.
2
2
..
.
0
1
..
.
2(n2)
n3
2(n2)
..
.
i=n
0
1
..
.
i=3
=1
1
1
..
.
n1
Divisiones
0
1
..
.
..
.
n1
..
.
n1
..
.
0
A = B Bt =
0
10
1
1 0 0
1 1 4
= @ 1 2 0 A@ 0 2 1 A
4 1 3
0 0 3
Sumas = M ultiplicac: =
= (n 1) + 2 (n 2) + 3(n 3) + : : : + (n 1) =
P
n3 n
= n1
i=1 i(n i) =
6
Problema 42 Calcular el nmero de operaciones necesarias para resolver un sistema por el mtodo de Cholesky.
Divisiones = (n 1) + (n 2) + (n 3) + : : : + 1 =
P
n(n1)
= n1
i=1 i =
2
Solucin: Las operaciones que se realizan en cada iteracin vienen dadas por:
i=2
..
.
i=n
= 2n
Operaciones
p
j = 1 : b11 = a11
21
j = 2 : b21 = ab11
..
.
j = n : bn1 = abn1
p11
j = 2 : b22 = a22 b221
21 b31
j = 3 : b32 = a32 b
b22
..
.
21 bn1
j = n : bn2 = an2 b
b22
..
.
q
n
6
n(n1)
2
= 13 n3 65 n + 12 n2
n3
3
B
B
AA1 = Id = B
@
1 0
0 1
.. .. . .
.
. .
0 0
0
0
..
.
1
1
C
C
C
A
B
B
AB
@
c11
c21
..
.
c12
c22
..
.
..
.
c1n
c2n
..
.
cn1
cn2
cnn
C B
C B
C=B
A @
1 0
0 1
.. .. . .
.
. .
0 0
0
0
..
.
1
l2 u2 = b2
C
C
C;
A
l2 = a2 m1 u1 ; u2 =
..
.
mn2 un2 + ln1 = an1
cn1
c12
B c22
B
AB .
@ ..
cn2
..
. 0
c1n
B c2n
B
AB .
@ ..
C B
C B
C=B
A @
1
cnn
C B
C B
C=B
A @
0
1
..
.
0
0
0
..
.
1
ln = an mn1 un1
C
C
C
A
C
C
C ; c.q.d.
A
0 C
C
b3
0 C
C
C
..
A
. b
n1
cn1
an
l1
B m1
B
=@
0
0
l1 u1
m1 u1 + l2
:
0
bn1
; mn1 = cn1
ln1
mn1 un1 + ln = an
Solucin: Consideremos
0
a1 b1 0
B c1 a2 b2
B
B
A = B 0 c2 a3
B ..
..
..
@ .
.
.
b2
; m2 = c2
l2
0
l2 u2
:
:
:
:
:
mn1
0
C
0
C
A
ln1 un1
mn1 un1 + ln
4
2
=2
i=2
m1 = 1
l2 = 0 2 (1) = 2
u2 =
4
2
=2
i=3
l1 u1 = b1
l1 = a1 ; u1 =
b1
; m1 = c1
l1
m2 = 1
l3 = 0 2 (1) = 2
m1 u1 + l2 = a2
13
(U x = y)
Divisiones
1
1
1
..
.
i=n
= 1 + 1 + : : : + 1 = (n 1)
Total=Sumas + M ultiplicac: + Divisiones =
= 3 (n 1)
El orden del algoritmo es O (3n)
y1
@ y2 A = @
y3
6
2
3+y1
2
1+y2
2
DIFERENCIACION E INTEGRACION
NUMERICA
3
A=@ 3 A
1
(xl )
(xi )
+ (xr xi ) f (xxi )f
(xi xl ) f (xxrr)f
xi
i xl
f (xi )
xr xl
Ux = y
0
10
1 0 1
1 2 0
x1
3
@ 0 1 2 A @ x2 A = @ 3 A
0 0 1
x3
1
1 0
1 0 1
x1
3 2x2
1
@ x2 A = @ 3 2x3 A = @ 1 A
x3
1
1
1 1 1
Problema 46 Calcular el nmero de operaciones necesarias para resolver un sistema tridiagonal por el mtodo
de Crout.
Operaciones
l1 = a1 ; u1 = bl11
m1 = c1 ; l2 = a2 m1 u1 ; u2 =
..
.
ln = an mn1 un1
00
(xi )
2! (xl
f 000 (xi )
(xl
3!
xi )2 +
xi )3
00
(xi )
2! (xr
xi )2 +
f 000 (xi )
(xr
3!
xi )3
(xi )
(xr xi ) f (x(xl )f
= (xr xi )[f 0 (xi )+
l xi )
Solucin: Las operaciones que se realizan en cada iteracin vienen dadas por:
Iteraci
on
i=1
i=2
..
.
i=n
M ultiplic:
0
1
1
..
.
Ly = b
Sumas
0
1
1
..
.
Iteraci
on
i=1
i=2
i=3
..
.
+f
00
(xi )
2! (xl
xi ) +
f 000 (xi )
(xl
3!
xi )2 ]
(xr )
(xi xl ) f (x(xi )f
= (xi xl )[f 0 (xi )+
i xr )
b2
l2
+f
00
(xi )
2! (xr
xi ) +
f 000 (xi )
(xr
3!
xi )2 ]
14
i xr )f (xl )
+ (x(xl x
i )(xl xr )
(xi )
(xi )
+ (xi xl ) f (x(xrr)f
=
(xr xi ) f (x(xl )f
xi )
l xi )
00
+f
00
+f
000
+f
000
(xi )
2! (xi
xl )(xr xi )+
(xi )
2! (xr
(xr xl ) f 0 (xi ) =
xi )(xl xi )+
(xi )
(xr
3!
(xi )
(xi
3!
xl )f (xr )
+ (xi(x
r xi )
xi )(xl xi )2 +
(xr xl ) f 0 (xi ) =
xl )(xr xi )2
000
(xi )
(xr
3!
(xr xl ) f 0 (xi ) =
0+
(xi xl )
xr xl
xi f (xi )
+ (x
i xl )
+ O(h2 )
(xi ) +
(xxi )(xxl )
(xr xi )(xr xl ) f
(xi ) +
f 0 (xi ) =
(xr ) +
f (xi ) =
(xxl )+(xxi )
(xr xi )(xr xl ) f
f 0 (xi ) =
f (xi )
(xi xr )
f(xi )
(xi xl )
xl f (xi )
(xi xl )
(xi xr )+(xi xi )
(xl xi )(xl xr ) f
xi f (xi )
(xr xi )
xr f (xi )
(xr xi ) +
xl f (xi )
(xi xl )
(xi xl )(f (xr )f (xi ))
+
(xr xi )
Solucin:
3
2
a ! f (xi + h) = f (xi ) + hf 0 (xi ) + h2 f 00 (xi ) + h6 f 000 (xi ) +
O(h4 )
(xr ) +
h2 00
2 f (xi )
=
1
6
6
3
1; b = 3; c = 1:
(xi ) +
i xl )+(xi xi )
+ (x
(xr xi )(xr xl ) f (xr ) +
(xr xi )f (xl )
(xi xl )
(xi xl )f (xi )
(xr xi )
simplicando,
r )+(xxi )
+ (xx
(xl xi )(xl xr ) f (xl )
(xi xl )f (xr )
(xr xi )
i )(xxr )
+ (x(xx
f (xl )
l xi )(xl xr )
f 0 (x) =
(xr xi )f(xl )
(xi xl )
xi f (xi )
(xi xl )
(xr xl ) f 0 (xi ) =
f (x) =
(xi xr )f(xl )
(xl xi )
+ O(h2 )
f (xi )f (xl )
f (xr )f (xi )
+(xr xi )
xr xi
xi xl
(xr xi )f (xi )
(xi xl )
(xr xl ) f 0 (xi ) =
(xi )
+
(xr xl )f 0 (xi ) = (xr xi ) f (x(xl )f
l xi )
f 0 (xi )
xr f(xi )
+
(x
r xi )
(xi )
+(xi xl ) f(x(xrr)f
xi )
(xr xl )f (xi )
+
(xi xl )
agrupamos trminos,
(xi )
(xi )
(xr xi ) f (x(xl )f
+ (xi xl ) f (x(xrr)f
=
xi )
l xi )
= (xr xl )f 0 (xi ) +
xl )f (xr )
+ (xi(x
r xi )
f 00 (xi )
2!
(xr xl )f (xi )
(xi xr )
(xl )
(xi xl )f (xr )
(xr xi )(xr xl ) +
15
f 000 (xi ) =
f (xr )f (xi )
f (xi )f (xl )
h
h
=
O(h2 ) =
f (xi ) 2
f (xr )f (xi )
xr xi
f (xi )f (xl )
xi xl
(xi )
2!
f 000 (xi )
3!
(xr xi )3
00
(xl xi )2 +
(xi )
2!
f 000 (xi )
3!
(xl xi )3
+f
000
(xi )
3!
f (xl )f (xi )
(xl xi )
+f
f 00 (xi )
2!
f 0 (xi ) +
000
(xi )
3!
(xr xi ) +
(xr xi )2
(xl xi )2
f (xi )f (xl )
(xi xl )
f 00 (xi ) 2
f (xi )
2!
P 0 (x) '
+
f (x )f (x )
f (xr )f (xi )
xi x l
xr xi
i
l
xr xl
f (x )f (x )
f (xr )f (xi )
xi x l
xr xi
i
l
xr xl
(x xl ) +
(x xi )
P 00 (x) ' 2
xr xl
f (x )f (x )
f (xr )f (xi )
xi x l
xr xi
i
l
xr xl
; c.q.d.
f (xi )f (xl )
(xr xi )
(xi xl )
xr xl
+ O(h)
Solucin:
f 0 (xi )
Solucin: Sustituyendo xl = xi h; y xr = xi + h;
tenemos:
f (xr )f (xi )
f 00 (xi ) 2
(x xl ) (x xi )
((xr xi )2 (xl xi )2 )
f (xr )f (xi )
f 00 (xi ) 2
f (xi )f (xl )
xi xl
f (xi )f (xl )
(xr xi )
(xi xl )
xr xl
f 000 (xr )
3!
xr xl
(x xl ) +
Derivamos el polinomio:
f (x )f (x )
f (xr )f (xi )
xi x l
xr xi
i
l
00
(xr xl ) +
000
+ f 3!(xi ) (xr xi )2 (xl xi )2
f (xr )f (xi )
f (xi )f (xl )
xi xl
(xl xi ) +
+ O(h2 )
Polinomio de Lagrange:
f 00 (xi )
2!
f 0 (xi ) +
(h h) +
xl ! f (xl )
f (xi )f (xl ) +
f (xr )f (xi )
(xl )
f (xxi )f
xi ! f (xi ) xi xl
xr xi
i xl
xr xl
f (xr )f (xi )
xr xi
xr ! f (xr )
f 000 (xi )
3!
00
xr xl
+f
f (xi )f (xl )
x x +h
(xi +hxi )
( i i )
xi +hxi +h
=
16
(xi xl )
f (x )f (x )
f (xr )f (xi )
+(xr xi ) xi x l
xr xi
i
l
xr xl
(0)
(1)
(01) f (4)f
+(40) f (0)f
40
01
41
10
91
4 +4 1
3
6
3
= 2
24
3
f (xi )f (xl )
(xr xi )
(xi xl )
xr xl
f (xr )f (xi )
f 00 (xi ) 2
=2
10
91
(40) (01)
41
Fxx + Fyy =
= 2 2+1
3 =2
discretizando
F =
Problema 55 Calcular una aproximacin del laplaciano de una funcin F (x; y) en el punto (x; y) =
(0; 0) conociendo los siguientes valores: F (0; 0) = 0;
F ( 12 ; 0) = 41 ; F ( 12 ; 0) = 14 ; F (0; 21 ) = 41 ; F (0; 12 ) = 14 ;
F ( 12 ; 12 ) = 12 ; F ( 12 ; 21 ) = 12 ; F ( 21 ; 12 ) = 21 ; F ( 12 ; 12 ) =
1
2
1
2
1
4
1
2
+Fi;j1 4Fi;j
+ (1 ) Fi+1;j +Fi1;j +Fhi;j+1
;
2
F (x + h; y + h)+F (x h; y h)+F (x h; y + h) +
h2
2 Fyy
2
h
2
8
3
4
3
1
1
1
1
2+2+2+2
2 14
=4
+ 1 23
p
2 2
1
Fx =
2 2 p
1
4h
2 2
2
3
1
1
1
1
4+4+4+4
1
4
F (x h; y) = F (x; y) hFx +
2
3
F (0; 0) =
Fxx + Fyy =
1
4
F =
1
2
1
4
1
2
El valor de h es 12 :
Aproximamos el laplaciano promediando las dos expresiones del ejercicio anterior. Si no realizramos este
promediado, no se tendran en cuenta todos los valores de
la funcin.
1
4
2 2
1
0p
Fy =
4h
2 2
0
0
0
p 2
2 2 p
1
2 2
21
p 0
2 21
2 2
0p
2 2
Fyy
F (x + h; y) + F (x h; y) + F (x; y + h) +
+F (x; y h) = 4F (x; y) + h2 Fxx + h2 Fyy
17
Consideramos una funcin que tiene los siguientes valores en un entorno de un punto (hi0 ; hj0 ) :
1
0
0
1
0
0
1
0
0
Problema 57 Calcular una aproximacin del gradiente de una funcin F (x; y) en el punto (x; y) =
(0; 0) conociendo los siguientes valores: F (0; 0) = 0;
F ( 12 ; 0) = 21 ; F ( 12 ; 0) = 21 ; F (0; 12 ) = 21 ; F (0; 12 ) =
1
1 1
1
1
1 1
2 ; F ( 2 ; 2 ) = 0; F ( 2 ; 2 ) = 0; F ( 2 ; 2 ) = 1;
1
1
F(2; 2) = 1
1
0
0
1
2
0
0
0
1
4h
1 2
4 h
1
1 1
Fy = (1 ) 1
2h + 4h = 2 h
1
4h
1 2
4 h
1 2
4 h
=2
(1; 1)
21
21
p
21
h
= 12
1
2
1
1
2+2
4h + 2
p
1 2 2
1
= 2h
2 h
p 1+1
2 4h =
p
21
h
1
1
2 2
4h
+ 2 2 11
4h =
p
1 2 2
2 h
1
= 2h
Fx
1
2h
rF =
=
=
1
Fy
1
2h
Este vector nos da la direccin de mximo ascenso,
que en este caso ser en diagonal hacia arriba a la derecha.
Fi1;j
Fx = (1 ) Fi+1;j2h
+
Fi+1;j+1 Fi1;j+1 +Fi+1;j1 Fi1;j1
4h
=
p
Fi+1;j Fi1;j
=2 21
+
4h
p
+Fi+1;j1 Fi1;j1
+ 2 2 Fi+1;j+1 Fi1;j+14h
Solucin:
Analticamente
2x 2y
2 2
rf(x; y) =
! rf (1; 1) =
1 1
1 1
Fi;j1
Fy = (1 ) Fi;j+12h
+
1
2
=2
p
La solucin vlida es = 2 2, ya que el gradiente
r2 F debe ser negativo en sus dos derivadas.
1
2
+
p
Fi;j1
Fy = 2 2 1 Fi;j+14h
+
p
+Fi1;j+1 Fi1;j1
+ 2 2 Fi+1;j+1 Fi+1;j14h
=
Fi1;j
Fx = 2 2 1 Fi+1;j4h
+
p
+Fi+1;j1 Fi1;j1
+ 2 2 Fi+1;j+1 Fi1;j+14h
=
y calculamos su gradiente:
1
1 1
Fx = (1 ) 1
2h + 4h = 2 h
1
2
p
F
F
= 2 2 1 i;j+14h i;j1 +
p F
F
+F
F
+ 2 2 i+1;j+1 i+1;j14h i1;j+1 i1;j1 ;
2. n = 3
f1 (x; y) = x y
@f1 (1;1)
@x = p
1
4(0:1) 2 p2 (f1 (1 + 0:1; 1 0:1) f1 (1 0:1; 1
1
4(0:1) 2 2 (f1 (1 + 0:1; 1 + 0:1) f1 (1 0:1; 1
p
1
2 1 (f1 (1 + 0:1; 1) f1 (1 0:1; 1)) =
4(0:1) 2
3
P
0:1)) +
+ 0:1)) +
= 0:55555555555 P (0:7745966692) +
@f1 (1;1)
@y = p
1
4(0:1) 2 p2 (f1 (1 0:1; 1 + 0:1) f1 (1 0:1; 1
1
4(0:1) 2 2 (f1 (1 + 0:1; 1 + 0:1) f1 (1 + 0:1; 1
p
1
2 1 (f1 (1; 1 + 0:1) f1 (1; 1 0:1)) =
4(0:1) 2
+0:88888888 P (0) +
+0:55555555555 P (0:7745966692) =
0:1)) +
= : 4
0:1)) +
R1
El valor exacto de la integral es 1 x3 x4 dx =
52 = : 4, que coincide con el valor del segundo caso. La
frmula de integracin numrica es exacta hasta el orden
2n 1; que en el segundo caso es equivalente a 5, con lo
que ya se saba que el valor obtenido sera exacto.
1
4(0:1) 2 2 (f2 (1 + 0:1; 1 + 0:1) f2 (1 0:1; 1
p
1
2 1 (f2 (1 + 0:1; 1) f2 (1 0:1; 1)) =
4(0:1) 2
0:1)) +
+ 0:1)) +
@f2 (1;1)
@y = p
1
4(0:1) 2 2 (f2 (1 0:1; 1 + 0:1) f2 (1 0:1; 1
p
1
4(0:1) 2 2 (f2 (1 + 0:1; 1 + 0:1) f2 (1 + 0:1; 1
p
1
2 1 (f2 (1; 1 + 0:1) f2 (1; 1 0:1)) =
4(0:1) 2
0:1)) +
0:1)) +
2 2
rf (1; 1) =
1 1
Solucin:
R
1. 2 cos(x)dx = sin(x)]2 = 1 (1) = 2
2
cos(x)dx =
R1
cos( 2 t) 2 dt =
2
2
cos
(0)
+
cos
32
32
4
p
= 13 2 + 31 = 2: 528 2
x x4 dx
2
32
cos 4 +
R1 3
P
4
x
x
dx
'
wk P (xk )
1
k=0
L1 (x) = x ! x0 = 0
P (x) = x3 x4
1. n = 2
2
P
wk P (xk ) =
k=1
wk P (xk ) =
k=1
= 1 P (0:5773502692 + 1 P (0:5773502692) =
= : 222 22
19
Problema 62 A partir de los ceros y de los pesos asociados a los polinomios de Legendre, y dado un intervalo
[a; b] cualquiera, encontrar los puntos xk ; y los pesos wk
que hacen exacta hasta el orden 2N 1 una frmula de
integracin numrica sobre el intervalo [a; b]
3
2
x x2 ex dx
1
R1 3
p
2
x x2 ex dx = 21 = : 886 23
1
k=1
x = (ba)t+(b+a)
2
dx = ba
2 dt
f (x) = x3 x2
este cambio representa la recta que pasa por los puntos -1,
1 para t = a; b; respectivamente.
R1 3
P
2
wk f (xk )
x x2 ex dx =
1
k=1
= w1 f (x1 ) + w2 f (x2) =
(b a) t + b + a b a
dt
2
2
a
1
Z b
N
X
ba
(b a) x
~k + b + a
f (x) dx '
w
~k
f
2
2
a
f (x) dx =
= 0:8862269255 f (0:707106781) +
+0:8862269255 f (0:707106781) =
k=1
= : 886 23
x x3 dx
Solucin:
1
3
2
0 x x dx = 12 = 8: 333 3 10
R1
1
dx
1 1+x2
2
f (x) =
f (x) = x2 x3
R1
ex
1+x2
1
1 1+x2 dx
R1 2
P
3
x
x
dx
=
wk f (xk ) =
0
R1
2
ex
ex dx
1 1+x2
= 0:8862269255 f (0:707106781) +
+0:8862269255 f (0:707106781) =
k=1
=
(w
~0 f x~02+1 + w
~1 f x~12+1 + +
2
x~2 +1
w
~2 f
)=
2
= 21 (0:55555556 f 0:7745966692+1
+
2
+0:8888888889 f 0+1
+
2
0:7745966692+1
+0:55555556 f
)=
2
= 1: 948 2
Problema 66 Calcular de forma exacta la integral
Z 1
3
x x2 ex dx
0
= 8: 333 3 102
20
R1 3
4
1 x x dx =
Solucin:
R1 3
x x2 ex dx = 4
0
1
x
R1 3
P
2
wk f (xk ) =
e
dx
=
x
x
0
R1
R0 3
x x4 dx + 0 x3 x4 dx '
1
'
k=0
= 0:8535533903 f (0:585786438) +
'
= 4:0
+
Problema 67 Calcular una frmula de aproximacin
numrica de la integral siguiente
Z 1
f (x)ex dx
R1
t=xa
t
=
0 f(t)e dx =
dt = dx
R1
R1
= a f (x a)ex+a dx = ea a f (x a)ex
ea
N
P
R1 R1
k=1
k+1 +xk
2
F (x; y) dydx =
N
P
w
~k
k=1
=
N
P
1 1
w
~k f (~
xk )
f (x a)ex = ea
#1
(xk+1 + xk )
(0 + 1) +
(1 0) =
Solucin:
k=0
R1
(xk+1 + xk )
f(t)et dx =
#0
5
= 12
= : 416 67
k+1 +xk
2
+0:1464466093 f (3:414213562) =
R1
= w0 f (x0 ) + w1 f (x1 ) =
N
P
w
~k
k=1
wk f (xk a)
R1
1 F
N
P
N
R1 P
1
w
~k F (~
xk ; y) dy =
k=1
(~
xk ; y) dy
w
~j F (~
xk ; y~k )
j=1
N
P
~ k F (~
W
xk ; y~k ) ;
k;j=1
donde
~k = w
W
~k w
~j
w
~k =
w
~j =
x x4 dx
Q
(x~
xi )
Q i6=k
1
xk ~
xi )
i6=k (~
R 1
R 1
1
Q
(y~
yi )
Q i6=k
yk ~
yi )
i6=k (~
y los x
~k e y~k son los ceros del polinomio de Legendre.
R1 3
4
dx = 25 = : 4
1 x x
Solucin:
RbRd
f (x) = x3 x4
21
F (x; y) dydx =
N
Rd P
c
k=1
w
~k F (~
xk ; y) dy =
N
P
w
~k
k=1
N
P
w
~k
k;j=1
F (~
xk ; y) dy
N
P
j=1
k=1
N
P
Rd
w
~j0 F
R1 R2
x
1 0 1+ey2
(~
xk ; y~k )
w
~k w
~j0 F (~
xk ; y~k ) ;
R2
0
R2
0
1 1
1
1 1+ey2
1. P (y) =
2
2
1 x dx 1 y dy
k=1
=w
~k ;
dy =
por Hermite,
R1
w
~k P (~
xk )
=x
~k + 1;
= w1 P (x1 ) + w2 P (x2 ) =
R1
x2 y 2 dxdy =
2
P
(ba)
~k
2 w
(b+a)
2
= 2:0
R1
= : 444 44
P (x) = x2
R1 R1
(ba)~
xk
2
= (0:5773502692 + 1) + (0:5773502692 + 1) =
P (y) = y
wk P (xk ),
xdx =
dy = 2: 144 3
P (x) = x
1 1 x
dy =
tenemos:
4
9
1
P
2
1 1+ey2
k=0
1. wk =
2 2
2
1 1+ey2
xdx =
xk =
R1 R1
R1
R1
x
~k = (ba)xk2+(b+a)
w
~k = (ba)
2 wk
(dc)yk +(d+c)
y~k =
2
w
~j0 = (dc)
2 wk
dxdy =
2
P
=
1
P
w
~j P (~
yk ) =
R1
2
1
ey dy
1 ey2 +1
2
P
w
~j P (~
yk ),
k=1
1
ey2 +1
wj P (yk ) =
k=0
k=1
= (w
~1 P (~
x1 ) + w
~2 P (~
x2 ))
= w1 P (y1 ) + w2 P (y2 ) =
= 0:8862269255 P (0:707106781) +
(w
~1 P (~
y1 ) + w
~2 P (~
y2 )) =
= (P (0:5773502692) + P (0:5773502692))
+0:8862269255 P (0:707106781) =
(P (0:5773502692) + P (0:5773502692)) =
= 1: 103 3
R1 R2
x
1 0 1+ey2
22
1. Para 1 punto:
x2 ydxdy =
= F ( 23 ; 23 )Area(T ) =
2 2
3
2
32
16
27
= : 592 59
Solucin:
2. Para 3 puntos:
R
(ax + by + c) dydx = 16 a + 16 b + 12 c
a = c = 0; b = 1;
1
3
b = c = 0; a = 1; 16 a = w0 x0 a ! x0 = 13 ;
luego para los valores w0 =
de integracin es exacta.
1
3 ; y0
1
3
la frmula
8
15
8
15
= : 533 33
1 1 1
1
El rea del tringulo! Area(T ) = 2 2 0 0
0 2 0
4 4
12 4
4 12
= Area(T )[ 25
48 F ( 10 ; 10 ) + F ( 10 ; 10 ) + F ( 10 ; 10 )
F (x; y) = x2 y
2
- x ydxdy
x2 ydxdy =
= : 533 33
2
3
2 2
27
48 F ( 3 ; 3 )] =
1=
3. Para 4 puntos:
1
2
= w0 y0 b ! y0 =
1
2 ; x0
2
3
= : 666 67
1
6b
= 13 Area(T ) F ( 22 ; 0) + F ( 22 ; 22 ) + F (0; 22 ) =
=
+ 12 c = w0 (x0 a + y0 b + c)
a = b = 0; c = 1; 12 c = w0 c ! w0 =
2
- x ydxdy
1. kxkp = 0 () x = 0;
=2
p
p
jx1 jp + jx2 jp = 0 =) jx1 jp + jx2 jp = 0,
23
Solucin:
2. kxkp = jj kxkp ; 8 2 K y x 2 E;
p
kxkp = p jx1 jp + jx2 jp
kxkp =
kxkp =
p
p
jjp jx1 jp + jjp jx2 jp
q
PN
p
i=1 jxi j
PN
p
p
=
Limp!1
i=1 jxi j
p
p
jjp (jx1 jp + jx2 jp )
P jxi j p
= Limp!1 p jxmax jp N
=
i=1 jxmax j
p
kxkp = jj p jx1 jp + jx2 jp
PN i j p
= Limp!1 jxmax j p i=1 jxjxmax
=
j
= jxmax j Limp!1
p
p
jx1 + y1 jp + jx2 + y2 jp kxkp + kykp =)
= jxmax j Limp!1
=) jx1 + y1 jp + jx2 + y2 jp
p
p
p
p jx1 jp + jx2 jp + p jy1 jp + jy2 jp
Para p = 2 tenemos:
Limp!1
jx1 + y1 j2 + jx2 + y2 j2
entonces
q
2
q
jxi j
jxmax j
jxmax j Limp!1
r
PN
p
i=1
P
N
i=1
jxi j
jxmax j
P
N
i=1
jxi j
jxmax j
jxi j
jxmax j
p 1=p
1 si xi = xmax
;
0 si xi 6= xmax
jxi j
jxmax j
p 1=p
p
p
x21 +x22 +2 (x21 + x22 ) (y12 + y22 )+y12 +y22 =)
= jxmax j, c.q.d.
=) x1 y1 + x2 y2
p
p
(x21 + x22 ) (y12 + y22 ) =)
Problema 77 Tomar N = 2; y dibujar el lugar geomtrico de los vectores x = (x1 ; x2 ) que verican
1. kxk1 < 1
2. kxk2 < 1
3. kxk1 < 1
=) 0 (x1 y2 + x2 y1 )2 ,
24
p
(x21 + x22 ) ()
() jxmax j
()
x2max
p
(x21 + x22 ) ()
x21
+ x22
supx
kABxk
kxk
supx
kABxk kBxk
kBxk kxk
supx
supx
kABxk kBxk
kBxk kxk
kBk kAk ;
= supx
kABxk kBxk
kxk kBxk ;
kBxk
kxk
supx
kABxk
kBxk
entonces
2
() x21 + x22 (jx1 j + jx2 j) ()
supx
kABxk
kxk
8
8
< x1 + x2 = 0 < x1 = x2
x1 + x2 = 0
:
:
2x3 = 0
x3 = 0
p1
2
1
p
2
x
1 = @
1
A
2. 2 ; 3 = 2
1
10
1 0 1
1 1 0
x1
0
@ 1 1 0 A @ x2 A = @ 0 A
0
0 0
x3
0
8
8
< x1 + x2 = 0 < x1 = x2
x1 x2 = 0
:
:
x3 libre
x3 libre
1
0
A;x
3 = @ 0 A
x
2 = @
1
0
Axi = i xi =) (A i Id)xi = 0
p1
2
p1
2
1
0
0 A
1
1 0
A=
1 1
Solucin:
1. kAk2 =
p
(AT A)
s
q
p
2 1
kAk2 =
= 3+12 5 = 1: 618
1 1
1
1
0
1
1
0 = 4 + 42 = 0
0
0
2
1 = 0
2 = 2
3 = 2
2
1
1
1
2. kAk1 = maxj
= 1 3 + 2 = 0, =
P
2
ja
j
ij
i=1
kAk1 = max(1; 2) = 2
1. 1 = 0
0
p1
2
1
p
2
jA i Idj = 0 =) P () = 0; c.q.d.
B=@
como xi 6= 0, entonces
10
p1
2
p1
2
La matriz,
xi 6= 0 2 E; i 2 CAxi = i xi
3. kAk1 = maxi
1 1 0
x1
0
@ 1 1 0 A @ x2 A = @ 0 A
0 0 2
x3
0
P
2
kAk1 = max(2; 1) = 2
26
j=1 jaij j
3
2
1
2
p
5
1
2 1 0
2. A = @ 1 2 1 A
0 1 2
Solucin:
1
1
2
2
2
1
1 = (2 ) (1 )2 1
1. 2
2
1
1
2 [2(1 ) + 2] 2 [2 + 2(1 )] =
(2 ) 2 2 8 (2 ) = (2 ) 2 2 + 8
= AAt i (At ) At =
de donde obtenemos
= jAAt i Idj
1 = 2
2 = 2
3 = 4
maxi fji jg
(A) = kAk2 A1 2 =
mini fji jg
4
maxi fj i jg
= =2
(A) = kAk2 A1 2 =
mini fj i jg
2
2 1
0
2. 1 2 1
0
1 2
Axi = i xi =)
=) A1 Axi = A1 i xi =)
=)
1
i xi
1 = 2 p
1 = 2 + p2
1 = 2 2
= A1 xi =)
=) A1 xi = 0i xi ,
Tambin es una matriz simtrica, con lo que sus autovectores forman una base ortonormal y su condicionamiento es:
2
i
i
i
mini fji jg
p
p
1
2+ 2
maxi fj i jg
p
(A) = kAk2 A
=
=
3+2
=
2
mini fj i jg
2 2
entonces
(A) = kAk2 A1 2
(A) = maxi fji jg
(A) =
maxi fji jg
mini fji jg ;
= 4 10 + 62 3 = 0
1
mini fji jg
Solucin:
c.q.d.
Bxi = i xi =)
=) R1 AR xi = i xi =)
=) RR1 ARxi = Ri xi =)
3 Vectores
ortonormales:
dos vectores son ortonormales si cumplen
0 si i 6= j
T
lo siguiente, xi xj =
1 si i = j
27
Problema 88 Demostrar
trigonomtricas
=) ARxi = i Rxi =)
=) Ayi = i yi ,
siguientes
igualdades
q
tan() = cot(2) + sign(cot(2)) 1 + cot2 (2)
1 1
A=
1 1
1
cos = p
1 + tan2 ()
sin = tan() cos
tan() + sin(2)
cot(2) =
2 sin2 ()
cos sin
R=
sin cos
Solucin:
1. cot(2) =
cos sin
1 1
cos sin
=
=
sin cos
1 1
sin cos
2 cos sin + 1
2 cos2 1
=
=
2 cos2 1
2 cos sin + 1
b1 0
=
0 b2
Se tiene que cumplir que los elementos que estn fuera
de la diagonal sean iguales a cero,
2 cos2 1 = 0
r
1
cos =
2
De esta igualdad se obtiene el valor del ngulo :
=
las
cos(2)
sin(2)
cos2 ()sin2 ()
2 sin() cos()
1tan2 ()
2 tan()
2 cot(2)
4 cot2 (2)+4
p
1 + cot2 (2)
p
3
; =
4
4
1p
sin 4
2 12 p2
cos 4
2
p
=
R1 =
sin 4 cos 4
21 2 12 2
p
1p
cos 3
sin 3
2 p2 12 p2
4
4
=
R2 =
sin 3
cos 3
12 2 12 2
4
4
2. cos = p
1
1+tan2 ()
1
cos2 ()+sin2 ()
cos2 ()
1
sin2 ()
1+ cos
2 ()
p
cos2 () = cos
b1 = 0; b1 = 2
b2 = 2 cos sin + 1
b2 = 2; b2 = 0;
luego las soluciones posibles son:
0 0
2 0
B1 =
; B2 =
0 2
0 0
28
sin()
cos()
cos = sin
4. cot(2) =
tan()+sin(2)
2 sin2 ()
sin()
cos()
+2 sin() cos()
2 sin2 ()
cos(2)
sin(2)
B
B
B
B
@
=
=
(2 cos2 ()1)
2 sin() cos()
=
0
= cot(2)
a0pq = 0
a0pp = app tan()apq
a0qq = aqq + tan()apq
= apj cos aqj sin j 6= p; q
= apj sin + aqj cos j 6= p; q
0
0
1
0
0
1
0
B 0 cos
B
0
B
B 0
@ 0 sin
0
0
1
an1
apn C
C
ani C
C
aqn A
ann
1
0
0
sin 0 C
C
0
0 C
C=
cos 0 A
0
1
aq1
apq
aqj
aqq
aqn
0
0
0 sin
1
0
0 cos
0
0
ai1
apj
aij
aqj
ani
ai1
apj cos aqj sin
aij
apj sin + aqj cos
ani
B = R1 AR =
0
1
0
B 0 cos
B
=B
0
B 0
@ 0 sin
0
0
ap1
app
apj
apq
apn
a11
ap1 cos aq1 sin
B ap1 cos aq1 sin app cos2 + aqq sin2 apq sin 2
B
ai1
apj cos aqj sin
=B
B
(app aqq )
@ ap1 sin + aq1 cos
sin 2 + apq cos 2
2
an1
apn cos aqn sin
a0pj
a0qj
a11
ap1
ai1
aq1
an1
a0pq = 0 =
(app aqq )
2
tan(2) =
2apq
(aqq app )
aqq = app +
2apq
tan(2)
C
C
C
C
A
2apq
tan(2)
sin2
1
C
C
C
C
A
= app cos2 +
+
sin
1
= arctan 2 = : 553 57
2
= 2 tan()
1
a11 = 2 + tan
arctan 2 = 2: 618
2
a33 = 1 + tan()
2
a33 = 1 tan
1
2: 618 0
0
A
1
0
B = R1 AR = @ 0
0
0 0: 381 97
+apq sin 2 =
=
sin2 +
2 1
A=
0 1
3 0
A=
1 1
Solucin:
1
cos 0 sin
0
1
0 A
R () = @
sin 0 cos
(app aqq )
2
2apq
(aqq app )
2
tan(2) =
(1 2)
=
1
arctan 2 = : 381 97
2
a21 = a32 = 0
= aqq
1. A =
arctan (2)
2
2 1
0 1
1
u2 = A kuu1 k =
30
2 1
0 1
3
2 p2
1
2 2
u =
2
A kuu2 k
2 1
0 1
7
10 p5p2
1
10 5 2
p !
3
p
2
2 5p
1
p
2
2 5
2 1
0 1
3
2 p2
1
10 2
7
10 p2
1
10 2
x =
2. A =
p
p p
27
2132
1066
p
p 26
p 2 ,
2
533 1066 26 2
3 0
1 1
: 997 79
6: 651 9 102
3 0
1 1
p
3
p
2 2
,
2
p1
2
p1
2
n
sign u4 ; u3
1. ku1 k = 1 ! u2 =
2 1
1 1
1
1
ku2 k = 1 ! u3 =
2 1
1 1
1
0
1
0
2
1
2 1 p
u =
26 = 2: 549 5
2
3 0
1 1
Solucin:
u2 = A kuu1 k =
u3 = A kuu2 k =
9
1066 p26 p2
2132 p
1
2132
1066 26 2
p p
3 0
1 1
= 3: 109 8;
p
p p !
p
21322782
1066 26 2
: 958 8
65
026
p
p
p
x =
=
;
282
p
: 284 09
1066 26 2
533 65 026
15
226 p113p2
1
226 113 2
4 1 p
u =
113 = 2: 126
5
p
3
u = 1 1066 = 2: 511 5
13
p
4
u = 1 65 026 = 3: 109 8
82
3 p
u = 5 = 2: 236 1
p p
,
3
A kuu3 k
p p
9
26 p2
26 p
1
26
26 2
u4 = A kuu3 k =
2 p
u = 5 = 2: 236 1
u =
p1
2
p1
2
p p
3
26
p 26p 2 =
1
13 26 2
31
u3
ku3 k
1
1=2
1
0 5 1
2 1 0
6
@ 0
1 1 A u3 = 65 @ 32 A
0
0 3
13
0 1 1
30
A ; u2 = 14
u3 = @ 14
15
15
2
2 1
A=
0 3
llegar hasta u3 partiendo de u = (1; 1):
15
El autovalor mximo
(A 2Id)1 es max =
- de
3 2
con signo positivo (sign u ; u
= 1)
Solucin:
Aun =
un1
kun1 k
2 1
0 3
u2 =
p1
2
p1
2
(A 2Id)1 x
= max x
p
1
61p 2
; u2 = = : 333 33
1
3
6 2
1p
2 1
2p 2
u3 =
1
0 3
2 2
u2 =
u3 =
1
3 p2
1
6 2
1
x
= (A 2Id) x
max
1
A 2Id
Id x
=0
max
1
Id x
= (A prox Id) x
=0
A 2+
max
1
1
43
prox = 2 +
= 2 + 14 =
max
14
15
1p
10 = : 527 05
; u3 =
6
3
u es el autovalor mximo de A1 , con lo que el
p
1
6
autovalor mnimo de A es min = ku
10 = 1:
3 k = 10
- 3 2
897 4; con signo negativo ya que sign u ; u
= 1.
prox = 3: 071 4
1
2 1 0
1 1 A
A0 = A 2Id = @ 0
0
0 3
Solucin:
01
02
03
04
05
06
07
08
09
10
11
12
n1
A0 un = kuun1 k
0
1
0
2 1 0
1
@ 0
1 1 A u2 = @ 1
0
0 3
1
0 5 1
6
u2 = @ 23 A ; u2 =
13
14
15
1
A
5
= : 833 33
6
32
SIGNO_PRODUCTO_ESCALAR(uf,vf,Nf)
DIMENSION uf(*),vf(*)
PE=0
DO 06 I=1,Nf
PE=PE+uf(I)*vf(I)
CONTINUE
IF (PE.GT.0) THEN
SIGNO_PRODUCTO_ESCALAR=1
ELSE
SIGNO_PRODUCTO_ESCALAR=-1
ENDIF
END
01
AUTOVALOR_MAXIMO(Af,uf,Nf,Nfmax,Nter,Tolf)
02
DIMENSION Af(Nfmax,*),uf(*),vf(Nfmax)
03
DO 26 I=1,Nter
04
NORMA=0
05
DO 11 J=1,Nf
06
vf(J)=0
07
DO 09 K=1,Nf
08
vf(J)=vf(J)+Af(J,K)*uf(K)
09
CONTINUE
10
NORMA=NORMA+ABS(vf(J))
11
CONTINUE
12
IF (NORMA.EQ.0) THEN
13
AUTOVALOR_MAXIMO=2.**120
14
RETURN
15
ENDIF
16
AUTOVALOR_MAXIMO=SIGNO_PRODUCTO_
ESCALAR(uf,vf,Nf)*NORMA
17
ERROR=0
18
DO 22 J=1,Nf
19
vf(J)=vf(J)/AUTOVALOR_MAXIMO
20
ERROR=ERROR+ABS(uf(J)vf(J))/(ABS(vf(J)+1.)
21
uf(J)=vf(J)
1.
22
CONTINUE
23
IF(ERROR<TOLf)
24
RETURN
25
ENDIF
2.
26
CONTINUE
27
AUTOVALOR_MAXIMO=2.**120
28
END
un = Mun1 + c =
1
0
1
0
1
0 1 0
= @ 12 0 0 A un1 + @ 23 A
1
0 13 0
3
Iteraciones:
1 0
1
0 1 0
1
1
0
u2 = M @ 0 A + @ 32 A = @ 32 A
1
1
0
3
3
0
u3 = M @
0
1
3
2
1
3
1
2
A+@
5
6
1
3
2
1
3
1
3
2
1
3
un = M un1 + c
A=@
1
2
5
6
0
7
4
2
3
1
A
80
19
< 1 =
@ 0 A
:
;
1
33
una base
1 ortogonal de autovec0 1
2 0 A,
0 1
80 1 0 19
0 =
< 1
0; @ 0 A ; @ 1 A $ 2
:
;
1
0
A=@ 1 A
1. Autovectores y autovalores:
Du = (L U)u + b
(L U )u + D
Solucin:
u=D
Problema 97 Calcular
0
1
tores de la matriz @ 0
1
partiendo de u1 = (0; 0; 0)
1
0 1 0
U =@ 0 0 0 A
0 0 0
3. u4 = M @ 1 A + @
del mtodo de
1
1
3 A
1
(L + D)u = U u + b
u = (L + D)1 (U )u + (L + D)1 b
de:
un = M un1 + c
Los autovalores de MJ :
(MJ )2 = 12
1. x = 1
y = 31
2 =1
2
z = 1+1
3 = 3
wopt =
2. x = 0
y = 32
z = 65
3. x = 1 + 32 =
3+ 1
y = 2 2 = 47
1+ 7
z = 3 4 = 11
12
2
q
1 + 1 (MJ )2
wopt =
(L + D + U )u = b
wopt =
p2
1+
1 12
4p
2+ 2
n
zn = w 1+y
+ (1 w) zn1
3
1 0
1
w
1: 171 6
A = @ 1: 071 1 A
u2 = @ w 3w
2
: 808 83
w 1+1:3071 1
0
w (1: 071 1 1) (1 w) 1: 171 6
35
+ (1 w) 1: 071 1
u3 = @ w 3+: 284
2
1+1: 740 2
w
+ (1 w) : 808 83
3
0
1
: 284 35
= @ 1: 740 2 A
: 931 34
0
w (1: 740 2 1) + (1 w) : 284 35
42
+ (1 w) 1: 740 2
u4 = @ w 3+: 818
2
1+1: 938 2
w
+ (1 w) : 931 34
3
0
1
: 818 42
= @ 1: 938 2 A
: 987 65
2p
1+ 12 2
wopt = 1: 171 6
1
2
Solucin:
2
1(MJ )2
1+
p
1p
0; 2 2; 12 2 , luego
A=
A=
x y = 1
x + 2y = 3
y + 3z = 1
34
que devuelve 0 si termina bien y 1 si termina mal. La funcin CONDICIONAMIENTO devuelve 2.*120 si termina
mal porque Jacobi da un error o se produce una divisin
por cero. Los parmetros son la matriz Af, Nf la dimensin real, Nfmax, la dimensin para coger memoria, Nter
nmero mximo de iteraciones, y Tolf la tolerancia (mximo .21 lneas de instrucciones)
Solucin:
01
CONDICIONAMIENTO(Af,Nf,Nfmax,Nter,Tolf)
02
DIMENSION Af(Nfmax,*)
03
CONDICIONAMIENTO=2.*120
04
IF(JACOBI(Af,Nf,Nfmax,TOLf,Nter).NE.0)
THEN
05
RETURN
06
END IF
07
AMAX=ABS(A(1,1))
08
AMIN=ABS(A(1,1))
09
DO I=2,Nf
10
IF(AMAX.LT.ABS(A(I,I))) THEN
11
AMAX=ABS(A(I,I))
12
END IF
13
IF(AMIN.GT.ABS(A(I,I))) THEN
14
AMIN=ABS(A(I,I))
15
ENDIF
16
END DO
17
IF(AMIN.EQ.0) THEN
18
RETURN
19
ENDIF
20
CONDICIONAMIENTO=AMAX/AMIN
21
END
u3 = Mu2 + c = M M u1 + c + c = M 2 u1 + M c + c
..
.
un = M n1 u1 + M n2 c + : : : Mc + c =
= M n1 u1 + M n2 + : : : M + 1 c
M
+ :::M + 1 c =
Pn
= M n2 + : : : M + 1
i=1 ci xi =
P
Pn
n
= M n2 i=1 ci xi + : : : M i=1 ci xi +
i=1
T
La matriz
T A posee un autovalor igual a cero ( = 0),
luego A = 0.
jAj = AT = 0
jAj =
i = 1 : : : 0 : : : n = 0
35
Pn
i=1 ci xi
Pn
Pn
n2
xi +
i=1 ci i
Problema 105 Plantear el algoritmo necesario para calcular, utilizando el mtodo de Newton-Raphson, las races
complejas o reales de un polinomio de grado 3:
Pn
+ : : : i=1 ci i xi + i=1 ci xi =
Pn
+ : : : + i + 1
= i=1 ci xi n2
i
|
{z
}
Solucin:
Pn
1
i=1 ci xi 1i ,
P (z) = az 3 + bz 2 + cz + d = 0
Solucin:
2
x + y2 1 = 0
2x 2y
rf(x; y) =
yx =0
1 1
un = (xn ; y n )
u0 = (1; 1)
rf (un )z = f (un )
un+1 = un + z
2x 2y
z1
x + y2 1
=
1 1
z2
yx
rf (un ) z = f (un )
un+1 = un + z
Iteraciones:
2 2
z1
1
1.
=
1 1
z2
0
z1
z2
14
14
u =u +z =
u1 =
2.
3
2
1
z1
z2
3
4
3
4
3
2
u =
17
24
17
24
1
1
z1
z2
3
4
3
4
1
24
1
24
u2 = u1 + z =
: 708 33
: 708 33
1
8
Funcion F (u)
f (1) = a u(1)3 3a u(1) u(2)2 +
+b u(1)2 b u(2)2 + c u(1) + d
f (2) = 3a u(1)2 u(2) a u(2)3 +
+2b u(1) u(2) + c u(2)
devolver f
Fin funcion
1
24
1
24
41
14
Algoritmo:
Este algoritmo utiliza una funcin, "Sistema(A; u)";
para resolver un sistema de ecuaciones.
Funcion rF (u)
2
rf (1; 1) = 3a u (1) 3a u(2)2 + 2b u (1) + c
rf (1; 2) = 6a u (1) u (2) 2b u (2)
rf (2; 1) = rf (1; 2)
rf (2; 2) = rf (1; 1)
devolver rf
Fin funcion
36
Solucin:
Algoritmo
un1 = (x0 ; y0 )
/* calculamos la primera
*/
aproximacin
yzexyz
@
0
rf (x; y; z) =
4 (z 1) x3
un+1 = un + z =
0 1 0 1
1
e (e 1)
11
=@ 1 A+@
2
1
3
0 15 1
1
2 e (e 1)
13
A
=@
2
4
Solucin:
y
x1
1. rf (x; y) =
! rf(1; 1) =
y2
x
1
1 0
1 0
0
! u2 =
+
1
1
1
1
1
1
1
=
1
2
2 0
rf (1; 2) =
0 1
1
1
=
2
2
! u3 =
2 0
0 1
0
0
10
1
z1
xyexyz
3z 2 A @ z2 A =
z3
x4
1
Iteracin:
0
10
1
0
1
e e e
z1
e1
@ 0 2 3 A @ z2 A = @ 2 A
0 0 1
3
z3
0
1 0 1
1
z1
e (e 1) 17
2
11
@ z2 A = @
A
2
z3
3
xzexyz
2y
0
exyz 1
2
@
y z3 2 A
=
(z 1)x4 3
(x 1)y = 0
(y 2)x = 0
rf (x; y; z) z = f (x; y; z)
un+1 = un + z
yzexyz
@
0
4 (z 1) x3
0
1
xyexyz
3z 2 A
x4
xzexyz
2y
0
17
2
A=
INTERPOLACION DE FUNCIONES II
Problema 108 Calcular los polinomios base de Hermite
que corresponden a tomar como puntos de interpolacin
x0 = 1; x1 = 1; y el orden de derivacin M = 1:
exyz 1 = 0
y2 z 3 2 = 0
(z 1)x4 3 = 0
partiendo de (x; y; z) = (1; 1; 1):
0
H1
(x) = (x 1) (a (x + 1) + b)
0.75
0.75
0.5
0.5
0.25
0.25
0
-1
-0.5
0
0
0.5
-1
-0.5
0.5
0
Figure 4: Polinomio de Hermite H1
-0.5
0.5
x
1
0
0.25
-0.05
0.2
-0.1
0.15
-0.15
0.1
-0.2
0.05
-0.25
0
-1
1
x
-0.5
y
0
0.5
1
x
1
Figure 5: Polinomio de Hermite H1
0
H1
(1) = 1
(1 1)2 (a (1 + 1) + b) = 4b = 1
b=
1
H1
(x) = (x 1)2 (a (x + 1) + b)
1
4
1
H1
(1) = (1 1)2 (a (1 + 1) + b) = 4b = 0
00
H1
(x) = 2 (x 1) (a (x + 1) + b) + (x 1) a = 0
b=0
00
H1
(x) = 2 (2) (a (0) + b) + (2) a = 0
4b + 4a = 0
10
H1
(x) = 2 (x 1) (a (x + 1) + b) + (x 1)2 a
a = b = 14 ;
10
H1
(1) = 2 (1 1) (a (1 + 1) + b) +
1
4
+ (1 1)2 a = 1
(x 1)2 (x + 2)
4a = 1
a = 14 ;
38
(x + 1)
di =
3. Para calcular los otros dos polinomios, basta considerar que son funciones simtricas a las dos anteriores. En la grca 6 se puede ver que esta funcin
0
es simtrica a H1
(x) (ver grca 4) con respecto al
eje de las y:
bi =
2
5
85
ci+1 ci
3hi
i = 0; : : : N 1
(ai+1 ai )
hi
2
5
3
8
2
5 5
8
5
0 2 1
C @ 152 A
3
A=
8
15
hi (2ci +ci+1 )
3
i = 0; : : : N 1
1 0
1 0
2
1 15
b0
@ b1 A = @ 1 45 85 A = @
3
b2
1 + 16
15
0
(x 1) (x + 2)
13
15
19
15
1
15
1
A
2
H10 (x) = 14 (x + 1) (x 2)
P1 (x) =
2
15
(x + 1)3 +
13
15
(x + 1) 1
x 2 [1; 0]
P2 (x) = 23 x3 + 52 x2 +
1
H11 (x) = H1
(x)
1 0
d0
@ d1 A = B
@
d2
0
H10 (x) = H1
(x)
1
4
H10 (x)
c1
c2
19
15 x
x 2 [0; 1]
1
4
H11 (x) =
1
4
(x + 1)
P3 (x) =
8
15
(x 1)3
8
5
(x 1)2 +
1
15
(x 1) + 1
x 2 [1; 2]
(x + 1)2 (x 1)
0.5
-1
-0.5
0.5
1.5
2
x
-0.5
-1
8 (xi xi1 )
hi = 1
ai = f (xi )
i = 0; : : : N
1 0
a0
f (x0 )
B a1 C B f (x1 )
B
C B
@ a2 A = @ f (x2 )
a3
f (x3 )
1
1
C B 0 C
C=B
C
A @ 1 A
0
Problema 110 Calcular la funcin que interpola, utilizando la funcin sinc(x) a la funcin f(x) = sin(x) en
los puntos x = ; 2 ; 0; 2 ; :
3(ai+1 ai )
hi
2 x y su
3(ai ai1 )
hi1
Solucin:
c0 = c3 = 0
4 1
c1
0
=
1 4
c2
6
sinc (x) =
sin(x)
x
P
sin(( a i))
f~(x) N
i=M f(xi ) ( x i)
a
x
xi = a i =
[2; 1; 0; 1; 2]
sin(( +2))
f~(x) f () 2x+2
+f
( )
2x
+f (0)
sin(( 2x
))
( 2x
)
+ sin
=
+f
sin(( 2x
2))
+f ()
sin(2x)
2
2x
sin 2x
2x
sin(( 2x
+1))
+
2
( 2x
+1)
sin(2x+)
2
sin(2x)
2x
2x+
sin(2x+)
2x+
Solucin:
x si x 0
jxj =
x si 0 x
sin(( 2x
1))
+
2
( 2x
1)
= sin
( 2x
2)
sin 2x
2x+
~
f(x)
ck =
R
f (x)eikx dx
jxjeikx dx
=
2
2
R0
R ikx
ikx
xe
dx
xe
dx
+ 0 2
2
c2 = c2 = 0
c1 = c1 = 2
c0 = 2
0
0
10
x
-0.5
f~(x)
-1
2 ix
e
= 12
2 eix =
cos x
0.5
-5
k=2
-10
ck eikx ;
2x
= 2 4xsin
2 2
2
X
1
4
f~(x) cos x
2
La siguiente grca compara f(x) = jxj con su aproximacin f~(x) para N = 2 en el intervalo [; ]:
jxj
0.5
3.75
0
-10
-5
10
x
2.5
-0.5
1.25
-1
0
-2.5
-1.25
1.25
2.5
x
3
terpolacin x=2; 3
2 ; ; 2 ; 0; 2 ; ; 2 ; 2
Polinomio trigonomtrico (N = 2; [; ])
En la siguiente grca se realiza la misma comparacin tomando 20 muestras en el intervalo [; ]:
40
jxj
y
3.75
2.5
1.25
0
-2.5
-1.25
1.25
2.5
x
aproximacin
mnimo
yi
0
1
0
2
Solucin: Aplicando las frmulas para calcular los coecientes de la recta que ms se aproxima a estos puntos,
obtenemos:
a=
PN
P
PN
xi yi N
i=1 xi
i=1 yi
PN
P
2
N i=1 x2i ( N
i=1 xi )
4(1+6)(1+2+3)(1+2)
4(1+22 +32 )(1+2+3)2
=
b=
i=1
PN
i=1
x2i
N
1
2
PN
P
yi N
i=1 xi
i=1 xi yi
P
2
N
2
x
x
(
)
i
i=1 i
i=1
PN
Pi=1
N
=
=0
P (x) = ax + b = 21 x
y
0
0
4
x
41