function [xRK, t, dt]=RK_1ODE(t_in, t_fin, N, x0, f)

t=linspace(t_in, t_fin, N); dt=t(2)-t(1);
xRK(1)=x0;
for i=1:N-1
    xc=xRK(i)+f(xRK(i),t(i))*dt/2;
    xRK(i+1)=xRK(i)+f(xc,t(i)+dt/2)*dt;
end

end