# Administrative Information
*This is a supplement to the initial-value-problem unit (Day 15 onward). It records, at a careful graduate level, the complete multivariable Taylor-series derivation of the classical four-stage, fourth-order Runge–Kutta method for the scalar nonautonomous problem $y'=f(t,y)$, $y(t_n)=y_n$. The derivation of RK2 by the same technique is assumed known. Nothing here is quoted from rooted-tree theory; the eight order conditions are derived directly by expansion and coefficient matching, and the tree correspondence is noted only in a postscript. Every material algebraic step is shown.*
> [!info]- Scope and prerequisites
> - Assumed: the RK2 (midpoint/Heun family) derivation via second-order Taylor matching.
> - Standing smoothness assumption: $f\in C^4$ on an open set containing the solution graph, so that all partial derivatives through total order four exist, are continuous, and may be evaluated freely; the exact solution is then $C^5$ in $t$.
> - All expansions are in the step size $h>0$, about the base point $(t_n,y_n)$, which we abbreviate $(t,y)$.
## Notation
All partial derivatives of $f$ are evaluated at the base point $(t,y)=(t_n,y_n)$ unless explicitly written otherwise. Subscripts denote partial differentiation:
$
f_t=\frac{\partial f}{\partial t},\qquad
f_y=\frac{\partial f}{\partial y},\qquad
f_{tt}=\frac{\partial^2 f}{\partial t^2},\qquad
f_{ty}=\frac{\partial^2 f}{\partial t\,\partial y},\qquad
f_{yy}=\frac{\partial^2 f}{\partial y^2},
$
and at third order
$
f_{ttt},\qquad f_{tty},\qquad f_{tyy},\qquad f_{yyy},
$
with the analogous meanings. Since $f\in C^4$, mixed partials are symmetric ($f_{ty}=f_{yt}$, etc.), and we always write the $t$-derivatives first. The unadorned symbol $f$ means $f(t_n,y_n)$.
For a differentiable function $g(t,y)$ evaluated along the exact solution $y(t)$, the chain rule gives the *total derivative along the solution*
$
\frac{d}{dt}\,g\bigl(t,y(t)\bigr)=g_t+g_y\,y'(t)=g_t+g_y f,
$
the last equality holding because $y'=f$ along the solution. We will use this repeatedly, each time writing out the result rather than hiding it in operator notation.
Four grouped quantities recur constantly, and it pays to name them now (each is a specific polynomial in the partials of $f$, evaluated at the base point):
$
\begin{aligned}
F &:= f_t+f\,f_y, \\
P &:= f_{ty}+f\,f_{yy}, \\
G &:= f_{tt}+2f\,f_{ty}+f^2 f_{yy}, \\
H &:= f_{ttt}+3f\,f_{tty}+3f^2 f_{tyy}+f^3 f_{yyy}.
\end{aligned}
$
$F$ is the total derivative of $f$ along the solution; $P$ is the total derivative of $f_y$ along the solution in the same sense ($P=(f_y)_t+(f_y)_y\,f$); $G$ and $H$ are the "pure" second and third directional derivatives of $f$ in the direction $(1,f)$:
$
G=\Bigl(\partial_t+f\,\partial_y\Bigr)^{(2)}f
\quad\text{and}\quad
H=\Bigl(\partial_t+f\,\partial_y\Bigr)^{(3)}f
$
*where the superscript means the directional derivative is taken with the direction vector $(1,f)$ held frozen at its base-point value* — that is, $G$ and $H$ are what you get from the binomial pattern $\sum_k \binom{n}{k} f^k\, \partial_t^{n-k}\partial_y^k f$, not from iterating the non-constant-coefficient operator $\partial_t + f(t,y)\partial_y$. This distinction matters: iterating the full operator would differentiate the coefficient $f$ as well, producing extra terms. Those extra terms are exactly the ones we will track separately below.
---
# 1. The exact Taylor expansion of $y(t+h)$ through $O(h^4)$
Since $f\in C^4$, the solution $y(\cdot)$ is five times continuously differentiable, and Taylor's theorem with Lagrange remainder gives
$
y(t+h)=y+h\,y'+\frac{h^2}{2}\,y''+\frac{h^3}{6}\,y'''+\frac{h^4}{24}\,y^{(4)}+\frac{h^5}{120}\,y^{(5)}(\xi),
\qquad \xi\in(t,t+h).
$
We must express $y',y'',y''',y^{(4)}$ in terms of partial derivatives of $f$ at $(t,y)$, by repeated total differentiation of $y'=f(t,y(t))$.
## 1.1 First derivative
By the differential equation itself,
$
y'=f.
$
## 1.2 Second derivative
Differentiate $y'(t)=f(t,y(t))$ once in $t$ using the chain rule:
$
y''=\frac{d}{dt}f(t,y(t))=f_t+f_y\,y'=f_t+f_y f=F.
$
## 1.3 Third derivative
Differentiate $y''=f_t+f_y f$ term by term, applying $\frac{d}{dt}g=g_t+g_y f$ to each factor.
First term:
$
\frac{d}{dt}f_t=(f_t)_t+(f_t)_y\,f=f_{tt}+f_{ty}f.
$
Second term, by the product rule:
$
\frac{d}{dt}\bigl(f_y f\bigr)
=\Bigl(\frac{d}{dt}f_y\Bigr)f+f_y\Bigl(\frac{d}{dt}f\Bigr)
=\bigl(f_{ty}+f_{yy}f\bigr)f+f_y\bigl(f_t+f_y f\bigr).
$
Expanding the products:
$
\frac{d}{dt}\bigl(f_y f\bigr)=f\,f_{ty}+f^2 f_{yy}+f_y f_t+f\,f_y^2.
$
Adding the two pieces and collecting:
$
y'''=f_{tt}+2f\,f_{ty}+f^2 f_{yy}+f_y f_t+f\,f_y^2.
$
In the grouped notation, since $G=f_{tt}+2ff_{ty}+f^2f_{yy}$ and $f_yF=f_yf_t+ff_y^2$,
$
y'''=G+f_y F.
$
## 1.4 Fourth derivative
Differentiate each of the five monomials in $y'''=f_{tt}+2f\,f_{ty}+f^2 f_{yy}+f_y f_t+f\,f_y^2$ separately. Throughout, $\frac{d}{dt}$ applied to any partial derivative $X$ of $f$ gives $X_t + X_y f$.
**(i)** $\dfrac{d}{dt}f_{tt}=f_{ttt}+f_{tty}f.$
**(ii)** Product rule on $2f\,f_{ty}$:
$
\frac{d}{dt}\bigl(2f\,f_{ty}\bigr)
=2\bigl(f_t+f_yf\bigr)f_{ty}+2f\bigl(f_{tty}+f_{tyy}f\bigr)
=2f_t f_{ty}+2f\,f_y f_{ty}+2f\,f_{tty}+2f^2 f_{tyy}.
$
**(iii)** Product rule on $f^2 f_{yy}$, using $\frac{d}{dt}f^2 = 2f(f_t+f_yf)$:
$
\frac{d}{dt}\bigl(f^2 f_{yy}\bigr)
=2f\bigl(f_t+f_y f\bigr)f_{yy}+f^2\bigl(f_{tyy}+f_{yyy}f\bigr)
=2f\,f_t f_{yy}+2f^2 f_y f_{yy}+f^2 f_{tyy}+f^3 f_{yyy}.
$
**(iv)** Product rule on $f_y f_t$:
$
\frac{d}{dt}\bigl(f_y f_t\bigr)
=\bigl(f_{ty}+f_{yy}f\bigr)f_t+f_y\bigl(f_{tt}+f_{ty}f\bigr)
=f_t f_{ty}+f\,f_t f_{yy}+f_y f_{tt}+f\,f_y f_{ty}.
$
**(v)** Product rule on $f\,f_y^2$, using $\frac{d}{dt}f_y^2=2f_y(f_{ty}+f_{yy}f)$:
$
\frac{d}{dt}\bigl(f\,f_y^2\bigr)
=\bigl(f_t+f_yf\bigr)f_y^2+f\cdot 2f_y\bigl(f_{ty}+f_{yy}f\bigr)
=f_y^2 f_t+f\,f_y^3+2f\,f_y f_{ty}+2f^2 f_y f_{yy}.
$
Now sum (i)–(v) and collect like monomials. Listing every raw term:
$
\begin{array}{lll}
\text{from (i):} & f_{ttt}, & f\,f_{tty}\\[2pt]
\text{from (ii):} & 2f_t f_{ty},\quad 2f\,f_y f_{ty}, & 2f\,f_{tty},\quad 2f^2 f_{tyy}\\[2pt]
\text{from (iii):} & 2f\,f_t f_{yy},\quad 2f^2 f_y f_{yy}, & f^2 f_{tyy},\quad f^3 f_{yyy}\\[2pt]
\text{from (iv):} & f_t f_{ty},\quad f\,f_t f_{yy}, & f_y f_{tt},\quad f\,f_y f_{ty}\\[2pt]
\text{from (v):} & f_y^2 f_t,\quad f\,f_y^3, & 2f\,f_y f_{ty},\quad 2f^2 f_y f_{yy}
\end{array}
$
Collecting coefficients monomial by monomial:
$
\begin{aligned}
y^{(4)}
={}& f_{ttt}
+3f\,f_{tty}
+3f^2 f_{tyy}
+f^3 f_{yyy} && (1+2,\;2+1 \text{ from (i)–(iii)})\\
&+f_y f_{tt}
+5f\,f_y f_{ty}
+4f^2 f_y f_{yy} && (2+1+2 \text{ and } 2+2 \text{ from (ii),(iv),(v)})\\
&+3f_t f_{ty}
+3f\,f_t f_{yy} && (2+1 \text{ from (ii),(iii),(iv)})\\
&+f_y^2 f_t
+f\,f_y^3. && (\text{from (v)})
\end{aligned}
$
This is eleven distinct monomials. We now verify the grouped form. Compute each group:
$
f_y G=f_y f_{tt}+2f\,f_y f_{ty}+f^2 f_y f_{yy},
$
$
3FP=3\bigl(f_t+f f_y\bigr)\bigl(f_{ty}+f f_{yy}\bigr)
=3f_t f_{ty}+3f\,f_t f_{yy}+3f\,f_y f_{ty}+3f^2 f_y f_{yy},
$
$
f_y^2 F=f_y^2 f_t+f\,f_y^3.
$
Adding $H+f_yG+3FP+f_y^2F$ and collecting: the $f\,f_yf_{ty}$ coefficient is $2+3=5$; the $f^2f_yf_{yy}$ coefficient is $1+3=4$; every other monomial appears in exactly one group with the coefficient listed above. The totals agree monomial-for-monomial with the sum (i)–(v), so
$
\boxed{\,y^{(4)}=H+f_y G+3FP+f_y^2 F\,}
$
## 1.5 The exact expansion
Substituting $y'=f$, $y''=F$, $y'''=G+f_yF$, $y^{(4)}=H+f_yG+3FP+f_y^2F$ into the Taylor polynomial:
$
y(t+h)=y+hf+\frac{h^2}{2}F+\frac{h^3}{6}\bigl(G+f_yF\bigr)
+\frac{h^4}{24}\bigl(H+f_yG+3FP+f_y^2F\bigr)+O(h^5).
$
**What has been established.** The exact solution admits the expansion above, with every coefficient computed by explicit chain- and product-rule differentiation; the $O(h^5)$ remainder is uniform on compact sets by continuity of the fifth derivative (equivalently, of the fourth partials of $f$). The eleven fourth-order monomials and their multiplicities $1,3,3,1,1,5,4,3,3,1,1$ have been derived, not quoted.
---
# 2. The elementary differentials through order four
By an *elementary differential of order $q$* we mean one of the specific polynomial expressions in $f$ and its partials that can appear in $y^{(q)}$; these are the building blocks against which both expansions will be matched. From §1:
**Order 1** (1 term):
$
f.
$
**Order 2** (2 monomials, one group):
$
f_t,\qquad f\,f_y
\qquad\text{grouped as } F=f_t+f f_y.
$
**Order 3** (5 monomials, two groups):
$
f_{tt},\quad f\,f_{ty},\quad f^2 f_{yy}
\qquad\text{grouped as } G,
$
$
f_y f_t,\quad f\,f_y^2
\qquad\text{grouped as } f_y F.
$
**Order 4** (11 monomials, four groups):
$
\begin{array}{ll}
\text{group } H: & f_{ttt},\quad f\,f_{tty},\quad f^2 f_{tyy},\quad f^3 f_{yyy}\\[3pt]
\text{group } f_yG: & f_y f_{tt},\quad f\,f_y f_{ty},\quad f^2 f_y f_{yy}\\[3pt]
\text{group } FP: & f_t f_{ty},\quad f\,f_t f_{yy},\quad f\,f_y f_{ty},\quad f^2 f_y f_{yy}\\[3pt]
\text{group } f_y^2F: & f_y^2 f_t,\quad f\,f_y^3
\end{array}
$
Two cautions, both of which matter later and justify the instruction not to combine terms prematurely.
*First*, the groups overlap at the monomial level: $f\,f_yf_{ty}$ occurs in both $f_yG$ (with weight $2$) and $FP$ (with weight $1$), and $f^2f_yf_{yy}$ occurs in both $f_yG$ (weight $1$) and $FP$ (weight $1$). So "matching coefficients of $f_yG$ and of $FP
quot; is meaningful only if we can first show the four groups are independent — which we do by exhibiting *marker monomials*: $f_{ttt}$ occurs only in $H$; $f_yf_{tt}$ only in $f_yG$; $f_tf_{ty}$ only in $FP$; $f\,f_y^3$ only in $f_y^2F$. Matching will therefore proceed at the monomial level, with the markers pinning the group coefficients and the shared monomials serving as consistency checks (§7).
*Second*, the groups — not the monomials — are the natural objects, because (as we will see) every stage expansion produces the partials of $f$ only in the combinations $F,P,G,H$ once the internal-consistency relations hold. The four order-4 groups are exactly the four elementary differentials of rooted-tree theory specialized to the scalar nonautonomous case, but we make no use of that fact until the postscript.
**What has been established.** A finite list of $1+2+5+11=19$ monomials spans everything that can appear through $h^4$ in either expansion, organized into $1+1+2+4=8$ groups whose independence is certified by marker monomials.
---
# 3. The stage expansions: general principles, $k_1$, $k_2$, and the origin of the consistency relations
## 3.1 The ansatz and the accuracy budget
The general explicit four-stage method is
$
\begin{aligned}
k_1 &= f(t,y),\\
k_2 &= f\bigl(t+c_2h,\;y+h\,a_{21}k_1\bigr),\\
k_3 &= f\bigl(t+c_3h,\;y+h(a_{31}k_1+a_{32}k_2)\bigr),\\
k_4 &= f\bigl(t+c_4h,\;y+h(a_{41}k_1+a_{42}k_2+a_{43}k_3)\bigr),
\end{aligned}
\qquad
y_{n+1}=y+h\bigl(b_1k_1+b_2k_2+b_3k_3+b_4k_4\bigr).
$
**Why each stage needs only $O(h^3)$ accuracy.** Every $k_i$ enters $y_{n+1}$ multiplied by $hb_i$. Our target is to match the exact expansion through $h^4$, i.e. to make the one-step (local truncation) error $O(h^5)$. If $k_i$ is known with an error of size $O(h^4)$, that error contributes $hb_i\cdot O(h^4)=O(h^5)$ to $y_{n+1}$ — invisible at the order we are matching. Hence it suffices to expand each stage exactly through the $h^3$ terms and carry a single symbol $O(h^4)$ for the rest. (Conversely, an error of size $O(h^3)$ in a stage would contaminate the $h^4$ terms of $y_{n+1}$, so nothing coarser suffices.)
**The tool: two-variable Taylor expansion.** For offsets $\delta$ and $\Delta$ with $\delta=O(h)$, $\Delta=O(h)$, Taylor's theorem in two variables for $f\in C^4$ gives
$
\begin{aligned}
f(t+\delta,\,y+\Delta)
={}&f+\delta f_t+\Delta f_y\\
&+\tfrac12\bigl(\delta^2 f_{tt}+2\delta\Delta\,f_{ty}+\Delta^2 f_{yy}\bigr)\\
&+\tfrac16\bigl(\delta^3 f_{ttt}+3\delta^2\Delta\,f_{tty}+3\delta\Delta^2 f_{tyy}+\Delta^3 f_{yyy}\bigr)
+R_4,
\end{aligned}
$
where the remainder $R_4$ collects the fourth-order terms with partials evaluated at an intermediate point; since $f\in C^4$ these are bounded, so $R_4=O\bigl((|\delta|+|\Delta|)^4\bigr)=O(h^4)$. All partials on the right are at the base point $(t,y)$. Every stage expansion below is an instance of this formula with $\delta=c_ih$ and $\Delta=$ the $y$-increment of that stage.
## 3.2 Stage one
There is nothing to expand:
$
k_1=f.
$
## 3.3 Stage two
Here $\delta=c_2h$ and $\Delta=h\,a_{21}k_1=h\,a_{21}f$. Substitute into the two-variable formula, term by term:
- Linear terms: $\;\delta f_t+\Delta f_y=h\bigl(c_2f_t+a_{21}f\,f_y\bigr)$.
- Quadratic terms: $\;\tfrac12\bigl(c_2^2h^2f_{tt}+2c_2h\cdot a_{21}hf\cdot f_{ty}+a_{21}^2h^2f^2f_{yy}\bigr)=\tfrac{h^2}{2}\bigl(c_2^2f_{tt}+2c_2a_{21}f\,f_{ty}+a_{21}^2f^2f_{yy}\bigr)$.
- Cubic terms: $\;\tfrac{h^3}{6}\bigl(c_2^3f_{ttt}+3c_2^2a_{21}f\,f_{tty}+3c_2a_{21}^2f^2f_{tyy}+a_{21}^3f^3f_{yyy}\bigr)$.
So, exactly,
$
k_2=f+h\bigl(c_2f_t+a_{21}f f_y\bigr)
+\frac{h^2}{2}\bigl(c_2^2f_{tt}+2c_2a_{21}f f_{ty}+a_{21}^2f^2f_{yy}\bigr)
+\frac{h^3}{6}\bigl(c_2^3f_{ttt}+3c_2^2a_{21}f f_{tty}+3c_2a_{21}^2f^2f_{tyy}+a_{21}^3f^3f_{yyy}\bigr)+O(h^4).
$
## 3.4 Where the internal-consistency relations come from
Notice what the $h^1$ term of $k_2$ looks like: $c_2f_t+a_{21}f f_y$. The exact solution's second derivative is $F=f_t+ff_y$ — the two monomials $f_t$ and $ff_y$ occur there *with equal weight*. In the Runge–Kutta expansion, however, the time offset $c_2h$ feeds the $t$-partials and the state offset $h a_{21}f$ feeds the $y$-partials, and these are controlled by *different* free parameters. The same decoupling recurs at every order: $c_i$ powers multiply the $t$-heavy monomials and row sums of $A$ multiply the $y$-heavy ones.
Consequence: if we match coefficients monomial-by-monomial with $c_2\neq a_{21}$ left independent, then already at order $h^2$ of $y_{n+1}$ we get *two* conditions,
$
\sum_i b_ic_i=\tfrac12
\quad(\text{from } f_t),
\qquad
\sum_i b_i\Bigl(\textstyle\sum_j a_{ij}\Bigr)=\tfrac12
\quad(\text{from } f f_y),
$
and at order $h^3$ the group $G$ splits into *three* conditions (from $f_{tt}$, $f f_{ty}$, $f^2f_{yy}$ respectively):
$
\sum_i b_ic_i^2=\tfrac13,\qquad
\sum_i b_ic_i\Bigl(\textstyle\sum_j a_{ij}\Bigr)=\tfrac13,\qquad
\sum_i b_i\Bigl(\textstyle\sum_j a_{ij}\Bigr)^2=\tfrac13,
$
and so on with worsening multiplicity at order four. All of these collapse pairwise (and triple-wise) into single conditions precisely when
$
c_i=\sum_j a_{ij}
\qquad\Longleftrightarrow\qquad
c_2=a_{21},\quad c_3=a_{31}+a_{32},\quad c_4=a_{41}+a_{42}+a_{43},
$
because then every mixed power $c_i^{p}\bigl(\sum_ja_{ij}\bigr)^{q}$ equals $c_i^{p+q}$.
The relations have an equivalent geometric reading. The $i$-th stage evaluates $f$ at the point $\bigl(t+c_ih,\;Y_i\bigr)$ with $Y_i=y+h\sum_ja_{ij}k_j$. Since every $k_j=f+O(h)$,
$
Y_i=y+h\Bigl(\sum_j a_{ij}\Bigr)f+O(h^2),
\qquad\text{while}\qquad
y(t+c_ih)=y+c_ih\,f+O(h^2).
$
So the sample point $(t+c_ih,Y_i)$ lies within $O(h^2)$ of the exact solution graph — i.e. the stage samples the slope field *where the solution actually is*, to leading order — if and only if $\sum_ja_{ij}=c_i$. Without the relation, each stage samples the slope field at a point displaced $O(h)$ horizontally relative to its vertical position on the graph, and the $t$- and $y$-expansions must then be matched separately, which is exactly the proliferation of conditions seen above.
(One can also phrase this via the augmented autonomous system obtained by adjoining $t'=1$: applying the same tableau to the augmented system advances the $t$-component of stage $i$ by $h\sum_ja_{ij}\cdot 1$, while the nonautonomous format above uses $c_ih$; the two formats define the same method for all $f$ iff $c_i=\sum_ja_{ij}$. This is a repackaging of the previous paragraph, not an extra assumption: the augmented expansion is the same two-variable expansion with $t$ treated as a solution component.)
We henceforth impose the consistency relations. We do not lose the classical method by doing so — its tableau satisfies them — and every subsequent expansion simplifies decisively. It must be conceded that this is a (standard, and universally adopted) *structural choice*: methods violating $c_i=\sum_ja_{ij}$ are not thereby excluded from attaining order four for the autonomous problem, but for the nonautonomous problem they would have to satisfy the larger split system, of which the collapsed system below is the tidy special case.
## 3.5 Stage two, simplified
With $a_{21}=c_2$, the expansion of §3.3 becomes, term by term:
- $h$: $\;c_2f_t+c_2ff_y=c_2\bigl(f_t+ff_y\bigr)=c_2F$.
- $h^2$: $\;\tfrac12\bigl(c_2^2f_{tt}+2c_2^2ff_{ty}+c_2^2f^2f_{yy}\bigr)=\tfrac{c_2^2}{2}\bigl(f_{tt}+2ff_{ty}+f^2f_{yy}\bigr)=\tfrac{c_2^2}{2}G$.
- $h^3$: $\;\tfrac{c_2^3}{6}\bigl(f_{ttt}+3ff_{tty}+3f^2f_{tyy}+f^3f_{yyy}\bigr)=\tfrac{c_2^3}{6}H$.
$
\boxed{\;k_2=f+c_2h\,F+\frac{c_2^2h^2}{2}\,G+\frac{c_2^3h^3}{6}\,H+O(h^4).\;}
$
Observe what is *absent*: $k_2$ contains no $f_yF$, no $f_yG$, no $FP$, no $f_y^2F$ terms. Those groups all involve $f_y$ acting on a *lower-order elementary differential*, and they can only arise when a stage increment itself contains $h^2$ or $h^3$ corrections built from earlier stages — that is, from *nesting*. $k_2