Solution (source code)

= Solution

For $f(x,y)=y$ and $\beta=1/2$, the <explicit midpoint method> multiplies the current value by $R=1+h+h^2/2$. Starting from one, induction gives
$$
\boxed{y_n=\left(1+h+\frac{h^2}{2}\right)^n.}
$$
Let $A=e^h$ and $B=R$. The <Taylor theorem with Lagrange remainder> for the <exponential function> gives
$$
\frac{h^3}{6}\leq A-B\leq\frac{h^3e^h}{6},\qquad 1\leq B\leq A.
$$
The <difference of powers> identity gives $A^n-B^n=(A-B)\sum_{k=0}^{n-1}A^{n-1-k}B^k$. Every summand lies between one and $A^{n-1}$. Since $nh=x_n$, the <global error> therefore satisfies
$$
\boxed{\frac{h^2x_n}{6}\leq y(x_n)-y_n\leq\frac{h^2x_ne^{x_n}}6.}
$$
The same inequalities hold at $n=0$, where the error vanishes. At the fixed endpoint $x_N=1$, the lower bound $h^2/6$ prevents any higher <order of a numerical method>, while the upper bound is $eh^2/6$. Thus \b[the convergence order is exactly two].