A worksheet illustrating the use of the Improved Euler's method.

Clear[f, y, L, M, Δ]

Enter the RHS of the differential equation.

f[y_] := Sqrt[y]

Enter the initial value of y.

y[0] = N[1]

Enter the total length of the time interval.

L = 4

Set the number of iterations to be used.

M = 32

Compute Δ.

Δ = N[L/M]

Perform the itermative step.

Do[y[i + 1] = 
        y[i] + (1/2)*Δ*(f[y[i]] + 
                f[y[i] + Δ*f[y[i]]]), {i, 0, M - 1, 
        1}]

Display the difference between the exact answer and the computed answer.

N[9 - y[M]]