Product Rule for Derivatives: Formula, Examples and Proof
The product rule: the derivative of f·g is f'g + fg'. The formula, worked examples, the three-factor version, a short proof and common mistakes.
Derivative rules Updated 3 min read
At a glance
- Applies to
- A product of two differentiable functions, both depending on x
- In words
- Derivative of the first times the second, plus the first times the derivative of the second
- Three factors
- (fgh)' = f'gh + fg'h + fgh'
- Not needed when
- One factor is a constant (use the constant multiple rule)
- Integral version
- Integration by parts
On this page
The product rule tells you how to differentiate two functions multiplied together. The derivative of a product is not the product of the derivatives. Instead, you differentiate one factor at a time and add the results.
The product rule formula
If f and g are differentiable, then
A common way to say it: derivative of the first times the second, plus the first times the derivative of the second. In shorthand, (fg)' = f'g + fg'.
For three factors the pattern continues, with one differentiated factor per term:
Worked examples
Example 1: a power times a trig function. Let f = x^2 and g = \sin x, so f' = 2x and g' = \cos x:
Example 2: a power times an exponential. With f = x and g = e^x:
Example 3: a logarithm. With f = x and g = \ln x:
Example 4: two polynomials, checked by expanding. For (3x + 1)(x^2 - 2):
Expanding first gives 3x^3 + x^2 - 6x - 2, whose derivative is also 9x^2 + 2x - 6.
Example 5: three factors. For x\,e^x\sin x:
When to use the product rule
Use it when two (or more) factors both depend on x:
| Expression | Use the product rule? |
|---|---|
| x^3\cos x | Yes |
| e^x \ln x | Yes |
| 5\sin x | No, 5 is a constant: constant multiple rule |
| \sin(x^2) | No, that is a composition: chain rule |
| \frac{x^2}{x + 1} | Use the quotient rule, or the product rule on x^2(x+1)^{-1} |
Many derivatives need the product rule and the chain rule together. For x^2 e^{3x}, the product rule splits it up and the chain rule handles e^{3x}: the result is 2x e^{3x} + 3x^2 e^{3x}.
Why the product rule works
Start from the limit definition of the derivative and add and subtract f(x+h)g(x) in the numerator:
As h \to 0, f(x+h) \to f(x) because differentiable functions are continuous, and the two difference quotients become g'(x) and f'(x). That leaves f(x)g'(x) + g(x)f'(x).
Picture a rectangle with sides f and g. When both sides grow a little, the area gains a strip of size f'g along one side and a strip of size fg' along the other.
Common mistakes
- Multiplying the derivatives. \frac{d}{dx}\,x^2\sin x \ne 2x\cos x. You need two terms.
- Differentiating both factors in the same term. Each term has exactly one primed factor.
- Using it on a constant multiple. It works but wastes time. \frac{d}{dx}\,4x^3 is just 12x^2.
- Forgetting the chain rule inside a factor. In x\sin(2x), the derivative of \sin(2x) is 2\cos(2x), so the answer is \sin(2x) + 2x\cos(2x).
Integrating the product rule gives integration by parts. For more examples and a side-by-side comparison with the quotient rule, read the full guide to the product and quotient rules.
Practice it now
The product rule
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson