You can differentiate and you can differentiate , but is neither of those: it is the sine of a quantity that is itself changing. Functions built by feeding one function into another are called compositions, such as , and . The chain rule differentiates every one of them, and it rests on a single fact: when one quantity drives another, their rates of change multiply.
Outside and inside
A composition is computed in two stages. The inner function turns into a number , and then the outer function turns into . To find the layers of a formula, ask what you would do last if you evaluated it at by hand. For you would cube 3 first and take the sine last, so the outside is and the inside is .
| Function | Inside | Outside |
|---|---|---|
The first two rows use the same two pieces in opposite orders. cubes the input before the sine acts; takes the sine first and cubes the output.
A product is not a composition. In , the two pieces are computed separately from and then multiplied; neither one is fed into the other, so that function needs the product rule (topic 2.8).
Why the rates multiply
Suppose changes 3 times as fast as , and changes 4 times as fast as . A small nudge to is magnified by 3 on its way to , and that change in is magnified by 4 on its way to , so changes times as fast as . Gears work the same way: if gear A turns gear B 3 times per turn and gear B turns gear C 4 times per turn, then C turns 12 times for each turn of A. With and , Leibniz notation writes this as
Here is where it comes from. Give a small change . That changes by some , which in turn changes by some . As long as , ordinary algebra gives
Now let . The second fraction approaches . Because is differentiable at , it is continuous there (topic 2.4), so as well, and the first fraction approaches , the derivative of at . If happens to equal 0 for arbitrarily small , the first fraction is undefined; a more careful proof patches that case and gets the same rule. The 's in Leibniz notation look like they cancel, which is a good memory aid, but the limit argument is the actual reason.
The outside derivative is evaluated at , not at , because never receives . Its input is , so its rate of change has to be measured at the value of it is actually given.
You can test the rule on a function you can also expand. For , the outside is and the inside is , so
Expanding first gives and , the same answer. Leaving off the inside derivative gives , which is too small by exactly the factor of 3 at which the inside changes.
Every rule you know, with an inside
Each derivative rule from Unit 2 becomes a chain rule pattern when its input is a function instead of : differentiate the outside as usual, keep as its input, and multiply by .
| Function | Derivative |
|---|---|
| , where |
The last row is the outside derivative evaluated at , times ; it needs because is defined only for . For example, .
Four patterns are worth recognizing on sight:
- A linear inside contributes its slope. and . The same holds for a function you know only by name: .
- Roots and reciprocals are powers. Rewrite as . Then its derivative is .
- Exponentials with other bases. Since , you can write , an exponential whose inside has slope . So , and for instance .
- A power of a trig function is a power first. has outside , so its derivative is . Compare , whose derivative is .
Three or more layers, and other rules mixed in
With three layers, the chain rule applies at each link, so the derivative is a product of three factors. Work from the outside in: differentiate the outermost layer while leaving everything inside it untouched, multiply by the derivative of what was inside, and repeat until you reach . For , on an interval where , the layers are , then , then :
When products, quotients and compositions are mixed, the operation you would do last decides which rule you use first. In the last step is multiplying by , so the product rule comes first, and the chain rule shows up inside it when you differentiate :
Compositions given by tables and graphs
The exam can give and only through a table of values or a graph. The rule does not change; you look up each number instead of computing it. For at :
- Find the inside value .
- Look up the outside derivative at that value, .
- Look up and multiply.
The two lookups come from different rows of the table, row for and row for , and reading from row instead gives a wrong number.
On a graph, the derivative at a point is the slope there, so for a graph made of line segments, at an input is the slope of the segment containing it. If lands exactly on a corner of the graph of , then is not differentiable at and the chain rule's condition fails. When in addition , the composition really does have a corner at : its slopes on the two sides of are the two segment slopes, each multiplied by , and they disagree. Example 3 works through one.
Worked examples
Let . Find and .
Show solution
Rewrite the function as a power so that only the chain rule is needed: . The outside is and the inside is , with .
At , the inside is and , so
The sign makes sense: for the denominator grows as grows, so is decreasing there. The quotient rule would also work, but it would need the chain rule anyway to differentiate the denominator, so rewriting as a power is the shorter path.
Let . Write an equation for the line tangent to the graph of at .
Show solution
A tangent line needs a point and a slope, so find and .
The layers, from outside in, are , then , then . Differentiating one layer at a time:
At , , so . Then
The tangent line is
Point-slope form is a complete answer; there is no need to simplify it.
The graph of the function , which consists of three line segments, is shown below. Let and .
(a) Find .
(b) Find .
(c) Is differentiable at ? Justify your answer.
Show solution
First read the slopes off the graph: on , on , and on .
(a) The outside of is and the inside is , so . The point is the midpoint of the segment from to , so and :
(b) Here the inside is , so . At the inside is , which lies on the middle segment:
(c) At the inside is , a corner of the graph of , so the chain rule cannot be used there. Look at on each side instead. For slightly less than 1, is slightly less than 2, where ; so , whose slope at is . For slightly greater than 1, is slightly more than 2, where ; so , whose slope at is . The slope of from the left of is and from the right is . They are not equal, so is not differentiable at .
The functions and are differentiable for all real numbers. The table below gives values of the functions and their derivatives at selected values of .
(a) Let . Find .
(b) Let . Find .
(c) Let . Write an equation for the line tangent to the graph of at .
(d) Let . Find .
Show solution
For each part, write the derivative rule in general first, then substitute table values. That line is the work the exam wants to see, and it makes a lookup error easy to spot.
(a) . The inside value is , so the outside derivative comes from row 3:
(b) The outside is , with derivative , and the inside is :
(c) The point: . The slope: the inside value is , so
The tangent line is .
(d) The last operation in is multiplying by , so start with the product rule; the second factor needs the chain rule with inside :
At , the inside is , so both lookups come from row 4:
Where students lose points
On the exam
Questions that test the chain rule directly can give the composition as a formula, or give and only through a table or a graph so that you must look up , and ; they appear in multiple choice and as free-response parts. On no-calculator free-response parts, an unsimplified numeric answer such as is acceptable; the arithmetic is not what is being tested. On calculator-active questions, the calculator can find a derivative's value at a point, but when a question asks for as an expression, you have to produce it by hand.
Check yourself
Question 1
If , then
- A
- B
- C
- D
Show answer
A
There are three layers: the square, the cosine, and . Their derivatives are , and , and the product is . Choice B stops one layer early and drops the factor of 3 from the innermost layer.
- A
Question 2
Let , where and are differentiable. If , and , what is ?
Show answer
By the chain rule, . Setting gives . The outside derivative is the one at , which is why the question can only be answered about .
Question 3
The function is differentiable for all real numbers, and . What is , and why don't you need to know anything about to answer?
Show answer
, for every differentiable .
The chain rule gives . At the inside derivative is 0, and is some finite number because is differentiable, so the product is 0 whatever is.
Question 4
What is the value of at ?
- A
- B
- C
- D
Show answer
C
The derivative is . At that is . Choice A forgets the inside derivative entirely, and choice D evaluates the exponential at the inside's derivative instead of multiplying by it.
- A
Question 5
On a calm day the air temperature , in degrees Celsius, falls with altitude at the rate degrees Celsius per kilometer. A weather balloon rises at kilometer per minute. At what rate is the temperature around the balloon changing with respect to time?
Show answer
degrees Celsius per minute (falling at 2.6 degrees Celsius per minute).
Temperature depends on altitude, which depends on time, so . The units multiply the same way: degrees per kilometer times kilometers per minute gives degrees per minute.