Topics You Need To Understand For This Page
Calculus Main Topics
Tools
Related Topics and Links
Chain Rule FAQs
Derivative  Chain Rule 
on this page:
► substitution method ► direct method

The Chain Rule is probably the most important derivative rule that you will learn since you will need to use it a lot and it shows up in various forms in other derivatives and integration. It can also be a little confusing at first but if you stick with it, you will be able to understand it well. 


There are two main ways to learn the chain rule, substitution and direct. I recommend writing out the substitution form while you are first learning. After you get the hang of it, you can use the direct (shorter) version.
NOTE: Do not be lazy here and try to use the direct version first. Write everything out so that you can see it. If you don't, you will struggle with this concept for the rest of your calculus life and this rule is used everywhere, and I mean EVERYWHERE from now on. You can't get away from it and you can't get around it. So, let's get started.
The chain rule says, if you have a function in the form y=f(u) where u is a function of x, then \(\displaystyle{ \frac{dy}{dx} = \frac{df}{du} \cdot \frac{du}{dx} }\).
The notation tells you that \(u(x)\) is a composite function of \(f\).
This is the method you should learn first since it breaks the problem into smaller, bitesize pieces that you already know how to take derivatives of. The best way to learn this concept is with examples.
1. \( y=(x+1)^2 \) can be separated into \(u = x+1 \) and \( y=u^2 \). We started on the outside and noticed that there was something with a power of 2. So we took that something and set it equal to u.
2. \( y=\sin(x^2) \) can be separated into \( u=x^2 \) and \( y=\sin(u) \). We noticed that, on the outside, we have the sine function. So we set whatever was on the inside to u.
3. \( y=\sqrt{\sin(x)} \) has an outside function as a square root, while the inside function is sine. So \( u=\sin(x) \) and \( y = \sqrt{u} \).
4. \( y=\sqrt{\sin(x^2)} \) is a combination of the last two examples and is a little more complicated (but not much). We do the same thing as before and notice that the outside function a square root. So we set u to the inside function, i.e. \( u=\sin(x^2) \) and \( y=\sqrt{u} \). When we try to take the derivative \(du/dx\), we need to do substitution again. So we let \(v=x^2\) and \(u=\sin(v)\).
In all of these examples, we just showed you how to set the problem with substitution. You would then complete the problem by taking the derivative of each piece. Try this example before going on to the direct method.
 Example   Calculate the derivative of \( y=\cos(x^2+3) \) using the substitution method. 
Using the substitution \( u=x^2+3 \), \( y=\cos(x^2+3) \) can now be written \( y=\cos(u) \).
\(
\begin{array}{rcl}
\displaystyle{\frac{dy}{dx}} & = & \displaystyle{\frac{dy}{du} \cdot \frac{du}{dx}} \\
& = & \displaystyle{\frac{d}{du}[\cos(u)] \cdot \frac{d}{dx}[x^2+3] }\\
& = & (\sin(u)) \cdot (2x) \\
& = & (2x)\sin(x^2+3)
\end{array}
\)

Okay, once you get the basic idea of the chain rule down, the next step is be able to write out the derivative without using substitution. Note: Some instructors jump to this technique right away without emphasizing the substitution concept. If your instructor does that, check your textbook and learn the chain rule with substitution first. You will be glad you did later on down the road.
Now, there are two ways to think about working problems without substitution. The technique that I think works best is to start from the outside and work your way in. Let's see how this is done using an example of an outside to inside technique.
 Example   Calculate the derivative of \( g(t)=\sin(t^3) \) using the direct method. 
The outside function is sine. So we write \( \displaystyle{ \frac{dg}{dt} = \cos(t^3) \cdot \frac{d}{dt}[t^3] }\). Notice here that we wrote the derivative of the outside and left the inside intact, i.e. unchanged in the term \( \cos(t^3)\). Then the second term is the derivative of the inside, written as \( \displaystyle{ \frac{d}{dt}[t^3] }\). Finishing this example, the answer is \(\displaystyle{ g'(t) = (3t^2)\cos(t^3) }\).

A second way to work this is to start on the inside and work your way out. Some of the videos further down on this page show this technique but we do not recommend it. The reason is that the more difficult problems (and ones you will probably see on your exam) are nested, i.e. you need to use the chain rule repeatedly. It is much easier to break the problem down and see what you need to do if you start on the outside and work your way in. Starting in the inside is sometimes difficult to find where to start. Let's do an example of this.
 Example   Evaluate \( \displaystyle{ \frac{d}{dx}[\sin(\tan(2x))]}\). 
This looks harder than it really is. If you follow the outsidein technique that we just mentioned and you write out some intermediate steps, you should be able to work this kind of problem easily.
\( \displaystyle{
\begin{array}{rcl}
\frac{d}{dx}[\sin(\tan(2x))] & = & \cos(\tan(2x)) \cdot \frac{d}{dx}[ \tan(2x) ] \\
& = & \cos(\tan(2x))\sec^2(2x) \cdot \frac{d}{dx}[2x] \\
& = & \cos(\tan(2x)) ~ \sec^2(2x) ~ 2 \\
& = & 2 ~ \cos(\tan(2x)) ~ \sec^2 (2x)
\end{array}
}\)
Let's look at each step individually.
In the term \( \displaystyle{ \sin(\tan(2x)) }\), the outside function is sine, the inside function is \(\tan(2x)\).
So the term \(\cos(\tan(2x))\) is the derivative of the outside function (sine) carrying along the inside term without changing it.
Next, we take the derivative of the inside term \(\displaystyle{ \frac{d}{dx}[ \tan(2x) ] }\).
Now, in this second term there is an outside function, tangent, and an inside function, \(2x\). The second line takes the derivative of \(\tan(2x)\) which is \(\sec^2(2x)\), keeping the inside term intact and then taking the derivative of the inside function, \( d[2x]/dx = 2 \).

Before working practice problems, let's watch a video. This video has a great explanation of the chain rule at the first and then some examples that should help you understand how to use this rule.
 PatrickJMT  Chain Rule for Finding Derivatives 

Okay, now you are ready for some practice problems.
practice filters 

use basic derivatives only (9) 

use trig rules (9) 

use exponential and/or logarithmic rules (7) 
hidden practice problems 
Instructions   Unless otherwise instructed, calculate the derivative of these functions and give your final answers in completely factored form.
Practice A01 
\(\displaystyle{ 3e^{ x^2+7 } }\) 


\(\displaystyle{ \frac{d}{dx} \left[ 3e^{ x^2+7 } \right] = 6xe^{x^2+7} }\) 
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx} \left[ 3e^{ x^2+7 } \right] & = & 3e^{x^2+7} \cdot \frac{d}{dx}[x^2+7] \\
& = & 3e^{x^2+7} \cdot (2x) \\
& = & 6xe^{x^2+7}
\end{array}
}\)
Another way to work this is with the substitution method. If we let \(u=x^2+7\) then
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx} \left[ 3e^{ x^2+7 } \right] & = & 3\frac{d[e^u]}{du} \cdot \frac{d[x^2+7]}{dx} \\
& = & 3e^u \cdot (2x) \\
& = & 6xe^{x^2+7}
\end{array}
}\)
Practice A01 Final Answer 
\(\displaystyle{ \frac{d}{dx} \left[ 3e^{ x^2+7 } \right] = 6xe^{x^2+7} }\) 
Practice A02 
\(\displaystyle{ (x^3+1)^4 }\) 


\(\displaystyle{ \frac{d}{dx} \left[ (x^3+1)^4 \right] = 12x^2(x^3+1)^3 }\) 
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx} \left[ (x^3+1)^4 \right] & = & 4(x^3+1)^3 \cdot \frac{d}{dx}[x^3+1] \\\\
& = & 4(x^3+1)^3 \cdot (3x^2) \\\\
& = & 12x^2(x^3+1)^3
\end{array}
}\)
Another way to work this is with the substitution method. If we let \(u=x^3+1\) then
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx} \left[ (x^3+1)^4 \right] & = & 3\frac{d[u^4]}{du} \cdot \frac{d[x^3+1]}{dx} \\\\
& = & 4u^3 \cdot (3x^2) \\\\
& = & 12x^2(x^3+1)^3
\end{array}
}\)
Practice A02 Final Answer 
\(\displaystyle{ \frac{d}{dx} \left[ (x^3+1)^4 \right] = 12x^2(x^3+1)^3 }\) 
Practice A03 
\(\displaystyle{ \ln(3x^2+9x5) }\) 


\(\displaystyle{ \frac{d}{dx}[ \ln(3x^2+9x5) ] = \frac{3(2x+3)}{3x^2+9x5} }\) 
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx}[ \ln(3x^2+9x5) ] & = & \frac{1}{3x^2+9x5}\cdot \frac{d}{dx}[3x^2+9x5] \\\\
& = & \frac{1}{3x^2+9x5}\cdot (6x+9) \\\\
& = & \frac{3(2x+3)}{3x^2+9x5}
\end{array}
}\)
In the first line, we used the chain rule. Using the substitution \( u = 3x^2+9x5 \) this could have solved more explicitly like this.
\( \displaystyle{
\begin{array}{rcl} \frac{d}{dx}[ \ln(3x^2+9x5) ] & = & \frac{d}{du}[\ln(u)] \cdot \frac{d}{dx}[3x^2+9x5] \\\\
& = & \frac{1}{u} \cdot (6x+9) \\\\
& = & \frac{1}{3x^2+9x5} \cdot [ 3(2x+3) ]
\end{array}
}\)
Practice A03 Final Answer 
\(\displaystyle{ \frac{d}{dx}[ \ln(3x^2+9x5) ] = \frac{3(2x+3)}{3x^2+9x5} }\) 
Practice A04 
calculate the first three derivatives of \(\displaystyle{ f(x)=\ln(2+3x) }\) 

First Derivative
\(\displaystyle{
\begin{array}{rcl}
f'(x) & = & \frac{d}{dx}[ \ln(2+3x) ] \\\\
& = & \frac{1}{2+3x} \frac{d}{dx}[2+3x] \\\\
& = & \frac{1}{2+3x} (3) = \frac{3}{2+3x}
\end{array}
}\)
Second Derivative
We can use the either quotient rule or product rule here. The product rule is the easiest here because of the constant in the numerator but we need to rewrite the first derivative as \(\displaystyle{ \frac{3}{2+3x} = 3(2+3x)^{1} }\).
\(\displaystyle{
\begin{array}{rcl}
f''(x) & = & \frac{d}{dx} \left[ 3(2+3x)^{1} \right] \\\\
& = & 3(1)(2+3x)^{2} \frac{d}{dx}[2+3x] \\\\
& = & 3(2+3x)^{2} (3) = \frac{9}{(2+3x)^{2}}
\end{array}
}\)
Third Derivative
Again, we can use either the quotient rule or product rule and we choose the product rule.
\(\displaystyle{
\begin{array}{rcl}
f^{(3)}(x) & = & \frac{d}{dx}\left[ 9(2+3x)^{2} \right] \\
& = & 9(2)(2+3x)^{3}\frac{d}{dx}[2+3x] \\
& = & 18(2+3x)^{3} (3) \\
& = & \frac{54}{(2+3x)^3}
\end{array}
}\)
Final Answers 
\(\displaystyle{
f'(x) =\frac{3}{2+3x}
}\)

\(\displaystyle{
f''(x) = \frac{9}{(2+3x)^{2}}
}\)

\(\displaystyle{
f^{(3)}(x) = \frac{54}{(2+3x)^3}
}\)

Practice A05 
\(\displaystyle{ f(x)=\sqrt{2x+1} }\) 


\(\displaystyle{\frac{1}{\sqrt{2x+1}}}\) 
Both of these videos contain the solution to this problem. We are including both here in case one of them helps you more than the other.
Practice A05 Final Answer 
\(\displaystyle{\frac{1}{\sqrt{2x+1}}}\) 
Practice A06 
\(\displaystyle{ f(x)=(x+1)^3 }\) 

Practice A07 
\(\displaystyle{ 7 \sin(x^2+1) }\) 


\(\displaystyle{ \frac{d}{dx}[ 7 \sin(x^2+1) ] = (14x) \cos(x^2+1) }\) 
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx}[ 7\sin(x^2+1) ] & = & 7\frac{d}{dx}[\sin(x^2+1)] \\\\
& = & 7\cos(x^2+1)\frac{d}{dx}[x^2+1] \\\\
& = & 7\cos(x^2+1)(2x) \\\\
& = & (14x)\cos(x^2+1)
\end{array}
}\)
In the first line above, we used the Constant Multiple Rule to move the 7 outside the derivative. Then we used the Chain Rule. A more explicit way to work this is to use substitution. Let \( u = x^2+1 \) which is the inside term. Then we would write
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx}[ 7\sin(x^2+1) ] & = & 7\frac{d}{du}[\sin(u)] \cdot \frac{d}{dx}[x^2+1] \\\\
& = & 7[\cos(u)](2x) \\\\
& = & (14x)\cos(x^2+1)
\end{array}
}\)
If we call the original function, say \(f(x)=7\sin(x^2+1)\), the first line is \(\displaystyle{ \frac{df}{dx} = \frac{df}{du}\cdot\frac{du}{dx} }\) using the Chain Rule. This is probably a better way to work the problem than the first solution, especially while you are learning. Once you have the chain rule down, you can easily work it as shown in the first solution.
Practice A07 Final Answer 
\(\displaystyle{ \frac{d}{dx}[ 7 \sin(x^2+1) ] = (14x) \cos(x^2+1) }\) 
Practice A08 
\(\displaystyle{ f(x) = (x^4+3x^22)^5 }\) 

Practice A09 
\( \tan(x^5 + 2x^3  12x) \) 


\( (5x^4 + 6x^2  12) \sec^2(x^5 + 2x^3  12x) \) 
Using substitution, the outside function is tangent and the inside function is everything inside the tangent parentheses. So, we let \( u = x^5 + 2x^3  12x \).
\(\displaystyle{
\begin{array}{rcl}
\frac{d}{dx}[\tan(x^5 + 2x^3  12x)] & = & \frac{d}{dx}[\tan(u)] \\\\
& = & \frac{d}{du}[\tan(u)] \frac{d}{dx}[u] \\\\
& = & \frac{d}{du}[\tan(u)] \frac{d}{dx}[x^5 + 2x^3  12x] \\\\
& = & \sec^2(u) (5x^4 + 6x^2  12) \\\\
& = & (5x^4 + 6x^2  12) \sec^2(x^5 + 2x^3  12x)
\end{array}
}\)
Practice A09 Final Answer 
\( (5x^4 + 6x^2  12) \sec^2(x^5 + 2x^3  12x) \) 
Practice A10 
\(y=4^{x^3\sin x}\) 


\(y'=4^{x^3\sin x}(3x^2\cos x)\ln 4\) 
Practice A10 Final Answer 
\(y'=4^{x^3\sin x}(3x^2\cos x)\ln 4\) 
Practice A11 
\(\displaystyle{ g(x)= (1+4x)^5(3+xx^2)^8 }\) 

Practice A12 
\(\displaystyle{ f(x) = (2x3)^4 (x^2+x+1)^5 }\) 

Practice A13 
\(\displaystyle{ y=\sin^3(x) \tan(4x) }\) 

Practice A14 
\(\displaystyle{ y = (2x^53) \sin(7x) }\) 


\(\displaystyle{ \frac{dy}{dx} = 7(2x^53)\cos(7x) + (10x^4)\sin(7x) }\) 
\(\displaystyle{ \begin{array}{rcl} \frac{dy}{dx} & = & (2x^53) \frac{d}{dx}[\sin(7x)] + \sin(7x)\frac{d}{dx} [2x^53] \\\\ & = & (2x^53)\cos(7x) (7) + \sin(7x) (10x^4) \\\\ & = & 7(2x^53)\cos(7x) + (10x^4)\sin(7x) \end{array} }\)
Practice A14 Final Answer 
\(\displaystyle{ \frac{dy}{dx} = 7(2x^53)\cos(7x) + (10x^4)\sin(7x) }\) 
Practice A15 
\(y=x^2\cos(1/x^3)\) 


\(y'=2x\cos(1/x^3)+3\sin(1/x^3)/x^2\) 
Practice A15 Final Answer 
\(y'=2x\cos(1/x^3)+3\sin(1/x^3)/x^2\) 
Practice A16 
\((x^21)e^{x}\) 


\(e^{x}(1+2xx^2)\) 
Practice A16 Final Answer 
\(e^{x}(1+2xx^2)\) 
Practice B01 
\(\displaystyle{ y = (1+\cos^2(7x))^3 }\) 

Practice B02 
\(\displaystyle{ y = \cos \left( \frac{1e^{2x}}{1+e^{2x}} \right) }\) 

Practice B03 
\(\displaystyle{ y=\left( \frac{x^2+1}{x^21} \right)^3 }\) 

Practice B04 
\(\displaystyle{ g(t) = \frac{(t+4)^{1/2}}{(t4)^{1/2}} }\) 


\(\displaystyle{g'(t) =\frac{4}{(t4)^{3/2}(t+4)^{1/2}}}\) 
There is a mistake in this video. See the comments below the video for the correction.
I hope you found the mistake yourself. When he simplifies \([ (t4)^1  (t+4)^1]\) the answer should be \([ (t4)^1  (t+4)^1] = [ t4 t4 ] = 8\). In the video he has 16. So the final answer is \(\displaystyle{ \frac{4}{(t4)^{3/2}(t+4)^{1/2}}}\)
Practice B04 Final Answer 
\(\displaystyle{g'(t) =\frac{4}{(t4)^{3/2}(t+4)^{1/2}}}\) 
Practice B05 
Use the quotient rule to find \(f'(x)\) of \(\displaystyle{ f(x)=\frac{6}{\ln(8x^2)} }\). 


\(\displaystyle{f'(x)=\frac{12}{x[\ln(8x^2)]^2}}\) 
Practice B05 Final Answer 
\(\displaystyle{f'(x)=\frac{12}{x[\ln(8x^2)]^2}}\) 
Practice B06 
\(\displaystyle{y=\ln\sqrt{\frac{x^2+1}{x+3}}}\) 


\(\displaystyle{y'=\frac{x}{x^2+1}\frac{1}{2(x+3)}}\) 
Practice B06 Final Answer 
\(\displaystyle{y'=\frac{x}{x^2+1}\frac{1}{2(x+3)}}\) 
Practice C01 
\(\displaystyle{ y=\left[ \tan \left( \sin \left( \sqrt{x^2+8x}\right) \right) \right]^5 }\)


Practice C02 
\(\displaystyle{ y=x \sin(1/x) + \sqrt[4]{(13x)^2 + x^5} }\) 

In this video, his second term contains t of x.
Practice C03 
\(\displaystyle{ f(x)=\left[ \frac{x+4}{\sqrt{x^2+1}} \right]^3 }\) 
