Work out runge kutta method instantly with clear inputs, formula shown and shareable results.
Classical fourth-order Runge-Kutta averages four slope evaluations per step with weights 1, 2, 2, 1 over 6. Its error falls as h⁴, so it is dramatically more accurate than Euler's method for the same step count.
RK4
yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
The exact answer is 1 − 0.5e⁻² ≈ 0.9323324, and RK4 with 100 steps matches it to about ten decimal places.
It balances accuracy and cost well, needing no derivatives of f and no history of previous steps.