.


           


{ }

Procedure chord(a, b : real; var

x : real);

begin

x := a - ((b - a)*fx(a))/(fx(b) - fx(a))

end;

{----------------------------------------------------------------------------------------}

{ }

Procedure tangent(a, b, eps : real; var

z : real);

begin

z := a - fx(a)/derivat1(a, eps)

end;

{----------------------------------------------------------------------------------------}

{ }

Procedure Combination(a, b, eps : real; var x : real);

var

z : real;

begin

repeat

if fx(a)*derivat2(a, eps) > 0

then

begin

tangent(a, b, eps, z);

chord(b, a, x);

b := z; a := x

end

else

begin

tangent(b, a, eps, z);

chord(a, b, x);

b := x; a := z

end

until abs(z - x) < eps

end;

{----------------------------------------------------------------------------------------}

{ }

begin

write(' a = '); readln(a);

write(' b = '); readln(b);

write(' eps = ');

readln(eps);

writeln(' , ');

writeln('1 - , 2 - ');

writeln(' 3 - '); readln(k);

Case k of

1 : chord1(a, b, eps, x);

2 : Tangent2(a, b, eps, x);

3 : Combination(a, b, eps, x)

end;

writeln(' x = ', x:6:t(eps));

writeln(' eps = ', eps:1:t(eps))

end.

4

{ }

Program integral_trapezoid;

uses WinCrt;

var

a, b, eps, j : real;

n : integer;