The *chain rule* is a formula for calculating the derivative of the composition of two (or more) functions. In function notation, it can be written as \[(f \circ g)'(x) = f'(g(x))\, g'(x).\]

An alternative way of writing it is as follows. If \(y\) is a function of \(u\), and \(u\) is a function of \(x\), then \[\frac{dy}{dx}=\frac{dy}{du}\,\frac{du}{dx}.\] For example, if \(y=(x^2+3)^5\), then if we write \(u=x^2+3\), we have \(y=u^5\), so \[\frac{dy}{dx}=5u^4\times2x=10x(x^2+3)^4.\]