Improved Euler Method Calculator

Enter the coefficients, initial point and step size for one improved Euler step.

How it is calculated

The tool works only on the linear equation y' = a·x + b·y, with coefficients you enter, and takes exactly one step from the point (x0, y0) with step size h. Slope at the start: s0 = a·x0 + b·y0. Euler predictor: yp = y0 + h·s0. Slope at the predicted end: s1 = a·(x0 + h) + b·yp. Corrected value: y1 = y0 + (h/2)·(s0 + s1). It prints y1, yp and s0 with six decimals. A negative h is accepted and steps backwards. There is no loop over many steps, so for a longer interval you have to feed the new point (x0 + h, y1) back in yourself. Other equations, such as y' = x·y, are not supported.

Worked example

Solve y' = x + y (a = 1, b = 1) from (0, 1) with h = 0.1. Start slope: 0 + 1 = 1, shown as 1.000000. Predictor: 1 + 0.1 × 1 = 1.100000. Slope at x = 0.1 with y = 1.1: 0.1 + 1.1 = 1.2. Corrected: 1 + 0.05 × (1 + 1.2) = 1.110000. For this equation the exact solution is y = 2eˣ − x − 1, which gives 1.110342 at x = 0.1, so Heun's value is off by about 0.0003, while plain Euler's 1.1 is off by about 0.010.

Try this example →

Common mistakes

  • Entering a nonlinear equation: the tool solves only y' = a·x + b·y, so for y' = x·y or y' = y² the result is meaningless.
  • Trying to enter an equation with a constant term: y' = 2 − 3y has a constant 2, but the tool only has the a·x and b·y terms, so that equation is not covered.
  • Expecting a full table of steps: you get only y at x0 + h; to go further, use the new point as the next start.
  • Choosing a large h: the error of one step grows quickly with h, and a step of 1 on a fast-changing solution can be badly off.
  • Mixing up the predictor and the answer: yp is only the intermediate Euler guess, and y1 is the improved value.

About this calculator

Heun's method — also called the improved or modified Euler method — is a second-order Runge-Kutta technique for numerically solving ordinary differential equations. It first takes a standard Euler “predictor” step, then averages the slope at the starting point with the slope at the predicted endpoint to compute a more accurate “corrected” value.

That averaging reduces the local truncation error from O(h²) for plain Euler down to O(h³), a meaningful accuracy gain for the same step size. This calculator performs one such step for y' = a·x + b·y and is used in numerical methods coursework and engineering/physics simulations as a stepping stone between simple Euler integration and higher-order solvers like RK4.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The tool takes one step only, so reach a later x by feeding each result back in as the new starting point. For y' = x + y from (0, 1), one step of 0.1 gives 1.110000. Two steps of 0.05 give 1.110253, nearer the true 1.110342, because the error shrinks fast as h shrinks. Enter the second step starting from x = 0.05 and y = 1.0525. What equation are you integrating?

Popular calculators

All Calculators