Title: Default for 11.5 The Chain Rule
Course: HELM Workbooks 2023-2024

The Chain Rule

In this Section we will see how to obtain the derivative of a composite function (often referred to as a `function of a function'). To do this we use the chain rule. This rule can be used to obtain the derivatives of functions such as \(e^{x^2+3x}\) (the exponential function of a polynomial); \( \sin( \ln x)\) (the sine function of the natural logarithm function); \(\sqrt{x^3 + 4}\) (the square root function of a polynomial).

The meaning of a function of a function

When we use a function like \(\sin 2x\) or \(e^{\ln x}\) or \(\sqrt{x^2 + 1}\) we are in fact dealing with a composite function or function of a function.

\(\sin 2x\) is the sine function of \(2x\). This is, in fact, how we `read' it:

\( \sin 2x \) is read `sine of \(2x\)'.

Similarly \(e^{\ln x}\) is the exponential function of the logarithm of \(x\):

\( e^{\ln x}\) is read `\(e\) to the power of \(\ln x\)'.

Finally \(\sqrt{x^2 + 1}\) is also a composite function. It is the square root function of the polynomial \(x^2 +1\):

\(\sqrt{x^2 + 1}\) is read as the `square root of \( (x^2 + 1) \)'.

When we talk about a function of a function in a general setting we will use the notation \(f(g(x))\) where both \(f\) and \(g\) are functions.

Example

Specify the functions \(f\), \(g\) for the composite functions \(f(g(x))\).

1. \(\sin 2x\)
2. \( e^{\ln x}\)
3. \(\sqrt{x^2 + 1}\)

Solution

1. Here \(f\) is the sine function and \(g\) is the polynomial \(2x\). We often write
\(f(g) = \sin g\) and \( g(x) = 2x\)
2. Here \(f(g) = e^g\) and \(g(x) = \ln x\)
3. Here \(f(g) = \sqrt{g}\) and \(g(x) = x^2 + 1\)

In each case the original function of \(x\) is obtained when \(g(x)\) is substituted into \(f(g)\).

The derivative of a function of a function

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

Key Point

The Chain rule

If \(y = f(g(x))\), that is, a function of a function, then \[ \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}\] This is called the chain rule.

Example

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

1. \( (2x^2 - 1)^2 \)
2. \( \ln e^x\)

Solution

1. Here \(y = f(g(x))\) where \(f(g) = g^2\) and \(g(x) = 2x^2 - 1\). Thus \[\dfrac{df}{dg} = 2g \text{ and } \dfrac{dg}{dx} = 4x\] \[\therefore \dfrac{dy}{dx} = 2g(4x) = 2(2x^2 - 1)(4x) = 8x(2x^2 - 1)\]
This result is easily checked by using the rule for differentiating products:
\(y = (2x^2-1)(2x^2-1)\) so \(\dfrac{dy}{dx} = 4x(2x^2-1)+(2x^2-1)(4x) = 8x(2x^2-1)\) as obtained above.
2. Here \(y = f(g(x))\) where \(f(g) = \ln g\) and \(g(x) = e^x\). Thus \[ \dfrac{df}{dg} = \dfrac{1}{g} \text{ and } \dfrac{dg}{dx} = e^x\] \[ \therefore \dfrac{dy}{dx} = \dfrac{1}{g}  e^x = \dfrac{1}{e^x}  e^x = 1\]
This is easily checked since, of course, \(y = \ln e^x = x\) and so, obviously \( \dfrac{dy}{dx} = 1\) as obtained above.

Exercise

Specify the functions \(f\) and \(g\) for the composite functions
1. \( [value] \)
\( f = \)
\( g = \)
2. \( [value] \)
\( f = \)
\( g = \)
3. \( [value] \)
\( f = \)
\( g = \)
Feedback: 1. For the function \( [value] \) \(f = [value]\) \(g = [value]\) 2. For the function \( [value] \) \(f = [value] \) \(g = [value] \) 3. For the function \( [value] \) \(f = \displaystyle [value]\) \(g = [value]\)

Exercise

Here we are going to differentiate \( y = [value]\) by using the chain rule
1. First, specify the functions \(f\) and \(g\) for the composite functions
\( f = \)
\( g = \)
2. Now obtain the derivative
\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y = [value].\) 1. We have \( f = [value] \) and \( g = [value] \). 2. So \( \dfrac{df}{dg} = [value]\) and \( \dfrac{dg}{dx} = [value]\). Hence \( \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}= [value] [value] = [value] \)

Exercise

Here we are going to differentiate \( y = [value] \) by using the chain rule
1. First, specify the functions \(f\) and \(g\) for the composite functions
\( f = \)
\( g = \)
2. Now obtain the derivative
\( \dfrac{dy}{dx} = \)
Feedback: We are fiven the function \(y = [value].\) 1. We have \( f = [value] \) and \( g = [value] \). 2. So \( \dfrac{df}{dg} = [value] \) and \( \dfrac{dg}{dx} = [value].\) Hence \( \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}= [value] ([value]) = [value]. \)

Exercise

Here we are going to differentiate \( y = \displaystyle{[value]} \) by using the chain rule
1. First, specify the functions \(f\) and \(g\) for the composite functions
\( f = \)
\( g = \)
2. Now obtain the derivative
\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y= \displaystyle [value].\) 1. We have \( f = [value] \) and \( \displaystyle g = [value] .\) 2. So \( \dfrac{df}{dg} = [value] \) and \( \dfrac{dg}{dx} = \displaystyle{[value]}.\) Hence \( \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}= \displaystyle [value] \left( \displaystyle [value]\right) = \displaystyle{[value]} .\)

Power functions

An example of a function of a function which often occurs is the so-called power function \([g(x)]^k\) where \(k\) is any rational number. This is an example of a function of a function in which \[f(g) = g^k\] Thus, using the chain rule: if \(y = [g(x)]^k\) then \[ \dfrac{dy}{dx} = \dfrac{df}{dg}  \dfrac{dg}{dx} = k g^{k-1} \dfrac{dg}{dx}.\] For example, if \(y = (\sin x + \cos x)^{1/3}\) then \( \dfrac{dy}{dx} = \dfrac{1}{3}(\sin x + \cos x)^{-2/3}(\cos x - \sin x) \).

Exercise

Here we are going to differentiate \( y = \displaystyle{[value]} \) by using the chain rule
1. First, specify the functions \(f\) and \(g\) for the composite functions
\( f = \)
\( g = \)
2. Now obtain the derivative
\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y= \displaystyle [value].\) 1. We have \( f = [value] \) and \( g = [value]. \) 2. So \( \dfrac{df}{dg} = \displaystyle [value] \) and \( \dfrac{dg}{dx} = [value].\) Hence \( \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}= \displaystyle [value] \cdot \displaystyle [value] = \displaystyle [value] .\)

Exercise

Here we are going to differentiate \( y = \displaystyle{[value]} \) by using the chain rule
1. First, specify the functions \(f\) and \(g\) for the composite functions
\( f = \)
\( g = \)
2. Now obtain the derivative
\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y= [value].\) 1. We have \( f = [value] \) and \( g = [value] \). 2. So \( \dfrac{df}{dg} = [value] \) and \( \dfrac{dg}{dx} = [value].\) Hence \( \dfrac{dy}{dx} = \dfrac{df}{dg} \times \dfrac{dg}{dx}= [value] [value] = [value]. \)

Exercise

Differentiate \( y = \displaystyle{[value]} \).

\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y= [value].\) We have \( f = [value] \) and \( g = [value] \). So \( \dfrac{df}{dg} = [value] \) and \( \dfrac{dg}{dx} = [value]\). Hence \( \dfrac{dy}{dx} = [value] .\)

Exercise

Differentiate \( y = \displaystyle{[value]} \).

\( \dfrac{dy}{dx} = \)
Feedback: We are given the function \( y = [value].\) We have \( f = [value] \) and \( g = [value] \). So \( \dfrac{df}{dg} = [value] \) and \( \dfrac{dg}{dx} = [value].\) Hence \( \dfrac{dy}{dx} = [value] \)