Given the IVP y(1)(t = t y(t) - t2 + 1 with y(0) = 3, to approximate y(1), we can do:
t[0] := 0; t[1] := 1; y[0] := 3; f := (t, y) -> t*y - t^2 + 1; h := t[1] - t[0]; y[1] := y[0] + h*f(t[0], y[0]);Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.