*i.e.*you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width.

### Section 3.9 : Chain Rule

We’ve taken a lot of derivatives over the course of the last few sections. However, if you look back they have all been functions similar to the following kinds of functions.

\[R\left( z \right) = \sqrt z \hspace{0.25in}f\left( t \right) = {t^{50}}\hspace{0.25in}y = \tan \left( x \right)\hspace{0.25in}\,\,\,h\left( w \right) = {{\bf{e}}^w}\hspace{0.25in}\,\,\,g\left( x \right) = \,\ln x\]These are all fairly simple functions in that wherever the variable appears it is by itself. What about functions like the following,

\[\begin{array}{ll}R\left( z \right) = \sqrt {5z - 8} & \hspace{0.5in}f\left( t \right) = {\left( {2{t^3} + \cos \left( t \right)} \right)^{50}} \hspace{0.5in}\hspace{0.25in}y = \tan \left( {\sqrt[3]{{3{x^2}}} + \tan \left( {5x} \right)} \right)\\ h\left( w \right) = {{\bf{e}}^{{w^4} - 3{w^2} + 9}} & \hspace{0.5in}\,\,\,g\left( x \right) = \,\ln \left( {{x^{ - 4}} + {x^4}} \right)\end{array}\]None of our rules will work on these functions and yet some of these functions are closer to the derivatives that we’re liable to run into than the functions in the first set.

Let’s take the first one for example. Back in the section on the definition of the derivative we actually used the definition to compute this derivative. In that section we found that,

\[R'\left( z \right) = \frac{5}{{2\sqrt {5z - 8} }}\]If we were to just use the power rule on this we would get,

\[\frac{1}{2}{\left( {5z - 8} \right)^{ - \frac{1}{2}}} = \frac{1}{{2\sqrt {5z - 8} }}\]which is not the derivative that we computed using the definition. It is close, but it’s not the same. So, the power rule alone simply won’t work to get the derivative here.

Let’s keep looking at this function and note that if we define,

\[f\left( z \right) = \sqrt z \hspace{0.25in}\hspace{0.25in}g\left( z \right) = 5z - 8\]then we can write the function as a composition.

\[R\left( z \right) = \left( {f \circ g} \right)\left( z \right) = f\left( {g\left( z \right)} \right) = \sqrt {5z - 8} \]and it turns out that it’s actually fairly simple to differentiate a function composition using the **Chain Rule**. There are two forms of the chain rule. Here they are.

#### Chain Rule

Suppose that we have two functions \(f\left( x \right)\) and \(g\left( x \right)\) and they are both differentiable.

- If we define \(F\left( x \right) = \left( {f \circ g} \right)\left( x \right)\) then the derivative of \(F\left( x \right)\) is, \[F'\left( x \right) = f'\left( {g\left( x \right)} \right)\,\,\,g'\left( x \right)\]
- If we have \(y = f\left( u \right)\) and \(u = g\left( x \right)\) then the derivative of \(y\) is, \[\frac{{dy}}{{dx}} = \frac{{dy}}{{du}}\,\,\frac{{du}}{{dx}}\]

Each of these forms have their uses, however we will work mostly with the first form in this class. To see the proof of the Chain Rule see the Proof of Various Derivative Formulas section of the Extras chapter.

Now, let’s go back and use the Chain Rule on the function that we used when we opened this section.

We’ve already identified the two functions that we needed for the composition, but let’s write them back down anyway and take their derivatives.

\[\begin{array}{ll}f\left( z \right) = \sqrt z & \hspace{0.5in}g\left( z \right) = 5z - 8\\ f'\left( z \right) = \displaystyle \frac{1}{{2\sqrt z }} & \hspace{0.5in}g'\left( z \right) = 5\end{array}\]So, using the chain rule we get,

\[\begin{align*}R'\left( z \right) & = f'\left( {g\left( z \right)} \right)\,\,g'\left( z \right)\\ & = f'\left( {5z - 8} \right)\,\,g'\left( z \right)\\ & = \frac{1}{2}{\left( {5z - 8} \right)^{ - \frac{1}{2}}}\,\left( 5 \right)\\ & = \frac{1}{{2\sqrt {5z - 8} }}\,\,\left( 5 \right)\\ & = \frac{5}{{2\sqrt {5z - 8} }}\end{align*}\]And this is what we got using the definition of the derivative.

In general, we don’t really do all the composition stuff in using the Chain Rule. That can get a little complicated and in fact obscures the fact that there is a quick and easy way of remembering the chain rule that doesn’t require us to think in terms of function composition.

Let’s take the function from the previous example and rewrite it slightly.

\[R\left( z \right) = \underbrace {\left( {5z - 8} \right)}_{{\mbox{inside function}}}\,\,\underbrace {^{\,\,\,\,\,\,\frac{1}{2}\,\,\,\,\,\,\,\,}}_{{\mbox{ outside }}\atop {\mbox{function}}}\]This function has an “inside function” and an “outside function”. The outside function is the square root or the exponent of \({\textstyle{1 \over 2}}\) depending on how you want to think of it and the inside function is the stuff that we’re taking the square root of or raising to the \({\textstyle{1 \over 2}}\), again depending on how you want to look at it.

The derivative is then,

\[R'\left( z \right) = \overbrace {\frac{1}{2}{{\underbrace {\left( {5z - 8} \right)}_{{\mbox{inside function}}\atop{\mbox{left alone}}}}^{ - \frac{1}{2}}}}^{{\mbox{derivative of}}\atop{\mbox{outside function}}}\,\,\,\underbrace {\,\,\,\,\left( 5 \right)\,\,\,\,}_{{\mbox{derivative of}}\atop{\mbox{inside function}}}\]In general, this is how we think of the chain rule. We identify the “inside function” and the “outside function”. We then differentiate the outside function leaving the inside function alone and multiply all of this by the derivative of the inside function. In its general form this is,

\[F'\left( x \right) = \underbrace {\,\,\,\,\,f'\,\,\,\,\,}_{{\mbox{derivative of}}\atop{\mbox{outside function}}}\,\,\,\,\underbrace {\,\,\left( {g\left( x \right)} \right)\,\,}_{{\mbox{inside function}}\atop{\mbox{left alone}}}\,\,\,\,\,\underbrace {\,\,\,g'\left( x \right)\,\,\,}_{{\mbox{times derivative}}\atop{\mbox{of inside function}}}\]We can always identify the “outside function” in the examples below by asking ourselves how we would evaluate the function. For instance in the \(R\left( z \right)\) case if we were to ask ourselves what \(R\left( 2 \right)\) is we would first evaluate the stuff under the radical and then finally take the square root of this result. The square root is the last operation that we perform in the evaluation and this is also the outside function. The outside function will always be the last operation you would perform if you were going to evaluate the function.

Let’s take a look at some examples of the Chain Rule.

- \(f\left( x \right) = \sin \left( {3{x^2} + x} \right)\)
- \(f\left( t \right) = {\left( {2{t^3} + \cos \left( t \right)} \right)^{50}}\)
- \(h\left( w \right) = {{\bf{e}}^{{w^4} - 3{w^2} + 9}}\)
- \(g\left( x \right) = \,\ln \left( {{x^{ - 4}} + {x^4}} \right)\)
- \(y = \sec \left( {1 - 5x} \right)\)
- \(P\left( t \right) = {\cos ^4}\left( t \right) + \cos \left( {{t^4}} \right)\)

It looks like the outside function is the sine and the inside function is 3*x ^{2}+x*. The derivative is then.

Or with a little rewriting,

\[f'\left( x \right) = \left( {6x + 1} \right)\cos \left( {3{x^2} + x} \right)\]b \(f\left( t \right) = {\left( {2{t^3} + \cos \left( t \right)} \right)^{50}}\) Show Solution

In this case the outside function is the exponent of 50 and the inside function is all the stuff on the inside of the parenthesis. The derivative is then.

\[\begin{align*}f'\left( t \right) & = 50{\left( {2{t^3} + \cos \left( t \right)} \right)^{49}}\left( {6{t^2} - \sin \left( t \right)} \right)\\ & = 50\left( {6{t^2} - \sin \left( t \right)} \right){\left( {2{t^3} + \cos \left( t \right)} \right)^{49}}\end{align*}\]c \(h\left( w \right) = {{\bf{e}}^{{w^4} - 3{w^2} + 9}}\) Show Solution

Identifying the outside function in the previous two was fairly simple since it really was the “outside” function in some sense. In this case we need to be a little careful. Recall that the outside function is the last operation that we would perform in an evaluation. In this case if we were to evaluate this function the last operation would be the exponential. Therefore, the outside function is the exponential function and the inside function is its exponent.

Here’s the derivative.

\[\begin{align*}h'\left( w \right) & = {{\bf{e}}^{{w^4} - 3{w^2} + 9}}\left( {4{w^3} - 6w} \right)\\ & = \left( {4{w^3} - 6w} \right){{\bf{e}}^{{w^4} - 3{w^2} + 9}}\end{align*}\]Remember, we leave the inside function alone when we differentiate the outside function. So, the derivative of the exponential function (with the inside left alone) is just the original function.

d \(g\left( x \right) = \,\ln \left( {{x^{ - 4}} + {x^4}} \right)\) Show Solution

Here the outside function is the natural logarithm and the inside function is stuff on the inside of the logarithm.

\[g'\left( x \right) = \,\frac{1}{{{x^{ - 4}} + {x^4}}}\left( { - 4{x^{ - 5}} + 4{x^3}} \right) = \frac{{ - 4{x^{ - 5}} + 4{x^3}}}{{{x^{ - 4}} + {x^4}}}\]Again remember to leave the inside function alone when differentiating the outside function. So, upon differentiating the logarithm we end up not with 1/\(x\) but instead with 1/(inside function).

e \(y = \sec \left( {1 - 5x} \right)\) Show Solution

In this case the outside function is the secant and the inside is the \(1 - 5x\).

\[\begin{align*}y' & = \sec \left( {1 - 5x} \right)\tan \left( {1 - 5x} \right)\left( { - 5} \right)\\ & = - 5\sec \left( {1 - 5x} \right)\tan \left( {1 - 5x} \right)\end{align*}\]In this case the derivative of the outside function is \(\sec \left( x \right)\tan \left( x \right)\). However, since we leave the inside function alone we don’t get \(x\)’s in both. Instead we get \(1 - 5x\) in both.

f \(P\left( t \right) = {\cos ^4}\left( t \right) + \cos \left( {{t^4}} \right)\) Show Solution

There are two points to this problem. First, there are two terms and each will require a different application of the chain rule. That will often be the case so don’t expect just a single chain rule when doing these problems. Second, we need to be very careful in choosing the outside and inside function for each term.

Recall that the first term can actually be written as,

\[{\cos ^4}\left( t \right) = {\left( {\cos \left( t \right)} \right)^4}\]So, in the first term the outside function is the exponent of 4 and the inside function is the cosine. In the second term it’s exactly the opposite. In the second term the outside function is the cosine and the inside function is \({t^4}\). Here’s the derivative for this function.

\[\begin{align*}P'\left( t \right) & = 4{\cos ^3}\left( t \right)\left( { - \sin \left( t \right)} \right) - \sin \left( {{t^4}} \right)\left( {4{t^3}} \right)\\ & = - 4\sin \left( t \right){\cos ^3}\left( t \right) - 4{t^3}\sin \left( {{t^4}} \right)\end{align*}\]There are a couple of general formulas that we can get for some special cases of the chain rule. Let’s take a quick look at those.

- \(f\left( x \right) = {\left[ {g\left( x \right)} \right]^n}\)
- \(f\left( x \right) = {{\bf{e}}^{g\left( x \right)}}\)
- \(f\left( x \right) = \ln \left( {g\left( x \right)} \right)\)

a The outside function is the exponent and the inside is \(g\left( x \right)\).

\[f'\left( x \right) = n{\left[ {g\left( x \right)} \right]^{n - 1}}g'\left( x \right)\]b The outside function is the exponential function and the inside is \(g\left( x \right)\).

\[f'\left( x \right) = g'\left( x \right){{\bf{e}}^{g\left( x \right)}}\]c The outside function is the logarithm and the inside is \(g\left( x \right)\).

\[f'\left( x \right) = \frac{1}{{g\left( x \right)}}g'\left( x \right) = \frac{{g'\left( x \right)}}{{g\left( x \right)}}\]The formulas in this example are really just special cases of the Chain Rule but may be useful to remember in order to quickly do some of these derivatives.

Now, let’s also not forget the other rules that we’ve got for doing derivatives. For the most part we’ll not be explicitly identifying the inside and outside functions for the remainder of the problems in this section. We will be assuming that you can see our choices based on the previous examples and the work that we have shown.

- \(T\left( x \right) = {\tan ^{ - 1}}\left( {2x} \right)\,\,\sqrt[3]{{1 - 3{x^2}}}\)
- \(f\left( z \right) = \sin \left( {z{{\bf{e}}^z}} \right)\)
- \(\displaystyle y = \frac{{{{\left( {{x^3} + 4} \right)}^5}}}{{{{\left( {1 - 2{x^2}} \right)}^3}}}\)
- \(\displaystyle h\left( t \right) = {\left( {\frac{{2t + 3}}{{6 - {t^2}}}} \right)^3}\)

Let’s first notice that this problem is first and foremost a product rule problem. This is a product of two functions, the inverse tangent and the root and so the first thing we’ll need to do in taking the derivative is use the product rule. However, in using the product rule and each derivative will require a chain rule application as well.

\[\begin{align*}T'\left( x \right) & = \frac{1}{{1 + {{\left( {2x} \right)}^2}}}\left( 2 \right)\,\,{\left( {1 - 3{x^2}} \right)^{\frac{1}{3}}} + {\tan ^{ - 1}}\left( {2x} \right)\left( {\frac{1}{3}} \right){\left( {1 - 3{x^2}} \right)^{ - \frac{2}{3}}}\left( { - 6x} \right)\\ & = \frac{{2{{\left( {1 - 3{x^2}} \right)}^{\frac{1}{3}}}}}{{1 + {{\left( {2x} \right)}^2}}} - 2x{\left( {1 - 3{x^2}} \right)^{ - \frac{2}{3}}}{\tan ^{ - 1}}\left( {2x} \right)\end{align*}\]In this part be careful with the inverse tangent. We know that,

\[\frac{d}{{dx}}\left( {{{\tan }^{ - 1}}x} \right) = \frac{1}{{1 + {x^2}}}\]When doing the chain rule with this we remember that we’ve got to leave the inside function alone. That means that where we have the \({x^2}\) in the derivative of \({\tan ^{ - 1}}x\) we will need to have \({\left( {{\mbox{inside function}}} \right)^2}\).

b \(f\left( z \right) = \sin \left( {z{{\bf{e}}^z}} \right)\) Show Solution

Now contrast this with the previous problem. In the previous problem we had a product that required us to use the chain rule in applying the product rule. In this problem we will first need to apply the chain rule and when we go to differentiate the inside function we’ll need to use the product rule.

Here is the chain rule portion of the problem.

\[f'\left( z \right) = \cos \left( {z{{\bf{e}}^z}} \right)\frac{d}{{dz}}\left[ {z{{\bf{e}}^z}} \right]\]In this case we did not actually do the derivative of the inside yet. We just left it in the derivative notation to make it clear that in order to do the derivative of the inside function we now have a product rule.

Here is the rest of the work for this problem.

\[f'\left( z \right) = \cos \left( {z{{\bf{e}}^z}} \right)\left( {{{\bf{e}}^z} + z{{\bf{e}}^z}} \right)\]c \(\displaystyle y = \frac{{{{\left( {{x^3} + 4} \right)}^5}}}{{{{\left( {1 - 2{x^2}} \right)}^3}}}\) Show Solution

For this problem we clearly have a rational expression and so the first thing that we’ll need to do is apply the quotient rule. In the process of using the quotient rule we’ll need to use the chain rule when differentiating the numerator and denominator.

\[y' = \frac{{5{{\left( {{x^3} + 4} \right)}^4}\left( {3{x^2}} \right){{\left( {1 - 2{x^2}} \right)}^3} - {{\left( {{x^3} + 4} \right)}^5}\left( 3 \right){{\left( {1 - 2{x^2}} \right)}^2}\left( { - 4x} \right)}}{{{{\left( {{{\left( {1 - 2{x^2}} \right)}^3}} \right)}^2}}}\]These tend to be a little messy. Notice that when we go to simplify that we’ll be able to a fair amount of factoring in the numerator and this will often greatly simplify the derivative.

\[\begin{align*}y' & = \frac{{{{\left( {{x^3} + 4} \right)}^4}{{\left( {1 - 2{x^2}} \right)}^2}\left( {5\left( {3{x^2}} \right)\left( {1 - 2{x^2}} \right) - \left( {{x^3} + 4} \right)\left( 3 \right)\left( { - 4x} \right)} \right)}}{{{{\left( {1 - 2{x^2}} \right)}^6}}}\\ & = \frac{{3x{{\left( {{x^3} + 4} \right)}^4}\left( {5x - 6{x^3} + 16} \right)}}{{{{\left( {1 - 2{x^2}} \right)}^4}}}\end{align*}\]After factoring we were able to cancel some of the terms in the numerator against the denominator. So even though the initial chain rule was fairly messy the final answer is significantly simpler because of the factoring.

d \(\displaystyle h\left( t \right) = {\left( {\frac{{2t + 3}}{{6 - {t^2}}}} \right)^3}\) Show Solution

Unlike the previous problem the first step for derivative is to use the chain rule and then once we go to differentiate the inside function we’ll need to do the quotient rule.

Here is the work for this problem.

\[\begin{align*}h'\left( t \right) & = 3{\left( {\frac{{2t + 3}}{{6 - {t^2}}}} \right)^2}\frac{d}{{dt}}\left[ {\frac{{2t + 3}}{{6 - {t^2}}}} \right]\\ & = 3{\left( {\frac{{2t + 3}}{{6 - {t^2}}}} \right)^2}\left[ {\frac{{2\left( {6 - {t^2}} \right) - \left( {2t + 3} \right)\left( { - 2t} \right)}}{{{{\left( {6 - {t^2}} \right)}^2}}}} \right]\\ & = 3{\left( {\frac{{2t + 3}}{{6 - {t^2}}}} \right)^2}\left[ {\frac{{2{t^2} + 6t + 12}}{{{{\left( {6 - {t^2}} \right)}^2}}}} \right]\end{align*}\]As with the second part above we did not initially differentiate the inside function in the first step to make it clear that it would be quotient rule from that point on.

There were several points in the last example. First is to not forget that we’ve still got other derivatives rules that are still needed on occasion. Just because we now have the chain rule does not mean that the product and quotient rule will no longer be needed.

In addition, as the last example illustrated, the order in which they are done will vary as well. Some problems will be product or quotient rule problems that involve the chain rule. Other problems however, will first require the use the chain rule and in the process of doing that we’ll need to use the product and/or quotient rule.

Most of the examples in this section won’t involve the product or quotient rule to make the problems a little shorter. However, in practice they will often be in the same problem so you need to be prepared for these kinds of problems.

Now, let’s take a look at some more complicated examples.

- \(\displaystyle h\left( z \right) = \frac{2}{{{{\left( {4z + {{\bf{e}}^{ - 9z}}} \right)}^{10}}}}\)
- \(f\left( y \right) = \sqrt {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \)
- \(y = \tan \left( {\sqrt[3]{{3{x^2}}} + \ln \left( {5{x^4}} \right)} \right)\)
- \(g\left( t \right) = {\sin ^3}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\)

In this case let’s first rewrite the function in a form that will be a little easier to deal with.

\[h\left( z \right) = 2{\left( {4z + {{\bf{e}}^{ - 9z}}} \right)^{ - 10}}\]Now, let’s start the derivative.

\[h'\left( z \right) = - 20{\left( {4z + {{\bf{e}}^{ - 9z}}} \right)^{ - 11}}\frac{d}{{dz}}\left( {4z + {{\bf{e}}^{ - 9z}}} \right)\]Notice that we didn’t actually do the derivative of the inside function yet. This is to allow us to notice that when we do differentiate the second term we will require the chain rule again. Notice as well that we will only need the chain rule on the exponential and not the first term. In many functions we will be using the chain rule more than once so don’t get excited about this when it happens.

Let’s go ahead and finish this example out.

\[h'\left( z \right) = - 20{\left( {4z + {{\bf{e}}^{ - 9z}}} \right)^{ - 11}}\left( {4 - 9{{\bf{e}}^{ - 9z}}} \right)\]Be careful with the second application of the chain rule. Only the exponential gets multiplied by the “-9” since that’s the derivative of the inside function for that term only. One of the more common mistakes in these kinds of problems is to multiply the whole thing by the “-9” and not just the second term.

b \(f\left( y \right) = \sqrt {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \) Show Solution

We’ll not put as many words into this example, but we’re still going to be careful with this derivative so make sure you can follow each of the steps here.

\[\begin{align*}f'\left( y \right) & = \frac{1}{2}{\left( {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \right)^{ - \frac{1}{2}}}\frac{d}{{dy}}\left( {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \right)\\ & = \frac{1}{2}{\left( {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \right)^{ - \frac{1}{2}}}\left( {2 + 3{{\left( {3y + 4{y^2}} \right)}^2}\left( {3 + 8y} \right)} \right)\\ & = \frac{1}{2}{\left( {2y + {{\left( {3y + 4{y^2}} \right)}^3}} \right)^{ - \frac{1}{2}}}\left( {2 + \left( {9 + 24y} \right){{\left( {3y + 4{y^2}} \right)}^2}} \right)\end{align*}\]As with the first example the second term of the inside function required the chain rule to differentiate it. Also note that again we need to be careful when multiplying by the derivative of the inside function when doing the chain rule on the second term.

c \(y = \tan \left( {\sqrt[3]{{3{x^2}}} + \ln \left( {5{x^4}} \right)} \right)\) Show Solution

Let’s jump right into this one.

\[\begin{align*}y' & = {\sec ^2}\left( {\sqrt[3]{{3{x^2}}} + \ln \left( {5{x^4}} \right)} \right)\frac{d}{{dx}}\left( {{{\left( {3{x^2}} \right)}^{\frac{1}{3}}} + \ln \left( {5{x^4}} \right)} \right)\\ & = {\sec ^2}\left( {\sqrt[3]{{3{x^2}}} + \ln \left( {5{x^4}} \right)} \right)\left( {\frac{1}{3}{{\left( {3{x^2}} \right)}^{ - \frac{2}{3}}}\left( {6x} \right) + \frac{{20{x^3}}}{{5{x^4}}}} \right)\\ & = \left( {2x{{\left( {3{x^2}} \right)}^{ - \frac{2}{3}}} + \frac{4}{x}} \right){\sec ^2}\left( {\sqrt[3]{{3{x^2}}} + \ln \left( {5{x^4}} \right)} \right)\end{align*}\]In this example both of the terms in the inside function required a separate application of the chain rule.

d \(g\left( t \right) = {\sin ^3}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\) Show Solution

We’ll need to be a little careful with this one.

\[\begin{align*}g'\left( t \right) & = 3{\sin ^2}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\frac{d}{{dt}}\sin \left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\\ & = 3{\sin ^2}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\cos \left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\frac{d}{{dt}}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\\ & = 3{\sin ^2}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\cos \left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\left( {{{\bf{e}}^{1 - t}}\left( { - 1} \right) + 3\cos \left( {6t} \right)\left( 6 \right)} \right)\\ & = 3\left( { - {{\bf{e}}^{1 - t}} + 18\cos \left( {6t} \right)} \right){\sin ^2}\left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\cos \left( {{{\bf{e}}^{1 - t}} + 3\sin \left( {6t} \right)} \right)\end{align*}\]This problem required a total of 4 chain rules to complete.

Sometimes these can get quite unpleasant and require many applications of the chain rule. Initially, in these cases it’s usually best to be careful as we did in this previous set of examples and write out a couple of extra steps rather than trying to do it all in one step in your head. Once you get better at the chain rule you’ll find that you can do these fairly quickly in your head.

Finally, before we move onto the next section there is one more issue that we need to address. In the Derivatives of Exponential and Logarithm Functions section we claimed that,

\[f\left( x \right) = {a^x}\hspace{0.25in}\hspace{0.25in} \Rightarrow \hspace{0.25in}\hspace{0.25in}f'\left( x \right) = {a^x}\ln \left( a \right)\]but at the time we didn’t have the knowledge to do this. We now do. What we needed was the chain rule.

First, notice that using a property of logarithms we can write \(a\) as,

\[a = {{\bf{e}}^{\ln a}}\]This may seem kind of silly, but it is needed to compute the derivative. Now, using this we can write the function as,

\[\begin{align*}f\left( x \right) & = {a^x}\\ & = {\left( a \right)^x}\\ & = {\left( {{{\bf{e}}^{\ln a}}} \right)^x}\\ & = {{\bf{e}}^{\left( {\ln a} \right)x}}\\ & = {{\bf{e}}^{x\,\,\ln a}}\end{align*}\]Okay, now that we’ve gotten that taken care of all we need to remember is that \(a\) is a constant and so \(\ln a\) is also a constant. Now, differentiating the final version of this function is a (hopefully) fairly simple Chain Rule problem.

\[f'\left( x \right) = {{\bf{e}}^{x\,\,\ln a}}\left( {\ln a} \right)\]Now, all we need to do is rewrite the first term back as \({a^x}\) to get,

\[f'\left( x \right) = {a^x}\ln \left( a \right)\]So, not too bad if you can see the trick to rewriting the \(a\) and with using the Chain Rule.