Improved Euler Method Calculator
This Improved Euler Method Calculator approximates the solution of an initial value problem more accurately than plain Euler, and shows the working line by line. A first slope predicts where the step lands, a second slope is read at that predicted point, and the average of the two is what the step actually uses. Averaging the two slopes is what cancels most of the error. Following the same pattern every time keeps predictor and corrector distinct.
Step-by-step method
- Set up the problem.
- Write the update rule.
- Apply the rule step by step.
- Write the approximation.
Formula: Improved Euler Method
The slope at the start and the slope at the end of a trial step are averaged, which gives a far better step than Euler's method.
Useful Tips to Remember
A smaller step size h gives a more accurate answer but needs more steps. Keep x and y moving together: every step adds h to x and uses the new y in the next slope. Round only the final answer, and keep the working values as accurate as you can. Check that \(x_{0} + nh\) is the x value you want to reach. Work out \(k_{2}\) at the end of the trial step, \(x_{k} + h\) and \(y_{k} + hk_{1}\), not at the original point.
Required knowledge
- How the basic step works, covered in the Euler's Method Calculator.
- How to evaluate f at a point, covered in the Function Evaluator Calculator.
Where Is the Improved Euler Method Used?
The improved Euler method, also called Heun's method, is a simple predictor-corrector scheme, the same idea used in many professional solvers. Its error falls much faster than Euler's as h shrinks, so it is used where a cheap but reasonably accurate step is needed, such as in simple engineering simulations, orbit sketches and biological growth models.
- Predictor-corrector simulations
- Engineering models with moderate accuracy
- Orbital and projectile sketches
- Biological growth models
- Teaching error and step size
Improved Euler Method Practice Problems
Example 1 steps \(y' = y - x\) from \(y(0) = 2\) with \(h = 0.2\) for 5 steps, and Example 2 steps \(y' = xy\) from \(y(0) = 1\) with \(h = 0.1\) for 3 steps. Compare the answers with Euler's method. For two more free worked examples, check out the Improved Euler Method Notes.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the update rule.
- Apply the rule step by step.
- Write the approximation.
Formula
Formula: Improved Euler Method
The slope at the start and the slope at the end of a trial step are averaged, which gives a far better step than Euler's method.
Step 1
Step 1 - Set up the problem.
In this problem: We are approximating the solution of \(y' = - x + y\) starting from \(y(0) = 2\), taking 5 steps of size \(h = 0.2\) to reach \(x = 1\).
Step 2
Step 2 - Write the update rule.
In this problem: The improved Euler method, also called Heun's method, works out the slope at the start of the step and the slope at the end of a trial Euler step, then moves using the average of the two. This is much more accurate than Euler's method.
Step 3
Step 3 - Apply the rule step by step.
In this problem: The rule is applied 5 times, and each step starts where the last one ended. The table shows every point, rounded to 6 decimal places.
Step 3a
Step 3a - Step 1.
In this problem: From \((x_{0}, y_{0}) = (0,\; 2)\), the slope at the start is \(k_{1} = f(0,\; 2) = - 0 + {2} = 2\). A trial Euler step gives \(y_{k} + hk_{1} = 2 + 0.2 \times 2 = 2.4\), and the slope there is \(k_{2} = f(0.2,\; 2.4) = - 0.2 + {2.4} = 2.2\). Averaging the two slopes gives \(y_{1} = 2 + \frac{0.2}{2}\left(2 + 2.2\right) = 2.42\).
Step 3b
Step 3b - Step 2.
In this problem: From \((x_{1}, y_{1}) = (0.2,\; 2.42)\), the slope at the start is \(k_{1} = f(0.2,\; 2.42) = - 0.2 + {2.42} = 2.22\). A trial Euler step gives \(y_{k} + hk_{1} = 2.42 + 0.2 \times 2.22 = 2.864\), and the slope there is \(k_{2} = f(0.4,\; 2.864) = - 0.4 + {2.864} = 2.464\). Averaging the two slopes gives \(y_{2} = 2.42 + \frac{0.2}{2}\left(2.22 + 2.464\right) = 2.8884\).
Step 3c
Step 3c - Step 3.
In this problem: From \((x_{2}, y_{2}) = (0.4,\; 2.8884)\), the slope at the start is \(k_{1} = f(0.4,\; 2.8884) = - 0.4 + {2.8884} = 2.4884\). A trial Euler step gives \(y_{k} + hk_{1} = 2.8884 + 0.2 \times 2.4884 = 3.38608\), and the slope there is \(k_{2} = f(0.6,\; 3.38608) = - 0.6 + {3.38608} = 2.78608\). Averaging the two slopes gives \(y_{3} = 2.8884 + \frac{0.2}{2}\left(2.4884 + 2.78608\right) = 3.415848\).
Step 3d
Step 3d - Step 4.
In this problem: From \((x_{3}, y_{3}) = (0.6,\; 3.415848)\), the slope at the start is \(k_{1} = f(0.6,\; 3.415848) = - 0.6 + {3.415848} = 2.815848\). A trial Euler step gives \(y_{k} + hk_{1} = 3.415848 + 0.2 \times 2.815848 = 3.979018\), and the slope there is \(k_{2} = f(0.8,\; 3.979018) = - 0.8 + {3.979018} = 3.179018\). Averaging the two slopes gives \(y_{4} = 3.415848 + \frac{0.2}{2}\left(2.815848 + 3.179018\right) = 4.015335\).
Step 3e
Step 3e - Step 5.
In this problem: From \((x_{4}, y_{4}) = (0.8,\; 4.015335)\), the slope at the start is \(k_{1} = f(0.8,\; 4.015335) = - 0.8 + {4.015335} = 3.215335\). A trial Euler step gives \(y_{k} + hk_{1} = 4.015335 + 0.2 \times 3.215335 = 4.658401\), and the slope there is \(k_{2} = f(1,\; 4.658401) = - 1 + {4.658401} = 3.658401\). Averaging the two slopes gives \(y_{5} = 4.015335 + \frac{0.2}{2}\left(3.215335 + 3.658401\right) = 4.702708\).
Step 4
Step 4 - Write the approximation.
In this problem: After 5 steps the approximation is \(y(1) \approx 4.702708\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the update rule.
- Apply the rule step by step.
- Write the approximation.
Formula
Formula: Improved Euler Method
The slope at the start and the slope at the end of a trial step are averaged, which gives a far better step than Euler's method.
Step 1
Step 1 - Set up the problem.
In this problem: We are approximating the solution of \(y' = x y\) starting from \(y(0) = 1\), taking 3 steps of size \(h = 0.1\) to reach \(x = 0.3\).
Step 2
Step 2 - Write the update rule.
In this problem: The improved Euler method, also called Heun's method, works out the slope at the start of the step and the slope at the end of a trial Euler step, then moves using the average of the two. This is much more accurate than Euler's method.
Step 3
Step 3 - Apply the rule step by step.
In this problem: The rule is applied 3 times, and each step starts where the last one ended. The table shows every point, rounded to 6 decimal places.
Step 3a
Step 3a - Step 1.
In this problem: From \((x_{0}, y_{0}) = (0,\; 1)\), the slope at the start is \(k_{1} = f(0,\; 1) = 0 \times {1} = 0\). A trial Euler step gives \(y_{k} + hk_{1} = 1 + 0.1 \times 0 = 1\), and the slope there is \(k_{2} = f(0.1,\; 1) = 0.1 \times {1} = 0.1\). Averaging the two slopes gives \(y_{1} = 1 + \frac{0.1}{2}\left(0 + 0.1\right) = 1.005\).
Step 3b
Step 3b - Step 2.
In this problem: From \((x_{1}, y_{1}) = (0.1,\; 1.005)\), the slope at the start is \(k_{1} = f(0.1,\; 1.005) = 0.1 \times {1.005} = 0.1005\). A trial Euler step gives \(y_{k} + hk_{1} = 1.005 + 0.1 \times 0.1005 = 1.01505\), and the slope there is \(k_{2} = f(0.2,\; 1.01505) = 0.2 \times {1.01505} = 0.20301\). Averaging the two slopes gives \(y_{2} = 1.005 + \frac{0.1}{2}\left(0.1005 + 0.20301\right) = 1.020175\).
Step 3c
Step 3c - Step 3.
In this problem: From \((x_{2}, y_{2}) = (0.2,\; 1.020175)\), the slope at the start is \(k_{1} = f(0.2,\; 1.020175) = 0.2 \times {1.020175} = 0.204035\). A trial Euler step gives \(y_{k} + hk_{1} = 1.020175 + 0.1 \times 0.204035 = 1.040579\), and the slope there is \(k_{2} = f(0.3,\; 1.040579) = 0.3 \times {1.040579} = 0.312174\). Averaging the two slopes gives \(y_{3} = 1.020175 + \frac{0.1}{2}\left(0.204035 + 0.312174\right) = 1.045986\).
Step 4
Step 4 - Write the approximation.
In this problem: After 3 steps the approximation is \(y(0.3) \approx 1.045986\).
Final Answer
Notes and Practice Mode
Want to understand the method more deeply? The Improved Euler (Heun) Method Notes go through the same pattern with extra worked examples and fuller explanations of the ideas behind each step, so you can see why every step works and not just what to do. When you are ready to test yourself, Improved Euler (Heun) Method Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode for this calculator is available on the Pro plan.
Login and upgrade to Pro to unlock the full step solution.
Example Problems
Click one to load it into the box and solve it.