# Computing $\frac{d^k}{dx^k}\left(f(x)^k\right)$ where $k$ is a positive integer

Does anyone know a formula for the derivative $$\frac{d^k}{dx^k}\left(f(x)^k\right)$$ where $k$ is some positive integer?

I started trying to work it out but it got messy.

-
Possibly a duplicate of: math.stackexchange.com/questions/140185/… – Argon Aug 1 '12 at 0:35

Apply Faà di Bruno's formula to get $$\frac{d^n}{dx^n}(g(x)^n)=\sum \frac{n!^2}{m_1!\dots m_n!(n-\sum_{j=1}^nm_j)!}g(x)^{n-\sum_{j=1}^nm_j}\prod_{j=1}^n\left(\frac{g^{(j)}(x)}{j!}\right)^{m_j},$$ where the sum is taken over the $n$-uples $(m_1,\dots,m_n)$ of integer satisfying $\sum_{k=1}^nkm_k=n$.

(I changed the notations to be conform with the link)

-
I think it will be easier to compute that derivative directly... – Norbert Jul 31 '12 at 22:53
@Norbert: which derivative do you mean? – Davide Giraudo Jul 31 '12 at 22:54
I mean $(f^k(x))^{(k)}$. You answer is correct, but in practice it seems to me useless – Norbert Jul 31 '12 at 22:58
Thank you, Davide. This is exactly the kind of answer I was looking for. It will be very useful. – student Jul 31 '12 at 23:03

As a probable illustration of Davide Giraudo's powerful answer (+1) you may get the following result :

$\begin{array} {r|cccccccc} k\\ \hline 1&1f'\\ 2&2f''f&2f'^2\\ 3&3f'''f^2&18f''ff'&6f'^3\\ 4&4f''''f^3&48f'''f^2f'&36f''^2f^2&144f'^2f''f&24f'^4\\ 5&5f'''''f^4&100f''''f^3f'&200f'''f^3f''&600 f'''f^2f'^2&900f^2f'f''^2&1200ff'^3f''&120f'^5\\ \end{array}$

This triangle appears as sequence OEIS A049009 titled "Number of functions from a set to itself such that the sizes of the pre-images of the individual elements in the range form the n-th partition in Abramowitz and Stegun order"

In fact this is a product of multinomials coefficients and 'number of multisets associated with least integer of each prime signature' (the second one shifted by $2$ I think). Perhaps that this will help a little to interpret Davide's general answer (I have not much hope for further simplification...)

Hoping it helped anyway,

-

As a reformulation of Davide's answer, the $k$-th derivative of $f(x)^k$ is most easily expressed using the partial Bell polynomials:

$$\frac{\mathrm d^k}{\mathrm dx^k}f(x)^k=\sum_{j=1}^k j!\binom{k}{j} f(x)^{k-j} \mathrm{B}_{k,j}(f^\prime(x),f^{\prime\prime}(x),\cdots,f^{(k-j+1)}(x))$$

This construction is most convenient if the computing environment you are using supports partial Bell polynomials (e.g. Mathematica).

-

After Raymond's explication of Davide's Faa di Bruno-formula I decomposed it in an even more memorizable form. Example k=4 $$\begin{eqnarray} {(f^4)^{(4)}\over 4! \cdot 4! } &=& {{ f^{(0)}\over 0!} { f^{(0)}\over 0!}{ f^{(0)}\over 0!} \over 3! }{{ f^{(4)}\over 4!} \over 1! } \\ \\ &+ & {{ f^{(0)}\over 0!} { f^{(0)}\over 0!} \over 2! }{{ f^{(1)}\over 1!} \over 1! } {{ f^{(3)}\over 3!} \over 1! } \\ \\ &+ & {{ f^{(0)}\over 0!} { f^{(0)}\over 0!} \over 2! }{{ f^{(2)}\over 2!}{ f^{(2)}\over 2!} \over 2! } &+ & {{ f^{(0)}\over 0!} \over 1! } {{ f^{(1)}\over 1!} { f^{(1)}\over 1!} \over 2! }{{ f^{(2)}\over 2!} \over 1! } \\ \\ &+ & {{ f^{(1)}\over 1!} { f^{(1)}\over 1!} { f^{(1)}\over 1!} { f^{(1)}\over 1!}\over 4! } \\ \\ \end{eqnarray}$$ The key for that decomposition is, that for some k we need k factors in each summand. Then the sum of all derivation-indices (with their multiplicity!) must also equal k. A j-fold multiplicity of a factor must be compensated by a j! in the denominator.
If we write $\displaystyle [k]= { f^{(k)}\over k! }$ and $\displaystyle [k \times j] = { [k]^j \over j!}$ we can denote it even more compact: $$\begin{eqnarray}{(f^4)^{(4)} \over 4!4! }&=& [0 \times 3][4 \times 1] \\ &+& [0 \times 2][1 \times 1][3 \times 1] \\ &+& [0 \times 2][2 \times 2] + [0 \times 1][1 \times 2][2 \times 1] \\ &+&[1 \times 4] \end{eqnarray}$$ where, if we take the brackets as products and the terms as sums then each term has the sum k. It is a simple mechanic to write down the terms by hand for some small k, even for $k=10$ or so this should be doable with paper and pen.

-
Thanks for the very nice and clear rewriting Gottfried! – Raymond Manzoni Aug 1 '12 at 7:48
@RaymondManzoni: :-) After getting this I did a similar explanation on the wikipedia-page for the Faà di Bruno, see en.wikipedia.org/w/… . Perhaps it is a much general useful translation, to use the factorially scaled derivatives and factorially scaled multiplicities of the factors in similar applications ... – Gottfried Helms Aug 1 '12 at 10:41