You are on page 1of 10

TAREA 2

Resolver:
x

1
e 3 sin x=0
2
Usando la regla falsa en el intervalo
1.
2.
3.
4.

[ 0.5 ; 1 ] con tolerancia de 1%

Grficamente
Analticamente(calculo simblico)
Usando el programa Matlab dado en clase
Mtodo de biseccin

Solucin
1. Usando geogebra

La solucin dado el intervalo es:


El punto A como se muestra la grafica

(0.39; 0)

2. Utilizando el mtodo de la regla falsa


x

1
e 3 sin x=0
2
Usando la regla falsa en el intervalo
a=-0.5

[ 0.5 ; 1 ] con tolerancia de 1%

f(a)= 0.13294

b=1

f(b)= -1.73708

f(a)* f(b-) < 0

Existe raz en este intervalo

c=

Primera iteracin:

af ( b ) bf (a)
f ( b )f (a)

c=0.39336

f ( c )=0.00618

[ 0.5,0.39336 ] ..no contiene laraiz , se descarta

[ 0.39336,1 ] .. contiene la raiz , a c


-

Segunda iteracin:

El nuevo intervalo quedara

[ 0.39336,1 ]

a= 0.39336

f(a)= 0.00618

b= 1

f(b)= -1.73708

c=

af ( b ) bf (a)
f ( b )f (a)

c=-0.38841

Error =

|crc |

Error =

|0.388410.39336
|
0.38841

*100

*100

Error=1.27442% > tol.


r=c

[ 0.39336,0.38841 ] no contiene laraiz , se descarta

[ 0.38841,1 ] contiene laraiz , a c


-

Tercera iteracin:

El nuevo intervalo quedara


a=-0.38841

[ 0.38841,1 ]

f(a)=0.00016

b= 1
c=

f(b)= -1.73708

af ( b ) bf (a)
f ( b )f (a)

c=-0.38827

Error =

|crc |

Error =

|0.388270.38841
|
0.38827

*100

*100

Error=0.03605% < tol.

Raz = -0.38827
Error = 0.03605738%
3. f=input('Ingrese la funcin :' , 's');
f=inline(f);
a=input('Ingrese el extremo inferior del intervalo:');
b=input('Ingrese el extremo superior del intervalo: ');
tol=input('Ingrese la tolerancia: ');
n=input('Ingrese el numero mximo de iteraciones:');
if (f(a)*f(b)<0)
i=1 ;
e=1000;
fprintf('Iter.\t\t inf.\t\t\t\t Sup.\t\t\t\t Raiz\t\t\t\t
Error\n');
while (e>=tol && i<=n)
c=(a*f(b)-b*f(a))/(f(b)-f(a));
if (i==1)
fprintf('%2d\t\t%12.10f\t\t\t%12.10f\t\t\t
%12.10f\t\t\t"------"\n',i,a,b,c);
end
if (f(a)*f(c)<0)
b=c;
end
if (f(b)*f(c)<0)
a=c;

end
r=c;
c=(a*f(b)-b*f(a))/(f(b)-f(a));
e=abs(((c-r)/c)*100);
i=i+1;
fprintf('%2d\t\t%12.10f\t\t\t%12.10f\t\t\t%12.10f\t\t\t
%12.10f\n',i,a,b,c,e );
end
fprintf('Raiz=%12.10f\n' , c );
fprintf('ERROR=%12.10f\n',e );
else
fprintf('No existe raiz en este intervalo o debe elegir otro
metodo' );
end

4. Utilizando el mtodo de la biseccin


x

1
e 3 sin x=0
2
Usando la biseccin en el intervalo
a=-0.5

[ 0.5 ; 1 ] con tolerancia de 1%

f(a)= 0.13294

b=1

f(b)= -1.73708

f(a)* f(b-) < 0

Existe raz en este intervalo

Primera iteracin:

c=

a+b
2

c=

(0.5+1)
2

c=0.25

f ( c )=f ( 0.25 )=0.83431

f(x)

a=-0.5

b=0.25

r=c
-

Segunda iteracin:

c=

a+b
2

c=

(0.5+0.25)
2

c=0.125

f ( c )=f (0.125 )=0.33451


X

f(x)

a=-0.5
Error =
Error =

|crc |
|0.1250.25
0.125 |

b=-0.125

*100

*100

Error =300%>tol
r=c

Tercera iteracin:

c=

a+b
2

c=

(0.50.125)
2

c=0.3125

f ( c )=f (0.3125 )=0.09364


X

f(x)

a=-0.5
Error =

|crc |

Error =

|0.31250.125
|
0.3125

b=-0.3125

*100

*100

Error = 60%>tol.
r=c
-

Cuarta iteracin:

c=

a+b
2

c=

(0.50.3125)
2

c=0.40625

f ( c )=f (0.40625 )=0.02182


X

f(x)

a=-0.40625

b=-0.3125

Error =

|crc |

Error =

|0.406250.3125
|
0.40625

*100

*100

Error=23,076923%>tol.
r=c
-

Quinta iteracin:

c=

a+b
2

c=

(0.406250.3125)
2

c=0.359375

f ( c )=f (0.359375 )=0.03542


X

f(x)

a=-0.40625
Error =

|crc |

Error =

|0.3593750.40625
|
0.359375

b=-0.359375

*100

*100

Error=13.0434%>tol.
r=c
-

Sexta iteracin:

c=

a+b
2

c=

(0.406250.359375)
2

c=0.3828125

f ( c )=f (0.3828125 )=0.00667


X

f(x)

a=-0.40625
Error =

|crc |

Error =

|0.38281250.359375
|
0.3828125

b=-0.3828125

*100

*100

Error=6.12244%>tol.
r=c
-

Sptima iteracin:

c=

a+b
2

c=

(0.406250.3828125)
2

c=0.394531
f ( c )=f (0.394531 )=0.00761

f(x)

a=-0.394531
Error =

|crc |

Error =

|0.3945310.3828125
|
0.394531

*100

Error=2.97023%>tol

*100

b=-0.3828125

r=c
-

Octava iteracin:

c=

a+b
2

c=

(0.3945310.3828125)
2

c=0.388671

f ( c )=f (0.388671 )=0.00047


X

f(x)

a=-0.388671

Error =

|crc |

Error =

|0.3886710.394531
|
0.388671

b=-0.3828125

*100

*100

Error=1.5077%>tol
r=c
-

Novena iteracin:

c=

a+b
2

c=

(0.3886710.3828125)
2

c=0.385741

f ( c )=f (0.385741 )=0.0031


X

f(x)

a=-0.388671

Error =

|crc |

Error =

|0.3857410.388671
|
0.385741

b=-0.385741

*100

*100

Error=0.7595%<tol
r=c

Raz = -0.385741
Error = 0.7595%