# Why does the chain rule work?

The chain rule is used to differentiate composite function, which are something of the form $f \left(g \left(x\right)\right)$. The rule states that the derivative of such a function is the derivative of the outer function, evaluated in the inner function, times the derivative of the inner function. In formulas:
d/dx (f(g(x)) = f'(g(x)) * g'(x).
d/dx (f(g(h(x))) = f'(g(h(x))) * g'(h(x)) * h'(x), and so on