%Metodo de Euler com extrapolacao de Richardson

function x = Euler_Richardson(t0,tf,h,x0,F)

    x1 = Euler(t0,tf,h,x0,F);
    x2 = Euler(t0,tf,h/2,x0,F);
    for i=1:length(x1)
% Richardson: x(t_n)=(2^p x_{2n}(h/2)- x_n(h))/(2^p-1) + O(h^{p+1})
      x(i) = 2*x2(2*i-1)-x1(i);
    end
end