Runge-Kutta (RK4) Method Calculator

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

This Runge-Kutta Method Calculator approximates the solution of an initial value problem with the classic fourth-order scheme, and shows the working line by line. Four slopes are measured across each step, one at the start, two in the middle and one at the end, and their weighted average drives the step. Weighting the middle slopes twice as heavily is what makes it so much more accurate than Euler. Following the same pattern every time keeps the four slopes in order.

Step-by-step method

  1. Set up the problem.
  2. Write the fourth-order Runge-Kutta update rule.
  3. Apply the four slope estimates row by row.
  4. Report the final approximation y at x_n.

Formula:

\(y_{k+1} = y_{k} + \tfrac{h}{6}\left(k_{1} + 2k_{2} + 2k_{3} + k_{4}\right)\)
See Example 1 Hide Example 1

Problem

\(y' = - x + y,\quad y(0.0) = 2.0,\; h = 0.2,\; n = 5\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the fourth-order Runge-Kutta update rule.
  3. Apply the four slope estimates row by row.
  4. Report the final approximation y at x_n.

Step 1

Step 1 - Set up the problem.

In this problem:

\(y' = - x + y,\quad y(0.0) = 2.0,\; h = 0.2,\; n = 5\)

Step 2

Step 2 - Write the fourth-order Runge-Kutta update rule.

In this problem:

\(y_{k+1} = y_{k} + \tfrac{h}{6}\left(k_{1} + 2k_{2} + 2k_{3} + k_{4}\right)\)

Step 3

Step 3 - Apply the four slope estimates row by row.

In this problem:

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 2.0 \\ 1 & 0.2 & 2.4214 \\ 2 & 0.4 & 2.891818 \\ 3 & 0.6 & 3.422106 \\ 4 & 0.8 & 4.025521 \\ 5 & 1.0 & 4.718251 \end{array}\)

Step 4

Step 4 - Report the final approximation y at x_n.

In this problem:

\(y(1.0) \approx 4.718251\)

Final Answer

\(y(1.0) \approx 4.718251\)
See Example 2 Hide Example 2

Problem

\(y' = x y,\quad y(0.0) = 1.0,\; h = 0.1,\; n = 3\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the fourth-order Runge-Kutta update rule.
  3. Apply the four slope estimates row by row.
  4. Report the final approximation y at x_n.

Step 1

Step 1 - Set up the problem.

In this problem:

\(y' = x y,\quad y(0.0) = 1.0,\; h = 0.1,\; n = 3\)

Step 2

Step 2 - Write the fourth-order Runge-Kutta update rule.

In this problem:

\(y_{k+1} = y_{k} + \tfrac{h}{6}\left(k_{1} + 2k_{2} + 2k_{3} + k_{4}\right)\)

Step 3

Step 3 - Apply the four slope estimates row by row.

In this problem:

\(\begin{array}{ccc} k & x_k & y_k \\ \hline 0 & 0.0 & 1.0 \\ 1 & 0.1 & 1.005013 \\ 2 & 0.2 & 1.020201 \\ 3 & 0.3 & 1.046028 \end{array}\)

Step 4

Step 4 - Report the final approximation y at x_n.

In this problem:

\(y(0.3) \approx 1.046028\)

Final Answer

\(y(0.3) \approx 1.046028\)

Example Problems

Click one to load it into the box and solve it.