2.4. 0,01 (x 1)3 = 0, [0,95; 1,1].
Excel:
1) A 1: F 4 , , 2.3.
2) , .. B 4 B 10, C 4 C 10, D 3 D 10, E 4 E 10, F 3 F 10.
2.3
A | B | C | D | E | F | |
1 |
| f(a)= | =(1-B3)^3 |
|
|
|
2 | k | a | x | f(x) | b | b-a |
3 | 1 | 0,95 | =(B3+E3)/2 | =(1-C3)^3 | 1,1 | =E3-B3 |
4 | 2 | =(D3=0;C3; (C$1*D3<0;B3;C3)) |
|
| =(C$1*D3>0; E3;C3) |
|
. 2.4. F b a. 0,01, . 5 . 0,01 1,0015625 ≈ 1,00.
2.4
A | B | C | D | E | F | |
1 |
| f(a)= | 0,000125 |
|
|
|
2 | k | a | x | f(x) | b | b-a |
3 | 1 | 0,95 | 1,025 | -2E-05 | 1,1 | 0,15 |
4 | 2 | 0,95 | 0,9875 | 2E-06 | 1,025 | 0,075 |
5 | 3 | 0,9875 | 1,00625 | -2E-07 | 1,025 | 0,0375 |
6 | 4 | 0,9875 | 0,996875 | 3,1E-08 | 1,00625 | 0,0187 |
7 | 5 | 0,996875 | 1,0015625 | -4E-09 | 1,00625 | 0,0094 |
8 | 6 | 0,996875 | 0,9992188 | 4,8E-10 | 1,0015625 | 0,0047 |
9 | 7 | 0,99921875 | 1,0003906 | -6E-11 | 1,0015625 | 0,0023 |
10 | 8 | 0,99921875 | 0,9998047 | 7,5E-12 | 1,000390625 | 0,0012 |
, .. f (x) . 2.3 [0,9; 1,1], x = 1. , B 3 0,9. 2.5 ( 2 ).
2.5
A | B | C | D | E | F | |
1 |
| f(a)= | 0,001 |
|
|
|
2 | k | a | x | f(x) | b | b-a |
3 | 1 | 0,9 | 1 | 0 | 1,1 | 0,2 |
4 | 2 | 1 | 1 | 0 | 1 | 0 |
Excel f(x) bisect(a, b, eps) , Visual Basic. :
Function f(Byval x): f = (x - 1) ^ 3: End Function
Function bisect(a, b, eps)
1 x = (a + b) / 2
If f(x) = 0 Then GoTo 5
If f(x) * f(a) < 0 Then
b = x
Else
a = x
End If
If Abs(a - b) > eps Then GoTo 1
5 bisect = x
End Function
f(x) ,
bisect(a, b, eps) f (x) = 0. , bisect(a, b, eps) f(x). c -:
|
|
1) Visual Basic. Microsoft Visual Basic. Excel , , .2.5.
. 2.5.
2) Insert Module -, 2.6.
.2.6.
Excel . , D 18
=bisect(0,95;1;0,00001),
0,999993896.
( ) Visual Basic f(x). , 0,001 sin5 x + x 2 1 = 0, (0,4; 0,5).
Function f(x)
f = (x - 1) ^ 3
End Function
Function f(x)
f = Sin(5 * x) + x ^ 2 - 1
End Function
D 18 0,441009521 ( (0,4; 0,5), 2.3!).
Mathcad - bisec (f, a, b, ε), :
f , f (x) = 0;
a, b [ a, b ];
ε .
Mathcad:
1) Mathcad. bisec (f, a, b, ε). bisec (f, a, b, ε):=. := Add line. . , , ←, while, break if otherwise.
2) f (x):=sin(5*x)+x^21, bisec :
bisec (f, 0.8,0.7,0.0001)=. = 0,7266601563. .
Mathcad bisec (f, a, b, ε) :
- : |
f(x)=sin5x+x2-1 0,0001: |
. y (x) = (x 1)3 (0,9; 1,1), x = 1, :
|
C ++ f (x) = 0 :
#include <iostream.h>
#include <math.h>
#include <conio.h>
double f(double x);
typedef double (*PF)(double);
double bisec(PF f,double a, double b,double eps);
int main(){
double a, b, x, eps;PF pf;
cout << "\n a = "; cin >> a;
cout << "\n b = "; cin >> b;
cout << "\n eps = "; cin >> eps;
pf = f;
x = bisec(pf,a,b,eps); cout << "\n x = " << x;
cout << "\n Press any key "; getch();
return 0;
}
double f(double x){
double r;
r = sin(5*x)+x*x-1;
return r;
}
double bisec(PF f, double a, double b,double eps){
double x;
do{ x = (a + b)/2;
if (f(x) == 0) break;
if (f(x)*f(a)<0) b = x;
else a = x;
}while (fabs(b-a) > eps);
return x;
}
f (x)
sin5 x + x 2 1 = 0
2.3. (0,4; 0,5) 0,00001 ( ):
a = 0.4
b = 0.5
eps = 0.00001
x = 0.44101
Press any key
.
.
) 0,1 , ;
) ;
) , , 0,0001.
1. | cos 3 x x 3 = 0. | 11. | x e x + 3 x 5 = 0. | 21. | e x (x 5) + 3 = 0. |
2. | cos2 x x 4 = 0. | 12. | esin x + 3 x = 0. | 22. | e x 3 x 5 = 0. |
3. | tg x + x = 1, [0; 1]. | 13. | 33 x cos x = 0. | 23. | e2 x ∙ln x x = 0. |
4. | ln(1 + x 2) x 3 = 1. | 14. | sin(1 + x 2) = x. | 24. | tg x ln( x) = 0. |
5. | sin(e x) + 3 x = 0. | 15. | x 2 + sin2 x = 2. | 25. | x 1/3 + 2tg x = 1. (0; 3) |
6. | sin x /e x + x 2 1 = 0. | 16. | e2 x 3 x 3 = 0. | 26. | e2 x 3 x 3 = 0. |
7. | tg2 x + x = 1. [0; 1]. | 17. | e cos x x 3 = 0. | 27. | e2 x ∙tg x x = 1. (0; 4) |
8. | x /(1 + x 4) = ln x. | 18. | x 2 + ln x + 2 = 0. | 28. | 1/ln x x = 0. |
9. | x 3 2ctg x = 0. [1; 2]. | 19. | x 4 sin2 x + x 1 = 0. | 29. | x 5 2cos x = 0. |
10. | x 5 2cos x + 1 = 0. | 20. | (7 x 2)ln x = 2 x. | 30. | sin x x 2 + 1 = 0. |