Euler's Method (First-Order ODE)
Enter dy/dx = f(x, y) with an initial condition and step size, and Euler's method computes the numerical solution. Shows the y value at the end point, a step-by-step table, and a graph of the solution curve.
Input
dy/dx=
Examples (tap to fill in)
y
x + y
x - y
x*y
-2*y
sin(x) - y
Operators: + - * / ^ (power) / Functions: sin cos tan asin acos atan sinh cosh tanh exp log (natural log) ln log10 sqrt cbrt abs pow(a,b) / Constants: pi (π), e / Variables: x and y.
Result
When dy/dx = y and y(0) = 1
y(1) ≈
2.593742
y at the end point
2.593742
x = 1
Number of steps
10 steps
h = 0.1
Initial condition
y(0) = 1
Interval 0 → 1
Numerical solution progression
| n | x | y | Slope f(x, y) |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 1 | 0.1 | 1.1 | 1.1 |
| 2 | 0.2 | 1.21 | 1.21 |
| 3 | 0.3 | 1.331 | 1.331 |
| 4 | 0.4 | 1.4641 | 1.4641 |
| 5 | 0.5 | 1.61051 | 1.61051 |
| 6 | 0.6 | 1.771561 | 1.771561 |
| 7 | 0.7 | 1.948717 | 1.948717 |
| 8 | 0.8 | 2.143589 | 2.143589 |
| 9 | 0.9 | 2.357948 | 2.357948 |
| 10 | 1 | 2.593742 | 2.593742 |
How it works
- Enter the right-hand side f(x, y), initial values x0 and y0, step size h, and end x (xend); Euler's method y_{n+1} = y_n + h·f(x_n, y_n) then updates y in order from x0 to xend, computing the value at each step.
- The right-hand side expression can use both variables x and y. Operators include + - * / and ^ (power); functions include sin, cos, tan, exp, log (natural log), ln, sqrt, abs, pow(a,b) and more; constants pi (π) and e are supported. Trigonometric arguments are treated in radians.
- The main result shows the approximate value of y at the end x in large type, alongside the number of steps, step size, and initial condition. The table below traces x, y, and the slope f(x, y) for each step number n, while the graph follows the solution curve and each point.
- Euler's method is the most basic first-order accurate solver, and an error proportional to the step size h remains. Halving h roughly halves the error but increases the number of steps. If accuracy matters, make h small enough.
- If the step size is too large, the solution may oscillate or diverge (especially for rapidly decaying expressions such as -2y). A warning is shown when the value diverges, so reduce h or reconsider the interval.
- The expressions you enter and the results are never sent anywhere; everything is processed inside your browser. Use it with confidence.
Reviews
Tell us what you think of this calculator.
Write a review
Found an incorrect result or a problem? Turn this on to report it.
- Home
Euler's Method (First-Order ODE)