Const x0=0; xk=0.8; h=0.1; e=0.0001; var x,xn,x4,a,s:real; n,i,k:integer; begin x:=x0-h; n:=round((xk-x0)/h)+1; writeln('№ x S(x) y(x)'); for i:=1 to n do begin x:=x+h; xn:=x; x4:=x*x*x*x; a:=x; s:=x; k:=0; while abs(a)>e do begin k:=k+1; xn:=xn*x4; a:=xn/(4*k+1); s:=s+a; end; writeln(i,' ',x:4:1,' ',s:8:5,' ',1/4*ln((1+x)/(1-x))+1/2*arctan(x):8:5); end; end.
Answers & Comments
Verified answer
Const x0=0; xk=0.8; h=0.1; e=0.0001;var x,xn,x4,a,s:real; n,i,k:integer;
begin
x:=x0-h;
n:=round((xk-x0)/h)+1;
writeln('№ x S(x) y(x)');
for i:=1 to n do
begin
x:=x+h;
xn:=x;
x4:=x*x*x*x;
a:=x;
s:=x;
k:=0;
while abs(a)>e do begin
k:=k+1;
xn:=xn*x4;
a:=xn/(4*k+1);
s:=s+a;
end;
writeln(i,' ',x:4:1,' ',s:8:5,' ',1/4*ln((1+x)/(1-x))+1/2*arctan(x):8:5);
end;
end.
Результат:
№ x S(x) y(x)
1 -0.0 -0.00000 -0.00000
2 0.1 0.10000 0.10000
3 0.2 0.20006 0.20006
4 0.3 0.30049 0.30049
5 0.4 0.40208 0.40208
6 0.5 0.50648 0.50648
7 0.6 0.61678 0.61678
8 0.7 0.73901 0.73901
9 0.8 0.88665 0.88668