# Chain Rule

Learn the chain rule of differentiation for functions.

## We'll cover the following

## Derivative of a function of a function

Imagine a function

$f=y^2$

where $y$ is itself:

$y=x^3+x$

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

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

How does $f$ change with $x$? Well, we could expand the expression $f = (x^3 + x)^2$ and apply this same approach. We can’t apply it naively to $(x^3 + x)^2$ to become $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:

$\frac{\partial f}{\partial x} = \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial x}$

Get hands-on with 1200+ tech skills courses.