Combine rules in one derivative
A product with a composition inside
The top graph shows \(f(x) = x\,e^{-2x}\), and the lower graph shows its slope \(f'(x)\). Drag the point along the curve. The curve rises to a peak at \(x = 0.5\) and then falls, so the slope is 0 at the peak.
The last operation multiplies \(x\) by \(e^{-2x}\), so the product rule gives two terms. The first term, the dashed green curve, is the slope of \(x\), which is 1, times \(e^{-2x}\), so it is positive.
The second term is \(x\) times the slope of \(e^{-2x}\). Because \(e^{-2x}\) is a composition, the chain rule gives this slope as \(e^{-2x}\) times the inside slope \(-2\). The second term, \(-2x\,e^{-2x}\), is the dashed red curve and is negative.
The chalk curve is the sum of the two terms, and the orange bar shows its height at \(x\).
Product rule outside, chain rule inside
The curve is now \(u(x)\cdot g(h(x))\), where \(h\) is the inside function and \(g\) is the outside function.
Drag the point. At every x, the chalk curve is the sum of the green and red terms, because the product rule gives one term per factor.
The green term uses the slope of \(u\). The red term uses the slope of \(g(h(x))\), which the chain rule gives as the slope of \(g\) at \(h(x)\) times the slope of \(h\).
Notation
The last operation is a product of \(u\) and \(w\), so the product rule comes first.
\[\cy{f'} = u'w + uw'\]If \(w = g(h(x))\) is a composition, the chain rule gives its slope.
\[w' = g'(h(x))\,h'(x)\]Put the slope of \(w\) into the product rule. The inside slope \(h'(x)\) multiplies only the second term, because only \(w\) is a composition.
\[\begin{aligned} \cy{f'(x)} &= u'(x)\,g(h(x)) \\ &\quad + u(x)\,g'(h(x))\,h'(x) \end{aligned}\]This needs \(u\), \(g\) and \(h\) to be differentiable. A quotient works the same way, with the quotient rule first.
When it fails
Suppose you leave out the inside slope \(-2\). The second term becomes \(x\,e^{-2x}\), and the sum is \(e^{-2x}(1 + x)\), which is about 0.271 at \(x = 1\).
The red line has this slope and rises, but the curve falls at x = 1. At the peak, x = 0.5, the red slope is about 0.552, but the orange tangent is flat.
Example 1: a quotient with a composition
Find \(y'\) for \(y = \dfrac{e^{3x}}{x}\), where \(x > 0\).
The last operation divides \(e^{3x}\) by \(x\), so the quotient rule comes first. The top is a composition, so the chain rule gives its slope.
Call the top \(u\). The outside function \(e^{\square}\) has a slope equal to itself, and the inside function \(3x\) has slope 3.
\[u = e^{3x}, \qquad u' = 3e^{3x}\]Put \(u\), \(u'\), \(v = x\) and \(v' = 1\) into the quotient rule.
\[y' = \dfrac{3e^{3x}\cdot x - e^{3x}\cdot 1}{x^2}\]Factor \(e^{3x}\) out of the top. Because \(e^{3x}\) and \(x^2\) are positive, the slope is 0 only where \(3x - 1 = 0\), at \(x = \tfrac13\), which is the lowest point of the curve.
\[y' = \dfrac{e^{3x}(3x - 1)}{x^2}\]
Example 2: a product with a root inside
Find \(y'\) for \(y = x^2\sqrt{4 - x^2}\), where \(0 < x < 2\).
The last operation is a product, so the product rule comes first. Let \(u = x^2\) and \(w = \sqrt{4 - x^2}\).
The factor \(w\) is a composition. The outside function, the square root, has slope \(\dfrac{1}{2\sqrt{\ }}\), and the inside function \(4 - x^2\) has slope \(-2x\).
\[w' = \dfrac{-2x}{2\sqrt{4 - x^2}} = -\dfrac{x}{\sqrt{4 - x^2}}\]A tempting wrong move: Differentiate the square root and leave out the inside slope.
\[y' = 2x\sqrt{4 - x^2} + \dfrac{x^2}{2\sqrt{4 - x^2}}\]At \(x = 1\) this gives about 3.753, but the orange tangent has slope about 2.887, so the red line is too steep. The inside slope \(-2x\) is negative, so the second term must be negative.
Keep the inside slope. To combine the terms, write the first one over \(\sqrt{4 - x^2}\).
\[\begin{aligned} y' &= 2x\sqrt{4 - x^2} - \dfrac{x^3}{\sqrt{4 - x^2}} \\ &= \dfrac{2x(4 - x^2) - x^3}{\sqrt{4 - x^2}} \\ &= \dfrac{8x - 3x^3}{\sqrt{4 - x^2}} \end{aligned}\]
Practice
Find \(g'(x)\) for \(g(x) = \left(\dfrac{x}{x + 2}\right)^3\), where \(x \ne -2\).
The last operation is a cube, so the chain rule comes first. Move the slider to x = 2 and compare your slope with the orange tangent.
Solution
The last operation is a cube, so the chain rule gives \(3\left(\dfrac{x}{x+2}\right)^2\) times the slope of the inside.
The inside is a quotient, so the quotient rule gives its slope.
\[\begin{aligned} \left(\dfrac{x}{x+2}\right)' &= \dfrac{(x+2) - x}{(x+2)^2} \\ &= \dfrac{2}{(x+2)^2} \end{aligned}\]Multiply the outside slope by the inside slope.
\[\begin{aligned} g'(x) &= 3\left(\dfrac{x}{x+2}\right)^2\cdot\dfrac{2}{(x+2)^2} \\ &= \dfrac{6x^2}{(x+2)^4} \end{aligned}\]At \(x = 2\), the slope is \(\tfrac{24}{256} = \tfrac{3}{32}\), which matches the orange tangent.
Questions
The figure shows \(f(x) = x\,e^{-2x}\), as in the first picture. The dashed green and red curves are the two terms of its slope.
The peak is at \(x = 0.5\), where the tangent is flat. Which formula for \(f'(x)\) is 0 there?
- \(e^{-2x} - 2x\,e^{-2x}\)
- \(e^{-2x} - x\,e^{-2x}\)
- \(-2e^{-2x}\)
- \(e^{-2x}\)
Answer
\(e^{-2x} - 2x\,e^{-2x}\)
At \(x = 1\) the tangent slopes down. Which statement explains this?
- The red term is larger in size than the green term, because the inside slope \(-2\) multiplies \(x\,e^{-2x}\).
- Both terms are negative.
- Only the first term counts, and it is negative.
Answer
The red term is larger in size than the green term, because the inside slope \(-2\) multiplies \(x\,e^{-2x}\).
What is the derivative of \(\dfrac{(x^2 + 1)^3}{x}\) at \(x = 1\)?
- 16
- 4
- −16
- 24
Answer
16
Summary
You name the last operation, apply its rule, and use the chain rule on any piece that is a composition.
This works because each rule handles one layer, and the inside slope multiplies only the term that differentiates the composition.
You use it when a product, quotient or power contains a composition, such as \(x\,e^{-2x}\).
This is one of four skills in topic 3.5 of Which & Why: AP Calculus.