Improved Euler Method Calculator

Published on: July 18, 2026
Final Answer: Free Full Steps: Pro

This Improved Euler Method Calculator (Heun's method) approximates the solution of y' = f(x, y) using a predictor-corrector step: it estimates a slope, predicts a value, then averages the slopes for a more accurate update.

Step-by-step method

  1. Set up the initial value problem and read x0, y0, h, and n.
  2. Write the improved Euler (Heun) update rule.
  3. Apply the predictor and corrector row by row.
  4. Report the final approximation y at x_n.

Formula:

\(y_{k+1} = y_{k} + \tfrac{h}{2}\left(k_{1} + k_{2}\right),\quad k_{1} = f(x_{k}, y_{k}),\; k_{2} = f(x_{k}+h,\, y_{k}+h k_{1})\)

Example 1:

\\(y' = x + y,\quad y(0.0) = 1.0,\; h = 0.2,\; n = 4\\)

Step 1 - Set up the initial value problem and read x0, y0, h, and n.

In this problem: We approximate the solution of \(y' = x + y\) starting at \((0.0, 1.0)\) with step size 0.2 for 4 steps.

\(y' = x + y,\quad y(0.0) = 1.0,\; h = 0.2,\; n = 4\)

Step 2 - Write the improved Euler (Heun) update rule.

In this problem: This is the update rule applied at each step.

\(y_{k+1} = y_{k} + \tfrac{h}{2}\left(k_{1} + k_{2}\right),\quad k_{1} = f(x_{k}, y_{k}),\; k_{2} = f(x_{k}+h,\, y_{k}+h k_{1})\)

Step 3 - Apply the predictor and corrector row by row.

In this problem: Each row applies the update rule to move from one point to the next.

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 1.0 \\ 1 & 0.2 & 1.24 \\ 2 & 0.4 & 1.5768 \\ 3 & 0.6 & 2.031696 \\ 4 & 0.8 & 2.630669 \end{array}\)

Step 4 - Report the final approximation y at x_n.

In this problem: After 4 steps, the approximation is \(y(0.8) \approx 2.630669\).

\(y(0.8) \approx 2.630669\)

Final answer:

\\(y(0.8) \approx 2.630669\\)

Example 2:

\\(y' = - x^{2} + y + 1,\quad y(0.0) = 0.5,\; h = 0.2,\; n = 5\\)

Step 1 - Set up the initial value problem and read x0, y0, h, and n.

In this problem: We approximate the solution of \(y' = - x^{2} + y + 1\) starting at \((0.0, 0.5)\) with step size 0.2 for 5 steps.

\(y' = - x^{2} + y + 1,\quad y(0.0) = 0.5,\; h = 0.2,\; n = 5\)

Step 2 - Write the improved Euler (Heun) update rule.

In this problem: This is the update rule applied at each step.

\(y_{k+1} = y_{k} + \tfrac{h}{2}\left(k_{1} + k_{2}\right),\quad k_{1} = f(x_{k}, y_{k}),\; k_{2} = f(x_{k}+h,\, y_{k}+h k_{1})\)

Step 3 - Apply the predictor and corrector row by row.

In this problem: Each row applies the update rule to move from one point to the next.

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 0.5 \\ 1 & 0.2 & 0.826 \\ 2 & 0.4 & 1.20692 \\ 3 & 0.6 & 1.637242 \\ 4 & 0.8 & 2.110236 \\ 5 & 1.0 & 2.617688 \end{array}\)

Step 4 - Report the final approximation y at x_n.

In this problem: After 5 steps, the approximation is \(y(1.0) \approx 2.617688\).

\(y(1.0) \approx 2.617688\)

Final answer:

\\(y(1.0) \approx 2.617688\\)
See Example 1 Hide Example 1

Problem

\(y' = x + y,\quad y(0.0) = 1.0,\; h = 0.2,\; n = 4\)

Approach

Step-by-step method

  1. Set up the initial value problem and read x0, y0, h, and n.
  2. Write the improved Euler (Heun) update rule.
  3. Apply the predictor and corrector row by row.
  4. Report the final approximation y at x_n.

Step 1

Step 1 - Set up the initial value problem and read x0, y0, h, and n.

In this problem:

\(y' = x + y,\quad y(0.0) = 1.0,\; h = 0.2,\; n = 4\)

Step 2

Step 2 - Write the improved Euler (Heun) update rule.

In this problem:

\(y_{k+1} = y_{k} + \tfrac{h}{2}\left(k_{1} + k_{2}\right),\quad k_{1} = f(x_{k}, y_{k}),\; k_{2} = f(x_{k}+h,\, y_{k}+h k_{1})\)

Step 3

Step 3 - Apply the predictor and corrector row by row.

In this problem:

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 1.0 \\ 1 & 0.2 & 1.24 \\ 2 & 0.4 & 1.5768 \\ 3 & 0.6 & 2.031696 \\ 4 & 0.8 & 2.630669 \end{array}\)

Step 4

Step 4 - Report the final approximation y at x_n.

In this problem:

\(y(0.8) \approx 2.630669\)

Final Answer

\(y' = x + y,\quad y(0.0) = 1.0,\; h = 0.2,\; n = 4 = y(0.8) \approx 2.630669\)
See Example 2 Hide Example 2

Problem

\(y' = - x^{2} + y + 1,\quad y(0.0) = 0.5,\; h = 0.2,\; n = 5\)

Approach

Step-by-step method

  1. Set up the initial value problem and read x0, y0, h, and n.
  2. Write the improved Euler (Heun) update rule.
  3. Apply the predictor and corrector row by row.
  4. Report the final approximation y at x_n.

Step 1

Step 1 - Set up the initial value problem and read x0, y0, h, and n.

In this problem:

\(y' = - x^{2} + y + 1,\quad y(0.0) = 0.5,\; h = 0.2,\; n = 5\)

Step 2

Step 2 - Write the improved Euler (Heun) update rule.

In this problem:

\(y_{k+1} = y_{k} + \tfrac{h}{2}\left(k_{1} + k_{2}\right),\quad k_{1} = f(x_{k}, y_{k}),\; k_{2} = f(x_{k}+h,\, y_{k}+h k_{1})\)

Step 3

Step 3 - Apply the predictor and corrector row by row.

In this problem:

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 0.5 \\ 1 & 0.2 & 0.826 \\ 2 & 0.4 & 1.20692 \\ 3 & 0.6 & 1.637242 \\ 4 & 0.8 & 2.110236 \\ 5 & 1.0 & 2.617688 \end{array}\)

Step 4

Step 4 - Report the final approximation y at x_n.

In this problem:

\(y(1.0) \approx 2.617688\)

Final Answer

\(y' = - x^{2} + y + 1,\quad y(0.0) = 0.5,\; h = 0.2,\; n = 5 = y(1.0) \approx 2.617688\)