Why Match Taylor Expansions?
A Runge–Kutta method advances an approximate solution by evaluating the differential equation’s right-hand side at selected points. Its coefficients determine how those evaluations are combined. To obtain second-order accuracy, the update must reproduce the exact solution’s Taylor expansion through the terms involving the square of the step size.
The comparison is more than a way to check familiar methods. It identifies the coefficient conditions that any explicit two-stage method must satisfy to have second-order accuracy for general smooth differential equations. The analysis also shows why all the conditions matter: different terms in the exact Taylor expansion represent different ways the solution can change.
The General Explicit Two-Stage Update
Consider the initial-value problem \(y'=f(t,y)\), with current value \(y_n\) at time \(t_n\), and step size \(h\). For the general explicit two-stage update considered here, define the stage slopes \(k_1\) and \(k_2\) by
and set
The coefficients \(a,c,b_1,b_2\) are fixed numbers. The first stage evaluates the slope at the current point. The second stage evaluates it at a point displaced by \(c h\) in time and \(a h k_1\) in solution value. The update combines the two slopes with weights \(b_1\) and \(b_2\). We allow \(a\) and \(c\) to be independent initially, so the Taylor comparison can determine whether they must be related.
Expand the Exact Solution
Along a solution of \(y'=f(t,y)\), the chain rule gives
Here \(f_t\) and \(f_y\) are the partial derivatives of \(f\) with respect to its first and second arguments. If \(f\) is sufficiently smooth, Taylor’s theorem at \(t_n\) therefore gives
where \(f\), \(f_t\), and \(f_y\) on the right are evaluated at \((t_n,y_n)\). The two degree-two contributions have distinct sources: \(f_t\) accounts for explicit time variation in the equation, while \(f_y f\) accounts for the change in the slope as the solution value changes.
Expand the Runge–Kutta Update
The first stage is \(k_1=f\). For the second stage, expand \(f\) about \((t_n,y_n)\). Its time argument changes by \(c h\), and its solution argument changes by \(a h k_1=a h f\). Thus
Substitute this expansion into the update. The \(O(h^2)\) remainder in \(k_2\) is multiplied by \(h\), so it contributes \(O(h^3)\) to \(y_{n+1}\):
For this expression to agree with the exact Taylor expansion for general smooth \(f\), the coefficients of \(f\), \(f_t\), and \(f_yf\) must match. This gives the second-order conditions.
Why These Conditions Are Necessary and Sufficient
The expansions show sufficiency directly: if the three conditions hold, the numerical update becomes
which agrees with the exact solution through degree two in \(h\). The one-step difference is therefore \(O(h^3)\).
The conditions are also necessary if the method is to work for general equations. The three contributions can be tested separately. For \(f(t,y)=1\), the slope is constant, and matching the coefficient of \(h\) requires \(b_1+b_2=1\). For \(f(t,y)=t\), starting at \(t_n=0\), the exact solution has a nonzero \(f_t\) contribution and \(f_yf=0\); matching the degree-two term requires \(b_2c=1/2\). For \(f(t,y)=y\), starting at \(y_n=1\), \(f_t=0\) and \(f_yf=1\); matching the degree-two term requires \(b_2a=1/2\). Each condition is therefore forced by a suitable test equation.
In the standard explicit Runge–Kutta convention, the second-stage time coefficient equals the sum of the coefficients used to form its solution argument. For this two-stage method, that convention imposes \(c=a\). The conditions above already force \(c=a\) for second-order accuracy, since \(b_2c=b_2a=1/2\) and hence \(b_2\ne0\).
Worked Example: Find Coefficients from a Chosen Weight
Worked Example: Find Coefficients from a Chosen Weight
Suppose \(b_2=2/3\). Find the other coefficients required for second-order accuracy, then check the resulting method on \(y'=t+y\), starting from \(t_n=0\), \(y_n=1\).
The condition \(b_1+b_2=1\) gives
The other two conditions give
Check all three conditions by substitution:
Now apply the method to the stated equation. The first slope is
The second-stage point is
At that point, \(k_2=t_*+y_*=\frac34h+1+\frac34h=1+\frac32h\). The update is
For a Taylor check, the differential equation gives \(y'(0)=1\). Differentiating \(y'=t+y\) gives \(y''=1+y'\), so \(y''(0)=2\). Hence the exact solution has expansion \(y(h)=1+h+\frac{2}{2}h^2+O(h^3)=1+h+h^2+O(h^3)\). The computed update matches through degree two, as required.
Worked Example: Verify the Midpoint Method
Worked Example: Verify the Midpoint Method
The explicit midpoint method uses \(a=c=1/2\), \(b_1=0\), and \(b_2=1\). Check its second-order conditions, then take one step for \(y'=t\), \(y(0)=0\).
Substitution gives
All three conditions are satisfied. In particular, no second-order Taylor contribution fails: the first-order term and both degree-two terms match.
For the one-step check, \(k_1=f(0,0)=0\). The second-stage point has time coordinate \(h/2\) and solution coordinate \(0+(h/2)k_1=0\), so \(k_2=f(h/2,0)=h/2\). Thus the method gives
The exact solution is \(y(t)=t^2/2\), since its derivative is \(t\) and it satisfies \(y(0)=0\). Therefore \(y(h)=h^2/2\), exactly the value computed by the method for this equation. This particular test happens to be integrated exactly in one step; the Taylor conditions guarantee second-order accuracy more generally, not exactness for every equation.
Worked Example: Diagnose a Failed Condition
Worked Example: Diagnose a Failed Condition
Consider coefficients \(b_1=1/2\), \(b_2=1/2\), \(a=1\), and \(c=1/2\). Determine whether they give second-order accuracy for general equations. If not, exhibit a test equation where the failure appears.
The first condition holds, and the solution-value condition holds:
But the time-shift condition does not hold:
To see the consequence, use \(y'=t\) with \(y(0)=0\). The first stage gives \(k_1=0\). The second stage evaluates at time \(h/2\), so \(k_2=h/2\). The update is
The exact solution is \(y(t)=t^2/2\), so \(y(h)=h^2/2\). The one-step difference is \(-h^2/4\), which is of order \(h^2\), not \(h^3\). Thus this method does not have second-order local accuracy for general equations.
Common Pitfall: Check Each Product Separately
A frequent error is to verify the weight sum and one of the two product conditions, then assume the remaining condition follows automatically. It does not. The coefficients \(b_2c\) and \(b_2a\) govern different Taylor contributions, so both must be checked.
For example, the midpoint method has \(b_2=1\) and \(a=c=1/2\). Its products are \(b_2a=1\cdot1/2=1/2\) and \(b_2c=1\cdot1/2=1/2\): both conditions are satisfied. By contrast, in the failed method above, \(b_2a=1/2\) is satisfied but \(b_2c=1/4\) is not. Keeping the products in the correct order makes the check transparent.
The Heun method provides another useful check: \(a=c=1\), \(b_1=b_2=1/2\). It satisfies \(b_1+b_2=1\), \(b_2a=1/2\), and \(b_2c=1/2\). Both midpoint and Heun therefore satisfy all the second-order conditions, despite using different stage locations and weights.
What the Conditions Tell Us
Since \(b_2c=b_2a=1/2\), every second-order method in this general family has \(b_2\ne0\), and division by \(b_2\) gives
Thus choosing any nonzero \(b_2\) determines the other three coefficients through these formulas. The familiar midpoint and Heun methods are two choices within this family. The conditions do not say that every such choice has identical numerical behavior on every problem; they say that the required degree-one and degree-two Taylor terms match.
When applying the conditions, first identify which coefficient controls each part of the update. Then check the weight sum, the time-shift product, and the solution-shift product separately. If a condition fails, a suitable simple test equation can expose the missing Taylor contribution. This is the central value of matching expansions: it turns an accuracy requirement into precise algebraic tests, and it explains what those tests protect.
Check Your Understanding
Use the coefficient conditions and Taylor expansions developed above to answer these questions.
- For \(a=c=1/3\), \(b_1=1/4\), and \(b_2=3/4\), check each second-order condition.
- If \(b_2=1/4\), what values of \(a\), \(c\), and \(b_1\) are required for second-order accuracy?
- Which Taylor contribution is tested by the equation \(y'=t\) at \(t=0\), \(y=0\)?
- Why does satisfying \(b_1+b_2=1\) alone not establish second-order accuracy?
- For the Heun coefficients \(a=c=1\), \(b_1=b_2=1/2\), verify all three conditions.