The Error in Euler's Method

Initialization

EulerStep[{t_, y_}, dt_] := {t + dt, y + f[t, y] dt}

ResultEuler[ic_, tend_, 
        numsteps_] := Nest[
          EulerStep[#1, ((tend - ic[[1]])/numsteps)] &, ic, 
          numsteps][[2]]

DumpEPS[graphic_,  filename_] := 
Display[
        filename  <>  ".eps",  graphic,  "EPS"]

Off[General::spell1]

$TextStyle = {FontFamily -> "Courier-Bold",  
          FontSize  ->  18};

f(t,y)=y+1,  y(0)=0,  0 ≤ t ≤ 3

\(Clear[f]; \ f[t_, y_] := y + 1
\)
t0 = 0;
tend = 3;

y0 = 0;

Part (a)

yrule=DSolve[{y'[t]==f[t, y[t]],y[t0] == y0},y[t],t][[1, 
        1]]

yend = y[t] /. yrule /. t -> tend

N[yend]

Part (b)

EulerApprox = 
        NestList[EulerStep[#1, ((tend - t0)/20.0)] &, {t0, y0}, 
          20];
TableForm[EulerApprox]

Part (c)

Abs[
      N[yend - EulerApprox[[21, 
            2]]]]

Part (d)

y0 = 0.0;  t0 = 0.0;  tend = 3.0;

\(\(ResultsList1 = 
        Map[{#1, ResultEuler[{t0, y0}, tend, #1], 
              Abs[N[yend] - ResultEuler[{t0, y0}, tend, #1]]} &, 
          Range[1000, 6000, 1000]];\)
\)
TableForm[ResultsList1]

Part (e)

y0 = 0.0;  t0 = 0.0;  tend = 3.0;

Timing[ResultsList2 = 
            Map[{#1, 
Abs[
                    N[yend] - ResultEuler[{t0, y0}, tend, #1]]} &, 
              Range[100, 6000, 100]];][[1]]

TableForm[ResultsList2]

figure1 = 
        ListPlot[
          ResultsList2, 
AxesOrigin -> {0, 
              0}, 
Ticks -> 
{Range[
                2000, 6000, 2000],  Range[0, 0.5, 0.2]}, 
          PlotRange -> {{0, 6000}, {0, 
                0.5}}, 
PlotStyle ->  
            PointSize[0.01],  
          AspectRatio -> (1/GoldenRatio)];

Part (f)

Fit[ResultsList2, {(1/n)}, n]

figure2 = Plot[(87.6474/n), {n, 100, 6000}];

figure3  =  Show[figure1, figure2];