With one additional rule, we will have the power to take the derivative of any f
With one additional rule, we will have the power to take the derivative of any function we can write down. What is this amazing rule? Why, it’s called the chain rule. The chain rule is [latex]\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)[/latex]. If we drop the [latex](x)[/latex] on each function (note that it is still there, it is just implied), we have a slightly shorter version:
[latex]\boxed{\cfrac{d}{dx} f(g) = f'(g) \cdot g'}[/latex]
Here, [latex]f(g)[/latex] is called function composition. It does not mean [latex]f[/latex] times [latex]g[/latex]. It means we are sticking [latex]g[/latex] inside of [latex]f[/latex]! Like [latex]f[/latex] is eating [latex]g[/latex]! That’s actually cannibalism if you think about it — so don’t think about it too closely. But do remember how to do function composition.
Why does this work? I’m not going to do a formal proof, but let’s run through an idea behind it. Recall that the derivative is the slope or how steep the graph of a function is. This is a lot easier to think about if we’re talking about lines. For example, suppose [latex]{\color{red}f = 6x - 10}[/latex], and [latex]{\color{blue}g = \frac{1}{2}x + 3}[/latex]. As we know from algebra, the slope of the [latex]{\color{red}f}[/latex] line is [latex]{\color{red}6}[/latex], and the slope of the [latex]{\color{blue}g}[/latex] line is [latex]{\color{blue} \frac{1}{2}}[/latex].
So what is the slope of [latex]{\color{red}f}({\color{blue}g})[/latex]? What this means is we are putting [latex]{\color{blue}g}[/latex] inside of [latex]{\color{red}f}[/latex]. So if [latex]{\color{red}f = 6x - 10}[/latex], and [latex]{\color{blue}g = \frac{1}{2}x + 3}[/latex], we take the blue [latex]{\color{blue}\frac{1}{2}x + 3}[/latex] and use that to replace the red [latex]{\color{red}x}[/latex]. Here is what is would look like:
\begin{align*}
{\color{red}f}({\color{blue}g}) & = {\color{red}6{\color{blue}\left(\frac{1}{2}x + 3\right)}-10} \\
& = 6\left(\frac{1}{2}x + 3\right)-10 \\
& = 3x + 18 – 10 \\
& = 3x – 8
\end{align*}
So again, what is the slope of [latex]{\color{red}f}({\color{blue}g})[/latex]? We can see from this calculation that it is [latex]3[/latex], the product of the two slopes [latex]{\color{red}6}[/latex] and [latex]{\color{blue} \frac{1}{2}}[/latex]. That’s why you have [latex]f' \cdot g'[/latex] in the formula.
Okay, but what about the [latex](g)[/latex] after the [latex]f'[/latex] in the formula? One way to think about the function composition [latex]f(g)[/latex] is we are looking at the [latex]f[/latex] curve at the [latex]x[/latex]-location of [latex]g[/latex]. When you take the derivative, you’re still looking at that same location (now on the [latex]f'[/latex] curve), so you still need that [latex](g)[/latex] there to specify that location.
We must identify an “inside” (g) and “outside” (f) function in order to use the chain rule. Often, the “inside” function will be in parentheses (though not always). That works in this case, so the “inside” function is