We discuss how to tackle the problem of applying chain rules when you have functions with several layers of composition.
Video Lecture
Perhaps the two hardest parts of the chain rule are: figuring out how to recognize a composition of functions, and what order to apply the chain rule when you have a function with several layers of compositions. The solution to the first problem, unfortunately only really comes with practice. For this reason we have several example videos to demonstrate how to recognize and break up these compositions. The goal of this segment however is to answer our other problem: how to determine the order of chain rule applications.
Text and Additional Details
The general rule of thumb when using the chain rule, is to work from the outside in. Let’s consider a case of three compositions; say . As mentioned, we want to tackle this from the outside in, and try not to do too much at once.
Apply chain rule to outermost function | ||
stuffstuffstuff | ||
Apply chain rule to next outermost function | ||
stuffstuffstuff | ||
Apply chain rule to next outermost function | ||
Which happens to be the innermost function . | ||
This is easier to think of in this general abstraction, and a bit harder to do in practice with actual functions; which is why we will do a number of example videos for it. But the key here is to not try and bite off too much at once. Notice how, for each step, we did (only) one more application of the chain rule and left the rest of the chain rule process (the “derivative of ’stuff’ part”) for the next step. This lets you keep track of what you are doing at each step and not forget or skip steps.
Consider the following concrete version of the above; . Carefully dissecting this function we could interpret it as , , and . Then we would have:
So, if we want to take the derivative of the lefthand side, we should do it as we did above:
Applied definition of , , . | ||
Apply chain rule to outermost function | ||
, stuffstuffstuff | ||
Apply chain rule to next outermost function | ||
, stuffstuffstuff | ||
Apply chain rule to next outermost function | ||
Which happens to be the innermost function . | ||
Applying the chain rule is something that will happen a lot as we move forward, and keeping track of which step you are on, and which things still need to be differentiated is a surprisingly easy thing to mess up along the way. Thus we showed here that we want to apply the chainrule from the outside in, and don’t be afraid to use the notation to not do too much in a single step.