A differential equation gives a slope, and Euler’s method uses that slope to move a short distance, then recomputes the slope and moves again. If \(\tfrac{dy}{dx}=F(x,y)\), then one Euler step is

\[y_{\text{new}} = y+F(x,y)\Delta x\]

The method replaces a curve with a sequence of short tangent-line approximations.

A first example

Consider \(\tfrac{dy}{dx}=y\) with \(y(0)=1\), whose exact solution is \(y=e^x\), and suppose the step size is \(\Delta x=0.5\). At the starting point \((0,1)\), the slope is \(y=1\), so \(y(0.5) \approx 1+1(0.5) = 1.5\). Now recompute the slope at the new approximate point, where the slope is approximately \(1.5\), so \(y(1) \approx 1.5+1.5(0.5) = 2.25\). The exact value is \(e\approx2.718\), and the approximation is low.

Step size matters

With two big steps the path lands far below the curve, at 4 against a true 7.389. With forty small steps it closes most of that gap, reaching 7.040: the error has fallen from about 3.4 to about 0.35. Note that it is still short, and visibly so at the right-hand edge, because a twentyfold cut in step size buys only about a twentyfold cut in error. The dots mark the points Euler's method actually computes; the segments between them are the tangent lines it walks along. Notice that every path sits below the gray curve. That is not an accident, and the reason is a scoring point on the exam.

The visualization compares Euler approximations for the same differential equation using different step sizes. With a large step, each tangent line is followed for a relatively long distance before the slope is updated, and with a smaller step, the slope is recomputed more often. The approximation usually improves.

For this equation, the error is systematic. Since \(y''=y>0\), the solution is concave up, and a tangent line to a concave-up curve lies below the curve locally, so Euler’s method produces an underestimate as it moves to the right. The sign of the error is not a universal feature of Euler’s method, and it depends on the concavity of the solution.

Recompute every slope

A common mistake is to calculate the initial slope once and reuse it for every step, which would produce one tangent line, not Euler’s method. Each new point gives a new value of \(F(x,y)\), so the slope must be recomputed. A table is often the cleanest way to organize the process.

Step \(x\) \(y\) slope \(F(x,y)\)
0 0 1 1
1 0.5 1.5 1.5
2 1.0 2.25 2.25

The value in one row becomes the starting point for the next.

How quickly the error falls

Euler’s method is a first-order method. Over a fixed interval, halving the step size typically reduces the global error by roughly a factor of two when the solution is sufficiently smooth. This is slower than higher-order numerical methods, but Euler’s method has an important advantage for learning, because its geometry is completely visible. Each step says: start at the current point, use the differential equation to find the tangent slope, and follow that tangent for a short distance.

A useful self-test

Consider \(\tfrac{dy}{dx}=-y\) with \(y(0)=4\). With step size \(\Delta x=1\), Euler’s method gives \(y(1) \approx 4+(-4)(1) = 0\), while the exact solution is \(y=4e^{-x}\), so \(y(1)\approx1.47\). The Euler estimate is again low. Here, \(y''=y>0\), so the exact solution is concave up even though it is decreasing.

That is enough to explain the direction of the tangent-line error.