How to use the Euler and Modified Euler Method Calculator
- 1. Enter the equationType f(x, y) for dy/dx, then x₀, y₀, the step h and the x where you want y.
- 2. Pick the methodEuler, modified Euler, or both. Choose whether the corrector is applied once or repeated.
- 3. Read the tableEach row shows f, the predictor, the corrector values and the new y.
Euler and modified Euler
Euler's method follows the tangent line for one step: yₙ₊₁ = yₙ + h f(xₙ, yₙ). It is simple but only first order, so the error is roughly proportional to h.
Modified Euler (a predictor-corrector method) first predicts y* = yₙ + h f(xₙ, yₙ), then corrects with the average slope: yₙ₊₁ = yₙ + (h/2)[f(xₙ, yₙ) + f(xₙ₊₁, y*)]. Many Indian textbooks repeat the corrector with the newest value until two results agree to the required decimals; applying it once is Heun's method. Either way the error is roughly proportional to h², so it is far more accurate for the same step.
Worked example
Solve dy/dx = x + y, y(0) = 1 with h = 0.1 and find y(0.2). Euler: y₁ = 1 + 0.1 × 1 = 1.1, then y₂ = 1.1 + 0.1 × 1.2 = 1.22.
Modified Euler, step 1: predictor y* = 1.1; corrector 1 + 0.05(1 + 0.1 + 1.1) = 1.11; repeating gives 1.1105 and then 1.110525, which agrees with the previous value to 0.0001, so y(0.1) ≈ 1.110525. Step 2 settles at y(0.2) ≈ 1.24321. The exact solution y = 2eˣ − x − 1 gives 1.24281, so modified Euler is much closer than Euler's 1.22.
Choosing the step size
Halving h roughly halves Euler's error and quarters the modified Euler error. For higher accuracy with fewer steps, use the fourth-order Runge-Kutta calculator.
Frequently asked questions
Why is modified Euler more accurate?
It uses the average of the slopes at both ends of the step instead of the slope at the start only, which cancels the main error term.
Should the corrector be repeated?
Follow your syllabus. Grewal-style problems repeat it until two values agree; Heun's method applies it once. The tool does both.
What must (x − x₀)/h be?
A whole number of steps. If it is not, the tool suggests the nearest x you can reach with that h.
Can I enter any function?
Yes, any f(x, y) built from numbers, x, y, + − * / ^ and functions like sin, exp, ln and sqrt.
Is this calculator free?
Yes. You fill a short form once when you see your first result, and other Uncodemy tools then open without the form. Everything is calculated in your browser.