Unit 3 · Topic 3.5

Choose and combine derivative rules

Builds on the product, quotient and chain rules. 12 minutes.

  1. Example 1Choose the outermost derivative rule
  2. Example 2Combine rules in one derivative
  3. Example 3Use combined rules with a table
  4. Example 4Find and repair a rule error

Each derivative rule so far handles one operation. The sum and constant multiple rules, \((u\pm v)'=u'\pm v'\) and \((ku)'=k\,u'\), come from topic 2.6, and the product, quotient and chain rules from topics 2.8, 2.9 and 3.1. Most functions combine several operations, as \(p(x)=x^2\sqrt{x+1}\) does: a square root acts on a sum, and its result multiplies a power.

This topic shows which rule to apply first, how the rules fit together in one derivative, and how to find an error in the result.

The rule for the last operation comes first

A number line for the input x at the top. Below it, two boxes act on x side by side: one computes x squared, and the other computes the square root of x plus 1. Their results, u and v, sit on two shorter number lines, and a box outlined in orange multiplies u by v, which gives p on the bottom line. Orange dots mark the values: at x = 3 they are u = 9, v = 2 and p = 18. A button puts the square-root box after the squaring box instead, so that it receives u and the figure computes q, the square root of x squared plus 1, with the square-root box outlined in orange.

Figure 1Orange lines carry each value into the next box, which computes the formula written in it. Orange dots mark the values on the number lines, and the orange outline marks the operation that comes last.

Figure 1 computes \(p(x)\) with three boxes. From the input \(x\) on the top line, one box squares \(x\), which gives \(\cy{u}=x^2\). The other box adds 1 to \(x\) and takes the square root, which gives \(\cy{v}=\sqrt{x+1}\). The last box multiplies \(u\) by \(v\). At \(x=3\), the boxes give \(u=9\) and \(v=2\), and the last box gives \(p(3)=18\). Move \(x\). The numbers change, but the multiplication still comes last.

The last operation of an expression is the one you do last when you compute its value at a number, and its rule comes first. Some books call it the outermost operation. The operations that have rules are sums and differences, constant multiples, products, quotients and compositions. In a composition, a function such as a power, root, exponential, logarithm or trigonometric function acts on an expression. A power of an expression, such as \(\left(x^2+1\right)^3\), is a composition in which the cube acts last, so the chain rule gives its derivative, \(3\left(x^2+1\right)^2\cdot 2x\).

The same two boxes can also act one after the other. Use the button under Figure 1 to feed \(u\) into the second box. That box then adds 1 to \(u=x^2\) and takes the square root, so the figure computes \(q(x)=\sqrt{x^2+1}\). The square root now comes last, so \(q\) is a composition, and the chain rule comes first: \(q'(x)=\frac{1}{2\sqrt{x^2+1}}\cdot 2x\), which is \(\frac{x}{\sqrt{x^2+1}}\).

The rule for the last operation can come first because each rule holds for any functions that meet its hypotheses, whatever their formulas. The product rule, \((uv)'=u'v+uv'\), needs only factors that are differentiable at \(x\). It therefore applies to \(p\) with \(u=x^2\) and \(v=\sqrt{x+1}\), although \(v\) is itself a composition:

\[\begin{aligned}p'(x)&=\left(x^2\right)'\sqrt{x+1}\\&\quad+x^2\left(\sqrt{x+1}\right)'\end{aligned}\]

The rule leaves the derivatives of the two factors, and each factor has fewer operations than \(p\). Then find the last operation of each factor. In \(\sqrt{x+1}\), the square root comes last, so the chain rule, \(\frac{d}{dx}f\big(g(x)\big)=f'\big(g(x)\big)\,g'(x)\), applies with the square root as the outer function. The derivative of the square root at the inner function \(x+1\) is \(\frac{1}{2\sqrt{x+1}}\), and the inner derivative is 1:

\[\begin{aligned}\left(\sqrt{x+1}\right)'&=\frac{1}{2\sqrt{x+1}}\cdot 1\\p'(x)&=2x\sqrt{x+1}+\frac{x^2}{2\sqrt{x+1}}\end{aligned}\]

The inner derivative appears only in the second term, because only the second factor is a composition. Each step removes an operation, so the steps end with basic functions such as powers of \(x\), \(\sin x\), \(e^x\) and \(\ln x\), whose derivatives you know.

The quotient rule also needs a bottom that is not 0. The chain rule needs the inner function to be differentiable at \(x\), and the outer function at the value it receives. Where every step's hypotheses hold, the rules also prove that the derivative exists. With the two boxes side by side in Figure 1, move \(x\) to \(-1\). The square root then receives 0, where it has no derivative, so the formula for \(p'\) holds only for \(x>-1\).

A rewrite can change the last operation, and with it the rule. For \(x\neq 0\), the quotient \(\frac{x^3+2x^2}{x}\) equals the sum \(x^2+2x\), whose derivative \(2x+2\) needs no quotient rule. The quotient rule, \(\left(\frac{u}{v}\right)'=\frac{u'v-uv'}{v^2}\), gives the same result after more algebra. Two correct routes give the same derivative, so a second route can test the first.

Values from a table

When a table gives \(f\), \(g\) and their derivatives at a few inputs, write the derivative with the rules first. Then read each number at the input where its function is evaluated. A product or quotient of \(f\) and \(g\) at an input \(a\) takes all four numbers from the row of \(a\). In \(f\big(g(x)\big)\), \(g(a)\) and \(g'(a)\) come from the row of \(a\), and \(f'\) from the row of \(g(a)\), where it is evaluated (topic 3.1). If the table has no row for an input that the rule needs, it cannot give the derivative.

Checking a derivative

The graph of y = x times e to the minus 2x for x from 0 to 2. It rises from the origin to its top at x = 1/2, where y is about 0.18, and then falls toward the axis. An orange point on it carries an orange tangent and its slope. Below, the graph of y prime = (1 − 2x) times e to the minus 2x falls from 1 at x = 0, crosses the axis at x = 1/2 and stays a little below it, and an orange bar rises from the axis to it at the same x, with its height. A button adds a red line through the point and a red curve in the lower graph for a claimed derivative, (1 + x) times e to the minus 2x, which lies above the graph of y prime for every x after 0.

Figure 2The orange line through the orange point has the slope that the formula for \(y'\) gives. In the lower graph, the orange bar runs from the axis to the graph of \(y'\). The red line and the red curve show a claimed derivative with an error.

Figure 2 graphs \(y=x\,e^{-2x}\) for \(0\le x\le 2\), a product whose second factor is a composition. Both factors are differentiable for every \(x\), so the product rule and the chain rule for \(e^{-2x}\) give

\[\begin{aligned}y'&=1\cdot e^{-2x}+x\cdot e^{-2x}\cdot(-2)\\&=(1-2x)\,e^{-2x}\end{aligned}\]

In the lower graph, the curve is the graph of this formula, and the orange bar runs from the axis to it at \(x\). The orange line through the point has the slope that the formula gives. Move \(x\). At every input, the orange line has the direction of the curve at the point, so the formula gives the slope of the tangent. Move the point to the top of the curve, at \(x=\frac{1}{2}\). The tangent there is horizontal, and the formula gives 0, because \(1-2x=0\).

Use the button under Figure 2 to leave out the inner derivative \(-2\). The second term becomes \(x\,e^{-2x}\), and the claimed derivative becomes \((1+x)\,e^{-2x}\). The red line through the point has the claimed slope, which is \(\frac{3}{2e}\) at the top of the curve, where the tangent is horizontal. In the lower graph, the red curve lies above the graph of \(y'\) at every \(x>0\).

The two curves meet only at \(x=0\), where their difference, \(3x\,e^{-2x}\), is 0, so a test at \(x=0\) misses this error. A test at one input can show that a formula is wrong, but not that it is correct. Without a graph, the definition of the derivative gives the same test at one input.

Most errors in a combined derivative are of three types. A piece is missing, such as an inner derivative or a term of the product rule. A sign is wrong, as in the derivative of a cosine, or in a quotient rule with \(u'v\) and \(uv'\) in the wrong order. In the third type, a step uses a rule that does not exist, such as multiplying the derivatives of two factors. To find the error, compare each step with the rule for its operation.

Example 1

Choose the outermost derivative rule

Let \(r(x)=\left(\dfrac{x}{x+1}\right)^4\) and \(s(x)=\dfrac{(x+1)^4}{x}\). Name the rule to apply first to each function, and find \(r'(x)\) and \(s'(x)\).

Solution

To compute \(r\) at a number, you divide \(x\) by \(x+1\) and then raise the result to the fourth power. The power comes last, so \(r\) is a composition, and the chain rule comes first. Its inner function \(\frac{x}{x+1}\) is a quotient, differentiable for \(x\neq-1\), and the quotient rule gives its derivative:

\[\begin{aligned}r'(x)&=4\left(\frac{x}{x+1}\right)^3\cdot\frac{(x+1)-x}{(x+1)^2}\\&=\frac{4x^3}{(x+1)^5}\end{aligned}\]

To compute \(s\), you raise \(x+1\) to the fourth power and then divide by \(x\). The division comes last, so the quotient rule comes first, for \(x\neq 0\), where the bottom is not 0. The top is a composition, and the chain rule gives its derivative, \(4(x+1)^3\cdot 1\). Factor \((x+1)^3\) out of the top:

\[\begin{aligned}s'(x)&=\frac{4x(x+1)^3-(x+1)^4}{x^2}\\&=\frac{(x+1)^3(3x-1)}{x^2}\end{aligned}\]

Example 2

Combine rules in one derivative

Let \(w(x)=\dfrac{x}{\sqrt{x^2+16}}\). Find \(w'(x)\) and \(w'(3)\).

Solution

Since \(x^2+16>0\), the top and the bottom are differentiable for every \(x\), and the bottom is never 0. The division comes last, so the quotient rule comes first. The bottom is a composition, so the chain rule gives its derivative:

\[\begin{aligned}\left(\sqrt{x^2+16}\right)'&=\frac{2x}{2\sqrt{x^2+16}}\\&=\frac{x}{\sqrt{x^2+16}}\end{aligned}\]

The quotient rule gives the first line below. To simplify, multiply the top and the bottom of the quotient by \(\sqrt{x^2+16}\):

\[\begin{aligned}w'(x)&=\frac{\sqrt{x^2+16}-\frac{x^2}{\sqrt{x^2+16}}}{x^2+16}\\&=\frac{\left(x^2+16\right)-x^2}{\left(x^2+16\right)^{3/2}}\\&=\frac{16}{\left(x^2+16\right)^{3/2}}\end{aligned}\]

At \(x=3\), \(x^2+16=25\), and \(25^{3/2}=125\), so \(w'(3)=\frac{16}{125}\).

Example 3

Use combined rules with a table

The table gives values of the differentiable functions \(f\) and \(g\) and their derivatives. Let \(m(x)=x^2 f\big(g(x)\big)\). Find \(m'(3)\). \[\begin{array}{c|cccc} x & f(x) & f'(x) & g(x) & g'(x)\\ \hline 1 & 5 & -2 & 2 & 3\\ 2 & -3 & 1 & 4 & -1\\ 3 & -1 & 8 & 1 & 4\\ 4 & 7 & -4 & 3 & -5 \end{array}\]

Solution

The last operation multiplies \(x^2\) by \(f\big(g(x)\big)\), so the product rule comes first, and the chain rule gives the derivative of the second factor. Since \(f\) and \(g\) are differentiable, the rules apply:

\[\begin{aligned}m'(x)&=2x\,f\big(g(x)\big)\\&\quad+x^2\,f'\big(g(x)\big)\,g'(x)\end{aligned}\]

The row \(x=3\) gives \(g(3)=1\) and \(g'(3)=4\). The function \(f\) receives \(g(3)=1\), so its value \(f(1)=5\) and its derivative \(f'(1)=-2\) come from the row \(x=1\):

\[\begin{aligned}m'(3)&=2\cdot 3\cdot 5+3^2\cdot(-2)\cdot 4\\&=30-72=-42\end{aligned}\]

Example 4

Find and repair a rule error

A student writes that the derivative of \(x^2\cos 3x\) is \(2x\cos 3x+3x^2\sin 3x\). Find the error, and give the correct derivative.

Solution

Both factors are differentiable for every \(x\). The last operation is a product, so compare each term with the product rule. The first term, \(\left(x^2\right)'\cos 3x=2x\cos 3x\), is correct. In the second term, the chain rule gives \(\left(\cos 3x\right)'=-\sin(3x)\cdot 3\), because the derivative of the cosine is the negative of the sine. The student's second term has the wrong sign:

\[\begin{aligned}&\frac{d}{dx}\left(x^2\cos 3x\right)\\&\quad=2x\cos 3x-3x^2\sin 3x\end{aligned}\]

To test the correction at \(x=\frac{\pi}{6}\), where \(\cos 3x=0\), use the definition of the derivative. Since \(\cos\left(\frac{\pi}{2}+3h\right)=-\sin 3h\), the difference quotient of \(x^2\cos 3x\) at \(\frac{\pi}{6}\) is \(-\left(\frac{\pi}{6}+h\right)^2\frac{\sin 3h}{h}\). It approaches \(-3\left(\frac{\pi}{6}\right)^2=-\frac{\pi^2}{12}\), because \(\frac{\sin 3h}{h}\) approaches 3 (topic 1.7). The corrected formula gives this value, and the student's formula gives \(\frac{\pi^2}{12}\).

Each example is one of the four skills of topic 3.5 in Which & Why: AP Calculus.