ODE Solvers, One by One
Given the slope everywhere, how do you find the path?
Every integrator here is a different answer to one question: you know f, and you want y. We build them in order - Euler, Heun, RK4, then implicit methods - and each one exists because the previous one failed in a specific, reproducible way you will have seen for yourself.
The simplest possible integrator. Worth studying not because you will use it, but because every failure mode of every later method is already visible here in its purest form.
Four slope samples per step, weighted 1-2-2-1, and suddenly the error falls as the fourth power. The coefficients are not arbitrary — they are what you get when you demand that error terms cancel.
When the fastest mode in the system forces a step size thousands of times smaller than accuracy needs. The fix costs a nonlinear solve per step and is worth it.
Fixed steps waste effort where the solution is smooth and under-resolve where it is not. Estimate the local error each step and resize.