Lecture 13: Section 3.4 The Chain Rule

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.


Topic 1: Understanding Composite Functions

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.

Example 1: Composing Two Functions

Let $f(u) = \sin(u)$ and $g(x) = x^2+1$. Find the composite function $F(x) = f(g(x))$.

Solution:

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.

Example 2: Decomposing a Function

Let $H(x) = (3x^2 - 5x)^9$. Find functions $f$ and $g$ such that $H(x) = f(g(x))$.

Solution:

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".

  • The inner function is what's inside the parentheses: $g(x) = 3x^2 - 5x$.
  • The outer function is what's being done to the inner part. It's taking something and raising it to the 9th power: $f(u) = u^9$.

We can check our work: $f(g(x)) = (g(x))^9 = (3x^2 - 5x)^9$, which is correct.

A Crucial Skill

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.

Check Your Understanding #1

Decompose the function $H(x) = e^{\cos(x)}$. Find an outer function $f$ and an inner function $g$.

Check Your Understanding #2

Decompose the function $G(x) = \sqrt[3]{(x^2+1)^2}$. Find an outer function $f$ and an inner function $g$.


Topic 2: Building Intuition for the Chain Rule

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.

An Intuitive Example with Linear Functions

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 rate of change of $y$ with respect to $u$ is $\frac{dy}{du} = 2$. For every 1-unit increase in $u$, $y$ increases by 2 units.
  • The rate of change of $u$ with respect to $x$ is $\frac{du}{dx} = 3$. For every 1-unit increase in $x$, $u$ increases by 3 units.

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.


Topic 3: The Chain Rule Formally Stated

The intuition of multiplying rates leads us to the formal statement of the rule, which can be expressed in two very useful ways.

The Chain Rule

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} $$

Topic 4: Applying the Chain Rule

Example 3: Power Rule Combined with Chain Rule

Differentiate $F(x) = (x^3 - 1)^{100}$.

Solution:

Identify the inner and outer functions:

  • Inner function: $g(x) = u = x^3 - 1$
  • Outer function: $f(u) = u^{100}$

Find their derivatives:

  • $g'(x) = 3x^2$
  • $f'(u) = 100u^{99}$

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} $$

Example 4: Involving a Trig Function

Differentiate $y = \sin(x^2)$.

Solution:

  • Inner function: $u = x^2$
  • Outer function: $y = \sin(u)$

Find their derivatives:

  • $\frac{du}{dx} = 2x$
  • $\frac{dy}{du} = \cos(u)$

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) $$

Check Your Understanding #3

Find the derivative of $y = \sqrt{e^x + 1}$.


Topic 5: A Powerful Application: The Derivative of $a^x$

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.

Deriving the Rule for $\frac{d}{dx}(a^x)$

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.

  • Inner function: $u = (\ln a)x$, so $\frac{du}{dx} = \ln a$.
  • Outer function: $y = e^u$, so $\frac{dy}{du} = e^u$.

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 $$

General Exponential Derivative Rule

$$ \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.


Final Practice

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.

Final Practice Problem #1

Find the derivative of $g(t) = \left(\frac{t-2}{2t+1}\right)^9$.

Final Practice Problem #2

Differentiate $f(x) = e^{5x} \cos(x^3)$.

Final Practice Problem #3

Differentiate $y = \frac{\tan(2x)}{(x^2+1)^3}$.


Conclusion

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.

Learning Objectives

After this lecture, you should be able to:

  • Identify the "inner" and "outer" functions of a composite function.
  • State the Chain Rule in both prime and Leibniz notation.
  • Apply the Chain Rule to find the derivatives of composite functions, including those involving powers, exponentials, and trigonometric functions.
  • Use the Chain Rule to derive the differentiation formula for $a^x$.
  • Combine the Chain Rule with the Product and Quotient rules to differentiate complex functions.