This problem came up in some math that I am working out on my own, not from a textbook, so there may not be any solution.
$$g(x) = \sin(f(x))$$
For any polynomial function $f(x)$,
$$g'(x)=\cos(f(x))f'(x)$$
$$g''(x)=-\sin(f(x))f'(x)^2+f''(x)\cos(f(x))$$
$$g'''(x)=-\cos(f(x))f'(x)^3-3\sin(f(x))f'(x)f''(x)+\cos(f(x))f'''(x) \\ \vdots$$
As you can see, each one is much more complex than the last, and takes much longer to evaluate than the last.
Is there pattern to find $g^{(n)}(x)$ without just brute-forcing it with the chain rule?
EDIT: To make the question more specific to my case, $f(x)$ is a polynomial function, and I only need to find $g^{(n)}(x)$ at $x=0$.
Thanks!
You want Faà di Bruno's formula.