Sunteți pe pagina 1din 4

Lucrare de laborator Nr.

1
Tema: Localizarea rdcinilor i metoda njumtirii.
Subiectul 1. S se localizeze, aplicnd metoda grafic, rdcinile
ecuaiilor:
1) x*x-5*x-ln(x)=0
Rezolvare:
1) x*x-5*x-ln(x)
x

y1

16

25

y2

10,69315

16,09861

21,38629

26,60944

40
35
30
25
y1

20

y2

15
10
5
0
1

x [2;3]

x*x-5*x-ln(x)

2,5

2,5

2,25

2,25
2,25

2,5
2,375

2,375
2,3125

2,3125

2,375

2,34375

e=0,01
f(a)

2,69315
2,69315
0,67031
0,67031
0,03437

f(b)

f(c)

|b-a|

10,90139

2,208709

2,208709

-0,67031

0,5

2,208709
0,656487

0,656487
-0,03437

0,25
0,125

0,656487

0,304101

0,0625

2,3125

2,34375

2,328125

2,3125

2,328125

2,320313

2,3125

2,320313

2,316407

0,03437
0,03437
0,03437

0,304101

0,133136

0,03125

0,133136

0,04895

0,015625

0,048956

0,007183

0,007813

Rspuns: Una din rdcinile ecuaiei este x= 2,316407


2) sin(2*x)-x+3=0

-2

-1

y1

0,756802

0,9093

0,909297

0,7568

0,27942

0,989358

0,54402

0,53657

0,990607

y2

-5

-4

-3

-2

-1

-4

5
4
3
2
1
0
-1 0
-2
-3
-4
-5
-6

-2

x [2;4]
a

y1
2

sin(2*x)-x+3=0

2
3

b
4
4

c
3
3,5

f(a)
1,909297
0,14112

3
3

3,5
3,25

3,25
3,125

0,14112
0,14112

3,125

3,0625

0,14112

e=0,01
f(b)
-1,7568
-1,7568
0,85078
-0,3582
0,10841

f
0,14112
-0,85078

|b-a|
2
1

-0,3582
-0,10841

0,5
0,25

0,01651

0,125

y2

3,0625

3,125

3,09375

0,01651

3,0625
3,0625
3,070313

3,09375
3,078125
3,078125

3,078125
3,070313
3,074219

0,01651
0,01651
0,000906

0,10841
0,04593
-0,0147
-0,0147

-0,04593

0,0625

-0,0147
0,000907
-0,0069

0,03125
0,015625
0,007812

Rspuns: Una din rdcinile ecuaiei este x=3,074219

Subiectul 2. Utiliznd metoda analitic de localizare ardcinilor, s se


verifice i s se concretizeze segmentele care conin rdcinile ecuaiilor din
Subiectul 1, folosind programele Pascal.
1) x*x*x-5*x-ln(x)=0
Program local;
uses crt;
var a,c,b,h,x1,x2:real;
function fnl(x:real):real;
begin
fnl:= x*x-5*x-ln(x);
end;
begin
clrscr;
writeln('introdu extremit segm a si b, pasul h');
readln(a,b,h);
x1:=a;x2:=x1+h;
while x2<=b do begin
if fnl(x1)*fnl(x2)<0 then writeln('[',x1:12:4,';',x2:12:4,']');
x1:=x2;
x2:=x1+h;
end;
readkey;
end.

2) sin(2*x)-x+3=0
Program local;
uses crt;
var a,c,b,h,x1,x2:real;
function fnl(x:real):real;
begin
fnl:= sin(2*x)-x+3=0;
end;
begin
clrscr;
writeln('introdu extremit segm a si b, pasul h');
readln(a,b,h);
x1:=a;x2:=x1+h;

while x2<=b do begin


if fnl(x1)*fnl(x2)<0 then writeln('[',x1:12:4,';',x2:12:4,']');
x1:=x2;
x2:=x1+h;
end;
readkey;
end.

S-ar putea să vă placă și