clear all, close all, clc;
f1=@fEXS62a;
f2=@fEXS62b;

x0=[0 0];
xend=[3 pi];
funk={f1 f2};
for i =1:2
    fel=inf;
    n=1;
    funkhandle=funk{i};
    T=litenTrapets(funkhandle, x0(i),xend(i),n);
    n=n*2;
    Tny=litenTrapets(funkhandle, x0(i),xend(i),n);
    Ttak=Tny+(Tny-T)/3;
    iter=1;
    while abs(fel)>T*1e-4
        n=n*2;
        T=Tny;
        Tny=litenTrapets(funkhandle, x0(i),xend(i),n);
        Ttakny=Tny+(Tny-T)/3
        fel=Ttak-Ttakny
        Ttak=Ttakny;
        iter=iter+1;
    end
    disp([Tny fel iter])
    pause
end    