:

## Nth order derivatives and Faa di Bruno formula

In connection with recent developments for symbolic sequences, a number of improvements were implemented regarding symbolic differentiation, that is the computation of  order derivatives were n is a symbol, the simplest example being the  derivative of the exponential, which of course is the exponential itself. This post is about these developments, done in collaboration with Katherina von Bülow, and available for download as usual from the Maplesoft R&D web page for Differential Equations and Mathematical functions (the update itself is bundled with the official updates of the Maple Physics package).

It is important to note that Maple is pioneer in having an actual implementation of symbolic differentiation, something that works for real, since several releases.  The development, however, was somewhat stuck because we were unable to compute the symbolic  derivative of a composite function . A formula for this problem is actually known, it is the Faà di Bruno formula, but, in order to implement it, first we were missing the incomplete Bell functions , that got implemented in Maple 15, nice, but then we were still missing differentiating symbolic sequences, and functions whose arguments are symbolic sequences (i.e. the number of arguments of the function is n, a symbol, of unknown value at the time of differentiating). All this got implemented now within the new MathematicalFunctions:-Sequence package, opening the door widely to these improvements in  differentiation.

The symbolic differentiation code works as mostly all other computer algebra code, by mapping complicated problems into a composition of simpler problems all of which are tractable; what follows is then an illustration of these basic cases.

Among the simplest new case that can now be handled there is that of a power where the exponent is linear in the differentiation variable. This is actually an easy problem

 >
 (1)

More complicated, consider the  power of a generic function; the corresponding symbolic derivative can be mapped into a sum of symbolic derivatives of powers of  with lower degree

 >
 (2)

In some cases where  is a known function, the computation can be carried on furthermore. For example, for  the result can be expressed using Stirling numbers of the first kind

 >
 (3)

The case of sin and cos are relatively simpler, but then assumptions on the exponent are required in order to proceed further ahead from (2), for example

 >
 (4)

The case of functions of arbitrary number of variables (typical situation where symbolic sequences are required) is now handled properly. This is the pFq hypergeometric function of symbolic order p and q

 >
 (5)

The case of the MeijerG function is more complicated, but in practice, for the computer, once it knows how to handle symbolic sequences, the more involved problem becomes computable

 >
 (6)

Not only the mathematics of this result is correct: the object returned is actually computable to the end (if you provide the values of n, p, m and q), and the typesetting is actually fully readable, as in textbooks, including copy and paste working properly; all this is new.

The  derivative of a number of mathematical functions that were not implemented before, are now also implemented, covering the gaps, for example:

 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)

In the same way the fundamental formulas for the  derivative of all the 12 elliptic Jacobi functions  as well as the four elliptic JacobiTheta functions,  the LambertW , LegendreP  and some others are now all implemented.

Finally there is the "holy grail" of this problem: the  derivative of a composite function  - this always-unreachable implementation of Faa di Bruno formula. We now have it :)

 >
 (11)

Note the symbolic sequence of symbolic order derivatives of lower degree, both of of f and g, also within the arguments of the IncompleteBellB function. This is a very abstract formula ... And does this really work? Of course it does :). Consider, for instance, a case where the  derivatives of  and  can both be computed by the system:

 >
 (12)

This is the  derivative expressed using Faa di Bruno's formula, in turn expressed using symbolic sequences within the IncompleteBellB  function

 >
 (13)

These results can all be verified. Take for instance

 >
 (14)

Compute now the inert functions: on the left-hand side this is just the (now explicit) 3rd order derivative, while on the right-hand side we have a sum of IncompleteBellB  functions, where the number of arguments, expressed in (13) using symbolic sequences that depend on the summation index k and the differentiation order n, now in (14) depend only on , and get transformed into explicit sequences of arguments when the summation is performed and k assumes integer values

 >
 (15)

Take left-hand side minus right-hand side

 >
 (16)
 >

:)