# A general formula for the $n$-th derivative of a parametrically defined function

Letting

\begin{align*}x&=f(t)\\y&=g(t)\end{align*}

the following expressions are well known:

\begin{align*}\frac{\mathrm dy}{\mathrm dx}&=\frac{g^\prime (t)}{f^\prime (t)}\\\frac{\mathrm d^2 y}{\mathrm dx^2}&=\frac{f^\prime (t)g^{\prime\prime} (t)-g^\prime (t)f^{\prime\prime} (t)}{f^\prime (t)^3}\end{align*}

With some effort, we can derive the expression for the third derivative:

$$\frac{\mathrm d^3 y}{\mathrm dx^3}=\frac{f'(t) \left(g^{(3)}(t) f'(t)-3 f''(t) g''(t)\right)+g'(t) \left(3 f''(t)^2-f^{(3)}(t)f'(t)\right)}{f'(t)^5}$$

After deriving expressions for the next higher derivatives, I am unable to detect any particular pattern in the expressions, save for the denominator $f'(t)^{2n-1}$ of the $n$-th derivative. I've also tried to search around for information on the derivatives of parametrically-defined functions, but no dice.

Here then is my question: is there a general formula for $\dfrac{\mathrm d^n y}{\mathrm dx^n}$ in terms of $f(t),g(t)$ and their derivatives?

-
If $\;\mathrm{d}^ny/\mathrm{d}x^n=h_n(t)f\,'(t)^{1-2n}$ then $h_1=g'$ and $h_{n+1}=h'_nf\,'-(2n-1)h_nf\;''$. I got that much. –  anon Oct 1 '11 at 11:47
My instinct says that an elementary formula is unlikely since the $n$-th derivative will be a linear combination of a product of $(n-1)$ derivatives of $f$ (of various degrees) and a derivative of $g$ (of some degree). This means we have a $n$-dimensional array of coefficients for $\dfrac{\mathrm{d}^n y}{\mathrm{d} x^n}$... –  Zhen Lin Oct 1 '11 at 11:54
I guess you could 'factorize' it as $$\frac{d^ny}{dx^n}=\frac{1}{(f')^{2n+1}}\left[\prod_{k=1}^n\left(f'\frac{d}{dt}‌​-(2k-1)f''\right)\right]g'.$$ Edit: It seems I can't make the $d$'s above into \mathrm style in comments, but I can in the answer preview. –  anon Oct 1 '11 at 11:57
@Zhen: I know (and I did have the foresight not to say the word "elementary" in the question body); I'm down with an expression involving Bell polynomials or somesuch. ;) –  Guess who it is. Oct 1 '11 at 11:58
Well, actually, perhaps something might be possible if we use the Faà di Bruno formula. After all, in order to divide by $f'(t)$, $f'(t) \ne 0$, and so $f$ is locally invertible by the inverse function theorem. Then we can express $y$ as a function of $x$ (locally) by a composite of $g$ and $f^{-1}$... –  Zhen Lin Oct 1 '11 at 12:01

Three formulas for the $n$th derivative of a parametrically-defined function appear in Section 3 of Todorov's paper "New Explicit Formulas for the $n$th Derivative of Composite Functions," Pacific Journal of Mathematics 92 (1): 1981, pp. 217-236. Despite the English title, the paper is in German. None of the three formulas look like they would be particularly easy to use, but that's probably to be expected given the discussion in my original answer.

The first formula, apparently due to Pourchet, is $$\frac{d^n y}{dx^n} = \sum_{k=1}^n B_{nk}(t) g^{(k)}(t),$$ where the functional coefficients $B_{nk}$ satisfy the recurrence relation $$B_{n+1,k} = \frac{1}{f'} \left( B'_{nk} + B_{n,k-1} \right),$$ for $1 \leq k \leq n+1$ and $n \geq 1$. The boundary values are $B_{n0} = B_{n,n+1} = 0$, $B_{11} = 1/f'$.

The next two formulas are explicit and are due to Todorov, but they involve determinants. First we have $$\frac{d^n y}{dx^n} = \frac{1}{(f')^{n(n+1)/2}} \begin{vmatrix} \dfrac{d}{dt} \dfrac{f}{1!} & \dfrac{d}{dt} \dfrac{f^2}{2!} & \cdots & \dfrac{d}{dt} \dfrac{f^{n-1}}{(n-1)!} & \dfrac{dg}{dt} \\ \dfrac{d^2}{dt^2} \dfrac{f}{1!} & \dfrac{d^2}{dt^2} \dfrac{f^2}{2!} & \cdots & \dfrac{d^2}{dt^2} \dfrac{f^{n-1}}{(n-1)!} & \dfrac{d^2g}{dt^2} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ \dfrac{d^n}{dt^n} \dfrac{f}{1!} & \dfrac{d^n}{dt^n} \dfrac{f^2}{2!} & \cdots & \dfrac{d^n}{dt^n} \dfrac{f^{n-1}}{(n-1)!} & \dfrac{d^ng}{dt^n} \end{vmatrix},$$ which at least has nice symmetry.

The second general formula given by Todorov is $$\frac{d^n y}{dx^n} = \frac{1}{(f')^{2n-1}} \begin{vmatrix} a_{11}(n) \dfrac{f'}{1!} & 0 & \cdots & 0 & \dfrac{g'}{0!} \\ a_{21}(n) \dfrac{f''}{2!} & a_{22}(n) \dfrac{f'}{1!} & \cdots & 0 & \dfrac{g''}{1!} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ a_{n-1,1}(n) \dfrac{f^{(n-1)}}{(n-1)!} & a_{n-1,2}(n) \dfrac{f^{(n-2)}}{(n-2)!} & \cdots & a_{n-1,n-1}(n) \dfrac{f'}{1!} & \dfrac{g^{(n-1)}}{(n-2)!} \\ a_{n1}(n) \dfrac{f^{(n)}}{n!} & a_{n2}(n) \dfrac{f^{(n-1)}}{(n-1)!} & \cdots & a_{n,n-1}(n) \dfrac{f''}{2!} & \dfrac{g^{(n)}}{(n-1)!} \end{vmatrix},$$ where $a_{jk}(n) = (j-k+1)n - j$, for $1 \leq k \leq \min\{j,n-1\}$ and $1 \leq j \leq n$.

Todorov has some other formulas involving special cases of $f$, as well as results on the $n$th derivative of composite functions (as the title of the paper indicates).

In general, the operation on the right-hand side of $$\frac{d^n y}{dx^n} = \left(\frac{1}{f'} \frac{d}{dt}\right)^n g(t)$$ (which I have in my original answer) is called a Lie derivative. That appears to be the magic word here. (My running across this term in another setting is what led me to Todorov's paper.)

There are two special cases of this formula, given in Comtet's Advanced Combinatorics (p. 220), that are particularly interesting. If $f(t) = \log t$, then $1/f'(t) = t$, and $$\frac{d^n y}{dx^n} = \left(t \frac{d}{dt}\right)^n g(t) = \sum_{k=1}^n \left\{ n \atop k \right\} t^k g^{(k)}(t).$$ If $f(t) = \dfrac{e^{-at}}{-a}$, then $1/f'(t) = e^{at}$, and $$\frac{d^n y}{dx^n} = \left(e^{at} \frac{d}{dt}\right)^n g(t) = \sum_{k=1}^n \left[ n \atop k \right] a^{n-k} g^{(k)}(t).$$

In general, thanks to the chain rule, we have $$\frac{d^n y}{dx^n} = \left(\frac{1}{f'(t)} \frac{d}{dt}\right)^n g(t).$$ So a large part of the difficulty in finding a nice expression for $\frac{d^n y}{dx^n}$ lies in the form of $f'(t)$. The uglier $f'(t)$ is, the uglier this expression will be.

Looking at a simple case for $f'(t)$ should shed some light on the general case. Letting $f'(t) = 1$ is too simple, but the case $f'(t) = t$ (so, say, $f(t) = t^2/2$) gives some insight. See the end of the post for comments about what this case means for the general case.

If $f'(t) = t$ we have $$\frac{d^n y}{dx^n} = \frac{(-1)^{n-1}\phi_{n-1} (-t D(g'))}{t^{2n-1}} ,$$ where $D$ is the differentation operator (so $D^k(g') = g^{(k+1)}(t)$) and $\phi_n$ is the $n$th reverse Bessel polynomial.

The $n$th reverse Bessel polynomial is defined to be $$\phi_n(t) = \sum_{k=0}^n \frac{(2n-k)! t^k}{(n-k)! k! 2^{n-k}}.$$

For example, for some small values of $n$ we have \begin{align*} \frac{dy}{dx} &= \frac{g'(t)}{t} = \frac{\phi_0 (-t D(g'))}{t}, \\ \frac{d^2y}{dx^2} &= \frac{g''(t)t - g'(t)}{t^3} = -\frac{ \phi_1 (-t D(g'))}{t^3}, \\ \frac{d^3y}{dx^3} &= \frac{g'''(t)t^2 - 3g''(t)t + 3g'(t)}{t^5} = \frac{\phi_2 (-t D(g')}{t^5}, \\ \end{align*} which agrees with what J.M. has above. (Note that $D^0(g') = g'(t).)$ From here we do a proof by induction.

We will need $\frac{d\phi_{n-1} (-t D(g'))}{dt}$, so let's calculate that first. Once we get through the differentiation we'll substitute $z$ for $-t D(g')$, for simplicity's sake. \begin{align*} \frac{d\phi_{n-1} (-t D(g'))}{dt} &= -\sum_{k=1}^{n-1} \frac{(2n-2-k)! k (-t)^{k-1} D^k (g')}{(n-1-k)! k! 2^{n-1-k}} + \sum_{k=0}^{n-1} \frac{(2n-2-k)! (-t)^k D^{k+1} (g')}{(n-1-k)! k! 2^{n-1-k}} \\ &= \frac{1}{t} \left(\sum_{k=1}^{n-1} \frac{(2n-2-k)! z^k}{(n-1-k)! (k-1)! 2^{n-1-k}} - \sum_{k=0}^{n-1} \frac{(2n-2-k)! z^{k+1}}{(n-1-k)! k! 2^{n-1-k}}\right) \\ &= \frac{1}{t} \left(\sum_{k=0}^{n-2} \frac{(2n-3-k)! z^{k+1}}{(n-2-k)! k! 2^{n-2-k}} - \sum_{k=0}^{n-1} \frac{(2n-2-k)! z^{k+1}}{(n-1-k)! k! 2^{n-1-k}}\right) \\ &= \frac{1}{t} \left(- z^n + z \sum_{k=0}^{n-2} \frac{(2n-3-k)! z^k}{(n-1-k)! k! 2^{n-1-k}} \left(2(n-1-k) - (2n-2-k)\right) \right) \\ &= -\frac{1}{t} \left( z^n + z \sum_{k=0}^{n-2} \frac{(2n-3-k)! k z^k}{(n-1-k)! k! 2^{n-1-k}} \right) \\ &= -\frac{1}{t} \left( z^n + z^2 \sum_{k=0}^{n-3} \frac{(2n-4-k)! z^k}{(n-2-k)! k! 2^{n-2-k}} \right) \\ &= -\frac{z^2}{t} \phi_{n-2} (z). \end{align*} Then we have, with $z = -t D(g')$, \begin{align*} \frac{d^{n+1} y}{dx^{n+1}} &= (-1)^{n-1} t^{-1} \left((1-2n) t^{-2n} \phi_{n-1}(z) - t^{1-2n} t^{-1} z^2 \phi_{n-2} (z)\right)\\ &= (-1)^n t^{-1-2n} ((2n-1) \phi_{n-1}(z) + z^2 \phi_{n-2} (z)) \\ & = \frac{(-1)^n \phi_n (z)}{t^{2(n+1)-1}} , \end{align*} since the reverse Bessel polynomials satisfy the recurrence $\phi_n (z) = (2n-1)\phi_{n-1}(z) + z^2 \phi_{n-2}(z)$.

Since the Bessel polynomials show up even in this simple case, it appears that the general case will have to include some generalization of the Bessel polynomials. In fact, for general $f'(t)$ the argument above goes through to show that the coefficients of the terms in the numerator of $\frac{d^n y}{dx^n}$ containing only powers of $f'(t)$ and $f''(t)$ and derivatives of $g(t)$ are the those of the reverse Bessel polynomials. What's remains, then, is to characterize the terms containing third and higher-order derivatives of $f$.

-
Ooh, nice additions! Unfortunately, it might be a while before I can get back to doing mathematical stuff, so I can't try the formulae out. Still, that determinant looks pretty neat... –  Guess who it is. Jan 16 '13 at 17:35
This is an awesome answer. –  copper.hat May 14 at 5:21

I am not sure if what follows is useful for symbolic manipulations, but it is definitely useful for numerical evaluation of these derivatives.

First, let me state the "closed form" expression for $n^\text{th}$ derivative of $f^{-1}(x)$. Naturally, it is found by fiddling with $f(f^{-1}(x))=x$. Since the above is a composition, it is natural to expect appearance of Bell polynomials (see ref. by Paolo Ricci).

The derivation has been done by a trial and error:

$$\frac{\mathrm{d}^n}{\mathrm{d} x^n} f^{-1}(x) = Y\left(\begin{array}{cc} \frac{(n)_1}{ f^{-1}(x)} & -\frac{ f^{(2)}( f^{-1}(x)) }{ 2 \left(f^{-1}(x)\right)^2 } \\ \frac{(n)_2}{ f^{-1}(x)} & -\frac{ f^{(3)}( f^{-1}(x)) }{ 3 \left(f^{-1}(x)\right)^3 } \\ \vdots & \vdots \\ \frac{(n)_{n-1}}{ f^{-1}(x)} & -\frac{ f^{(n)}( f^{-1}(x)) }{ n \left(f^{-1}(x)\right)^n } \end{array} \right) \qquad \qquad \text{for} \quad n \ge 2$$

Or in Mathematica:

In[136]:= Table[
With[{z = InverseFunction[f][x]},
BellY[Table[{Pochhammer[n, j]/
Derivative[1][f][
z], -Derivative[j + 1][f][
z]/((j + 1) Derivative[1][f][z]^(j + 1))}, {j, n - 1}]] -
D[z, {x, n}] // Simplify], {n, 2, 6}]

Out[136]= {0, 0, 0, 0, 0}


Now, to answer your question, we write $y = g(f^{-1}(x))$, and apply another Bell polynomial for derivative of a composition:

In[137]:=
With[{p = 4, z = InverseFunction[f][x]},
Sum[Derivative[m][g][z] BellY[p, m,
Table[If[k == 1, 1/Derivative[1][f][z],
BellY[Table[{Pochhammer[k, j]/
Derivative[1][f][
z], -Derivative[j + 1][f][
z]/((j + 1) Derivative[1][f][z]^(j + 1))}, {j,
k - 1}]]], {k, p}]], {m, 1, p}] - (D[
g[z], {x, p}])] // Expand

Out[137]= 0

-
Looks neat, but I was sorta kinda hoping for something entirely in terms of $f^{(k)}(x)$ and $g^{(k)}(x)$... –  Guess who it is. Oct 4 '11 at 14:59
You can replace Bell's $Y$-polynomial with it's sum representation, using: With[{n = 5}, Sum[n! y[Total[m]] Apply[Times, (Array[x, n]/Range[n]!)^m 1/m!], {m, FrobeniusSolve[Range[n], n]}] - BellY[Table[{y[k], x[k]}, {k, n}]]] –  Sasha Oct 4 '11 at 15:19
Oh, I did have an inkling that Bell will be needed here; what I was considering was some expression with Bell polynomials and the derivatives of $f$ and $g$... –  Guess who it is. Oct 4 '11 at 15:24