The simplest method for the numerical integration of a first-order ordinary differential equation
is Euler's method. Consider the problem:
This method assume that for a small distance ∆x along the x-axis from some initial point x0,
the function g(x) is a constant equal to g(x0).
dx/dy |x=x0 =
f (x0, y0) = g(x0)
Assuming that g(x) = g(x0) for all values of x between x0 and x1 = x + ∆x,
then the change in y corresponding to the small change ∆x in x is given approximately by:
If y1 is used to denote y0 + ∆y, then the above equation becomes:
y1 = y0 + ∆x f (x0, y0) = y0 + h f (x0, y0)
where h = ∆x; y1 can then be calculated from the above equation. This completes the solution process for
one step along the x-axis. The process can be repeated by using the previous solution as the starting values for the current
step, yielding a general solution:
y2 = y1 + h f (x1, y1)
y2 = y2 + h f (x2, y2)
yn + 1 = yn + h f (xn, yn)
This is known as Euler's method. The calculation process, step by step, along the x-axis from the initial point x0 to
the required finishing point.
One of our main algorithm implementation mechanisms include writing algorithms using differential equations. The next tab shows the solution and numerical implementation of a first-order differential equation.