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
Examples (tap to fill in)
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.
Related calculators
Bisection Method Equation Solver
NumericalSolve f(x)=0 with the bisection method. Enter a function and an interval to get the approximate root, f(root), the iteration count, and the error, plus a per-step table of intervals and midpoints and a function graph.
Open calculator →False Position Method (Regula Falsi) Solver
NumericalA numerical tool that solves your equation f(x)=0 with the false position method (linear interpolation, regula falsi). Enter an interval and a tolerance to get the approximate root, f(root), the iteration count, and a table and chart of the iteration process.
Open calculator →Newton's Method (specify f(x) and f'(x))
NumericalEnter f(x) and its derivative f'(x) as expressions and use Newton's method to find an approximate root of f(x)=0. Includes an iteration table and a convergence chart.
Open calculator →Newton's Method Calculator (f(x) only, numerical derivative)
NumericalSolve f(x) = 0 with Newton's method. Just enter the equation, initial guess, tolerance, and max iterations - the derivative is approximated automatically by numerical differentiation. Shows the approximate root, f(root), iteration count, error, plus a step table and a graph.
Open calculator →