Chain Rule

Learn the chain rule of differentiation for functions.

Derivative of a function of a function

Imagine a function

f=y2f=y^2

where yy is itself:

y=x3+xy=x^3+x

We can write this as f=(x3+x)2f = (x^3 + x)^2 if we want to.

How does ff change with yy? That is, what is f/y\partial f / \partial y? This is easy as we just apply the power rule we just developed, multiplying and reducing the power, so f/y=2y\partial f / \partial y= 2y.

How does ff change with xx? Well, we could expand the expression f=(x3+x)2f = (x^3 + x)^2 and apply this same approach. We can’t apply it naively to (x3+x)2(x^3 + x)^2 to become 2(x3+x)2(x^3 + x).

If we did many of these the long, hard way, using the diminishing deltas approach like we used before, we’d stumble upon another set of patterns. Let’s jump straight to the answer.

The pattern is this:

fx=fyyx\frac{\partial f}{\partial x} = \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial x}

Get hands-on with 1400+ tech skills courses.