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