Euler's Method

A numerical technique for approximating solutions to differential equations by stepping along the slope field in small increments.

Euler's method follows the current slope in straight steps.
one tangent stepexact curveEuler path
Definition

Euler's Method is a numerical technique for approximating the solution to a differential equation. Given an initial value problem dydx=f(x,y)\frac{dy}{dx} = f(x, y) with y(x0)=y0y(x_0) = y_0, we step forward in small increments of size hh:

yn+1=yn+h⋅f(xn,yn)y_{n+1} = y_n + h \cdot f(x_n, y_n)

At each step, we use the current slope f(xn,yn)f(x_n, y_n) to predict where the curve goes next. It is the simplest numerical ODE solver and the foundation for understanding more advanced methods.

Key terms:

  • hh — the step size (smaller hh gives more accuracy)
  • f(xn,yn)f(x_n, y_n) — the slope at the current point
  • (xn,yn)(x_n, y_n) — the current approximation point
One step of Euler's Method

Approximate y(0.1)y(0.1) given dydx=y\frac{dy}{dx} = y, y(0)=1y(0) = 1, using step size h=0.1h = 0.1.

y1=y0+h⋅f(x0,y0)=1+0.1⋅(1)=1.1y_1 = y_0 + h \cdot f(x_0, y_0) = 1 + 0.1 \cdot (1) = 1.1

The exact answer is y(0.1)=e0.1≈1.10517y(0.1) = e^{0.1} \approx 1.10517, so the error is about 0.0050.005.

Try it

Use Euler's Method with h=0.5h = 0.5 to approximate y(1)y(1) given dydx=x\frac{dy}{dx} = x, y(0)=0y(0) = 0.

Solution

Step 1: x0=0x_0 = 0, y0=0y_0 = 0. Slope =f(0,0)=0= f(0, 0) = 0. y1=0+0.5⋅0=0y_1 = 0 + 0.5 \cdot 0 = 0

Step 2: x1=0.5x_1 = 0.5, y1=0y_1 = 0. Slope =f(0.5,0)=0.5= f(0.5, 0) = 0.5. y2=0+0.5⋅0.5=0.25y_2 = 0 + 0.5 \cdot 0.5 = 0.25

So y(1)≈0.25y(1) \approx 0.25. The exact answer is y=x22y = \frac{x^2}{2}, giving y(1)=0.5y(1) = 0.5. Error =0.25= 0.25 — large because hh is large.

Related concepts

Needs first