Chain Rule vs Product Rule: When to Use Which in Calculus
Solver AI TeamPublished Updated 11 min read
Chain rule or product rule? Learn how to instantly identify which differentiation rule to apply, avoid common pitfalls, and work through examples that combine both.
Frequently asked questions
Can you use the chain rule and product rule in the same problem?
Yes. For y = x² · sin(3x), the outer structure is a product, so start with the product rule: y′ = 2x · sin(3x) + x² · (derivative of sin(3x)). That last derivative needs the chain rule and equals 3cos(3x). The result is y′ = 2x sin(3x) + 3x² cos(3x).
What is the derivative of sin(3x)?
The derivative of sin(3x) is 3cos(3x). The outer function is sine and the inner function is 3x. Differentiate the outer function to get cos(3x), then multiply by the derivative of the inner function, which is 3. Leaving off that factor of 3 is one of the most common calculus mistakes.
Is the derivative of a product the product of the derivatives?
No. The derivative of f(x)g(x) is f′(x)g(x) + f(x)g′(x), not f′(x)g′(x). A quick check is y = x · x = x², whose derivative is 2x. The product of the derivatives would be 1 · 1 = 1, which is wrong, while the product rule gives 1·x + x·1 = 2x.
Do you need the product rule to differentiate 5 sin(x)?
No. A constant factor just comes out front, so d/dx[5 sin x] = 5 cos x. The product rule is needed only when both factors depend on x, such as x · sin(x) or x³ · eˣ. If you used the product rule on 5 sin x anyway, you would still get 5 cos x, just with extra work.
How do you differentiate x · e^(2x)?
Treat it as a product with f = x and g = e^(2x). Then f′ = 1, and g′ = 2e^(2x) by the chain rule. The product rule gives y′ = 1 · e^(2x) + x · 2e^(2x) = e^(2x)(1 + 2x). Skipping the chain rule on e^(2x) would give the wrong answer.
The product rule is a differentiation formula used when you need to find the derivative of two functions that are multiplied together.
The Rule — Product Rule
If you have y = f(x) · g(x), then the derivative is y' = f'(x) · g(x) + f(x) · g'(x). In words: differentiate the first function and multiply by the second, then add the first function multiplied by the derivative of the second.
Example — y = x² · sin(x)
For example, if y = x² · sin(x), you have two separate functions being multiplied: f(x) = x² and g(x) = sin(x).
The key indicator that you need the product rule is seeing two distinct functions joined by multiplication where neither is simply a constant. If one factor is a constant (like 5 · sin(x)), you can just pull the constant out and differentiate normally — no product rule needed.
The product rule arises naturally in physics when differentiating quantities like momentum (mass times velocity) when both mass and velocity depend on time.
What Is the Chain Rule?
The chain rule is used when you need to differentiate a composite function — a function inside another function.
The Rule — Chain Rule
If y = f(g(x)), then the derivative is y' = f'(g(x)) · g'(x). In words: differentiate the outer function (keeping the inner function unchanged), then multiply by the derivative of the inner function.
Example 1 — y = sin(3x)
For example, if y = sin(3x), the outer function is sin(u) and the inner function is u = 3x.
The derivative of the outer is cos(u) = cos(3x), and the derivative of the inner is 3.
Answery' = cos(3x) · 3 = 3cos(3x)
Example 2 — y = (x² + 1)⁵
Another example: y = (x² + 1)⁵. The outer function is u⁵ and the inner is u = x² + 1.
Answery' = 5(x² + 1)⁴ · 2x = 10x(x² + 1)⁴
The Key Insight
The chain rule is needed whenever something other than a plain x is "inside" another function — inside parentheses raised to a power, inside a trig function, inside a logarithm, under a square root, or inside an exponential.
How to Tell Which Rule You Need
The decision comes down to asking one question: Is this a product of two functions, or is this a function inside a function? Look at the structure of the expression.
Structure
What You See
Rule to Use
Product
Two separate pieces multiplied together — like x³ · eˣ or ln(x) · cos(x)
Product rule
Composition
One function wrapped around another — like e^(x²), sin(5x + 1), or √(x³ + 2)
Chain rule
The Quick Test
Can you point to two separate factors being multiplied at the outermost level? If yes, start with the product rule. If instead the outermost operation is something like a power, trig, exponential, or log function applied to a non-trivial input, start with the chain rule.
When you need both rules
Sometimes you need both rules in the same problem. For instance, y = x² · sin(3x) is a product (product rule first) where the second factor sin(3x) is a composition (chain rule for its derivative).
The Takeaway
Training yourself to read the structure of an expression is one of the most valuable calculus skills you can develop.
Common Mistakes and How to Avoid Them
Students make several predictable errors when applying these rules.
Mistake 1 — Forgetting the chain rule entirely
Writing the derivative of sin(3x) as cos(3x) instead of 3cos(3x) is one of the most common errors in calculus. Always check: is there an inner function whose derivative I need to multiply by?
Mistake 2 — Mixing up the product rule formula
Some students write f'(x) · g'(x) instead of f'(x) · g(x) + f(x) · g'(x). The product of the derivatives is not the derivative of the product.
Mistake 3 — Using the product rule when the chain rule is needed
The expression (2x + 1)⁴ is not a product of two functions — it is a composition (the power function applied to a linear function). Use the chain rule, not the product rule.
Mistake 4 — Forgetting to apply the chain rule inside a product rule
When differentiating x · e^(2x), the product rule gives 1 · e^(2x) + x · (derivative of e^(2x)), and that derivative of e^(2x) requires the chain rule to get 2e^(2x). If you skip it, your answer is wrong.
The Takeaway
When in doubt, scan your problem with Solver AI to see the correct rule applied step by step.
Worked Examples: Product Rule
Let's practice the product rule with several examples.
Example 1 — d/dx [x³ · eˣ]
Find d/dx [x³ · eˣ].
Let f = x³, g = eˣ. Then f' = 3x², g' = eˣ.
Product rule: y' = 3x² · eˣ + x³ · eˣ.
Answery' = eˣ(3x² + x³) = x²eˣ(3 + x)
Example 2 — d/dx [sin(x) · cos(x)]
Find d/dx [sin(x) · cos(x)].
Let f = sin(x), g = cos(x). Then f' = cos(x), g' = −sin(x).
In every case, the pattern is the same: differentiate the outer shell, leave the inside alone, then multiply by the derivative of the inside. If you can identify the "layers" of a function, the chain rule becomes second nature.
When You Need Both Rules Together
Many real calculus problems require both the product rule and the chain rule in a single differentiation.
Example 1 — y = x² · e^(3x)
Consider y = x² · e^(3x). At the top level, this is a product of x² and e^(3x), so start with the product rule:
y' = 2x · e^(3x) + x² · d/dx[e^(3x)]
Now, d/dx[e^(3x)] requires the chain rule: outer eᵘ, inner 3x, so the derivative is 3e^(3x).
Chain rule for the second term: 4(x² + 1)³ · 2x = 8x(x² + 1)³.
Answery' = cos(x)(x² + 1)⁴ + 8x · sin(x)(x² + 1)³
The Strategy
The strategy is always the same: identify the outermost structure, apply the appropriate rule, and handle inner layers with the chain rule as needed. With practice, this layered approach becomes automatic.
The Takeaway
Solver AI is excellent for checking these multi-rule problems — just snap a photo and see each rule applied in the correct order.