Let $B(x)$ be infinitely differentiable with respect to $x$.
Drop the use of parentheses on $B$ to delimit the argument $x$
and use them instead to hold the order of the derivative with respect to $x$.
i.e. $B(0) = B$,
$B(1) = dB/dx$, etc.


Let parentheses on $x$ hold the order of the derivative of $x$ with respect to $t$.


So
\begin{align\*}
x\_1 & {}= B(x) = B \\
x\_2 & {}= BB\_1 \\
x\_3 & {}= BB\_1^2 + B^2 B\_2.
\end{align\*}


Is there a "nice" formula for the integer coefficient of an arbitrary monomial
$B(0)^u(0) \cdot B(1)^u(1) \cdot\dotsb\cdot B(n-1)^u(n-1)$ in $x(n)$?


The first few terms are:
\begin{align\*}
x(1) & {}= B, \\
x(2) & {}= B\cdot B(1), \\
x(3) & {}= B\cdot B(1)^2 + B^2\cdot B(2), \\
x(4) & {}= B\cdot B(1)^3 + 4\cdot B^2\cdot B(1)\cdot B(2) + B^3\cdot B(3).
\end{align\*}


One of my (many) approaches involved defining $A = 1/B$ so that
$A(x)dx/dt = 1$. Then integrating and solving with the Lagrange Inversion Formula yields


$x(n)$ = sum over all sequences $S=(s(2),s(3),\dotsc)$ of nonnegative integers such that
$\sum (i-1)\cdot s(i)$ equals $n-1$ of
$$(-1)^{T(S)} \cdot (T(S)+n-1)!A^{(-n-T(S))}\cdot \prod\_{i=2}^n \frac1{s(i)!}\left(\frac1{i!}\cdot\frac{d^{(i-1)}A}{dx^{(i-1)}}\right)^{s(i)} $$
where $T(S) = \sum\_{i=2}^n i\cdot s(i)$.


I know I can simply make the upper limits in these products be infinity, because all but finitely many of the terms in the products are 1, because all but finitely many of the
$s(i)$ in any sequence $S$ are zero.


But, for future computational purposes, I want to drag around the finite limits to remind myself when it comes time to implement on a computer.


So then I tried substituting the Faa da Bruno formula for
$$
A(n) = d^A/dx^n = \text{sum of $(-1)^k\cdot k!\cdot B^{-1-k}\cdot\sum\_{V=(v(1),v(2),\dotsc)}\prod \left(\frac{B(i)}{i!}\right)^{v(i)}\frac1{v(i)!}$}
$$
into the equation above and expanding and collecting all similar monomials in the $B$s.


But, I cannot visualize a simple formula for the way all the terms combine.




---


So now I tried computing the terms of this sequence directly.


Homogeneity immediately tells you that any monomial product $B(i)^u(i)$ from $i = 0$ to $n-1$
appearing with nonzero coefficient in $x(n)$ satisfies $u(0) = 1 + \sum\_{i = 2}^{n - 1} (i-1)\cdot u(i)$ and $u(1) = n-1 - \sum\_{i = 2}^n i\cdot u(i)$.
I solved for $u(0)$ and $u(1)$ in terms of the "slack" (?) variables $u(2), \dotsc, u(n-1)$
because the terms whose coefficients I CAN compute are most easily expressed in this form.


So, all I've got so far is
\begin{align\*}
x(n) ={} & B\cdot B(1)^{n-1} + (2^{n-1} - n)\cdot B^2\cdot (B(1))^{n-3}\cdot B(2) +{} \\
& {}(1/4)(3^n - 3 - 2^{n+1}\cdot(n-1) + 2(n-1)^2)\cdot B^3\cdot(B(1))^{n-5}\cdot(B(2))^2 \\
& {}+ (1/4)\cdot(3^{n-1} - 2^{n+1} + 2\cdot n+1)\cdot B^3\cdot (B(1))^{n-4}\cdot B(3) \\
& {}+ \cdots? +{} \\
& {}+ \left(\frac{n^2-3\cdot n+4}2\right)\cdot B^{n-2}\cdot B(1)\cdot B(n-2) + B^{n-1}\cdot B(n-1).
\end{align\*}
I could keep going, deriving longer and longer formulae for more of the terms,
and then HOPE that I can guess the general pattern for all of them.


$B(i)^{u(i)}$ means $B(i)$ raised to the $u(i)$-th power.



Formula for n-th iteration of dx/dt=B(x)
These expansions can be described in terms of [rooted trees](https://en.wikipedia.org/wiki/Tree_(graph_theory)). The first few coefficients are easy to derive by hand, but rooted trees provide you a way of generating the coefficients to arbitrary order, see [here](http://en.wikipedia.org/wiki/Butcher_group). You start with the trivial tree, and at each stage of the derivation you add another level to the tree according to specific rules. The coefficients that occur in the tree have various number-theoretic properties.


This is a very interesting part of combinatorics, with applications in numerical analysis and quantum field theory (the only two fields that I understand). As for numerical analysis, the design of RK methods of arbitrary order didn't go anywhere precisely because of the calculatory issues that you experienced. It was actually a pretty big achievement by John Butcher in the 1960s that he was able to describe these prolongations of ODEs in a compact way, and hence provide a description of RK methods of arbitrary order.


