unit UnitL3v9;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Memo1: TMemo;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    BitBtn1: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
Var
  Xn,Xk,s,y,h,X:extended;
  n,fact,i:integer;
implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text:='0,1';
Edit2.Text:='1';
Memo1.Clear;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Xn:=StrToFloat(Edit1.Text);
Xk:=StrToFloat(Edit2.Text);
n:=14;
h:=(Xk-Xn)/10;
 X:=Xn;
 fact:=1;


 While X<=Xk do begin
                 S:=0;
                for n:=0 to 14 do begin
                    if n=0 then fact:=1 else fact:=fact*n;
                    s:=s+(n*n+1)*exp(n*ln(x/2))/fact;
                                 end;
                    y:=((X*X/4+X/2+1)*Exp(X/2));
Memo1.Lines.Add('X='+FloatToStr(X)+'   '+'S='+FloatToStr(s)+'      '+'Y='+FloatToStr(y));

  X:=X+h;
                 end;
end;

end.
