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.
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$.
Now, we will make everything in the inside be our 2nd function. I will call this second function $g(x)=x^2+3x+1$
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)$.
So, $f[g(x)]=[g(x)]^4=(x^2+3x+1)^4$
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.
Now, we need to find 2 things: $f'[g(x)]$ and $g'(x)$
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$
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.
I allow students to use these notes to study and help each other for non-commercial use. I do not give permission for anyone to use these notes for commercial use.