Euler's Method Calculator

Euler's method approximates the solution of a first order initial value problem by walking along the slope field in straight lines. Enter the right-hand side of dy/dx = f(x, y), the starting point, a step size and how many steps to take, and it returns the full table: x, y, the slope at each point and the next value. A second tab takes the exact solution as well and prints the error at every step, plus the same run at half the step size so you can see the error roughly halve. The method is first order, so the answer is an approximation whose error accumulates rather than cancelling.

Calculator Type

The equation, the starting point, a step size and how many steps to take. Every step is shown so the arithmetic can be checked by hand.

Use x and y, numbers, + - * / ^, brackets, pi, e, and the functions sqrt, abs, ln, log, exp, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, floor and ceil. Angles are in radians.
Smaller steps are more accurate and slower. The error falls roughly in proportion to h.
The march ends at x0 + h times this, which is shown with the answer.
Widget

The same march, with the exact solution y(x) typed in beside it, so every step carries its error. It also repeats the run at half the step size, which is the check that the method is behaving as first order.

Use x and y, numbers, + - * / ^, brackets, pi, e, and the functions sqrt, abs, ln, log, exp, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, floor and ceil. Angles are in radians.
The closed form you are checking against. It must be written in x alone.
Smaller steps are more accurate and slower. The error falls roughly in proportion to h.
The march ends at x0 + h times this, which is shown with the answer.
Widget