Higher order: Taylor’s series
We can go a step beyond Euler’s method keeping up to second order terms in the expansion around x0. Doing so we obtain y(x+Δx)=y(x)+y′(x)Δx+21y′′(x)(Δx)2+O(Δx3) from the ODE we get y′(x)y′′(x)==f(x,y),dxdf=∂x∂f+∂y∂fdxdy=∂x∂f+∂y∂ff
Substituting in the Taylor expansion we obtain
yn+1=yn+fΔx+21(Δx)2[∂x∂f+f∂y∂f]+O(Δx3),where all the functions and derivatives are evaluated in (xn,yn).
Multistep or Predictor-Corrector methods
We can achieve higher accuracy by relating yn+1 not only to yn, but also to points further in the past yn−1,yn−2,... To derive such formulas we can formally integrate exactly the equation of motion to obtain: yn+1=yn+∫xnxn+1f(x,y)dx
The problem is that we don’t know f(x,y) over the interval (xn,xn+1). However, we can use the values of y at xn and xn−1 to provide a linear extrapolation: f=Δx(x−xn−1)fn−Δx(x−xn)fn−1+O(Δx2), with fn=f(xn,yn). Inserting into the integral we obtain yn+1=yn+Δx(23fn−21fn−1)+O(Δx3) Note that the value of y0 is not sufficient information to get this algorithm started. The value of y1 has to be obtained first by some other procedure, like the ones described previously. This means that the method is not "self starting".
Runge-Kutta methods
2nd order Runge-Kutta
Euler’s method rests on the idea that the slope at one point can be used to extrapolate to the next. A plausible idea to make a better estimate of the slope is to extrapolate to a point halfway across the interval, and then to use the derivative at this point to extrapolate across the whole interval. Thus,
kyn+1==Δxf(xn,yx),yn+Δxf(x+Δx/2,yn+k/2)+O(Δx3).It has the same accuracy as the Taylor series. It requires the evaluation of f twice for each step.
4th order Runge-Kutta
Similar ideas can be used to derive a 3rd or 4th order Runge-Kutta method. It has been found by experience that the best balance between accuracy and computational effort is given by a fourth-order algorithm. Such a method would require evaluating f four times at each step, with a local accuracy of O(Δx5). It can be written as follows: k1k2k3k4yn+1=====Δxf(xn,yn),Δxf(xn+Δx/2,yn+k1/2),Δxf(xn+Δx/2,yn+k2/2),Δxf(xn+Δx,yn+k3),yn+61(k1+2k2+2k3+k4)+O(Δx5).
Runge-Kutta method are self-starting, meaning that they can be used to obtain the first few iterations for a non self-starting algorithm.