I am sitting with a problem where I have to show that Heun's method is consistent w.r.t. properties which is not related to my question. Anyway.
I am given two different definitions and the above statement is easy to prove with
(1) $\phi (t,y;h) = \frac{1}{2}(f(t,y)+f(t+h,y+hf(t,y)))$ (Heuns method)
and for the second definition I am given I have that
(2) $\int_{x_{j}}^{x_{j+1}} f(t,y(t))dt \approx \frac{1}{2}h_{j}(f(x_{j},y_{j}) + f(x_{j+1},y_{j+1})) \\ \approx \frac{1}{2}h_{j}(f(x_{j},y_{j}) + f(x_{j+1},y_{j}+h_{j}f(x_{j},y_{j})))$
But I am confused about how these two different ways of expressing Heuns method are related, especially since notation (1) is given after the exercise where I have to use it
The ODE is equivalent to the integral equation $$ y(x+h)=y(x)+\int_0^h f(x+s, y(x+s))\,ds. $$ First we approximate the integral with the trapezoidal formula $$ y(x+h)=y(x)+\frac h2[f(x,y(x))+f(x+h, y(x+h))] + O(h^3) $$ which now is an implicit equation for $y(x+h)$. Reflect that we now compute approximations by using $y_k$ for the approximation of $y(x_k)$, $x_k=x_0+kh$, $$ y_{k+1}=y_k+\frac h2[f(x_k,y_k)+f(x_{k+1}, y_{k+1})]. $$ This is the implicit trapezoidal method. Now we can replace the $y_{k+1}$ on the right side with an $O(h^2)$ approximation $\tilde y_{k+1}$ without changing the error order $O(h^3)$ of the step. The immediate candidate for that first approximation is the value of the Euler step $\tilde y_{k+1}=y_k+hf(x_k,y_k)$. This then constitutes the explicit trapezoidal or modified Euler or Heun's method.