Lesson Part 1
Composite Functions
Composite functions are formed by combining one function with another.
To form a composite, one function is substituted into the input of a second function.
In function notation, if \( g(x) \) and \( h(x) \) are two functions, then the composite of \(g\) and \(h\) is the function \(f(x)\) defined by
\[f(x) = (g \circ h)(x) = \textcolor{NavyBlue}{g(}\textcolor{BrickRed}{h(x)}\textcolor{NavyBlue}{)}\]
where \(\textcolor{NavyBlue}{g(x)}\) is the outer function and \(\textcolor{BrickRed}{h(x)}\) is the inner function. It is read either as \(g\) composed with \(h\) or as \(g\) of \(h(x)\).
For example, the function \( f(x) = (3x^2 - 7x)^5 \) may be written as the composition of two other functions.
It can be decomposed into two separate component functions: \( g(x) = x^5 \) and \( h(x) = 3x^2 - 7x \).
Note:
The order of the composition is important.
The function, \(f(x)\), is the composition of \(g\) and \(h\), which is different than the composition of \(h\) and \(g\).
The function \( h \) composed with \( g \) would be
\[(h \circ g)(x) = h(g(x))\]
Substituting \(h(x) = 3x^2 - 7x\) into this expression
\[(h \circ g)(x) = 3(g(x))^2 - 7(g(x))\]
Substituting \(g(x)=x^5\) into this expression
\[ \begin{align*} (h \circ g)(x) &= 3(x^5)^2 - 7(x^5) \\ &= 3x^{10} - 7x^5 \end{align*} \]
Differentiating Composite Functions
The next question that we have is, how do we differentiate composite functions?
Consider the function given in the example, \( f(x) = (3x^2 - 7x)^5 \).
It would be very time consuming and possibly even difficult to expand, simplify, and then differentiate this expression.
Instead, we will develop a method called the chain rule to differentiate composite functions.
The Chain Rule
We will use an example here to illustrate how to use the chain rule.
Observe that in the previous example, where \( f(x) = (3x^2 - 7x)^5 \), if we let \(g(u)=u^5\) and we let \(u=h(x)=3x^2-7x\), then \(f(x)=g(h(x))\). We have now decomposed \(f(x)\) into its two functions, its inner function and its outer function.
From previously learned differentiation rules, we know how to differentiate \(g(u)\) and \(h(x)\) individually, the chain rule allows us to differentiate them when they are formed into a composite function, \(y=g(h(x))\).
It turns out that the derivative of the composite function, \(f(x)=g(h(x))\), is the product of the derivatives of \(g(u)\) and \(h(x)\). That is, \(f'(x)=g'(u)h'(x)\).
Consider the following derivatives as rates of change:
- \(\dfrac{dy}{du}\) is the rate of change of \(y\) with respect to \(u\).
- \(\dfrac{du}{dx}\) is the rate of change of \(u\) with respect to \(x\).
- \(\dfrac{dy}{dx}\) is the rate of change of \(y\) with respect to \(x\).
Suppose \(y\) changes \(3\) times as fast as \(u\), and \(u\) changes \(4\) times as fast as \(x\). Then it makes sense that \(y\) changes \(3\times4=12\) times as fast as \(x\).
That is, the rate of change in \(y\) with respect to \(x\) is equal to the product of the other two rates. This is the basis for the chain rule.
The Chain Rule
If \(h(x)\) is differentiable at \(x\) and \(g(x)\) is differentiable at \(h(x)\), then the composite function, \( f(x) = g(h(x)) \) or \(f(x) = (g \circ h)(x)\), is differentiable at \(x\) and \(f'(x)\) is given by the product
\[ f'(x) = g'(h(x)) \cdot h'(x)\]
In Leibniz notation, if \(y=g(u)\) and \(u=h(x)\) are both differentiable functions, then
\[ \dfrac{dy}{dx} = \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right) \]
Note:
Before using the chain rule, it is very important to first identify the inner and outer functions that make up the composition.
Lesson Part 2
Let's work through the following examples to familiarize ourselves with using the chain rule.
Examples
Example 1
Differentiate \( y = (3x^2 - 7x)^5 \) using the chain rule.
Solution
Start by identifying the inner and outer functions.
Since \( y = (3x^2 - 7x)^5\), let the inner function be \(u=3x^2 - 7x\).
Then, in terms of \(u\), the outer function is \(y=u^5\).
Now, differentiate these two equations separately.
- \(u= 3x^2 - 7x\) implies \(\dfrac{du}{dx}= 6x - 7\)
- \(y=u^5\) implies \(\dfrac{dy}{du}=5u^4\)
- \(\dfrac{du}{dx}= 6x - 7\) and \(\dfrac{dy}{du}=5u^4\)
Substituting \(u= 3x^2 - 7x\) into \(\dfrac{dy}{du}\), we have \(\dfrac{dy}{du}=5(3x^2 - 7x)^4.\)
Recall the formula for the chain rule: \( \dfrac{dy}{dx} = \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right) \).
Substitute \(\dfrac{dy}{du}\) and \(\dfrac{du}{dx}\), into the chain rule, to get
\[ \begin{align*} \dfrac{dy}{dx} &= \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right) \\ &= (5u^4)(6x - 7) \\ &= 5(3x^2 - 7x)^4(6x - 7) \end{align*} \]
Therefore, the derivative of \( y = (3x^2 - 7x)^5 \) is \(\dfrac{dy}{dx} = 5(3x^2 - 7x)^4(6x - 7)\).
Example 2
Find the derivative of \( f(x) = 4(3x - 2)^5 - 9 \).
Try example 2 on your own and then we will discuss its solution.
Solution
In example 2, the function is defined in function notation.
Recall that the formula for the chain rule, in function form, is
\[f'(x)= g'(h(x)) \cdot h'(x)\]
For the function \(f(x)\), the inner function is \(h(x)=3x-2\).
Let \(u=h(x)\). Then, the outer function is \( g(u) = 4u^5 - 9 \).
Now, differentiate each equation separately.
- \( g(u)= 4u^5 - 9 \) implies \( g'(u)=20u^4 \)
- \( h(x)=3x-2 \) implies \( h'(x)= 3 \)
We want to have \(g'(u)\) expressed with respect to \(x\). Substitute \(u=h(x)\) into \(g'(u)\), to get \( g'(h(x)) = 20(3x - 2)^4 \).
Finally, substitute \(g'(h(x))\) and \(h'(x)\) into the formula for the chain rule.
\[ \begin{align*} f'(x) &= g'(h(x)) \cdot h'(x) \\ &= 20(3x - 2)^4 \cdot (3) \\ &= 60(3x - 2)^4 \end{align*} \]
Therefore, the derivative of \( f(x) = 4(3x - 2)^5 - 9 \) is \(f'(x) = 60(3x - 2)^4\).
Example 3
What is the slope of the tangent line to the curve \( y = \sqrt{3x^3 +6} \) at the point where \( x = 1 \)?
Try example 3 now, and then we will look at its solution.
Solution
To determine the slope of the tangent line, we need to find the derivative of \(y\) and then substitute the value of \(x = 1\) into the derivative formula.
To differentiate this expression, rather than having \(y\) expressed with a radical, instead we will express it using a rational exponent.
\[y = \sqrt{3x^3 +6} = (3x^3 + 6)^{\frac{1}{2}}\]
We are going to try to speed things up a bit for chain rule. For this example, we will use a more condensed solution to find the derivative, but the essence of the methods of chain rule will still be here.
Recall the formula for the chain rule: \( \dfrac{dy}{dx} = \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right) \).
So really, to differentiate a composite function we're going to differentiate the outer function, ignoring the inner function. Then we're going to multiply by the derivative of the inner function.
The outer function here is \(y = \sqrt{u} = u^{\frac{1}{2}}\), where the inner function \(u = 3x^3+6\).
Differentiating these two functions, we have
\[\dfrac{dy}{dx}= \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right)\]
Now, let's just substitute these two expressions directly into the chain rule formula.
\[ \begin{align*} \dfrac{dy}{dx} &= \left(\dfrac{1}{2}u^{-\frac{1}{2}}\right)(9x^2) \\ &= \left(\dfrac{1}{2\sqrt{u}}\right)(9x^2) \end{align*} \]
Let's convert \(\dfrac{dy}{du}\) back into its radical formand simplify this expression.
\[\dfrac{dy}{dx} = \dfrac{9x^2}{2\sqrt{ 3x^3 +6}}\]
Remember, we've been asked to find the slope of the tangent when \(x = 1\).
Thus, where \(x=1\), the slope of the tangent is
\[ \begin{align*} \left. \dfrac{dy}{dx}~\right\vert_{x=1} &= \dfrac{9(1)^2}{2\sqrt{ 3(1)^3 +6}} \\ &=\dfrac{3}{2} \end{align*} \]
Here, the slope of the tangent line is \(\dfrac{3}{2}\).
Lesson Part 3
Differentiating Rational Functions with the Chain Rule
We can use the chain rule to differentiate rational expressions. Recall that we can express a fraction as a product by using a negative exponent.
A rational expression, \( \dfrac{p(x)}{q(x)}\), can be written as
\[ \dfrac{p(x)}{q(x)}=p(x) \cdot \dfrac{1}{q(x)} = p(x) \cdot [q(x)]^{-1} \]
Once written in this form, we can apply the product rule and chain rule to differentiate.
Example 4
Let's begin with the following example, differentiate \( y = \dfrac{5}{x^2 - 7}. \)
Solution
To differentiate this expression, let's write this expression as a product using negative exponents.
\[y = \dfrac{5}{x^2 - 7}= 5(x^2 - 7)^{-1} \]
In condensed form, the outer function is \(y=5u^{-1}\), where the inner function is \(u=x^2 - 7\).
Differentiate these two expressions separately and substitute them into the chain rule.
\[ \begin{align*} \dfrac{dy}{dx} &= \left(\dfrac{dy}{du}\right)\left(\dfrac{du}{dx}\right) \\ &= \left(-5u^{-2}\right)(2x) \\ &= \left(\dfrac{-5}{u^{2}}\right)(2x) \\ &= \dfrac{-10x}{(x^2 - 7)^2} \end{align*} \]
Thus, the derivative of \(y=\dfrac{5}{x^2-7}\) is \(\dfrac{dy}{dx}=\dfrac{-10x}{(x^2-7)^2}\).
Lesson Part 4
To conclude this module, we will look at the following, more challenging question.
Challenge Question
Find the derivative, \(f'(x)\), of \( f(x) = \dfrac{x^2 - 5x}{\sqrt{9 - x^3}} \), and state the domain of \(f(x)\) and \(f'(x)\).
Solution
We can rewrite \(f(x)\), using negative rational exponents, to give
\[ \begin{align*} f(x) &= \dfrac{x^2-5x}{\sqrt{9-x^3}} \\ &= (x^2-5x) \left (\dfrac{1}{\sqrt{9-x^3}}\right ) \\ &= (x^2-5x)\left ( 9-x^3\right )^{-\frac{1}{2}} \end{align*} \]
In this case, we have a product of two functions \(f(x)=p(x)\cdot q(x)\), where the function \(q(x)\) is composite. So to differentiate this expression, we're going to need to use the two rules product rule and chain rule.
Let's begin by differentiating the composite function first, then use the product rule to differentiate the entire function. Since the second function is a composite function, we will need to use chain rule.
The composite function is \(q=(9 - x^3)^{-\frac{1}{2}}\) (in condensed form, \(q=u^{-\frac{1}{2}}\) where \(u=9 - x^3\)).
Therefore, we have an outer function of \(u^{-\frac{1}{2}}\) and an inner function of \(9 - x^3\).
As we've previously seen, we're going to differentiate these two expressions separately and then substitute them into the formula for chain rule.
\[ \begin{align*} q'(x) &= \left(\dfrac{dq}{du}\right)\left(\dfrac{du}{dx}\right) \\ &= \left(-\dfrac{1}{2}u^{-\frac{3}{2}}\right)(-3x^2) \\ &= \dfrac{3x^2}{2u^{\frac{3}{2}}} \\ &= \dfrac{3x^2}{2(9 - x^3)^{\frac{3}{2}}} \end{align*} \]
Now that this expression has been simplified, let's substitute the expression of \(x\) back in for \(u\).
Therefore, the derivative of the composite function \(q(x)=\dfrac{1}{\sqrt{9 - x^3}}\) is \(q'(x) =\dfrac{3x^2}{2(9 - x^3)^{\frac{3}{2}}}\).
Recall the product rule: \( f'(x) = p'(x)q(x) + p(x)q'(x)\), where \(p(x)\) is the first function in our product and \(q(x)\) is the second function in our product.
We have already found \(q'(x)\), so \(p'(x)\) is still left to be found.
Since \(p(x)=x^2 - 5x\), therefore \(p'(x)=2x - 5\).
We now have the four parts that we need for the product rule. Substituting each of these expressions into the formula for product rule, we arrive at the derivative of \(f'(x)\).
\[ \begin{align*} f'(x) &= p'(x)q(x) + p(x)q'(x) \\ &= (2x - 5)\left(\dfrac{1}{\sqrt{9 - x^3}}\right) + (x^2 - 5x)\left(\dfrac{3x^2}{2(9 - x^3)^{\frac{3}{2}}}\right) \\ &= \dfrac{2x - 5}{\sqrt{9 - x^3}} + \dfrac{3x^2(x^2 - 5x)}{2(9 - x^3)^{\frac{3}{2}}} \end{align*} \]
Using the fact that \((9-x^3)^{\frac{3}{2}}=(9-x^3)(9-x^3)^{\frac{1}{2}}\), we can simplify these functions by finding a common denominator for both rational expressions, expanding and simplifying the numerator, collecting like terms, and arriving at the final simplified expression for \(f'(x)\).
\[ \begin{align*} f'(x) &= \dfrac{2(2x - 5)(9-x^3)+(3x^4 - 15x^3)}{2(9 - x^3)^{\frac{3}{2}}} \\ &= \dfrac{36x-4x^4-90+10x^3+3x^4 - 15x^3}{2(9 - x^3)^{\frac{3}{2}}} \\ &= \dfrac{-x^4-5x^3+36x-90}{2(9 - x^3)^{\frac{3}{2}}} \end{align*} \]
Since \(\sqrt{9-x^3}\) is defined if and only if \(9-x^3\geq0\), the domain of \(f(x)=\dfrac{x^2-5x}{\sqrt{9-x^3}}\) is given by \(9-x^3 \gt 0\) (since the denominator cannot be \(0\)).
Thus, the domain is the interval defined by \(x^3 \lt 9\) (i.e., \(x \lt 9^{\frac{1}{3}}\)) for both \(f(x) = \dfrac{x^2 - 5x}{\sqrt{9 - x^3}}\) and \(f'(x)= \dfrac{-x^4-5x^3+36x-90}{2(9 - x^3)^{\frac{3}{2}}}\).
Quiz
See the quiz in the side navigation.