Methods for Solving 1st Order Differential Equations

Consider the following discrete methods of solution for the first order linear differential equation:

dy/dx = f(x,y)

Euler Method: Uses slope at beginning of interval to get next point.

yn+1 = yn + f(xn,yn)Dx

Verlet, Modified Euler, or Central Difference Method: Uses average of slope at the endpoints of the interval.

yn+1 = yn + [f(xn,yn) + f(xn+1, yn + f(xn,yn)Dx)] Dx / 2

An equivalent expression for the derivative is

dy(x)/dx)n = (yn+1 - yn-1) / 2Dx

Second Order Runge-Kutta Method: Predict midpoint of interval by Euler method and then use the slope at the midpoint as the slope over the entire interval.

yn+1 = yn + k2


k2 = f(xn + Dx/2, yn + k1/2) Dx

k1 = f(xn,yn) Dx

Fourth Order Runge-Kutta Method: Extension of 2nd order RK to include a quadratic term in the predictions, not just a linear term.

yn+1 = yn + [k1 + 2*k2 + 2*k3 + k4] Dx/6


k1 = f(xn, yn)

k2 = f(xn + Dx/2, yn + k1 Dx/2)

k3 = f(xn + Dx/2, yn + k2 Dx/2)

k4 = f(xn + Dx, yn + k3 Dx)

The 4th order RK method is more accurate than the Verlet method although it does require 4 evaluations of f(x,y) compared to 2 for the Verlet.