Euler’s Method
When a differential equation is hard or impossible to solve with a formula, you can still estimate its solution by taking small straight steps along the slope field. This guide shows the step rule, how step size affects accuracy, and how to tell whether an estimate is too high or too low.
Start at the known point \((x_0, y_0)\). The differential equation gives the slope there. Move a small horizontal distance \(h\) along that slope: \(y_1 = y_0 + h \cdot f(x_0, y_0)\). Repeat from the new point. Each step is a short tangent-line approximation, so smaller steps give better estimates. If the solution is concave up, the steps fall below it (underestimate); if concave down, above (overestimate).
1The idea
2The step rule
\(\dfrac{dy}{dx} = x + y\), \(y(0) = 1\), step \(h = 0.5\); estimate \(y(1)\)
- 1Start at \((0, 1)\). Slope there: \(0 + 1 = 1\). Step: \(y \approx 1 + 0.5(1) = 1.5\) at \(x = 0.5\).
- 2At \((0.5, 1.5)\), slope \(= 0.5 + 1.5 = 2\). Step: \(y \approx 1.5 + 0.5(2) = 2.5\) at \(x = 1\).
“Using Euler’s method with step size 0.5: \(y(0.5) \approx 1 + 0.5(1) = 1.5\), and \(y(1) \approx 1.5 + 0.5(2) = 2.5\).”
Each step uses the slope at the point you are leaving, not the one you are heading to. The slope at \((0.5, 1.5)\) is only used for the second step.
The slope depends on both \(x\) and \(y\) here. After the first step, \(x\) is 0.5, not 0. Keep a table of \(x\), \(y\), slope and the new \(y\).
3Step size
Same problem, h = 0.25
- 1Four steps, each \(y_{\text{new}} = y + 0.25(x + y)\):
\(x\) 0 0.25 0.5 0.75 1 \(y\) 1 1.25 1.625 2.15625 2.8828 - 2The exact solution is \(y = 2e^x - x - 1\), so \(y(1) = 2e - 2 \approx 3.437\). The smaller step lands closer.
From \(x = 0\) to \(x = 1\) with \(h = 0.25\) takes \(\frac{1 - 0}{0.25} = 4\) steps. Stop when \(x\) reaches the target and report the last \(y\).
\(\dfrac{dy}{dx} = 2y\), \(y(0) = 1\), \(h = 0.1\), two steps
- 1Step 1: \(1 + 0.1(2 \cdot 1) = 1.2\). Step 2: \(1.2 + 0.1(2 \cdot 1.2) = 1.44\).
- 2The exact value is \(e^{0.4} \approx 1.492\).
Estimate \(y(-0.5)\) for \(\dfrac{dy}{dx} = x + y\), \(y(0) = 1\), in one step
- 1To move left, use a negative step: \(h = -0.5\).
- 2\(y(-0.5) \approx 1 + (-0.5)(0 + 1) = 0.5\).
- 3The exact value is \(2e^{-0.5} - 0.5 \approx 0.713\). Going left along a tangent line of a concave-up curve also lands below the curve.
4Over or under?
Use concavity
- 1Differentiate the equation: \(\dfrac{d^2y}{dx^2} = 1 + \dfrac{dy}{dx} = 1 + x + y\).
- 2Near the path, \(x \ge 0\) and \(y \gt 0\), so \(y'' \gt 0\): the solution is concave up.
- 3A concave-up curve lies above its tangent lines, and each Euler step follows a tangent line.
Over or under depends on \(\frac{d^2y}{dx^2}\), not on whether the first slope is positive. Differentiate the equation (with the chain rule on \(y\)) and check its sign along the path.
Quick reference
| Item | Rule |
|---|---|
| Next y | \(y + h \cdot \frac{dy}{dx}\) at the current point |
| Next x | \(x + h\) |
| Smaller h | More steps, usually closer |
| Solution concave up | Euler underestimates |
| Solution concave down | Euler overestimates |