3.1: The Euler Method
Although it is not always possible to find an analytical solution of (3.1) for \(y = y(x)\), it is always possible to determine a unique numerical solution given an initial value \(y(x_0) = y_0\), and provided \(f(x, y)\) is a well-behaved function. The differential equation (3.1) gives us the slope \(f(x_0, y_0)\) of the tangent line to the solution curve \(y = y(x)\) at the point \((x_0, y_0)\). With a small step size \(∆x = x_1 − x_0\), the initial condition \((x_0, y_0)\) can be marched forward to \((x_1, y_1)\) along the tangent line using Euler’s method (see Fig. \(\PageIndex{1}\)) \[y_1=y_0+\Delta xf(x_0, y_0).\nonumber\]
This solution \((x_1, y_1)\) then becomes the new initial condition and is marched forward to \((x_2, y_2)\) along a newly determined tangent line with slope given by \(f(x_1, y_1)\). For small enough \(∆x\), the numerical solution converges to the exact solution.