Multiple differentiation of chain rule $\frac{d^n}{dx^n} f(g(x))$ computationally

50 Views Asked by At

The question was to find a simplified expression for $$\frac{d^n}{dx^n} f(g(x))$$ I was working to find some types of recursion relationship $$\frac{d^n}{dx^n} f(g(x))= \frac{d^{n-1}}{dx^{n-1}} (f'(g(x))\cdot g'(x)) $$ which was not some simple expression such as $$\sum_{k=1}^{n} \binom{n}{k} f^{n-k}(g(x)) \cdot g^{k}(x) $$

I'm thinking about to implement the solution computationally. It occurred that the sympy package was rather slow when $n$ was large(100-1000).

Is there any particular standard expression from computational mathematics for evaluating this types of expressions?