### 2 The derivative of a function of a function

To differentiate a function of a function we use the following Key Point:

##### Key Point 11

The Chain Rule

If $y=f\left(g\left(x\right)\right)$ , that is, a function of a function, then

$\frac{dy}{dx}=\frac{df}{dg}×\frac{dg}{dx}$
This is called the chain rule .
##### Example 12

Find the derivatives of the following composite functions using the chain rule and check the result using other methods

1. ${\left(2{x}^{2}-1\right)}^{2}$
2. $ln{e}^{x}$
##### Solution
1. Here $y=f\left(g\left(x\right)\right)$ where $f\left(g\right)={g}^{2}$ and $g\left(x\right)=2{x}^{2}-1$ . Thus

$\phantom{\rule{2em}{0ex}}\frac{df}{dg}=2g\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}\frac{dg}{dx}=4x\phantom{\rule{2em}{0ex}}\therefore \phantom{\rule{2em}{0ex}}\frac{dy}{dx}=2g.\left(4x\right)=2\left(2{x}^{2}-1\right)\left(4x\right)=8x\left(2{x}^{2}-1\right)$

This result is easily checked by using the rule for differentiating products:

2. Here $y=f\left(g\left(x\right)\right)$ where $f\left(g\right)=lng$ and $g\left(x\right)={e}^{x}$ . Thus

$\phantom{\rule{2em}{0ex}}\frac{df}{dg}=\frac{1}{g}\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}\frac{dg}{dx}={e}^{x}\phantom{\rule{2em}{0ex}}\phantom{\rule{1em}{0ex}}\therefore \phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{1}{g}\cdot {e}^{x}=\frac{1}{{e}^{x}}\cdot {e}^{x}=1$

This is easily checked since, of course,

$\phantom{\rule{2em}{0ex}}y=ln{e}^{x}=x$   and so, obviously  $\frac{dy}{dx}=1$  as obtained above.

Obtain the derivatives of the following functions

1. ${\left(2{x}^{2}-5x+3\right)}^{9}$
2. $sin\left(cosx\right)$
3. ${\left(\frac{2x+1}{2x-1}\right)}^{3}$
1. Specify $f$ and $g$ for the first function:

$f\left(g\right)={g}^{9}\phantom{\rule{2em}{0ex}}g\left(x\right)=2{x}^{2}-5x+3$ Now obtain the derivative using the chain rule:

$9{\left(2{x}^{2}-5x+3\right)}^{8}\left(4x-5\right)$ . Can you see how to obtain the derivative without going through the intermediate stage of specifying $f,g$ ?

2. Specify $f$ and $g$ for the second function:

$f\left(g\right)=sing\phantom{\rule{2em}{0ex}}g\left(x\right)=cosx$ Now use the chain rule to obtain the derivative:

$-\left[cos\left(cosx\right)\right]sinx$

3. Apply the chain rule to the third function:

$-\frac{12{\left(2x+1\right)}^{2}}{{\left(2x-1\right)}^{4}}$