C.3 Chain Rule - Deeper Work

You can see how the Chain Rule is chaining together the pieces here: the first line applies the Chain Rule to the outer function 𝑓, saying its derivative equals 𝑓 evaluated at its inner function (that happens to itself be a composite function 𝑔((𝑥))), multiplied by the derivative of that inner function. The second line then writes out that latter derivative, g' evaluated at its inner function (𝑥), multiplied by the derivative of h.

If that seems abstract, let's make it concrete by finding the derivative of this function.

EXAMPLE 1: Applying the Chain Rule to 𝑓(𝑥) =11+𝑒𝑥.

Differentiate 𝑓(𝑥) =11+𝑒𝑥.

Solution.

We'll once again solve this two ways, first formally, and then informally the way you would probably quickly reason through, essentially just writing down the answer as you go.

Solution 1 (more formal).

We have the outside function 𝑓(𝑢) =1𝑢, the inside function 𝑢 =𝑔(𝑤) =1 +𝑒𝑤, and the further inside function 𝑤 =(𝑥) = 𝑥.

Their derivatives are 𝑓(𝑢) = 1𝑢2, 𝑔(𝑤) =𝑒𝑤, and (𝑥) = 1.

Then applying the Chain Rule gives

[𝑓(𝑔((𝑥)))]=𝑓(𝑔((𝑥)))𝑔((𝑥))(𝑥)=1𝑢2𝑒𝑤(1)=1(1+𝑒𝑥)2𝑒𝑥(1)=𝑒𝑥(1+𝑒𝑥)2

While the final line shows the answer in its simplified form, we suggest focusing on the preceding line (also with a green checkmark) since — again with practice — you can see how the Chain Rule has been applied to reach this result, starting with the outer function and then working your way inward. The following 'informal reasoning' solution makes this even more apparent.

Solution 2 (less formal, the way you're likely to come to reason quickly).

The overall function is [some stuff]1, where you're holding in your head that this "stuff" = 1 +𝑒𝑥. So its derivative is

Students often request "harder examples," so let's find the derivative of a function comprised of 6(!) functions. You can step through finding the derivative of each component piece, but really we hope that — with practice, at least — you'll be able to start with the outside function and work your way inward, and write this answer down in one line. Indeed, we're putting the answer right at the top, so you can imagine doing just that, simply immediately writing down the answer, going term-by-term as you work your way further and further inside the nests of the function.

Example 2: Chain Rule applied to 𝑦(𝑥) =1sin(3𝑒𝑥1)

Show that the derivative of 𝑦(𝑥)=1sin(3𝑒𝑥1)=[sin(3𝑒𝑥1)]1 is 𝑑𝑦𝑑𝑥=[sin(3(𝑒𝑥)1/21)]2cos(3(𝑒𝑥)1/21)312(𝑒𝑥)1/2𝑒𝑥(1)

Solution.

Let's first show a picture of the chain that is this compound function. You probably wouldn't ever create this for yourself, but it's helpful for us to visualize together as we go step-by-step.

Links in a chain for the function f(x) = 1 over sin of (3 times the square root of e to the negative x). First link inside text: input something. Below that link is the input letter x. An arrow points to the second link, which has text inside: make it negative. Text beneath that link says f1(x) = -x. An arrow then points to the third chain link, with text inside: raise e to that power. Text beneath the link says f2(x) = e^x. An arrow then points to the fourth chain link, with text inside: take the square root. Text beneath the link says f3(x) = square root of x. An arrow then points to the fifth chain link, with text inside: multiply by 3, and subtract 1. Text beneath the link says f4(x) = 3x + 1. An arrow then points to the sixth chain link, with text inside: take the sine. Text beneath the link says f5(x) = sin(x). An arrow then points to the sixth chain link, with text inside: take the reciprocal. Text beneath the link says f6(x) = 1 over x = x to the negative one.

When presented with a more complicated function like y, we find it easier to rewrite reciprocals and roots in terms of negative and rational powers:

𝑦(𝑥)=1sin(3𝑒𝑥1)=[sin(3(𝑒𝑥)1/21)]1

This makes it easier to see where we need to use power rule, and gives us more of a visual cue for when we hit a new interior function.

Let's summarize our answer, showing how each term arose:

𝑑𝑦𝑑𝑥=𝑑𝑓6𝑑𝑓5¯¯¯¯¯¯¯¯¯¯[sin(3(𝑒𝑥)1/21)]2𝑑𝑓5𝑑𝑓4¯¯¯¯¯¯cos(3(𝑒𝑥)1/21)𝑑𝑓4𝑑𝑓33𝑑𝑓3𝑑𝑓2¯¯¯¯12(𝑒𝑥)1/2𝑑𝑓2𝑑𝑓1𝑒𝑥𝑑𝑓1𝑑𝑥(1)

If you wrote your answer like we did at the top of this Example (repeated here, with the added labels like 𝑑𝑓6𝑑𝑓5), you have completely taken the derivative, so celebrate!

Furthermore, your grader is probably scanning for a line like this (without the labels), which clearly shows how you applied the Chain Rule to every inside function. If you got to this point, your Calculus is perfect.

Tip icon

Now here's a warning: most people, including us, are likely to introduce an algebraic error if they work to simplify — especially when rushing on an exam. So check with your teacher about what an acceptable "final form" is for your answer. If you can box the result above and receive full credit, we strongly recommend doing so. (And again, celebrate your growing Calculus skills!)

For completeness, here is the same answer in simplified form:

𝑑𝑦𝑑𝑥=3cos(3𝑒𝑥1)2𝑒𝑥sin2(3𝑒𝑥1)

FAQ: When do I STOP applying the Chain Rule?

A student, Kiran, says:

"Now that I'm thinking about taking derivatives more layers down in the function, earlier why didn't we do 𝑑𝑑𝑥sin(2𝑥)?=cos(2𝑥)(2)𝑑𝑑𝑥(2)0?=0?!? I mean, if I apply the Chain Rule to the every layer of the function it seems like I should take the derivative of that last "2," but that makes the whole thing zero! That doesn't seem right, or match what we did before. How do I know where to stop?!?"

Great question! Kiran is certainly right that he's gone a step too far in taking that last derivative. If when using the Chain Rule you suddenly find yourself taking the derivative of a constant and the whole thing goes to zero, like Kiran's example, then you've also gone a step too far.

The reason is that the innermost function in sin(2𝑥) is 2𝑥. Let's think about the chain for this compound function:

Links in a chain for the function f(x) = sin(2x). First link inside text: input something. Below that link is the input letter x. An arrow points to the second link, which has text inside: multiply it by 2. Text beneath that link says f_1(x) = 2x. An arrow then points to the third chain link, with text inside: take the sine of that. Text beneath the link says f_2(u) = sin(u).

Creating this image (in our heads, if nothing else) shows where the calculation above went wrong: there is no inner function that is 𝑓3 =2, so there is no third term in the Chain Rule statement. Instead, 𝑑𝑑𝑥sin(2𝑥)=𝑑𝑓2𝑑𝑓1cos(2𝑥)𝑑𝑓1𝑑𝑥2 That is, we stop when we take the derivative of the innermost function, which is 2𝑥.

(We love that Kiran is thinking all of this through!)

And now, time to practice applying the Chain Rule to more complex functions!

Deeper Chain Rule Practice Problem #1

This problem requires using the Chain Rule twice.

Differentiate 𝑓(𝑥) =cos(tan(3𝑥)).

Deeper Chain Rule Practice Problem #2

This problem requires using the Chain Rule twice.

Differentiate 𝑓(𝑥) =sin(5𝑥).

Deeper Chain Rule Practice Problem #3

This problem requires using the Chain Rule three times.

Differentiate 𝑓(𝑥) =(1+sin9(2𝑥+3))2.

Hint: Recall that sin9() =[sin()]9.

Deeper Chain Rule Practice Problem #4
Let 𝑦 =cos(1+𝑥). Find 𝑦.
Deeper Chain Rule Practice Problem #5 (Prior uni exam question)
(𝑥) =𝑒sin(𝑥)

On the next and final screen in this Section on the Chain Rule, we'll use the rule to develop some further derivatives and facts that are useful to have in mind as we proceed. Of course that work will give you yet more practice at using the rule, too.


What questions do you have about what's on this screen, or other derivative problems you're working on? Please post on the Forum and let us know!