%%a
clear all, clc;
a=0;
b=1;
I=@(x) 30./(1+x.^4+sqrt(1+x.^3));

N=1;
L=b-a;
h=L/N;
x=a:h:b;
f=I(x);
trapets=h*(sum(f)-(f(1)+f(end))/2);
di=inf;
richardson=1;
while di>1e-6*richardson
    richardsonGammal=richardson;
    N=N*2;
    h=L/N;
    trapetsGammal=trapets;
    x=a:h:b;
    f=I(x);
    trapets=h*(sum(f)-(f(1)+f(end))/2);
    richardson=trapets+(trapets-trapetsGammal)/3
    di=abs(richardsonGammal-richardson);
end
