The product rule
Before reading this guide, it is recommended that you read Guide: Introduction to differentiation and the derivative.
Narration of study guide: |
What is the product rule?
In Guide: Introduction to differentiation and the derivative, you saw how valuable the idea of a derivative of a function is in determining the behaviour of that function. For instance, the derivative can be used to show if a function is increasing or decreasing at a point. Differentiation is commonly used in many subjects (physics, chemistry, biology, economics to name a few) to analyse behaviour of systems that change, and equations involving derivatives can be solved to explain this behaviour.
It was mentioned in that same guide that you are able to differentiate certain combinations of functions, such as the sum and difference of two functions, or scalar multiple of a single function. You need extra techniques to differentiate products, quotients, and compositions of functions; you will need the product rule, quotient rule, and chain rule respectively.
This guide will look at the product rule for differentiation in order to find the derivative of a product \(u(x)v(x)\) of two functions. This guide explains the rule, where it comes from, how it can be used, and how you can apply its techniques to functions that you may be familiar with.
The summary table of key derivatives from Guide: Introduction to differentiation and the derivative is reproduced here for reference:
Function \(f(x)\) | Derivative \(f'(x)\) | Notes |
---|---|---|
\(f(x) = c\) | \(f'(x) = 0\) | |
\(f(x) = ax + b\) | \(f'(x) = a\) | |
\(f(x) = ax^n\) | \(f'(x) = anx^{n-1}\) | \(n \neq 0\) |
\(f(x) = ae^{bx}\) | \(f'(x) = abe^{bx}\) | |
\(f(x) = a\sin(bx)\) | \(f'(x) = ab\cos(bx)\) | |
\(f(x) = a\cos(bx)\) | \(f'(x) = -ab\sin(bx)\) | |
\(f(x) = a\ln(bx)\) | \(f'(x) = \dfrac{a}{x}\) |
Statement of the product rule
Here is the statement of the product rule:
Let \(u(x)\) and \(v(x)\) be two differentiable functions. Then the product rule says that \[(uv)'(x) = \frac{\mathrm{d}}{\mathrm{d}x}\left(u(x)v(x)\right) = u'(x)v(x) + u(x)v(x)\] that is, the derivative of the product of \(u(x)\) and \(v(x)\) is equal to the product of \(v(x)\) and the derivative of \(u(x)\), plus the product of \(u(x)\) and the derivative of \(v(x)\).
This can also be written as \[\frac{\mathrm{d}}{\mathrm{d}x}\left(u(x)v(x)\right) = v\frac{\textrm{d}u}{\textrm{d}x} + u\frac{\textrm{d}v}{\textrm{d}x}.\]
The discovery of the product rule is often credited to Gottfried Leibniz (link to Mactutor biography, external site), one of the co-founders of calculus (along with Isaac Newton).
Sometimes \(f(x)\) and \(g(x)\) are written instead of \(u(x)\) and \(v(x)\) in the statement of the product rule. The reason that \(u(x)\) and \(v(x)\) is used here is that sometimes the product function is called \(f(x)\); and you then can’t use it again!
It does not matter which function you pick to be \(u(x)\) and which function you pick to be \(v(x)\); this is because \(u(x)v(x) = v(x)u(x)\).
To see why this really is the derivative of the product of two functions, please see [Proof sheet: Rules of differentiation.]
Examples
What is the derivative of \(y = x^3e^x\)?
In this case, you have two functions multiplied together to make \(y\). The two functions are \(u(x) = x^3\) and \(v(x) = e^x\). In order to use the product rule on \(y\), you could differentiate \(u(x)\) and \(v(x)\) beforehand and then substitute them into the product rule. Doing this gives
For \(u(x) = x^3\), then \(u'(x) = 3x^2\) by the power rule.
For \(v(x) = e^x\), then \(v'(x) = e^x\).
Putting these into the statement of the product rule gives
\[ \begin{aligned} \frac{\textrm{d}y}{\textrm{d}x} &= u'(x)v(x) + u(x)v'(x)\\[0.5em] &= (3x^2)(e^x)+ (x^3)(e^x) \\[0.5em] &= 3x^2e^x + x^3e^x \end{aligned} \] and this is your answer. You could also factorize the answer if you wanted to get \(y'(x) = (x^3 + 3x^2)e^x\).
You don’t need to be so rigorous in your own working. Here’s another example of using the product rule.
What is the derivative of \(f(z) = e^{3z}z^{1/3}\) with respect to \(z\)?
You can use the product rule on \(f(z)\) to differentiate with respect to \(z\). Set \(u(z) = e^{3z}\) and \(v(z) = z^{1/3}\). Differentiating both with respect to \(z\) gives \(u'(z) = 3e^{3z}\) and \(v'(x) = \frac{1}{3}z^{-2/3}\). Putting these into the statement of the product rule gives
\[ \begin{aligned} f'(z) &= u'(z)v(z) + u(z)v'(z)\\[0.5em] &= (3e^{3z})(z^{1/3}) + (e^{3z})\left(\frac{1}{3}z^{-2/3}\right)\\[0.5em] &= e^{3z}\left(3z^{1/3} + \frac{1}{3}z^{-2/3}\right) \end{aligned} \]
and this is your answer. Here, the answer has been factorized given the common \(e^{3z}\) term.
Here’s another example of the product rule, which is included solely for a chance to remember the signs for the derivatives of \(\sin(x)\) and \(\cos(x)\)!
Find the derivative of the function \(f(x) = 2\sin(x)\cos(x)\).
In this case, there are two options. You can either
- use the constant rule to take the \(2\) out and differentiate \(\sin(x)\cos(x)\) using the product rule, or
- take \(u(x) = 2\sin(x)\) and \(v(x) = \cos(x)\) and differentiate directly.
Let’s do the first of these. To use the product rule, take \(u(x) = \sin(x)\) and \(v(x) = \cos(x)\). Then \(u'(x) = \cos(x)\) and \(v'(x) = -\sin(x)\). Therefore, using the product rule gives
\[ \begin{aligned} \frac{\textrm{d}}{\textrm{d}x}\left(\sin(x)\cos(x)\right) &= u'(x)v(x) + u(x)v'(x)\\[0.5em] &= (\cos(x))(\cos(x))+(\sin(x))(-\sin(x))\\[0.5em] &= \cos^2(x) - \sin^2(x) \end{aligned} \]
Therefore, the derivative of \(f(x) = 2\sin(x)\cos(x)\) is \[f'(x) = 2\left(\cos^2(x) - \sin^2(x)\right).\]
You don’t always need the product rule to differentiate the product of two functions if that product of two functions can be expressed in a different way.
For instance, the function in Example 3 is \(f(x) = 2\sin(x)\cos(x)\), which by a trigonometric identity is equal to \(f(x) = \sin(2x)\). (See Guide: Trigonometric identities (radians) for more.) You can then differentiate \(\sin(2x)\) by the rules above to get \(2\cos(2x)\). By trigonometric identities, this is also equal to \(2\left(\cos^2(x) - \sin^2(x)\right)\), which is the same answer as in Example 3.
This shows you should explore all potential avenues before starting to use differentiation techniques.
Here’s an example which combines two separate differentiation rules; both the sum rule and the product rule.
Find the derivative of the function \(f(x) = e^x\sqrt{x} + x^3\).
Here, you could use the sum rule for differentiation to write \[\frac{\textrm{d}}{\textrm{d}x}\left(f(x)\right) = \frac{\textrm{d}}{\textrm{d}x}\left(e^x\sqrt{x}\right) + \frac{\textrm{d}}{\textrm{d}x}\left(x^3\right)\]
The first term needs the product rule to differentiate. To help with this, you can rewrite \(e^x\sqrt{x}\) as \(e^xx^{1/2}\). To use the product rule, take \(u(x) = e^x\) and \(v(x) = x^{1/2}\). Then \(u'(x) = e^x\) and \(v'(x) = \frac{1}{2}x^{-1/2}\). Therefore, using the product rule gives \[ \begin{aligned} \frac{\textrm{d}}{\textrm{d}x}\left(e^x\sqrt{x}\right) &= u'(x)v(x) + u(x)v'(x)\\[0.5em] &= (x^{1/2})(e^x) + \left(\frac{1}{2}x^{-1/2}\right)e^x\\[0.5em] &= e^x\left(\sqrt{x}+\frac{1}{2\sqrt{x}}\right) \end{aligned} \]
The second of these terms is differentiable using the power rule, and you can write \[\frac{\textrm{d}}{\textrm{d}x}\left(x^3\right) = 3x^2\]
Therefore, your final answer is \[ \begin{aligned} \frac{\textrm{d}}{\textrm{d}x}\left(f(x)\right) &= \frac{\textrm{d}}{\textrm{d}x}\left(e^x\sqrt{x}\right) + \frac{\textrm{d}}{\textrm{d}x}\left(x^3\right)\\[0.5em] &= e^x\left(\sqrt{x}+\frac{1}{2\sqrt{x}}\right) + 3x^2 \end{aligned} \] and this is your final answer. You can tidy this up if you want to, but it’s not necessary.
The next example demands that the function be rephrased in order to use the product rule.
Find the derivative of \(y = \dfrac{\ln(x)}{x^5}\).
Although this looks like one function divided by another, you can use the laws of indices (see Guide: Laws of indices to write as a product of two functions instead. Doing this gives \[y = \dfrac{\ln(x)}{x^5} = \ln(x) \cdot x^{-5}.\] Now you can use the product rule on this function. Take \(u(x) = \ln(x)\) and \(v(x) = x^{-5}\). Then \(u'(x) = \dfrac{1}{x} = x^{-1}\) and \(v'(x) = -5x^{-6}\). Therefore, using the product rule gives
\[ \begin{aligned} \frac{\textrm{d}y}{\textrm{d}x} &= u'(x)v(x) + u(x)v'(x)\\[0.5em] &=\left(x^{-1}\right)(x^{-5}) +(\ln(x))(-5x^{-6})\\[0.5em] &= x^{-6}-5x^{-6}\ln(x) + = \frac{1}{x^6}\left(1 - 5\ln(x)\right) \end{aligned} \]
and so \[\frac{\textrm{d}y}{\textrm{d}x} = \frac{1}{x^6}\left(1 - 5\ln(x)\right).\]
This technique does not work for all functions in a denominator without the use of other rules. For instance, consider the function \[f(x) = \frac{x^5}{\ln(x)}\] There are two ways you can differentiate this function with respect to \(x\):
use the quotient rule which deals with functions of the form \(\dfrac{u(x)}{v(x)}\) - see Guide: The quotient rule (where this function is Example 3) for more, or
write \(f(x) = x^5\cdot (\ln(x))^{-1}\), then use the product rule together with the chain rule to differentiate the composite function \((\ln(x))^{-1}\) (see Guide: The chain rule for more).
In particular, you cannot only use the product rule to differentiate \(f(x)\) in this case.
Here’s an example that again could use a rewrite before differentiating. This will save you a whole other application of the product rule!
Find the derivative of \(f(t) = 4t^4\cos(4t) + e^{-4t}\cos(4t)\) with respect to \(t\).
It seems here that you will have to use the product rule twice; once on the \(4t^4\cos(4t)\) term, and once on the \(e^{-4t}\cos(4t)\) term. However, you could notice here that \(\cos(4t)\) is common to both terms, and so you can factorize. This gives \[f(t) = 4t^4\cos(4t) + e^{-4t}\cos(4t) = (4t^4 + e^{-4t})\cos(4t).\]
You can now differentiate \(f(t)\) using one application of the product rule. Set \(u(t) = 4t^4 + e^{-4t}\) and \(v(t) = \cos(4t)\); it follows that \(u'(t) = 16t^3 - 4e^{-4t}\) and \(v'(t) = -4\sin(4t)\). Putting these into the statement of the product rule gives
\[ \begin{aligned} f'(t) &= u'(t)v(t) + u(t)v'(t)\\[0.5em] &= (16t^3 - 4e^{-4t})(\cos(4t)) + \left(4t^4 + e^{-4t}\right)\left(-4\sin(4t)\right)\\[0.5em] &= (16t^3 - 4e^{-4t})\cos(4t) - 4\left(4t^4 + e^{-4t}\right)\sin(4t) \end{aligned} \]
and this is a final answer. You could factorize this in any number of different ways; but the amount of times using the product rule can be minimized!
If you are differentiating a function that has terms in brackets multiplied together, don’t expand the brackets! This not only leads to extra work (and more opportunities for mistakes), but it will also result in using the product rule more times than is necessary.
Finally, here’s an example where a second application of the product rule is unavoidable.
What is the derivative of \(\displaystyle y = e^x\sin(2x)\cos(4x)\)?
In this case, \(y\) is a product of three distinct functions. The only option is to take either \(u(x)\) or \(v(x)\) as a product of two functions, and then use the product rule to find that derivative. Let’s take \(u(x) = e^x\) and \(v(x) = \sin(2x)\cos(4x)\). (The other three potential choices are perfectly acceptable!)
Now, you can differentiate both of these with respect to \(x\):
when \(u(x) = e^x\), then \(u'(x) = e^x\) (thanks to the indestructibility of \(e^x\)).
Now, when \(v(x) = \sin(2x)\cos(4x)\), what is \(v'(x)\)? You’re going to have to use the product rule to find out! In this case, you’re going to have to pick different names for the functions, since \(u(x)\) and \(v(x)\) have been used already. (The product rule still works fine even with different names.) In this case - since \(f\) has not yet been used - you can set \(f(x) = \sin(2x)\) and \(g(x) = \cos(4x)\). Therefore \(f'(x) = 2\cos(2x)\) and \(g'(x) = -4\sin(4x)\).
You can use the product rule to say that \[ \begin{aligned} v'(x) &= f'(x)g(x) + f(x)g'(x)\\[0.5em] &= (2\cos(2x))\cos(4x) + \sin(2x)(-4\sin(4x))\\[0.5em] &= 2\cos(2x)\cos(4x) - 4\sin(2x)\sin(4x) \end{aligned} \]
Finally, putting \(u'(x)\) and \(v'(x)\) into the product rule for \(y\) and simplifying gives
\[ \begin{aligned} \frac{\mathrm{d}y}{\mathrm{d}x} &= u'(x)v(x) + u(x)v'(x)\\[0.5em] &= \left(e^x\right)\left(\sin(2x)\cos(4x)\right) + \left(e^x\right)\left(2\cos(2x)\cos(4x) - 4\sin(2x)\sin(4x)\right) + \\[0.5em] &= e^x\left(\sin(2x)\cos(4x) + 2\cos(2x)\cos(4x) - 4\sin(2x)\sin(4x)\right) \end{aligned} \]
and this (finally) is your answer.
Quick check problems
Using the product rule, match the following six functions to their derivatives with respect to \(x\). One of the derivatives given does not match a function; you should select which one in the final sentence below.
Function | Derivative | |
---|---|---|
1. | \(3x^2\cos(2x)\) | |
2. | \(2x^3\sin(3x)\) | |
3. | \(x^2\cos(3x)\) | |
4. | \(3x^3\cos(2x)\) | |
5. | \(x^2\sin(3x)\) | |
6. | \(3x^2\sin(2x)\) |
where
- \(2x\cos(3x) - 3x^2\sin(3x)\)
- \(3x^2\cos(3x) + 2x\sin(3x)\)
- \(6x^2\cos(2x) + 6x\sin(2x)\)
- \(6x\sin(2x) + 6x^2\cos(2x)\)
- \(6x^3\cos(3x) + 6x\sin(3x)\)
- \(6x\cos(2x) - 6x^2\sin(2x)\)
- \(9x^2\cos(2x) - 6x^3\sin(2x)\)
So is the odd derivative out.
Further reading
For more questions on the subject, please go to Questions: The product rule.
For more about techniques of differentiation, please see Guide: The quotient rule, and Guide: The chain rule.
For more about why the rules and techniques of differentiation are true, please see Proof sheet: Rules of differentiation.
Version history
v1.0: initial version created 05/25 by tdhc.