We've learned how to differentiate sums, differences, products, and quotients of functions. But what about compositions of functions, like $F(x) = \sqrt{x^2+1}$? This function is not a simple polynomial, product, or quotient. It's a function "inside" another function. To differentiate these, we need what is arguably the most powerful and widely used differentiation tool: the Chain Rule.
Before we can apply the Chain Rule, we must be experts at recognizing and deconstructing composite functions. A composite function is created when we plug one function into another. If we have two functions, $f(x)$ and $g(x)$, the composite function $(f \circ g)(x)$ is defined as $f(g(x))$. We call $g(x)$ the "inner" function and $f(x)$ the "outer" function.
Let $f(u) = \sin(u)$ and $g(x) = x^2+1$. Find the composite function $F(x) = f(g(x))$.
We take the entire function $g(x)$ and substitute it for the variable $u$ in the function $f(u)$.
$$ F(x) = f(g(x)) = \sin(g(x)) = \sin(x^2+1) $$More often, we will need to do the reverse: start with a composite function and identify the "inner" and "outer" parts. This skill is absolutely essential for using the Chain Rule correctly.
Let $H(x) = (3x^2 - 5x)^9$. Find functions $f$ and $g$ such that $H(x) = f(g(x))$.
The key is to identify what is being done "last". In this case, the last operation is raising a quantity to the 9th power. The quantity being raised to the power is the "inside".
We can check our work: $f(g(x)) = (g(x))^9 = (3x^2 - 5x)^9$, which is correct.
Mastering the ability to decompose functions is not just for this section. It is a foundational skill required for related rates problems later in this course, and for almost all of Calculus II, especially integration techniques like u-substitution.
Decompose the function $H(x) = e^{\cos(x)}$. Find an outer function $f$ and an inner function $g$.
Decompose the function $G(x) = \sqrt[3]{(x^2+1)^2}$. Find an outer function $f$ and an inner function $g$.
Why is the derivative of a composition not simply the composition of the derivatives? The reason is that a composite function's rate of change depends on two factors: how fast the outer function is changing, and how fast the inner function is changing.
Let's consider two simple linear functions, which have constant rates of change (slopes).
Let $y = f(u) = 2u$ and $u = g(x) = 3x$.
The composite function is $y = f(g(x)) = 2(3x) = 6x$. The rate of change of this function is clearly $\frac{dy}{dx} = 6$. Notice that this final rate is simply the product of the individual rates: $6 = 2 \cdot 3$.
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} $$The graph below visualizes this concept. The line $u=3x$ has a slope of 3. The final composed line, $y=6x$, has a slope of 6, which is exactly the product of the two rates ($2 \times 3$). This "multiplying of rates" is the core idea of the Chain Rule.
The intuition of multiplying rates leads us to the formal statement of the rule, which can be expressed in two very useful ways.
If $g$ is differentiable at $x$ and $f$ is differentiable at $g(x)$, then the composite function $F=f \circ g$ defined by $F(x) = f(g(x))$ is differentiable at $x$ and $F'$ is given by the product:
In prime notation:
$$ F'(x) = f'(g(x)) \cdot g'(x) $$In words: "The derivative of the outer function (with the inner function left unchanged inside it), times the derivative of the inner function."
In Leibniz notation: If $y=f(u)$ and $u=g(x)$, then
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} $$Differentiate $F(x) = (x^3 - 1)^{100}$.
Identify the inner and outer functions:
Find their derivatives:
Apply the formula $F'(x) = f'(g(x)) \cdot g'(x)$:
$$ F'(x) = \underbrace{100(g(x))^{99}}_{\text{Derivative of outer}} \cdot \underbrace{(3x^2)}_{\text{Derivative of inner}} $$Substitute $g(x)$ back in:
$$ F'(x) = 100(x^3-1)^{99} \cdot 3x^2 = 300x^2(x^3-1)^{99} $$Differentiate $y = \sin(x^2)$.
Find their derivatives:
Apply the Leibniz form $\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$:
$$ \frac{dy}{dx} = \cos(u) \cdot 2x $$Substitute $u=x^2$ back in to get the answer in terms of $x$:
$$ \frac{dy}{dx} = \cos(x^2) \cdot 2x = 2x\cos(x^2) $$Find the derivative of $y = \sqrt{e^x + 1}$.
In Section 3.1, we learned that $\frac{d}{dx}(e^x) = e^x$, but we left a gap: what is the derivative of a general exponential function like $2^x$ or $10^x$? The Chain Rule allows us to answer this elegantly.
The key trick is to rewrite $a^x$ using the base $e$ and logarithms. Recall that $e^{\ln(k)} = k$.
$$ y = a^x = e^{\ln(a^x)} = e^{x \ln a} $$Now we have a composite function where the outer function is $e^u$ and the inner function is $u = x \ln a$. Note that $\ln a$ is just a constant.
Using the Chain Rule:
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} = e^u \cdot \ln a $$Substitute $u = x \ln a$ back in:
$$ \frac{dy}{dx} = e^{x \ln a} \cdot \ln a $$And since $e^{x \ln a} = a^x$, we have our final result:
$$ \frac{d}{dx}(a^x) = a^x \ln a $$For example, $\frac{d}{dx}(2^x) = 2^x \ln 2$. Notice that if we let $a=e$, we get $\frac{d}{dx}(e^x) = e^x \ln e = e^x \cdot 1 = e^x$, so this rule is consistent.
The true power of the Chain Rule is revealed when we combine it with the Product, Quotient, and other rules to differentiate highly complex functions. Test your understanding with the following problems.
Find the derivative of $g(t) = \left(\frac{t-2}{2t+1}\right)^9$.
Differentiate $f(x) = e^{5x} \cos(x^3)$.
Differentiate $y = \frac{\tan(2x)}{(x^2+1)^3}$.
The Chain Rule is the key to unlocking the derivatives of a vast universe of functions. It formalizes the idea that the rate of change of a system depends on the rates of all its nested parts. Almost every complex derivative problem you encounter from this point forward will involve the Chain Rule in some capacity, making its mastery one of the most important goals in differential calculus.
After this lecture, you should be able to: