In the 18th century Leonhard Euler invented a simple scheme for
numerically approximating the solution to an ODE. Given a first order ODE of the form dy/dx = f(x, y) subject to the initial boundary condition y(x 0) = y0, we estimate the function y(x) over a regular sample of values x n = x0 + hn. The parameter h is referred to as the step length. If yn is the approximation to y(x) at xn, then we can approximate the gradient at xn by f(xn, yn). We estimate yn+1 by assuming the gradient remains constant in the interval between xn and xn+1. This leads to the following method: