Solving dy/dx = f(x, y) step by step
Type a first-order differential equation, a starting point and a step size. Euler, Heun and Runge-Kutta 4 each march across the interval, and the page shows where each lands, how far off it is and how the curves compare.
Type dy/dx using x and y. The worked example is dy/dx = x + y with y(0) = 1, whose exact solution is known. Saved on this device only.
Loading Differential Equation Numerical Solver. If nothing appears, turn on JavaScript.
Enrichment · STEM ExplorationsOpen to everyone · no sign-in
A method of order p has an error that shrinks like the step to the power p. Euler is order 1, Heun order 2 and the classical Runge-Kutta method order 4. That is why a coarse step wrecks Euler long before it troubles Runge-Kutta.
A step that is too large can make a stable equation look unstable, and some equations are stiff and need special methods. If the three curves disagree sharply, shorten the step and watch which ones settle together.
The worked examples are invented for illustration. What you type is saved only in this browser and is never sent to Caveat. Support: team@caveatacademic.com.