8. Further Differentiation#

Here we will look at the rules which help us to differentiate functions of functions, products of functions and quotients of functions. These three rules are very important and one has to be able to apply then without trouble. Most importantly, one has to be able to apply the right formula to the right question, \eg~you need to be able to spot if you deal with a function of a function or a product of functions.

8.1. The Chain Rule#

The chain rule or function of a function rule tells us how to differentiate compositions of functions. Recall from the first term that if \(y = f(u(x))\) we deal with the composition of two function, i.e.~we apply a function \(u\) first on \(x\) and then apply the function \(f\) to work on this result \(u(x)\). As an explicit example, if \(y = (x+1)^2\), then \(u(x) = x+1\) and \(f(x) = x^2\). I tend to call (in this notation) the function \(u\) the inner function and the function \(f\) the outer function.

Theorem 8.1 (The Chain Rule)

If \(y = f(u)\) is a function of \(u\), where \(u=u(x)\) is a function of \(x\), then

\[ \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} \]

Remark 8.1

Note that it can be helpful to remember this formula by thinking “the \(du\)’s cancel”, even though this is not really what is happening. I tend to remember this formula as ‘inner times outer’, that is, it is the derivative (with respect to~\(x\)) of the inner function \(u(x)\) multiplied by the derivative (with respect to~\(u\) ) of the outer function \(f(u)\).

Example 8.1

Let \(y = (x^2+x)^5\). Find \(\frac{dy}{dx}\).

Solution.
Here we have a composite of functions. Let \(u = x^2 +x\); then \(y = u^5\) is a function of \(u\), where \(u=x^2+x\) is a function of \(x\), so we can apply the chain rule.

Now \(\frac{dy}{du} = 5u^4\) and \(\frac{du}{dx} = 2x +1\). Hence, using the formula for the chain rule we get

\[\begin{align*} \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} = 5u^4(2x+1)\\ &= 5(x^2+x)^4(2x+1), \end{align*}\]

where on the last line we are substituting in for \(u\). Hence the answer is \(\frac{dy}{dx}=5(x^2+x)^4(2x+1)\).

Note

There is no \(u\) occurring in the answer as there is no \(u\) in the question!

Example 8.2

Let \(y = (x^3 + x^{-1})^\frac{1}{2}\). Find \(\frac{dy}{dx}\).

Solution.
Let \(u = x^3 + x^{-1}\), so that \(y = u^{\frac{1}{2}}\). Now,

\[ \frac{dy}{du} = \frac{1}{2}u^{-\frac{1}{2}} \hspace{1em} \text{ and } \hspace{1em} \frac{du}{dx} = 3x^2 - x^{-2}. \]

Thus, by the chain rule,

\[\begin{align*} \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} &= \frac{1}{2}u^{-\frac{1}{2}}\left(3x^2 -x^{-2}\right) \\ = \frac{1}{2}\left(x^3+x^{-1}\right)^{-\frac{1}{2}}\left(3x^2 -x^{-2}\right)\\ = \frac{3x^2-x^{-2}}{2\sqrt{x^3+x^{-1}}} \\ = \frac{x^2\left(3x^2-x^{-2}\right)}{2x^2\sqrt{x^3+x^{-1}}} = \frac{3x^4-1}{2\sqrt{x^7+x^3}}. \end{align*}\]

8.2. Rates of Change#

Differentiation lends itself well to applications involving quantities changing with time. Here’s an example which makes use of the chain rule.

Example 8.3

A large cube is expanding. Each edge is increasing at the rate of \(0.02\) metres per second. Find the rate of increase (with respect to time) of the volume and the surface area when the edge is \(50\) metres long.

Solution.
Let the cube have edge length \(x\) in m, volume \(V\) in \(\mbox{m}^3\) and surface area \(S\) in \(\text{meters}^2\). Then \(V = x^3\) and so, differentiating, \(\frac{dV}{dx} = 3x^2\). Let \(t\) denote time. We have been asked to find the rate of change of \(V\) with respect to time, that is to calculate \(\frac{dV}{dt}\).

Using the chain rule we get

\[ \frac{dV}{dt} = \frac{dV}{dx}\cdot\frac{dx}{dt}=3x^2\frac{dx}{dt}. \]

But we are given that the edge is increasing at \(0.02\) metres per second; that is, \(\frac{dx}{dt}=0.02\). Hence \(\frac{dV}{dt}=3x^2\times 0.02 = 0.06x^2\). Thus, when \(x = 50\) we have \(\frac{dV}{dt} = 0.06\times 50^2 = 150\). Thus the volume is increasing at \(150~\mbox{m}^3\mbox{s}^{-1}\).

Similarly, \(S=6x^2\) and so \(\frac{dS}{dx} = 12x\). By the chain rule,

\[ \frac{dS}{dt} = \frac{dS}{dx}\cdot\frac{dx}{dt} = 12x\times 0.02 \]

so that when \(x = 50\) we have \(\frac{dS}{dt} = 12\times 50 \times 0.02 = 12\). So the surface area is increasing at \(12~\mbox{m}^2\mbox{s}^{-1}\).

8.3. Differentiating Products and Quotients#

Now let’s look at rules to help us differentiate products and quotients of functions. Remember that a product of functions means that we multiply two or more functions together, so \(y\) is of the form \(y = f(x)g(x)\) which is different from the form \(y= f(g(x))\). It is easy to spot a quotient of two functions as there will be a fraction line.

Theorem 8.2 (The Product Rule)

Let \(y = u.v\), where \(u\) and \(v\) are functions of \(x\). Then

\[ \frac{dy}{dx} = \frac{du}{dx}v + u\frac{dv}{dx}, \]

or, in another notation

\[ y' = (uv)' = u'v + uv'. \]

Example 8.4

Let \(y = (x^4 - 7x)(x^2 + 6x^\frac 12)\). Find \(\frac{dy}{dx}\).

Solution.
We will use the product rule with \(u = x^4 - 7x\) and \(v =x^2 + 6x^{\frac 12}\). Now \(\frac{du}{dx} = 4x^3 -7\) and \(\frac{dv}{dx} = 2x + 3x^{-\frac 12}\). Thus, by the product rule,

\[ \frac{dy}{dx} = (4x^3 -7)(x^2 + 6x^{\frac 12}) + (x^4 - 7x)(2x + 3x^{-\frac 12}) \]

We leave any simplifications (expanding, collecting, refactorising if possible) as an exercise.

Example 8.5

Let \(y = (x^5 - 4x^2)(2x^3 + x^\frac 13 + x^{-3})\). Find \(\frac{dy}{dx}\).

Solution.
Let \(u = x^5 - 4x^2\) and \(v = 2x^3 + x^\frac 13 + x^{-3}\) so that \(\frac{du}{dx} = 5x^4 - 8x\) and \(\frac{dv}{dx} = 6x^2 + \frac 13x^{-\frac 23} -3x^{-4}\). Thus by the product rule,

\[ \frac{dy}{dx} = (5x^4 - 8x)(2x^3 + x^\frac 13 + x^{-3}) + (x^5 - 4x^2)(6x^2 + \frac 13 x^{-\frac 23} -3x^{-4}). \]

Again, this expression could be simplified — simplifications are left as an exercise.

Now for the quotient rule.

Theorem 8.3 (The Quotient Rule)

Let \(y = \frac{u}{v}\), where \(u\) and \(v\) are functions of \(x\). Then

\[ \frac{dy}{dx} = \frac{\frac{du}{dx}v - u\frac{dv}{dx}}{v^2}, \]

or, in another notation

\[ y' = \left(\frac uv\right)' = \frac{u'v - uv'}{v^2}. \]

Remark 8.2

Note that the product rule is symmetric, i.e.~\((uv)' = u'v + uv' = uv'+u'v\) but the quotient rule needs to be treated carefully. We have a \(-\) in the numerator and thus you need to make sure that you multiply everything in the right order.

Example 8.6

Let \(\displaystyle y = \frac{x^3 + 5x^\frac 12}{x^4 + 2x^3 +3}\). Find \(\frac{dy}{dx}\).

Solution.
We use the quotient rule with \(u = x^3 + 5x^\frac 12\) and \(v = x^4 + 2x^3 +3\). Now \(\frac{du}{dx} = 3x^2 + \frac 52x^{-\frac 12}\) and \(\frac{dv}{dx} = 4x^3 + 6x^2\). Thus, by the quotient rule,

\[ \frac{dy}{dx} = \frac{(3x^2 + \frac 52x^{-\frac 12})(x^4 + 2x^3 +3) - (x^3 + 5x^\frac 12)(4x^3 + 6x^2)}{(x^4 + 2x^3 +3)^2}. \]

Note

Quite often, when using the quotient rule, terms can be cancelled; we will see examples of this later on. If it is possible to do so, you should always do it! Simplifying the answer is a good practice to get in to. But remember: you can ONLY cancel expressions if they occur in both the terms in the numerator.

Example 8.7

Let \(\displaystyle y = \frac{x^3 +x^{-3}}{x^2 + x^\frac 23 + 6}\). Find \(\frac{dy}{dx}\).

Solution.
We use the quotient rule with \(u = x^3 + x^{-3}\) and \(v = x^2 + x^\frac 23 +6\). Then \(\frac{du}{dx} = 3x^2 - 3x^{-4}\) and \(\frac{dv}{dx} = 2x + \frac 23 x^{-\frac 13}\) and hence, by the quotient rule,

\[ \frac{dy}{dx} = \frac{(3x^2 - 3x^{-4})(x^2 + x^\frac 23 +6) - (x^3 + x^{-3})(2x + \frac 23 x^{-\frac 13})}{(x^2 + x^\frac 23 +6)^2}. \]

8.4. Quotient, produce and chain rules used together#

It is often the case that we need to use more than one of the differentiation rules at the same time. So let’s look at some examples.

Example 8.8

Let \(y = x^3(1+x^4)^5\). Find \(\frac{dy}{dx}\).

Solution.
Here we need the product rule first of all as \(y\) is the product of the two functions \(u= x^3\) and \(v = (1+x^4)^5\). So let \(u = x^3\) and \(v = (1+x^4)^5\) so that we can use the product rule.

To use the product rule we have to find \(\frac{dv}{dx}\), and to do this we need the chain rule where the inner function is \(w = 1+x^4\) and the outer function is \(u = w^5\). (Note that we need a different name for the inner function than ‘\(u\)’ as we already used it for something different.)

Now we find \(\frac{du}{dx}\) using the chain rule:

Let \(w = 1+x^4\), so that \(v = w^5\). Now \(\frac{dw}{dx} = 4x^3\) and \(\frac{dv}{dw} = 5w^4\). Thus, by the chain rule,

\[\begin{align*} \frac{du}{dx} = \frac{dv}{dw}\frac{dw}{dx} &= 5(1+x^4)^4 4x^3\\ &= 20 x^3(1+x^4)^4. \end{align*}\]

Now we can use the product rule to get

\[\begin{align*} \frac{dy}{dx} = v\frac{du}{dx} + u \frac{dv}{dx} &= 3x^2(1+x^4)^5 + x^3(20x^3(1+x^4)^4)\\ &= x^2(1+x^4)^4(3(1+x^4) + 20x^4)\\ &= x^2(1+x^4)^4(23x^4+3). \end{align*}\]

Example 8.9

Let \(y = (x^3(1+x^4))^5\). Find \(\frac{dy}{dx}\).

Solution.
Here we need the chain rule first of all as \(y\) is the composition of functions: we have \(y=f(u)\), where

\[ u := x^3(1+x^4), \hspace{1em} \text{ and } \hspace{1em} f(u) := u^5. \]

Therefore, by the chain rule,

\[ \frac{dy}{dx} = \frac{dy}{du}\frac{du}{dx}. \]

This means we have to find \(\frac{dy}{du}\) and \(\frac{du}{dx}\). Now,

\[ \frac{dy}{du}=f'(u) = 5u^4. \]

For \(\frac{du}{dx}\), note that \(u\) is a product of functions:

\[ u = x^3(1+x^4) = vw, \]

where \(v = x^3\) and \(w = 1+x^4\). Therefore, we can calculate \(\frac{du}{dx}\) using the product rule.

We have \(v = x^3\), \(w = 1+x^4\), \(v' = 3x^2\) and \(w' = 4x^3\). Thus, by the product rule,

\[\begin{align*} \frac{du}{dx} = (vw)' &= v'w + vw'\\ &= 3x^2(1+x^4) + x^3(4x^3)\\ &= x^2(3 + 3x^4 + 4x^4) = x^2(3 + 7x^4). \end{align*}\]

Now we can use the chain rule to get

\[\begin{align*} \frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} &= 5u^4(x^2(3+7x^4))\\ &= 5(x^3(1+x^4))^4(x^2(3+7x^4))\\ &= 5x^{14}(1+x^4)^4(3+7x^4). \end{align*}\]

Example 8.10

Let \(\displaystyle y = \frac{x^2+x}{(x+7)^4}\). Find \(\frac{dy}{dx}\), simplifying your answer where possible.

Solution.
We use the quotient rule with \(u = x^2 + x\) and \(v = (x+7)^4\). Then \(\frac{du}{dx}=2x+1\) but to find \(\frac{dv}{dx}\) we need to use the chain rule with \(w = x+7\), so that \(v = w^4\). Then

\[\begin{align*} \frac{dv}{dx} = \frac{dv}{dw}\cdot\frac{dw}{dx} &= 4w^3\times 1\\ &= 4(x+7)^3. \end{align*}\]

Now the quotient rule gives

\[\begin{align*} \frac{dy}{dx} = \frac{v\frac{du}{dx} - u \frac{dv}{dx}}{v^2} &= \frac{(2x+1)(x+7)^4 - (x^2+x)(4(x+7)^3)}{((x+7)^4)^2}\\ &= \frac{(x+7)^3((2x+1)(x+7) - 4x^2-4x)}{(x+7)^8}\\ &= \frac{2x^2 +14x+x+7 - 4x^2 -4x}{(x+7)^5}\\ &= \frac{-2x^2+11x +7}{(x+7)^5}. \end{align*}\]

Note that here we have cancelled a common factor of \((x+7)^3\) from the numerator and the denominator.

Example 8.11

Let \(\displaystyle y = \sqrt{\frac{x-3}{x^2+1}}\) and find \(\frac{dy}{dx}\).

Solution.
Here we use the chain rule with \(w = \frac{x-3}{x^2+1}\) so that \(y = w^\frac 12\).

To find \(\frac{dw}{dx}\) we use the quotient rule with \(u = x-3\) and \(v = x^2+1\). Thus

\[ \frac{dw}{dx} = \frac{1(x^2+1) - (x-3)(2x)}{(x^2+1)^2} = \frac{-x^2 +6x +1}{(x^2+1)^2}, \]

and the chain rule gives us

\[\begin{align*} \frac{dy}{dx} = \frac{dy}{dw}\frac{dw}{dx} &= \frac{1}{2}\left(\frac{x-3}{x^2+1}\right)^{-\frac{1}{2}} \frac{-x^2 +6x +1}{(x^2+1)^2} \\ &= \frac{(-x^2+6x+1)(x^2+1)^\frac 12}{2(x-3)^\frac 12 (x^2+1)^2} = \frac{-x^2+6x+1}{2(x-3)^\frac 12(x^2+1)^\frac 32}. \end{align*}\]

8.5. The Inverse Function Rule#

Suppose we have \(y=f(x)\) and we rearrange to get \(x\) in terms of \(y\), that is we get \(x=f^{-1}(y)\). Then we can calculate both \(\frac{dy}{dx}\) and \(\frac{dx}{dy}\). The inverse function rule gives a link between the two.

Example 8.12

Let \(y = f(x) = 5x +2\). Find

(i) \(\frac{dy}{dx}\)

(ii) The inverse function, \(f^{-1}(y)\), and

(iii) \(\frac{dx}{dy}\).

Solution.
(i) \(\frac{dy}{dx} = 5\).

(ii) Rearranging we get \(x = \frac{y-2}{5} = \frac y5 - \frac 25\). That is \(f^{-1}(y)=\frac y5 - \frac 25\).

(iii) From part (ii) we get \(\frac{dx}{dy} = \frac 15\).

We note that, in the solution for Example 8.12, we find \(\frac{dy}{dx} = \frac{1}{\frac{dx}{dy}}\). This, in fact, always happens.

Theorem 8.4 (The Inverse Function Rule)

Let \(y=f(x)\). Then

\[ \frac{dy}{dx} = \frac{\quad 1\quad}{\frac{dx}{dy}}. \]

Geometrically, this is not a surprise. We obtain the graph of \(y = f^{-1}(x)\) by reflecting the graph of \(y = f(x)\) at the line \(y = x\), i.e.~we exchanged the role of \(x\) and \(y\) on the graph.

This will be useful as we move on to differentiating some more non-standard functions.