• Need one-on-one tutoring with me? I teach all of this material! Contact me for a quick response on your needs.
  • Want my FULL version of these notes with more worked examples and help? Click here.

Introduction

Thus far we have looked at differentiating “simple” functions, for example using the power rule on functions of the form x^n. But what about more complicated functions, such as y = (x^3 + 5)^5? These more complicated examples require slightly different methods, which I’ll introduce by first discussing function composition.

Function Notation and Compositions

Recall in function notation that, if f(x) = 3x^2 - 4x + 12, finding f(2) is as simple as plugging the 2 in for x inside of f. This is also true with more complicated arguments! For example, we would find f(z^3) by plugging in z^3 for x in f. This produces 3(z^3)^2 - 4(z^3) + 12 = 3z^6 - 4z^3 + 12. For practice, show that f(x+3) = 3(x+3)^2 - 4(x+3) + 12= 3x^2 + 14x + 27.

x + 3 in the above example is another function of x, distinct from f. Let’s call it g, so that g(x) = x+3. Then the second example above could be written as f(g(x)), because we plugged in the entire function of x + 3 for the variable in f. Plugging in a function for the variable in another function is the composition of those functions:

    \begin{equation*} \textit{The composition of $f(x)$ and $g(x)$ is}\; \; f(g(x)) \end{equation*}

Check out my full notes on this section for a more detailed review of function composition as well as practice with function notation like used above.

The Chain Rule

This ends up being useful in calculus when we want to take the derivative of functions that match rules we already know (such as the power rule), but that have more complicated arguments inside. Consider my example in the introduction, y = (x^3 + 5)^5. This is similar to something we can take the derivative of already (using the power rule), namely, x^5, however instead of x being taken to that power, we have a whole function. If we call the function we already know how to work with f(x) = x^5, and the “inner” function g(x) = x^3 + 5, then we can say that y = f(g(x)) in this example. This is a composition of functions, and we already know how to take the derivative of the “outer” function! Such situations require the chain rule of differentiation:

I’ve used the two most common notations you’ll come across. They both have tricky aspects that often throw people off. The first notation is shorthand and uses the “prime” notation. Although the meaning of g'(x) is fairly straightforward (the derivative of g(x) with respect to x), the meaning of f' \big( g(x) \big) is less straightforward. The prime hides the important fact that this derivative is not just with respect to x, it is with respect to the inner function, g. The second notation shows this more clearly, although it hides the independent variable; f(x) becomes f here, and g(x) becomes g.

What does it mean to take a derivative with respect to g(x) instead of with respect to x? When the chain rule is first being learned, I prefer not to get bogged down in the details of this question. Instead, I’d rather you think of this rule in words, just like with the product rule and quotient rule. In general, let’s say you have a derivative rule, such as the power rule. Let’s also say you seek to take the derivative of a function that matches the rule, except you have another function (call it the “inside” function) plugged into the variable of your rule. You take the derivative of the function using the rule just like you ordinarily would, but you must also multiply this by the derivative of the inside function. You can think something more condensed, like derivative of outside times the derivative of what’s inside.

The Process Explained

Say we wanted to take the derivative of my example above, y = (x^3 + 5)^5. This is similar to y = x^5, which we know how to handle, but instead of x, we have x^3 + 5 plugged into the base of the exponent. So, we take the derivative just like normal, which is \textcolor{blue}{5(x^3 + 5)^4}, but we must tack on a derivative of the inner function afterwards as well (shown in red):

    \[ \diff{}{x} \Big[(x^3 + 5)^5 \Big] = \textcolor{blue}{5(x^3 + 5)^4} \cdot \textcolor{red}{\diff{}{x} \Big[x^3 + 5 \Big]} \]

    \[ = \textcolor{blue}{5(x^3 + 5)^4} \cdot  \textcolor{red}{3x^2} \]

    \[ = 15x^2(x^3 + 5)^4 \]

Power Rule Examples

Let’s take a look at some more examples that utilize the power rule as the “outer” function, since we’ve only discussed the power rule so far in these notes. For problems with later special functions, see the next section!

Example 1

Use the chain rule to find the derivative of f(x) = (16x^2+1)^4.

Here we have a problem similar to the power rule, but the inner function is 16x^2+1 instead of the standard x, so we need to use the chain rule. The derivative is the derivative using the power rule without changing the inner function, times the derivative of the inner function:

    \[ f'(x) = 4(16x^2 + 1)^3 \cdot \diff{}{x} \Big[16x^2 + 1 \Big] \]

    \[ = 4(16x^2 + 1)^3 \cdot (32x) \]

    \[ = 128x(16x^2 + 1)^3 \]

where on the last line, I combined the terms in the multiplication out in front.

Example 2

Find  \diff{y}{x} where y = \sqrt{x+16}

We know that y = \sqrt{x} can be differented using the power rule (since the square root means taken to the power of 1/2), but because we have x + 16 plugged into the square root, we need the chain rule:

    \[ \diff{y}{x} = \frac{1}{2}(x+16)^{-1/2} \cdot \diff{}{x} \Big[ x+ 16 \Big] \]

    \[ = \frac{1}{2\sqrt{x+16}} \cdot(1) = \frac{1}{2\sqrt{x+16}} \]

Here, the chain rule didn’t really change the process or the outcome, although it’s always necessary with composite functions. This will happen if the “inner” function is just a “shift” of the variable, in this case x + 16 instead of just x.

Example 3

Let x(t) = \sqrt{t^4 - 3t^2 + 1}. Find \diff{x}{t}.

Using the chain rule, we get:

    \[ \diff{x}{t} = \frac{1}{2}(t^4 - 3t^2 + 1)^{-1/2} \cdot \diff{}{t} \Big[t^4 - 3t^2 + 1 \Big] \]

    \[ = \frac{1}{2}(t^4 - 3t^2 + 1)^{-1/2} \cdot (4t^3 - 6t) \]

    \[ = \frac{2t^3 - 3t}{\sqrt{t^4 - 3t^2 + 1}} \]

And we’re done.

Example 4

Find the derivative of g(x) = (2x+3)(x^2-4)^7.

We have a product of two functions in parentheses here, which necessitates the product rule. That proceeds as follows:

    \[ g'(x) = \diff{}{x} \Big[ 2x+3 \Big] \cdot (x^2-4)^7 + (2x+3) \cdot \textcolor{blue}{\diff{}{x} \Big[(x^2-4)^7 \Big]} \]

where the final terms requires the chain rule:

    \[ \textcolor{blue}{\diff{}{x} \Big[(x^2-4)^7 \Big] = 7(x^2 -4)^6 \cdot (2x)  = 14x(x^2 - 4)^6} \]

where 2x is the derivative of x^2 - 4. Plugging in and simplifying, we get

    \[ g'(x) = 2 \cdot (x^2 - 4)^7 + (2x+3) \cdot \textcolor{blue}{14x(x^2 - 4)^6} \]

In the interest of simplification, I’ll now factor out (x^2 - 4)^6 from both of the additive terms:

    \[ = (x^2 - 4)^6 \cdot \Big[2(x^2 -4)^1 + (2x+3)\cdot 14x \Big] \]

    \[ = (x^2 - 4)^6(30x^2 +42x -8) \]

Example 5

Compute the derivative of z = \frac{\sqrt{x^3 - 2}}{2x^2 - 3}.

There really aren’t any tricks to be played here, so we have to use the quotient rule. One of the derivatives in the quotient rule will require a chain rule, but we’ll worry about that when we get to it. Then,

    \[ z' = \frac{\textcolor{blue}{\diff{}{x} \Big[ \sqrt{x^3 - 2} \Big]} \cdot (2x^2 - 3) - \sqrt{x^3 - 2} \cdot \diff{}{x} \Big[2x^2 - 3 \Big] }{(2x^2 - 3)^2} \]

The blue term requires the chain rule:

    \[ \textcolor{blue}{\diff{}{x} \Big[ \sqrt{x^3 - 2} \Big] = \frac{1}{2}(x^3 - 2)^{-1/2} \cdot (3x^2) = \frac{3x^2}{2\sqrt{x^3 - 2}}} \]

Continuing on, we have

    \[ z' = \frac{\textcolor{blue}{\frac{3x^2}{2\sqrt{x^3 - 2}}} \cdot (2x^2 - 3) - \sqrt{x^3 - 2} \cdot (4x)}{(2x^2 - 3)^2} \]

Show that, upon multiplying top and bottom by 2\sqrt{x^3 - 2}, we get

    \[ = \frac{6x^4 - 9x^2 - 8x(x^3 - 2)}{2(2x^2 - 3)^2\sqrt{x^3 - 2}} \]

    \[ = \frac{-2x^4 - 9x^2 + 16x}{2(2x^2 - 3)^2\sqrt{x^3 - 2}} \]

More Chain Rule Examples

The following are more examples of using the chain rule with special functions which are only covered later on in these notes. These problems only apply after you’ve done some future material as well.

Example 6

Find the derivative of y = e^{x^3}}.

We know that \diff{}{x} e^x = e^x, so now we have to find \diff{}{x} \big(e^{f(x)} \big) which, employing the chain rule, is e^{f(x)} \cdot f'(x):

    \[ y' = e^{x^3}} \cdot 3x^2 \]

    \[ = 3x^2 e^{x^3}} \]

Example 7

Let x(t) = \ln{(12t^4 - 3)}. Find x'(t).

We know that \diff{}{t} \ln{t} = \frac{1}{t} so now we have to find \diff{}{t} \big( \ln{f(t)} \big) which, employing the chain rule, is \frac{1}{f(t)} \cdot f'(t) = \frac{f'(t)}{f(t)}.

This often confuses people because they want to make it  \frac{1}{t} \cdot f'(t) instead of \frac{1}{f(t)} \cdot f'(t), however the chain rule requires the first term to be f'(g(t)) and not f'(t), so we leave the inner argument alone for the first half of the chain rule:

    \[ \diff{}{t} \Big[ \ln{(12t^4 - 3)} \Big] = \frac{48t^3}{12t^4 - 3} \]

Example 8

Find f'(x) where f(x) = \sin{(12x^2)}.

We know that \diff{}{x} \sin{x} = \cos{x}, so now we have to find \diff{}{x} \sin{ \big(f(x) \big)} which, employing the chain rule, is \cos{\big(f(x) \big)} \cdot f'(x) so:

    \[ f'(x) = \cos{(12x^2)} \cdot 24x \]

    \[ = 24x \cos{(12x^2)} \]

Example 9

Find f'(x) where f(x) = \tan{(12x^2)}.

We know that \diff{}{x} \tan{x} = \sec^2{x}, so now we have to find \diff{}{x} \tan{\big( f(x) \big)} which, employing the chain rule, is \sec^2{\big(f(x) \big)} \cdot f'(x) so:

    \[ f'(x) = \sec^2{(12x^2)} \cdot 24x \]

    \[ = 24x \sec^2{(12x^2)} \]

Need more? Here you can get the full version of these notes!