← Back to Home

Chain Rule

This is when you have a function inside another function.

The formula to differentiate such case is as follows:

$$\frac{d}{dx}f[g(x)]=f'[g(x)] \cdot g'(x)$$

It is easier to understand what this means using examples. If you didn't understand the explanation using the first example, try seeing the second example, maybe the picture helps.

Examples:

  • $(x^2+3x+1)^4$

    First, we need to identify our 2 functions.
    1. Let's look at that big outside bracket. If we ignore everything in the inside, we can say that the outside function is $f(x)=x^4$.
    2. Now, we will make everything in the inside be our 2nd function. I will call this second function $g(x)=x^2+3x+1$
    3. Now, I want you first to refresh your memory by reading "More stuff about functions" section. After that refresher, we are going to find what $f[g(x)]$ means. It means that in my original $f(x)=x^4$, everywhere I see an $x$, I will replace it with the entire $g(x)$.
    4. So, $f[g(x)]=[g(x)]^4=(x^2+3x+1)^4$
    5. You will know you are doing a good job if you have managed to reach the original thing you are trying to differentiate using these steps.
    6. Now, we need to find 2 things: $f'[g(x)]$ and $g'(x)$
    7. To find $f'[g(x)]$, you will ignore what is inside the big brackets. Just treat it as if it was $x^4$. Using the power rule, you know that the derivative of $x^4$ is $(1\cdot 4)x^{4-1}=4x^3$.

      Now, put back what you had inside those big brackets in place of $x$. You should get $4(x^2+3x+1)^3$
    8. Now, we need to find $g'(x)$. We know that $g(x)=x^2+3x+1$. So we need to differentiate that using the power rule.

      $\frac{d}{dx}(x^2+3x+1)=\frac{d}{dx}(x^2)+\frac{d}{dx}(3x)+\frac{d}{dx}(1)=(2 \cdot 1)x^{2-1}+3+0=2x^1+3$
    9. We can finally use the formula $\frac{d}{dx}f[g(x)]=f'[g(x)] \cdot g'(x)$

      Input $f'[g(x)]=4(x^2+3x+1)^3$ and $g'(x)=2x+3$

      Final answer: $4(x^2+3x+1)^3\cdot (2x+3)$
  • $(17x^9-22x^3)^5$

    Hand written steps to differentiate (17x^9 - 22x^3)^5 using the chain rule, f'[g(x)] times g'(x), with the outside and inside functions color coded. The power rule gives 5(17x^9 - 22x^3)^4, and the answer is 5(17x^9 - 22x^3)^4 times (153x^8 - 66x^2).
    The steps to differentiate $17x^9-22x^3$ are shown in the power rule section.

We will see more examples of the chain rule in combination with other rules.