M5.4.7 Chapter 7
Chain, product and quotient rules
How do I differentiate a function inside another function, a product, or a fraction?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Differentiate (3x + 1)⁵ with the chain rule
- Differentiate x² sin x with the product rule
- Differentiate a fraction with the quotient rule
So far you can differentiate xⁿ, eˣ, ln x, sin x and cos x, and sums of them. But most functions are built in other ways. The function (3x + 1)⁵ is a function inside another function. The function x² sin x is a product of two functions. The function (2x + 1) ÷ (x − 3) is a quotient. Each needs a rule of its own.
The chain rule is for a function of a function. Write y = u⁵ where u = 3x + 1. Then y depends on u, and u depends on x, like links in a chain. Now think of rates. If u changes 3 times as fast as x, and y changes 5u⁴ times as fast as u, then y changes 5u⁴ × 3 times as fast as x.
Draw it first
The chain of rates
1 The rate along each arrow is the derivative of that step.
2 Multiply the two rates. This gives dy/dx = 5u⁴ × 3 = 15u⁴.
The chain rule says: if y is a function of u and u is a function of x, then dy/dx = dy/du × du/dx. The symbols dy/du and du/dx look like fractions, and in this case multiplying them works as if the du cancelled. It is a rule you can trust, but remember that dy/dx is one symbol and not a real fraction.
Worked example
Differentiate y = (3x + 1)⁵.
- Let u = 3x + 1. Then y = u⁵.
- Differentiate each link: dy/du = 5u⁴ and du/dx = 3.
- Multiply: dy/dx = 5u⁴ × 3 = 15u⁴.
- Put u = 3x + 1 back: dy/dx = 15(3x + 1)⁴.
- At x = 0, u = 1, so the gradient is 15 × 1⁴ = 15.
Answer: dy/dx = 15(3x + 1)⁴.
The same idea gives a quick set of results. Whenever the inside is a straight line ax + b, the rate of change of the inside is the constant a, and it multiplies the result.
Worked example
Differentiate y = (x² + 1)³, and find the gradient at x = 1.
- Let u = x² + 1. Then y = u³.
- Differentiate each link: dy/du = 3u² and du/dx = 2x.
- Multiply: dy/dx = 3u² × 2x = 6xu².
- Put u = x² + 1 back: dy/dx = 6x(x² + 1)².
- At x = 1: 6 × 1 × (1 + 1)² = 6 × 1 × 4 = 24.
Answer: dy/dx = 6x(x² + 1)².
See it three ways
With things
Gears in a line: turn the first gear once and the second turns 3 times. The second drives a third that turns 5 times for each turn of the second. One turn of the first makes the third turn 3 × 5 = 15 times. Rates multiply along the chain.
As a picture
In words
To differentiate a function of a function, differentiate the outside and the inside, and multiply the two results.
In symbols
dy/dx = dy/du × du/dx. For y = sin(x²), u = x² gives dy/dx = cos(x²) × 2x.
The product rule is for two functions multiplied together, y = uv, where u and v are both functions of x. A rectangle helps. It has sides u and v, so its area is uv. Let x grow a little, so that u grows by δu and v grows by δv. The new area is (u + δu)(v + δv).
The change in area is v δu + u δv + δu δv. Divide by δx and let δx shrink. The two strips give v du/dx + u dv/dx. The corner gives δu δv ÷ δx, which goes to 0, since it is du/dx × δv with δv going to 0. So the product rule is: if y = uv, then dy/dx = u dv/dx + v du/dx.
Worked example
Differentiate y = x² sin x, and find the gradient at x = π.
- Let u = x² and v = sin x.
- Then du/dx = 2x and dv/dx = cos x.
- Product rule: dy/dx = u dv/dx + v du/dx = x² cos x + sin x × 2x.
- So dy/dx = x² cos x + 2x sin x.
- At x = π, cos π = −1 and sin π = 0. To 2 decimal places, dy/dx = π² × (−1) + 2π × 0 = −9.87.
Answer: dy/dx = x² cos x + 2x sin x. At x = π the gradient is −9.87.
The quotient rule is for a fraction y = u ÷ v. If y = u/v, then dy/dx = (v du/dx − u dv/dx) ÷ v². The order of the two terms on top matters, because there is a minus between them. Start with v du/dx, the bottom times the derivative of the top. Then subtract u dv/dx, the top times the derivative of the bottom.
Worked example
Differentiate y = (2x + 1) ÷ (x − 3), and find the gradient at x = 4.
- Let u = 2x + 1 and v = x − 3. Then du/dx = 2 and dv/dx = 1.
- The top of the quotient rule is v du/dx − u dv/dx = (x − 3) × 2 − (2x + 1) × 1.
- Expand: 2x − 6 − 2x − 1 = −7. The x terms cancel.
- So dy/dx = −7 ÷ (x − 3)².
- At x = 4: −7 ÷ 1² = −7.
Answer: dy/dx = −7/(x − 3)².
Which rule to use? Look at how the function is built from its last step. If the last step is a function of a bracket, use the chain rule. If the last step multiplies two functions, use the product rule. If the last step divides, use the quotient rule. Some functions need two rules, one inside the other.
Try it
Check the chain rule with chords
You need: a calculator, paper and a pencil.
- Take y = (3x + 1)⁵. At x = 0, y = 1. Work out y at x = 0.1: 1.3⁵ = 3.71293.
- The chord gradient is (3.71293 − 1) ÷ 0.1 = 27.1293. Write it down.
- Do the same for x = 0.01 and x = 0.001. The values of y are 1.159274 and 1.015090.
- Compare the chord gradients with 15, the chain rule result, and with 5, the answer from forgetting the 3.
What you will see: The chord gradients are 27.13, 15.93 and 15.09. They close in on 15, not on 5.
A wrong idea many people have
The derivative of (3x + 1)⁵ is 5(3x + 1)⁴. The power rule works on the bracket.
Why it feels right: It looks like the power rule, with the bracket in place of x. The answer 5(3x + 1)⁴ has the same shape as the power rule result for x⁵.
The test that breaks it: At x = 0 the chords of (3x + 1)⁵ have gradients 27.13, 15.93 and 15.09. The claim 5(3x + 1)⁴ gives 5 at x = 0. The chords are nowhere near 5.
What is true: The bracket changes 3 times as fast as x, and the chain rule multiplies by that rate. The result is 5(3x + 1)⁴ × 3 = 15(3x + 1)⁴. Always multiply by the derivative of the inside.
A wrong idea many people have
The derivative of a product uv is du/dx × dv/dx. For x² sin x it is 2x cos x.
Why it feels right: Adding and subtracting work term by term, so it seems that multiplying should too. The derivative of a product being the product of the derivatives looks tidy.
The test that breaks it: At x = π the chord gradient of x² sin x for a step of 0.001 is about −9.876, close to the true −9.870. The claim 2x cos x gives 2π × (−1) = −6.28.
What is true: In a product, each factor changes while the other one stays, and both effects add. That gives u dv/dx + v du/dx. The product rule has two terms, not one.
A wrong idea many people have
The derivative of u/v is (du/dx) ÷ (dv/dx). For (2x + 1) ÷ (x − 3) it is 2 ÷ 1 = 2.
Why it feels right: It is the same trick as the previous mistake, with division in place of multiplication. It looks like the derivative should split over the fraction.
The test that breaks it: At x = 4 the curve has y = 9. At x = 4.01, y = 9.02 ÷ 1.01 = 8.9307. The chord gradient is (8.9307 − 9) ÷ 0.01 = −6.93. The curve falls, and 2 says that it rises.
What is true: Use the quotient rule: (v du/dx − u dv/dx) ÷ v². Here that is −7/(x − 3)², which is −7 at x = 4. Note that the bottom is squared and that the minus sign sits between the two terms on top.
Key words
- chain rule
- dy/dx = dy/du × du/dx. It differentiates a function of a function.
- product rule
- if y = uv then dy/dx = u dv/dx + v du/dx.
- quotient rule
- if y = u/v then dy/dx = (v du/dx − u dv/dx) ÷ v².
- composite function
- a function built by putting one function inside another, such as (3x + 1)⁵.
Back to your guess
The answer is B: The derivative of y = (3x + 1)⁵ is 15(3x + 1)⁴.
The derivative is 15(3x + 1)⁴. The power rule brings down the 5 and lowers the power, but the bracket 3x + 1 changes 3 times as fast as x. So there is an extra factor 3. At x = 0, the chord gradients of (3x + 1)⁵ close in on 15, not on 5.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
What is the derivative of y = (3x + 1)⁵?
See the answer
15(3x + 1)⁴
Let u = 3x + 1. Then dy/du = 5u⁴ and du/dx = 3. Multiplying gives 15u⁴ = 15(3x + 1)⁴.
- If you chose B: You used the power rule only. The chain rule multiplies by the derivative of the inside, 3x + 1, which is 3. Read this page again.
- If you chose C: You multiplied by 3 and by 5 but did not lower the power. The power goes down by 1. Read this page again.
What is the derivative of y = sin 2x, with x in radians?
See the answer
2 cos 2x
Let u = 2x. Then y = sin u, dy/du = cos u and du/dx = 2. Multiplying gives 2 cos u = 2 cos 2x.
- If you chose A: You differentiated the outside, sin, but not the inside, 2x. The inside changes twice as fast as x. Read this page again.
- If you chose B: The derivative of sin is cos, not −sin. The negative sign belongs to the derivative of cos. Read this page again.
- If you chose D: The derivative of the outside function sin u is cos u, not sin u. Read this page again.
Which rule do you use to differentiate y = x³ cos x?
See the answer
The product rule
The function x³ cos x is x³ multiplied by cos x. A product uses u dv/dx + v du/dx.
- If you chose A: The chain rule is for a function inside another function. Here two separate functions are multiplied. Read this page again.
- If you chose C: The quotient rule is for one function divided by another. Here the two are multiplied. Read this page again.
Which rule is made for a fraction like y = (sin x) ÷ x?
See the answer
The quotient rule
The function is one function, sin x, divided by another, x. That is the quotient rule.
- If you chose A: There is no function inside another function here. One function is divided by another. Read this page again.
- If you chose B: You could write it as a product with x⁻¹, and that would work. But the question asks which rule is made for a fraction, and that is the quotient rule. Read this page again.
- If you chose C: The power rule is for xⁿ alone. Here sin x is divided by x. Read this page again.
Which rule do you use first to differentiate y = (x² + 1)⁴?
See the answer
The chain rule
The bracket x² + 1 is inside the power 4. That is a function of a function, so use the chain rule.
- If you chose A: There is no fraction in this function. Read this page again.
- If you chose B: The function is a power of a bracket, not two separate functions multiplied. Read this page again.
From an earlier chapter
What is the derivative of y = 4 cos x, with x in radians?
Find the gradient of y = (2x + 1)⁴ at x = 1.
See the answer
216
The chain rule gives dy/dx = 4(2x + 1)³ × 2 = 8(2x + 1)³. At x = 1 this is 8 × 3³ = 8 × 27 = 216.
Find the gradient of y = (x² + 1)(3x − 2) at x = 2. Use the product rule.
See the answer
31
Let u = x² + 1 and v = 3x − 2. Then du/dx = 2x and dv/dx = 3. The product rule gives u × 3 + v × 2x. At x = 2, u = 5 and v = 4, so the gradient is 5 × 3 + 4 × 4 = 15 + 16 = 31.
Find the gradient of y = (3x + 2) ÷ (x − 4) at x = 5. Use the quotient rule.
See the answer
−14
The top of the quotient rule is (x − 4) × 3 − (3x + 2) × 1 = −14. So dy/dx = −14 ÷ (x − 4)². At x = 5 this is −14 ÷ 1 = −14.
Find the gradient of y = x sin x at x = π, to 2 decimal places.
See the answer
−3.14
The product rule gives dy/dx = x cos x + sin x. At x = π, cos π = −1 and sin π = 0, so the gradient is −π = −3.14.
Keep it
Copy this into your exercise book.
Chain: dy/dx = dy/du × du/dx. Product: u dv/dx + v du/dx. Quotient: (v du/dx − u dv/dx) ÷ v². Look at the last step of the function to choose.
Draw: A row of boxes x, u, y with the rate written under each arrow, and the three rules written below.