Purpose and why it works Consider the problem of calculating the shape of an unknown curve which starts at a given point and satisfies a given differential equation. Here, a differential equation can be thought of as a formula by which the
slope of the
tangent line to the curve can be computed at any point on the curve, once the position of that point has been calculated. The idea is that while the curve is initially unknown, its starting point, which we denote by A_0, is known (see Figure 1). Then, from the differential equation, the slope to the curve at A_0 can be computed, and so, the tangent line. Take a small step along that tangent line up to a point A_1. Along this small step, the slope does not change too much, so A_1 will be close to the curve. If we pretend that A_1 is still on the curve, the same reasoning as for the point A_0 above can be used. After several steps, a
polygonal curve (A_0,A_1,A_2,A_3,\dots) is computed. In general, this curve does not diverge too far from the original unknown curve, and the error between the two curves can be made small if the step size is small enough and the interval of computation is finite.
First-order process When given the values for t_0 and y(t_0) , and the derivative of y is a given function of t and y denoted as y'(t) = f\left(t,y(t)\right) . Begin the process by setting y_0=y(t_0) . Next, choose a value h for the size of every step along t-axis, and set t_n = t_0 + nh (or equivalently t_{n+1} = t_n + h). Now, the Euler method is used to find y_{n+1} from y_n and t_n: y_{n+1} = y_n + hf(t_n,y_n). The value of y_n is an approximation of the solution at time t_n, i.e., y_n \approx y(t_n). The Euler method is
explicit, i.e. the solution y_{n+1} is an explicit function of y_i for i \leq n.
Higher-order process While the Euler method integrates a first-order ODE, any ODE of order N can be represented as a system of first-order ODEs. When given the ODE of order N defined as y^{(N+1)}(t) = f\left(t, y(t), y'(t), \ldots, y^{(N)}(t)\right) , as well as h, t_0, and y_0,y'_0,\dots, y^{(N)}_0, we implement the following formula until we reach the approximation of the solution to the ODE at the desired time: \vec{y}_{i+1} = \begin{pmatrix} y_{i+1}\\ y'_{ i+1 } \\ \vdots\\ y_{i+1}^{(N-1)}\\ y_{i+1}^{(N)} \end{pmatrix} = \begin{pmatrix} y_{i}+h\cdot y'_i\\ y'_i +h\cdot y''_i\\ \vdots\\ y^{(N-1)}_{i}+ h\cdot y^{(N)}_{i}\\ y^{(N)}_i + h\cdot f\left(t_i, y_i, y'_i, \ldots, y^{(N)}_i\right) \end{pmatrix} These first-order systems can be handled by Euler's method or, in fact, by any other scheme for first-order systems. ==First-order example==