Tutorials › AP Calculus › Distinguishing the Chain Rule from the Product Rule

Chain Rule and Nested Functions · Tutorial 177 of 999

Distinguishing the Chain Rule from the Product Rule

Learn to tell products from compositions and apply both differentiation rules correctly when an expression contains both structures.

Intermediate 9 min read

What You'll Learn

  • Identify the outermost operation in a written expression
  • Distinguish multiplying two functions from applying one function to another
  • Apply the product rule when both factors depend on the variable
  • Apply the chain rule to a function evaluated at an inner expression
  • Combine the rules when a product contains composite factors
  • Check derivatives by using equivalent forms or the difference quotient

Why the Structure of an Expression Matters

When differentiating, the first question is not simply which formula looks familiar. It is: how is the expression built? An expression may be a product, a composition, or a product whose factors are themselves compositions. Those structures call for different rules.

For example, \(x\sin(x^2)\) has an outer product: the factor \(x\) is multiplied by the factor \(\sin(x^2)\). But the second factor is also a composition: the sine function is applied to the inner expression \(x^2\). Differentiating it correctly requires both the product rule and the chain rule.

Key distinction: The product rule differentiates a product of functions. The chain rule differentiates a function evaluated at another function. They are not competing alternatives: one expression can have both structures.

Recognizing Products and Compositions

A product has the form \(u(x)v(x)\): two functions of \(x\) are multiplied. A composition has the form \(f(g(x))\): the output of an inner function \(g\) is used as the input to an outer function \(f\). In the composition \(\sin(x^2)\), for instance, \(x^2\) is the input to the sine function.

A useful first step is to look for the operation performed last when the expression is assembled. In \(x\sin(x^2)\), the last operation is multiplication, so start with the product rule. Within the second factor, the last operation is applying sine to \(x^2\), so differentiating that factor calls for the chain rule.

The way an expression is written helps reveal its useful structure. Some expressions can be rewritten in more than one way, so there may be more than one valid route to a derivative. The goal is to recognize a clear structure and apply the rules it requires.

Product Rule: If \(u\) and \(v\) are differentiable at \(x\), then $$ \frac{d}{dx}\bigl(u(x)v(x)\bigr)=u'(x)v(x)+u(x)v'(x). $$ Chain Rule: If \(g\) is differentiable at \(x\), and \(f\) is differentiable at \(g(x)\), then $$ \frac{d}{dx}f(g(x))=f'(g(x))g'(x). $$

Why the Product Rule Has Two Terms

Both factors in a product can change as \(x\) changes. The derivative must account for the change in each one. This idea is made precise by the difference quotient.

1
Start with the difference quotient.
For differentiable functions \(u\) and \(v\), subtract the product at \(x\) from the product at \(x+h\), then divide by \(h\).
2
Add and subtract a middle term.
Insert \(u(x+h)v(x)\), which lets us separate the changes in the two factors.
3
Take the limit.
As \(h\) approaches zero, differentiability gives the derivatives of the factors, and continuity gives \(u(x+h)\to u(x)\).
$$ \begin{aligned} \frac{u(x+h)v(x+h)-u(x)v(x)}{h} &=\frac{u(x+h)v(x+h)-u(x+h)v(x)}{h}\\ &\quad+\frac{u(x+h)v(x)-u(x)v(x)}{h}\\ &=u(x+h)\frac{v(x+h)-v(x)}{h} +v(x)\frac{u(x+h)-u(x)}{h}. \end{aligned} $$

Because differentiability implies continuity, \(u(x+h)\) approaches \(u(x)\). The difference quotients for \(u\) and \(v\) approach \(u'(x)\) and \(v'(x)\), respectively. Therefore the limit of the expression is \(u(x)v'(x)+v(x)u'(x)\), which is the product rule. Each term represents the contribution from the changing of one factor while the other factor is held at its corresponding value.

Worked Examples

Worked Example: A Product Containing a Composite Factor

Differentiate \(y=x\sin(x^2)\).

The outermost operation is multiplication. Set \(u(x)=x\) and \(v(x)=\sin(x^2)\). Then \(u'(x)=1\). To differentiate \(v\), use the chain rule: the outer function is sine, and the inner function is \(x^2\).

$$ v'(x)=\cos(x^2)\cdot 2x. $$

Now apply the product rule, keeping both terms:

$$ \begin{aligned} y' &=u'v+uv'\\ &=1\cdot\sin(x^2)+x\cdot\bigl(2x\cos(x^2)\bigr)\\ &=\sin(x^2)+2x^2\cos(x^2). \end{aligned} $$

Check: At \(x=0\), the derivative formula gives \(\sin(0)+0=0\). From the difference quotient, since \(y(0)=0\), $$ \lim_{h\to 0}\frac{h\sin(h^2)-0}{h} =\lim_{h\to 0}\sin(h^2)=0. $$ The two values agree.

Worked Example: A Composition That Is Not a Product

Differentiate \(y=(x^2+1)^3\).

The expression is a composition: the inner function is \(g(x)=x^2+1\), and the outer function is \(f(u)=u^3\). The outer derivative is \(3u^2\), and the inner derivative is \(2x\). Applying the chain rule gives:

$$ \begin{aligned} y' &=3(x^2+1)^2\cdot 2x\\ &=6x(x^2+1)^2. \end{aligned} $$

No product rule is needed in this form: the outer operation is raising the entire inner expression to the third power. To check, expand the original function and differentiate term by term:

$$ (x^2+1)^3=x^6+3x^4+3x^2+1, \qquad \frac{d}{dx}(x^6+3x^4+3x^2+1)=6x^5+12x^3+6x. $$

Expanding the chain-rule answer gives \(6x(x^4+2x^2+1)=6x^5+12x^3+6x\), as required.

Worked Example: A Product of Two Composite Factors

Differentiate \(y=(x^2+1)e^{3x}\).

The outermost operation is multiplication. Let \(u(x)=x^2+1\) and \(v(x)=e^{3x}\). Their derivatives are \(u'(x)=2x\) and, by the chain rule, \(v'(x)=e^{3x}\cdot 3\). Apply the product rule:

$$ \begin{aligned} y' &=u'v+uv'\\ &=2x e^{3x}+(x^2+1)(3e^{3x})\\ &=e^{3x}\bigl(2x+3x^2+3\bigr). \end{aligned} $$

Check: At \(x=0\), the derivative formula gives \(e^0(0+0+3)=3\). Using the difference quotient directly at zero gives the same result:

$$ \begin{aligned} \lim_{h\to 0}\frac{(h^2+1)e^{3h}-1}{h} &=\lim_{h\to 0}\left( \frac{e^{3h}-1}{h}+h e^{3h} \right)\\ &=3+0=3. \end{aligned} $$

Here \(\lim_{h\to0}(e^{3h}-1)/h=3\), from the derivative of the exponential at zero and the chain rule.

A Reliable Decision Process

Use the following process before differentiating a mixed expression. It helps prevent choosing one rule just because a familiar symbol appears.

1
Identify the outermost operation.
If the expression is a product of two variable-dependent factors, plan to use the product rule.
2
Inspect each factor.
If a factor applies a function to an inner expression, such as \(\sin(x^2)\) or \(e^{3x}\), use the chain rule to differentiate that factor.
3
Keep the product-rule terms distinct.
Write \(u'v+uv'\) before simplifying so neither contribution is lost.
4
Simplify and check.
Combine like terms or factor only after applying the required rules. Check by expanding, using an equivalent form, or evaluating the derivative at a convenient point.

Common Mistake: Using Only the Chain Rule

A common error is to notice the composite factor in \(x\sin(x^2)\) and differentiate only that factor, forgetting that it is multiplied by \(x\). For example, the incorrect calculation

$$ \frac{d}{dx}\bigl(x\sin(x^2)\bigr) \;\overset{\text{wrong}}{=}\; x\cdot 2x\cos(x^2) =2x^2\cos(x^2) $$

uses the chain rule on \(\sin(x^2)\) but omits the derivative contribution from \(x\). Correct the calculation by naming both product factors and applying the product rule:

$$ \begin{aligned} \frac{d}{dx}\bigl(x\sin(x^2)\bigr) &=1\cdot\sin(x^2)+x\cdot 2x\cos(x^2)\\ &=\sin(x^2)+2x^2\cos(x^2). \end{aligned} $$

The omitted term is not optional: it accounts for the change in the first factor. At \(x=0\), the incorrect expression gives zero, but the correct derivative there is also zero, so that point alone does not expose the error. At \(x=1\), however, the missing contribution is \(\sin(1)\), which is nonzero.

Why the Distinction Matters

The product rule and the chain rule describe different ways an expression can change. A product changes because either factor can change; a composition changes because its input changes and the outer function responds to that change. When both structures are present, the derivative must include both effects.

On an AP Calculus problem, identifying the structure before computing is especially useful when expressions contain trigonometric, exponential, or polynomial functions together. Writing the product-rule setup explicitly, then applying the chain rule inside each factor where needed, makes the calculation easier to follow and less likely to omit a term.

Takeaway: First determine whether the expression is multiplied or nested. Apply the product rule to products, the chain rule to compositions, and both rules when a product contains composite factors.

Check Your Understanding

For each question, identify the structure before differentiating. Show enough work to make clear which rule is being used.

  1. Is \(\cos(3x)\) a product, a composition, or both? Differentiate it.
  2. Differentiate \(x^2\sin x\). Which rule handles the outermost operation?
  3. Differentiate \(e^{x^2+1}\). Identify the outer and inner functions.
  4. Differentiate \((x+1)\cos(x^2)\). State where each rule is used.
  5. A student differentiates \(x e^{2x}\) as \(2xe^{2x}\). Identify the omitted contribution and give the correct derivative.

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon
Clinical Biostats