Chain rule for higher derivatives

From Calculus

Statement

Suppose n is a natural number, and f and g are functions such that g is n times differentiable at x=x0 and f is n times differentiable at g(x0). Then, fg is n times differentiable at x0. Further, the value of the nth derivative is given by a complicated formula involving compositions, products, derivatives, evaluations, and sums that depends on n.

Particular cases

Value of n Formula for nth derivative of fg at x0
1 f(g(x0))g(x0) (this is the chain rule for differentiation)
2 f(g(x0))(g(x0))2+f(g(x0))g(x0) (obtained by using the chain rule for differentiation twice and using the product rule for differentiation).