unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, math, vibor, ExtCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Button1: TButton;
    Memo1: TMemo;
    RadioGroup1: TRadioGroup;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.Text:='0,2';
edit2.Text:='0,8';
edit3.Text:='0,0001';
edit4.clear;
memo1.Clear;

end;

procedure TForm1.Button1Click(Sender: TObject);


var xn,xk,x,h,e,a,s,y,u:extended;
n,k:integer;
begin
memo1.clear;
memo1.lines.add('Результаты ст. гр. 020601 Якубовича М.С.');
xn:=strtofloat(edit1.text);
memo1.lines.add('xn:='+floattostrf(xn,ffFixed,6,2));
xk:=strtofloat(edit2.text);
memo1.lines.add('xk:='+floattostrf(xk,ffFixed,6,2));
h:=strtofloat(edit4.text);
memo1.lines.add('h:='+floattostrf(h,ffFixed,8,3));
e:=strtofloat(edit3.text);
memo1.lines.add('e:='+floattostrf(e,ffFixed,8,5));
x:=xn;

Case Radiogroup1.itemindex of
0: u:= S(x);
1: u:=Y(x);
repeat
a:=x/6; s:=x/6; n:=1;
while(abs(a)>e) do begin
n:=n+1;
a:=a*(sqr(n)*x)/((sqr(n-1))*(2*n+1)*2*n);
s:=s+a;
end;
y:=(1/4)*((x+1)/sqrt(x)*sinh(sqrt(x))-cosh(sqrt(x)));
memo1.lines.add('При x='+floattostrf(x,fffixed,6,2)+' сумма='
+floattostrf(s,ffFixed,8,4)+'y='
+ floattostrf(y,fffixed,8,4)+' N='+inttostr(n));
x:=x+h;
until
x>(xk+h/2);
end;



end.
