A worksheet illustrating the use of Euler's method.

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

Enter the RHS of the differential equation.

f[y_] := 1/y

Enter the initial value of y.

y[0] = 1.0

Enter the total length of the time interval.

L = 4

Set the number of iterations to be used.

M = 80

Compute Δ.

Δ = (L/M)

Perform the itermative step.

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

Display the final answer.

y[M]