Key Idea: Euler's method also works for second-order equations and coupled systems, like a swinging pendulum. You turn the equation into two first-order ones and step both together.
Second-order Euler
- Reduce — Set v = dx/dt. Then dx/dt = v and dv/dt = g(t, x, v).
- Step both — xₙ+₁ = xₙ + h·vₙ and vₙ+₁ = vₙ + h·g(tₙ, xₙ, vₙ).
- Same old row — Every rate comes from the current row before you update.
- Count — Steps = (target t − start t) ÷ h.
- Accuracy — A smaller h gives a closer estimate.
| t | x | v |
|---|---|---|
| 0 | 2 | 0 |
| 0.5 | 2 | −1 |
| 1 | 1.5 | −2 |
Update x and v at the same time, from the same row.
The exact value is x(1) = 2cos 1 ≈ 1.0806. Percentage error of 1.5? About 38.8%.
Why is that error so large? h = 0.5 is a coarse step.
Reduce d²x/dt² = −4x. With v = dx/dt, the second equation is dv/dt = −4x.
To reach t = 2 with h = 0.25, how many steps? 8.