Step 13: The Chain Rule
- A composite function has an inside and an outside, as in \( (3x^2 + 1)^5 \). The chain rule says \( \dfrac{dy}{dx} = \dfrac{dy}{du} \times \dfrac{du}{dx} \): differentiate the outside, leave the inside alone, then multiply by the derivative of the inside.
- Writing \( a^x = e^{x\ln a} \) gives \( \dfrac{d}{dx}(a^x) = a^x\ln a \), and \( \log_a x = \dfrac{\ln x}{\ln a} \) gives \( \dfrac{d}{dx}(\log_a x) = \dfrac{1}{x\ln a} \).
- The tangent at \( (x_1, y_1) \) is \( y-y_1 = m(x-x_1) \) with \( m = f'(x_1) \); the normal has gradient \( -\dfrac{1}{m} \).
- Exam point: a derivative is a rate, measured in units of \( y \) per unit of \( x \). Always state the units and say what the sign means.
Functions inside functions
How would you differentiate \( (3x^2 + 1)^5 \)? Expanding the bracket first would be slow and error-prone, and the power rule from Step 12 does not apply directly, because the thing raised to the power 5 is not \( x \). This is a composite function (Step 3): an inside function \( u = 3x^2 + 1 \) is fed into an outside function \( y = u^5 \).
Why multiply? Rates of change multiply, like gears. If gear \( Y \) turns 3 times for each turn of gear \( U \), and \( U \) turns 2 times for each turn of gear \( X \), then \( Y \) turns \( 3 \times 2 = 6 \) times for each turn of \( X \). In symbols, for small changes \( \dfrac{\Delta y}{\Delta x} = \dfrac{\Delta y}{\Delta u} \cdot \dfrac{\Delta u}{\Delta x} \), which is just cancelling \( \Delta u \). As \( \Delta x \to 0 \), \( \Delta u \to 0 \) as well, and the chord gradients become derivatives. (A full proof also deals with the case where \( \Delta u \) is zero, but the idea is the same.) This is where Leibniz notation earns its keep: the \( du \)s look as if they cancel, and the rule says that, in effect, they do.
So for \( y = (3x^2 + 1)^5 \): \( \dfrac{dy}{du} = 5u^4 \) and \( \dfrac{du}{dx} = 6x \), giving \( \dfrac{dy}{dx} = 5(3x^2 + 1)^4 \cdot 6x = 30x(3x^2 + 1)^4 \). With practice you skip writing \( u \) and say it in words: “five times the bracket to the four, times the derivative of the bracket”.
Differentiate (a) \( (2x^3-5)^4 \) (b) \( \dfrac{1}{\sqrt{4x + 1}} \) (c) \( e^{\sin x} \) (d) \( \ln(x^2 + 4) \).
In every case the outside function was differentiated with its inside left untouched, then multiplied by the derivative of the inside.
Some chains appear so often that they are worth knowing on sight. Here \( k \) and \( b \) are constants and \( f \) is any differentiable function.
| Function | Derivative | Example |
|---|---|---|
| \( [f(x)]^n \) | \( n[f(x)]^{n-1}f'(x) \) | \( (1-x^2)^3 \to -6x(1-x^2)^2 \) |
| \( e^{f(x)} \) | \( f'(x)e^{f(x)} \) | \( e^{5x} \to 5e^{5x} \) |
| \( \ln f(x) \) | \( \dfrac{f'(x)}{f(x)} \) | \( \ln(3x + 2) \to \dfrac{3}{3x + 2} \) |
| \( \sin(kx + b) \) | \( k\cos(kx + b) \) | \( \sin 4x \to 4\cos 4x \) |
| \( \cos(kx + b) \) | \( -k\sin(kx + b) \) | \( \cos(2x-1) \to -2\sin(2x-1) \) |
Chains combined with other rules
Real questions mix the rules. The trick is to see the overall structure first. Is the whole thing a product, a quotient or a chain? Apply that rule, and use the others for the pieces.
Differentiate \( y = x(1-2x)^3 \) and simplify fully.
Factorising rather than expanding shows at once that the gradient is zero at \( x = \tfrac{1}{2} \) and \( x = \tfrac{1}{8} \).
AP free-response questions often give no formulas at all, only a table of values, and ask for the derivative of a composite. The chain rule works just as well with numbers.
The table gives values of the differentiable functions \( f \) and \( g \) and their derivatives.
| \( x \) | \( f(x) \) | \( f'(x) \) | \( g(x) \) | \( g'(x) \) |
|---|---|---|---|---|
| 1 | 4 | \( -3 \) | 2 | 4 |
| 2 | 1 | 2 | 3 | \( -1 \) |
| 3 | 6 | 5 | 1 | 2 |
Find (a) \( h'(1) \), where \( h(x) = f\big(g(x)\big) \) (b) \( k'(2) \), where \( k(x) = [g(x)]^3 \).
The classic slip in (a) is to use \( f'(1) \) instead of \( f'(g(1)) \). The outside derivative is evaluated at the inside value, \( g(1) = 2 \).
Any base: aˣ and logₐ x
The chain rule also explains the strange multipliers from Step 12, where the gradient of \( 2^x \) was about 0.693 times its height. Since \( a = e^{\ln a} \), we can write \( a^x = e^{x\ln a} \). That is \( e^{kx} \) with the constant \( k = \ln a \), so its derivative is \( (\ln a)\,e^{x\ln a} = a^x\ln a \). And indeed \( \ln 2 \approx 0.693 \) and \( \ln 3 \approx 1.099 \). For logarithms, the change of base rule gives \( \log_a x = \dfrac{\ln x}{\ln a} \), which is just a constant multiple of \( \ln x \).
The same idea finishes off the power rule for any real power. For \( x > 0 \), \( x^n = e^{n\ln x} \), so \( \dfrac{d}{dx}(x^n) = e^{n\ln x} \cdot \dfrac{n}{x} = x^n \cdot \dfrac{n}{x} = nx^{n-1} \).
(a) Differentiate \( 3^{2x} \) and \( \log_{10}(5x) \). (b) Find the gradient of \( y = 5^x \) at \( x = 2 \), to 2 decimal places.
Notice in Step 2 that the 5 disappeared, just as \( \ln(2x) \) and \( \ln x \) have the same derivative.
Tangents and normals
The tangent at a point \( (x_1, y_1) \) on a curve has gradient \( m = f'(x_1) \). The normal is the line through the same point at right angles to the tangent. Perpendicular gradients multiply to \( -1 \) (Step 4), so the normal has gradient \( -\dfrac{1}{m} \), provided \( m \neq 0 \).
Find the equations of the tangent and the normal to \( y = \sqrt{2x + 1} \) at the point where \( x = 4 \). Give the normal in the form \( ax + by + c = 0 \).
Figure 1 shows both lines. The normal crosses the x-axis at \( (5, 0) \).
Rates of change, with units
A derivative is a rate. If \( y \) is measured in one unit and \( x \) in another, then \( \dfrac{dy}{dx} \) is measured in units of \( y \) per unit of \( x \). In context, an answer without units, or without a sentence saying what it means, usually loses a mark.
A town’s population after \( t \) years is \( P = 3000e^{0.025t} \). Find \( \dfrac{dP}{dt} \) when \( t = 8 \) and interpret it.
After 8 years the population is increasing at about 92 people per year.
An economics example: depreciation. A car bought for $20,000 loses 15% of its value each year, so after \( t \) years it is worth \( V = 20000 \times 0.85^t \) dollars. Using the \( a^x \) rule, \( \dfrac{dV}{dt} = 20000 \times 0.85^t \ln 0.85 \). At \( t = 3 \) this is \( 12282.50 \times (-0.1625) \approx -1996 \) dollars per year. The negative sign says the value is falling: three years in, the car is losing value at about $1,996 a year (Figure 2). Because \( \ln 0.85 \) is negative and \( 0.85^t \) shrinks, the losses get smaller every year.
A second economics example: chains of causes. A workshop’s daily cost is \( C = 800 + 30L + 0.4L^2 \) dollars when it employs \( L \) workers, and it is hiring steadily, with \( L = 20 + 3t \) after \( t \) weeks. At \( t = 4 \), \( L = 32 \), and
At \( L = 32 \) this is \( 55.6 \times 3 = 166.8 \). Each extra worker adds $55.60 to the daily cost, and three workers arrive each week, so the daily cost is rising by $166.80 per week. The units chain together too: dollars per worker times workers per week gives dollars per week.
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. Differentiate \( y = (5x-3)^6 \). Show worked answer
\( \dfrac{dy}{dx} = 6(5x-3)^5 \times 5 \).
\( = 30(5x-3)^5 \).
EasyQ2. Differentiate \( y = e^{4x}-\cos 2x \). Show worked answer
The derivative of \( \cos 2x \) is \( -2\sin 2x \), so subtracting it gives \( +2\sin 2x \).
\( \dfrac{dy}{dx} = 4e^{4x} + 2\sin 2x \).
MediumQ3. Find the gradient of \( y = \ln(3x^2 + 1) \) at \( x = 1 \). Show worked answer
At \( x = 1 \): \( \dfrac{6}{4} = \dfrac{3}{2} \).
MediumQ4. Differentiate \( y = x^2\sqrt{1 + x} \), giving your answer as a single fraction. Show worked answer
\( \dfrac{dy}{dx} = 2x\sqrt{1 + x} + \dfrac{x^2}{2\sqrt{1 + x}} \).
Common denominator \( 2\sqrt{1 + x} \): \( \dfrac{4x(1 + x) + x^2}{2\sqrt{1 + x}} \).
\( = \dfrac{x(5x + 4)}{2\sqrt{1 + x}} \).
MediumQ5. An investment is worth \( V = 8000 \times 1.05^t \) dollars after \( t \) years. Find \( \dfrac{dV}{dt} \) when \( t = 10 \), with units, and interpret it. Show worked answer
At \( t = 10 \): \( 8000 \times 1.62889 \times 0.04879 \approx 635.8 \).
Units: dollars per year.
After 10 years the investment’s value is growing at about $636 per year.
ExamQ6. The curve \( y = \dfrac{8}{(2x-1)^2} \) passes through the point \( P \) where \( x = \tfrac{3}{2} \). (a) Find \( \dfrac{dy}{dx} \). [2] (b) Find the equation of the tangent at \( P \), and show that the normal at \( P \) has equation \( 2x-8y + 13 = 0 \). [4] (c) The tangent and the normal at \( P \) meet the x-axis at \( A \) and \( B \). Find the area of triangle \( APB \). [3] Show worked answer
(b) At \( x = \tfrac{3}{2} \): \( 2x-1 = 2 \), so \( y = \tfrac{8}{4} = 2 \) and \( \dfrac{dy}{dx} = -\tfrac{32}{8} = -4 \). [M1]
Tangent: \( y-2 = -4(x-\tfrac{3}{2}) \), so \( y = -4x + 8 \). [A1]
Normal gradient \( \tfrac{1}{4} \): \( y-2 = \tfrac{1}{4}(x-\tfrac{3}{2}) \). [M1]
Multiply by 8: \( 8y-16 = 2x-3 \), so \( 2x-8y + 13 = 0 \). [A1]
(c) Tangent meets \( y = 0 \) at \( x = 2 \), so \( A = (2, 0) \). Normal meets \( y = 0 \) at \( x = -\tfrac{13}{2} \), so \( B = (-\tfrac{13}{2}, 0) \). [M1 A1]
Base \( AB = 2 + \tfrac{13}{2} = \tfrac{17}{2} \), height = y-coordinate of \( P \) = 2.
Area \( = \tfrac{1}{2} \times \tfrac{17}{2} \times 2 = \tfrac{17}{2} \). [A1]
Total: 9 marks.
Check yourself
1. What is \( \dfrac{d}{dx}(\sin 5x) \)?
2. What is \( \dfrac{d}{dx}(2^x) \)?
3. The tangent to a curve at a point has gradient 4. What is the gradient of the normal there?
Your score: 0 out of 3
The short version
- Chain rule: \( \dfrac{dy}{dx} = \dfrac{dy}{du} \times \dfrac{du}{dx} \), or \( f’\big(g(x)\big)\,g'(x) \). Differentiate the outside, keep the inside, multiply by the inside’s derivative.
- Standard chains: \( e^{kx} \to ke^{kx} \), \( \ln f(x) \to \dfrac{f'(x)}{f(x)} \), \( \sin(kx + b) \to k\cos(kx + b) \), \( [f(x)]^n \to n[f(x)]^{n-1}f'(x) \).
- \( \dfrac{d}{dx}(a^x) = a^x\ln a \) and \( \dfrac{d}{dx}(\log_a x) = \dfrac{1}{x\ln a} \).
- Tangent \( y-y_1 = m(x-x_1) \); normal gradient \( -\dfrac{1}{m} \). Take \( y_1 \) from the curve’s equation.
- A derivative is a rate in units of \( y \) per unit of \( x \). In chains of causes, the rates and the units multiply.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
