Here we compute derivatives of products and quotients of functions
1 The product rule
Consider the product of two simple functions, say
\[ f(x)\cdot g(x) \]
where \(f(x)=x^2+1\) and \(g(x)=x^3-3x\). An obvious guess for
the derivative of \(f(x)g(x)\) is the product of the derivatives:
\begin{align*} f'(x)g'(x) &= (2x)(3x^2-3)\\ &= 6x^3-6x. \end{align*}
Is this guess correct? We can check by rewriting \(f\) and \(g\) and doing the calculation in a
way that is known to work. Write with me
\begin{align*} f(x)g(x) &= (x^2+1)(x^3-3x)\\ &=x^5-3x^3+x^3-3x\\ &=x^5-2x^3-3x. \end{align*}
Hence
\[ \ddx f(x) g(x) = \ddx (x^5 - 2x^3 - 3x) = 5x^4-6x^2-3, \]
so we see that
\[ \ddx f(x) g(x) \ne f'(x)g'(x). \]
So the derivative of \(f(x)g(x)\) is not as simple as \(f'(x)g'(x)\). Never fear, we have a
rule for exactly this situation.
The product rule If
\(f\) and
\(g\) are differentiable, then
\[ \ddx f(x)g(x) = f(x)g'(x)+f'(x)g(x).\]
Let’s return to the example with which we started.
Let
\(f(x)=(x^2+1)\) and
\(g(x)=(x^3-3x)\). Compute:
\[ \ddx f(x)g(x)\]
Write with me
\begin{align*} \ddx f(x)g(x) &= f(x)g'(x) + f'(x)g(x)\\ &=(x^2+1)(\answer [given]{3x^2-3}) + (\answer [given]{2x})(x^3-3x). \end{align*}
We could stop here, but we should show that expanding this out recovers our
previous result. Write with me
\begin{align*} (x^2+1)&(3x^2-3) + 2x(x^3-3x)\\ &= 3x^4-3x^2 +3x^2 -3 + 2x^4-6x^2\\ &=\answer [given]{5x^4-6x^2-3}, \end{align*}
which is precisely what we obtained before.
Compute:
\[\ddx (xe^x-e^x) \]
Using the sum rule and the product rule, write with me
\begin{align*} \ddx \left (xe^x-e^x \right ) &=\ddx \left (xe^x\right )-\ddx e^x\\ &=(xe^x+e^x)-e^x\\ &=\answer [given]{x e^x}. \end{align*}
Now that we are pros, let’s try one more example.
Suppose
\(f\) is a function whose values are given in the following table.
| | |
| | |
| x |
f(x) |
f’(x) |
| | |
| 1 | -3 | 4 |
| 2 | 5 | -1 |
| 3 | 2 | 0 |
| | |
Compute \(\eval { \ddx \left ( (x^2+1) f(x) \right )}_{x=2}\).
Using the product rule, write with me.
\begin{align*} \ddx \left ( (x^2+1) f(x) \right ) &= \ddx \left ( \answer [given]{x^2+1} \right ) \cdot f(x) + (x^2+1) \cdot \ddx \left ( \answer [given]{f(x)} \right ) \\ &= \left ( \answer [given]{2x} \right ) \cdot f(x) + (x^2+1) \cdot \ddx \left ( f(x) \right ) \end{align*}
Plugging in \(x=2\) yields:
\begin{align*} \eval { \ddx \left ( (x^2+1) f(x) \right ) }_{x=2} &= \left ( \answer [given]{4} \right ) \cdot f\left ( \answer [given]{2} \right ) + \left ( \answer [given]{5} \right ) \cdot f'\left ( \answer [given]{2} \right )\\ &= 4 \cdot \answer [given]{5} + 5 \cdot \answer [given]{-1}\\ &= \answer [given]{15} \end{align*}
2 The quotient rule
We’d like to have a formula to compute
\[ \ddx \frac {f(x)}{g(x)}\]
This brings us to our next derivative
rule.
The quotient rule If
\(f\) and
\(g\) are differentiable, then
\[ \ddx \frac {f(x)}{g(x)} = \frac {f'(x)g(x)-f(x)g'(x)}{g(x)^2}. \]
Compute:
\[ \ddx \frac {x^2+1}{x^3-3x}\]
Write with me
\begin{align*} \ddx \frac {x^2+1}{x^3-3x} &= \frac {2x(\answer [given]{x^3-3x})-(\answer [given]{x^2+1})(3x^2-3)}{(\answer [given]{x^3-3x})^2}\\ &=\frac {-x^4-6x^2+3}{(\answer [given]{x^3-3x})^2}. \end{align*}
Compute:
\[\ddx \frac {\sin (x)}{x} \]
Write with me
\[\ddx \frac {\sin (x)}{x} = \frac {\cos (x)\cdot x-\sin (x)\cdot 1}{x^2}.\]
It is often possible to calculate derivatives in more than one way, as we have already
seen. Since every quotient can be written as a product, it is always possible
to use the product rule to compute the derivative, though it is not always
simpler.
Compute:
\[ \ddx \frac {625-x^2}{\sqrt {x}} \]
in two ways. First using the quotient rule and then using the product rule.
First, we’ll compute the derivative using the quotient rule. Write with me
\[ \ddx \frac {625-x^2}{\sqrt {x}} = \frac {\left (-2x\right )\left (\answer [given]{\sqrt {x}}\right ) - (\answer [given]{625-x^2})\left (\frac {1}{2}x^{-1/2}\right )}{\answer [given]{x}}. \]
Second, we’ll compute the derivative using the product rule:
\begin{align*} \ddx \frac {625-x^2}{\sqrt {x}} &= \ddx \left (625-x^2\right )x^{-1/2}\\ =\left (625-x^2\right )&\left (\answer [given]{\frac {-x^{-3/2}}{2}}\right )+ (\answer [given]{-2x})\left (x^{-1/2}\right ). \end{align*}
With a bit of algebra, both of these simplify to
\[ -\frac {3x^2+625}{2x^{3/2}}.\]
Suppose we have two functions,
\(f\), and
\(g\), and we know that
\(f(4) = 3\),
\(f'(4) = 5\),
\(g(4) = -2\), and
\(g'(4) = 2\). What is the slope
of the tangent line to the curve
\(y=\frac {f(x)}{g(x)}\) at the point where
\(x = 4\)?
The slope of the tangent line to
the curve
\(y=\frac {f(x)}{g(x)}\) at
\(x = 4\) is given by
\( \eval {\ddx \frac {f(x)}{g(x)}}_{x=4}\).
By the QuotientRule, this derivative is given by
\begin{align*} \eval {\ddx \frac {f(x)}{g(x)}}_{x=4} &=\eval {\frac {f'(x)g(x)-f(x)g'(x)}{\left (g(x)\right )^2}}_{x=4}\\ &=\frac {f'(4)g(4)-f(4)g'(4)}{\left (g(4)\right )^2}\\ &=\frac {5(-2)-3\cdot 2}{\left (-2\right )^2}\\ &=\frac {-10-6}{4}\\ &=-4 \end{align*}
Suppose we have two functions,
\(f\), and
\(g\), and we know that
\(f(4) = 3\),
\(f'(4) = 5\),
\(g(4) = -2\), and
\(g'(4) = 2\). What is the slope
of the tangent line to the curve
\(y=\frac {xf(x)}{g(x)}\) at the point where
\(x = 4\)?
The slope of the tangent line to
the curve
\(y=\frac {xf(x)}{g(x)}\) at
\(x = 4\) is given by
\( \eval {\ddx \frac {xf(x)}{g(x)}}_{x=4}\).
By the QuotientRule and the Product Rule, this derivative is given by
\begin{align*} \eval {\ddx \frac {xf(x)}{g(x)}}_{x=4} &=\eval {\frac {(xf'(x)+f(x))g(x)-xf(x)g'(x)}{\left (g(x)\right )^2}}_{x=4}\\ &=\frac {(4f'(4)+f(4))g(4)-4f(4)g'(4)}{\left (g(4)\right )^2}\\ &=\frac {(4\cdot 5+3)(-2)-4\cdot 3\cdot 2}{\left (-2\right )^2}\\ &=\frac {(4\cdot 5+3)(-2)-4\cdot 3\cdot 2}{\left (-2\right )^2}\\ &=\frac {-35}{2}\\ \end{align*}
Compute:
\[\ddx \frac {e^x \sin (x)}{(x^2+1)(x-3)} \]
This one is a bit more involved than the previous examples. We’ll work through it
step-by-step. The first step will be to setup the quotient rule and to notice that
both the numerator and denominator in the original function are products.
\begin{align*} \ddx &\frac {e^x \sin (x)}{(x^2+1)(x-3)} = \dfrac {\left (e^x \sin (x)\right )'\left ((x^2+1)(x-3)\right ) - \left (e^x \sin (x)\right )\left ((x^2+1)(x-3)\right )' }{\left ((x^2+1)(x-3)\right )^2} \\ =& \dfrac {\left ((e^x)' \sin (x)+e^x(\sin (x))'\right )\left ((x^2+1)(x-3)\right ) - \left (e^x \sin (x)\right )\left ((x^2+1)'(x-3)+(x^2+1)(x-3)'\right ) }{\left ((x^2+1)(x-3)\right )^2} \\ =& \dfrac {\left (e^x \sin (x)+e^x\cos (x)\right )\left ((x^2+1)(x-3)\right ) - \left (e^x \sin (x)\right )\left (2x(x-3)+(x^2+1)\cdot 1\right ) }{\left ((x^2+1)(x-3)\right )^2} \end{align*}
Let’s finish up with one more, mixing the rules together.
Suppose
\(f\) is a function
whose values are given in the following table.
| | |
| | |
| x |
f(x) |
f’(x) |
| | |
| 1 | -3 | 4 |
| 2 | 5 | -1 |
| 3 | 2 | 0 |
| | |
Compute \(\eval { \ddx \left ( \frac {x f(x)}{x+1} \right )}_{x=2}\).
The ‘Outside Operation’ is a quotient, so we’ll start with the quotient rule.
Notice that the numerator is a product? That means we’ll have to use product rule,
too.
\begin{align*} \ddx \left ( \frac {x f(x)}{x+1} \right ) &= \frac {\ddx \left (x f(x)\right ) \left (\answer [given]{x+1}\right ) - \left ( x f(x) \right ) \ddx \left (x+1\right )}{\answer [given]{(x+1)^2}}\\ &= \frac {\left ( \ddx (x) f(x) + x\ddx \left (f(x)\right ) \right ) (x+1) - \left ( x f(x) \right ) \left ( \answer [given]{1}\right )}{(x+1)^2}\\ &= \frac {\left ( f(x) + x f'(x) \right ) (x+1) - x f(x)}{(x+1)^2} \end{align*}
Plugging \(x=2\) into this yields:
\begin{align*} \eval { \ddx \left ( \frac {x f(x)}{x+1} \right )}_{x=2} &= \frac {\left ( f\left (\answer [given]{2}\right ) + 2 f'\left (\answer [given]{2}\right ) \right ) \left (\answer [given]{3}\right ) - \answer [given]{2} f\left (\answer [given]{2}\right )}{\answer [given]{9}} \\ &= \frac {\left ( 5 + 2 (\answer [given]{-1})\right ) (3) - 2 (5)}{9} \\ &= \answer [given]{\frac {-1}{9}} \end{align*}