The Euler method for solving the differential equation $$dy/dx=f(x,y)$$ can be rewritten in the form

$$k_1 = \Delta x f(x_n, y_n), \quad y_{n+1} = y_n + k_1,$$

and is called a first-order Runge-Kutta method. More accurate second-order Runge-Kutta methods have the form

$$k_1 = \Delta x f(x_n, y_n), \quad k_2 = \Delta x f(x_n+\alpha\Delta x, y_n + \beta k_1),\quad y_{n+1} = y_n + ak_1 + bk_2.$$

Some analysis (not shown here) on the second-order Runge Kutta methods results in the constraints

$$a+b=1, \qquad \alpha b = \beta b = 1/2$$.

Write down the second-order Runge-Kutta methods corresponding to (i) $$a=b$$, and (ii) $$a=0$$. These specific second-order Runge-Kutta methods are called the modified Euler method and the midpoint method, respectively.

Note: Remember, you may check the solutions in the lecture notes .