How it’s calculated
Euler's method follows the slope of a differential equation in small straight steps. Starting from (x₀, y₀), each step moves h to the right and uses the slope at the current point to predict the next y.
Because dy/dx = a·x + b·y + c is a first-order linear equation, its exact solution is known, so the calculator shows how far Euler's estimate is off at each step:
(For b ≠ 0, try y = Px + Q: matching terms gives P = −a/b and Q = −(a + bc)/b², and adding K·e^(b(x − x₀)), the solution of y′ = b·y, lets y(x₀) = y₀. For b = 0 the right side does not involve y, so just integrate.) Euler's error at a fixed x shrinks roughly in proportion to h: halve the step, roughly halve the error.
Example: dy/dx = x + y with y(0) = 1, h = 0.1, 10 steps. y₁ = 1 + 0.1 × (0 + 1) = 1.1; y₂ = 1.1 + 0.1 × (0.1 + 1.1) = 1.22; y₃ = 1.362; … y₁₀ ≈ 3.187485. The exact solution is y = 2eˣ − x − 1, so y(1) = 2e − 2 ≈ 3.436564, and Euler is about 0.249 too low.
Frequently asked questions
How do I make Euler’s method more accurate?
Use a smaller step size h (and more steps to reach the same x). The error at a fixed point is roughly proportional to h, so halving h about halves the error.
Why does Euler’s method underestimate here?
When the solution curves upward (concave up), each tangent-line step falls below the curve, and the errors build up. For a concave-down solution it overestimates.
Can I enter a different equation?
This calculator handles dy/dx = a·x + b·y + c, which has an exact solution to compare against. Set any of a, b, c to 0 as needed, for example b = 1, a = c = 0 gives dy/dx = y.
Can the method blow up?
Yes. With b negative and a large step (h·|b| > 2) the Euler values oscillate and grow even though the true solution decays. Reduce h if the table swings wildly.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- Calculus Volume 2, §4.2 Direction Fields and Numerical Methods (Euler's method) — OpenStax
- Calculus Volume 2, §4.5 First-order Linear Equations (exact solution) — OpenStax
- Python Numerical Methods, §22.3 The Euler Method — UC Berkeley
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator