In mathematics and computational science, Heun's method may refer to the improved or modified Euler's method (that is, the explicit trapezoidal rule), or a similar two-stage Runge–Kutta method. It is named after Karl Heun and is a numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. Both variants can be seen as extensions of the Euler method into two-stage second-order Runge–Kutta methods.
The procedure for calculating the numerical solution to the initial value problem via the improved Euler's method is:
by way of Heun's method, is to first calculate the intermediate value and then the final approximation at the next integration point.
where is the step size and .