(D4-D6) Chain Rule#
By the end of the lesson you will be able to:
compute the derivative of a composite function.
(D4) compute the derivative of a composite power function.
(D5) compute the derivative of a composite trigonometric function.
(D6) compute the derivative of a composite exponential or logarithmic function.
Lecture Videos#
Composite Functions#
Composite Function
A function \(h\) is the composition of functions \(f\) and \(u\) if:
Usually we call these two different pieces of our composite the inner function and the outer function.
In this definition, the
Outer Function: is function \(f\). This is the piece of our composition that happens last. It is usually the outermost layer of our composition, the part of our function furthest away from all of the \(x\)-terms.
Inner Function: is function \(u\). This is the piece of our composition that happens first. It is usually the part of our function that shows up inside a pair of parentheses - it occurs inside the outer function.
When we plug in variable \(x\), it first goes through the inner function, and then after that it goes through the outer function.
Example 1#
Consider the following functions:
Calculate the composition \(f\big(u(x)\big)\)
Calculate the composition \(u\big(f(x)\big)\)
Click through the tabs to see the steps of our solution.
Inner Function: In order to calculate the composition \(f\big(u(x)\big)\), we start by plugging-in the inner function \(u(x)=x^3\).
Outer Function: From here we need to plug \((x^3)\) into the outer function \(f(x)=\sec x\). We accomplish this by replacing each \(x\) in \(f(\color{blue}{x}\color{black})=\sec \color{blue}{x}\) with \((x^3)\).
And there’s our composition!
Inner Function: In order to calculate the composition \(u\big(f(x)\big)\), we start by plugging-in the inner function \(f(x)=\sec x\).
Outer Function: From here we need to plug \((\sec x)\) into the outer function \(u(x)=x^3\). We accomplish this by replacing each \(x\) in \(u(\color{blue}{x}\color{black})=\color{blue}{x}\color{black}^3\) with \((\sec x)\).
And there’s our composition!
Let’s review what we found:
Part 1: \(f\big(u(x)\big) =\sec (x^3)\)
Part 2: \(u\big(f(x)\big) =\big(\sec x \big)^3\)
Looking at these two compositions we see that they are two very different functions! This shows that the order of the functions matters in a composition.
Example 2#
Write each function as a composite of two simpler functions.
\(h(x) = (x^4+9x+3)^8\)
\(h(x) = \sin(x^4+9x+3)\)
\(h(x) = e^{x^4+9x+3}\)
\(h(x) = \ln(x^4+9x+3)\)
Click through the tabs to see the steps of our solution.
In each of these, we need to determine an outer function and an inner function for the given composite.
Outer Function: This is usually the outermost layer of our composition - the part of our function furthest away from all of the \(x\)-terms.
Inner Function: This is usually the part of our function that shows up inside a pair of parentheses - it occurs inside the outer function.
We need to determine an outer function and an inner function for the composite:
Outer Function: is the power function \((\cdot)^8\) since it is the very outermost layer of our composition.
Inner Function: is the polynomial \((x^4+9x+3)\) since this is inside the power function \((\cdot)^8\), it is literally inside a pair of parentheses.
Result: Therefore \(h(x)=f\big(u(x)\big)\) where \(u(x)=x^4+9x+3\) and \(f(x)=x^8\).
We need to determine an outer function and an inner function for the composite:
Outer Function: is the trigonometric function \(\sin(\cdot)\) since it is the very outermost layer of our composition.
Inner Function: is the polynomial \((x^4+9x+3)\) since this is inside the trig function \(\sin(\cdot)\), it is literally inside a pair of parentheses.
Result: Therefore \(h(x)=f\big(u(x)\big)\) where \(u(x)=x^4+9x+3\) and \(f(x)=\sin x\).
We need to determine an outer function and an inner function for the composite:
Outer Function: is the exponential function \(e^{(\cdot)}\) since it is the very outermost layer of our composition.
Inner Function: is the polynomial \((x^4+9x+3)\) since this is inside the exponential function \(e^{(\cdot)}\), it is literally inside the exponent of our exponential function.
Result: Therefore \(h(x)=f\big(u(x)\big)\) where \(u(x)=x^4+9x+3\) and \(f(x)=e^x\).
We need to determine an outer function and an inner function for the composite:
Outer Function: is the logarithmic function \(\ln{(\cdot)}\) since it is the very outermost layer of our composition.
Inner Function: is the polynomial \((x^4+9x+3)\) since this is inside the log function \(\ln{(\cdot)}\), it is literally inside a pair of parentheses.
Result: Therefore \(h(x)=f\big(u(x)\big)\) where \(u(x)=x^4+9x+3\) and \(f(x)=\ln x\).
Chain Rule#
Chain Rule
Let \(u\) be a differentiable function, and \(f\) differentiable at \(u(x)\). Then,
This rule tells us how to differentiate the composition of two or more functions. Essentially, if we see a complicated variable-term sitting inside another function - chain rule might be applicable.
Once you have identified the outer and inner functions, you can implement this rule by:
Differentiating the outer function.
Plugging in the inner function.
Multiplying this result by the derivative of the inner function.
We start by differentiating the outer function \(f\).
Next we plug the inner function \(u\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function. And there we have the chain rule!
Power - Outer Function#
General Power Rule
Let \(u\) be any differentiable function. Then,
This is a special case of the chain rule where the:
outer function is a power function \((\cdot)^r\).
inner function is a general function \(u(x)\).
We implement the general power rule very similar to the general chain rule, except we can be a bit more detailed in how we differentiate the outer power function.
We start by differentiating the outer power function \((\cdot)^r\) using our usual power rule.
Next we plug the inner function \(u\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function.
Example 3#
Differentiate the function \(h(x) = \big(x^4+9x+3\big)^8\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \((\cdot)^8\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^4+9x+3)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer power function \((\cdot)^8\) using our usual power rule.
Next we plug the inner function \((x^4+9x+3)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Trigonometric - Outer Function#
General Trigonometric Rule
Let \(u\) be any differentiable function. Then,
This is a special case of the chain rule where the:
outer function is a trigonometric function \(\sin(\cdot)\).
inner function is a general function \(u(x)\).
Note: This rule works for all \(6\) trigonometric functions (we’ve only stated it for the sine function though). And it also works for the \(6\) inverse trigonometric functions as well.
We implement the general trigonmetric rule very similar to the general chain rule, except we can be a bit more detailed in how we differentiate the outer trig function.
We start by differentiating the outer trig function \(\sin(\cdot)\) using our usual trigonometric derivatives.
Next we plug the inner function \(u\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function.
Example 4#
Differentiate the function \(h(x) = \sin(x^4+9x+3)\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(\sin(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^4+9x+3)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer trigonometric function \(\sin(\cdot)\) using our usual derivative formula.
Next we plug the inner function \((x^4+9x+3)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Exponential - Outer Function#
General Exponential Rule
Let \(u\) be any differentiable function. Then,
This is a special case of the chain rule where the:
outer function is an exponential function \(e^{(\cdot)}\).
inner function is a general function \(u(x)\).
We implement the general exponential rule very similar to the general chain rule, except we can be a bit more detailed in how we differentiate the outer exponential function.
We start by differentiating the outer exponential function \(e^{(\cdot)}\) using our usual derivative formula. Note that the derivative of \(e^x\) is \(e^x\).
Next we plug the inner function \(u\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function.
Example 5#
Differentiate the function \(h(x) = e^{x^4+9x+3}\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(e^{(\cdot)}\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^4+9x+3)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer exponential function \(e^{(\cdot)}\) using our usual derivative formula.
Remember that the derivative of \(e^x\) is just \(e^x\) again. So even though it doesn’t look like we have done anything here … we have!
Next we plug the inner function \((x^4+9x+3)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Logarithmic - Outer Function#
General Logarithmic Rule
Let \(u\) be any differentiable function. Then,
This is a special case of the chain rule where the:
outer function is a logarithmic function \(\ln\big(\cdot\big)\).
inner function is a general function \(u(x)\).
We implement the general logarithmic rule very similar to the general chain rule, except we can be a bit more detailed in how we differentiate the outer logarithmic function.
We start by differentiating the outer exponential function \(\ln{(\cdot)}\) using our usual derivative formula. Note that the derivative of \(\ln x \) is \(\tfrac{1}{x}\).
Next we plug the inner function \(u\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function.
Example 6#
Differentiate the function \(h(x) = \ln(x^4+9x+3)\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(\ln{(\cdot)}\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^4+9x+3)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer logarithmic function \(\ln{(\cdot)}\) using our usual derivative formula.
Next we plug the inner function \((x^4+9x+3)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
More Practice#
Example 7#
Differentiate the function \(h(x) = \sec^3 x\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions. To help with this, we can rewrite the trig expression to really emphasize that the outer function is a power function.
Notice that the outer function \((\cdot)^3\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((\sec x)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer power function \((\cdot)^3\) using our usual power rule.
Next we plug the inner function \((\sec x)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Example 8#
Differentiate the function \(y = \sec\big(x^3\big)\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(\sec(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^3)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer trig function \(\sec(\cdot)\) using our usual derivative formula.
Next we plug the inner function \((x^3)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Example 9#
Differentiate the function \(y = \dfrac{5}{\sqrt[3]{x^2+x+1}}\)
Click through the tabs to see the steps of our solution.
We start by first rewriting our function.
Since we have a function involving a fraction with variable terms only in the denominator, we will first rewrite the function using negative exponents. We also need to rewrite the root function using a fractional exponent.
Having done this preliminary rewriting of our function, we’re now ready to identify the outer and inner functions.
Notice that the outer function \(5 (\cdot)^{-1/3}\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^2+x+1)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer power function \(5 (\cdot)^{-1/3}\) using our usual power rule.
Next we plug the inner function \((x^2+x+1)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Example 10#
Differentiate the function \(f(x) = 5\ln \sqrt{x}\)
Click through the tabs to see the steps of our solution.
We start by first rewriting our function.
Since we see a root sign in our function, the first thing we should do is rewrite this using a fractional exponent.
Having done this preliminary rewriting of our function, we’re now ready to identify the outer and inner functions.
Notice that the outer function \(5 \ln(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((x^{1/2})\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer log function \(5 \ln(\cdot)\) using our usual derivative formula.
Next we plug the inner function \((x^{1/2})\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
If needed, we could actually simplify this answer down quite a bit, by rewriting that negative exponent term as a fraction:
Example 11#
Differentiate the function \(f(x) = \dfrac{1}{\sin^{-1}x}\)
Click through the tabs to see the steps of our solution.
We start by first rewriting our function.
Since we have a function involving a fraction with variable terms only in the denominator, we will first rewrite the function using a negative exponent.
At this point, it’s important to bring up the distinction between the two \((-1)\) terms that we see.
When we write \(\sin^{-1}\) the negative one here is not an exponent, it is actually just part of the name of the function: inverse sine.
When we write \((\cdots)^{-1}\) the negative one that we see outside the parentheses is an exponent.
Having done this preliminary rewriting of our function, we’re now ready to identify the outer and inner functions.
Notice that the outer function \( (\cdot)^{-1}\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((\sin^{-1} x)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer power function \((\cdot)^{-1}\) using our usual power rule.
Next we plug the inner function \((\sin^{-1} x)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Example 12#
Differentiate the function \(y = \arctan(3x)\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(\arctan(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((3x)\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by differentiating the outer power function \(\arctan(\cdot)\) using our usual power rule.
Next we plug the inner function \((3x)\) into the derivative of the outer function.
Finally, we multiply by the derivative of the inner function to complete our use of the chain rule.
And then from here, we finish differentiating the terms inside the remaining brackets to get:
Using Chain Rule More Than Once#
Example 13#
Differentiate the function \(f(x) = \sin\big(\cos(\ln x)\big)\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(\sin(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((\cos(\ln x))\) occurs inside the parentheses of our outer function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by applying the chain rule for this outer / inner function pair:
We’ve differentiated the outer function and multiplied by the derivative of the inner function (although we still need to differentiate the terms inside the brackets.)
To finish answering the question, we need to differentiate the terms inside the brackets.
However, looking at just these terms, we notice that they are actually a composite function as well, consisting of another outer / inner function pair:
Here the outer function \(\cos(\cdot)\) is on the outer-most layer of the composition (furthest from \(x\)). Whereas the inner function \((\ln x)\) occurs inside the parentheses.
We now apply chain rule again, to differentiate the \((\cos(\ln x))\) term inside the brackets:
And at this point, the remaining \((\ln x)\) term inside the brackets still needs to be differentiated, but it is something we can just do without any fancy rules:
And there’s our derivative! (Where we needed to use chain rule twice.)
Example 14#
Differentiate the function \(y=e^{\tan 3\theta}\)
Click through the tabs to see the steps of our solution.
We start by first identifying which derivative rules we might need to use.
The first step, is to identify the outer and inner functions.
Notice that the outer function \(e^{(\cdot)}\) is on the outer-most layer of the composition (furthest from \(\theta\)). Whereas the inner function \((\tan 3\theta)\) occurs inside the exponent of our outer exponential function. This shows that we really do have a composition of two functions, so chain rule is applicable.
We start by applying the chain rule for this outer / inner function pair:
We’ve differentiated the outer function and multiplied by the derivative of the inner function (although we still need to differentiate the terms inside the brackets.)
To finish answering the question, we need to differentiate the terms inside the brackets.
However, looking at just these terms, we notice that they are actually a composite function as well, consisting of another outer / inner function pair:
Here the outer function \(\tan(\cdot)\) is on the outer-most layer of the composition (furthest from \(\theta\)). Whereas the inner function \((3\theta)\) occurs inside the parentheses.
We now apply chain rule again, to differentiate the \((\tan(3\theta))\) term inside the brackets:
And at this point, the remaining \((3\theta)\) term inside the brackets still needs to be differentiated, but it is something we can just do without any fancy rules:
And there’s our derivative! (Where we needed to use chain rule twice.)
Chain Rule - Alternate#
Chain Rule - Alternate
Example 15#
Use the chain rule to calculate \(\dfrac{dy}{dx}\), where:
Click through the tabs to see the steps of our solution.
We start by first discussing why we might want to use this alternative form of the Chain Rule.
In this example, we’re interested in calculating the derivative of \(y\) with respect to variable \(x\). However, as the functions are presented, we have:
\(y\) represented as a function of variable \(u\)
and then \(u\) represented as a function of variable \(x\).
Since \(y\) depends on \(u\) and \(u\) depends on \(x\), in a way, \(y\) also depends on \(x\), albeit indirectly.
Whenever we have this indirect dependence, this alternate form of the chain rule can be helpful.
We start by applying the chain rule formula:
And then calculating the necessary derivatives:
Using these results we get:
Since we want the derivative of \(y\) in terms of \(x\), we should convert all variables in our derivative to \(x\). Wherever we see a \(u\) in our answer so far, we will replace it with \((x^2+1)\), since \(u=x^2+1\).
And there’s our derivative!