Tutorials › Calculus I › Chain Rule for Nested Polynomials

Product, Quotient, and Chain Rules · Tutorial 459 of 1495

Chain Rule for Nested Polynomials

Use the chain rule to differentiate nested polynomials, keeping the outer derivative and inner derivative distinct and verifying the result.

Intermediate 9 min read

What You'll Learn

  • Identify the inner and outer functions in a nested polynomial.
  • Apply the chain rule to a polynomial raised to a positive integer power.
  • Differentiate a polynomial composed with a more general polynomial.
  • Keep the inner derivative as a factor in the final expression.
  • Check a chain-rule result by expanding and differentiating the polynomial.

Why Nested Polynomials Need the Chain Rule

A polynomial can appear inside another polynomial. For instance, in \((x^2+2x)^3\), the expression \(x^2+2x\) is the input to the cube function. The input changes with \(x\), so differentiating the outer cube is not the whole calculation: we must also account for how quickly the inner expression changes.

The chain rule organizes these two changes. First differentiate the outer function while treating its input as a single quantity. Then multiply by the derivative of that input. This produces a formula that is often much shorter than expanding the entire polynomial before differentiating.

Definition: A nested polynomial has the form \(F(g(x))\), where \(g\) is the inner function and \(F\) is the outer function. The output of \(g\) is used as the input of \(F\).

For \((x^2+2x)^3\), the inner function is \(g(x)=x^2+2x\), and the outer function is \(F(u)=u^3\). The variable \(u\) is a placeholder for the input of the outer function; it makes the two layers easier to distinguish.

The Chain Rule for Nested Polynomials

The chain rule applies when \(g\) is differentiable at \(x\), and \(F\) is differentiable at the value \(g(x)\). It says that the derivative of the composition is the outer derivative evaluated at the inner expression, multiplied by the inner derivative.

Theorem: 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). $$ For polynomials, both functions are differentiable for every real input, so the rule applies for all real \(x\).

For a nested power, take \(F(u)=u^n\), where \(n\) is a positive integer. Using the power rule for the outer function gives \(F'(u)=nu^{n-1}\). Substituting \(g(x)\) for \(u\), and then multiplying by \(g'(x)\), gives

$$ \frac{d}{dx}\bigl(g(x)\bigr)^n = n\bigl(g(x)\bigr)^{n-1}g'(x). $$

The factor \(g'(x)\) is essential. The outer derivative describes the change in the output relative to a change in the inner input. The inner derivative describes the change in that input relative to \(x\). Multiplying accounts for both changes.

A Product-Rule Justification for a Cube

The chain rule is the general rule for a composition. For the specific case of a cube, the appearance of the inner derivative can also be seen directly from the product rule, without expanding the polynomial. Write \((g(x))^3\) as a product of three copies of \(g(x)\). The product rule for three factors says to differentiate each factor in turn and add the resulting terms.

$$ \begin{aligned} \frac{d}{dx}\bigl(g(x)\bigr)^3 &=g'(x)g(x)g(x)+g(x)g'(x)g(x)+g(x)g(x)g'(x)\\ &=3\bigl(g(x)\bigr)^2g'(x). \end{aligned} $$

Each term contains two unchanged copies of \(g(x)\) and one differentiated copy \(g'(x)\). Since multiplication is commutative, the three terms are equal, which gives the factor of \(3\). This calculation illustrates why differentiating only the outer cube would be incomplete: it would omit the change in the inner function.

A Reliable Procedure

When a polynomial is nested inside another polynomial, keep the layers separate until the chain rule has been applied. The following sequence makes it less likely that a derivative factor will be lost.

1
Name the inner function.
Write the expression depending on \(x\) as \(g(x)\).
2
Write the outer function.
Use a separate input, such as \(u\), to describe the polynomial applied to \(g(x)\).
3
Differentiate the outer function.
Find \(F'(u)\), then substitute \(g(x)\) for \(u\).
4
Multiply by the inner derivative.
Find \(g'(x)\) and include it as a factor.
5
Check the result.
For a manageable polynomial, expand the original expression and differentiate it directly to compare.

Worked Examples

Worked Example: Differentiating a Cubed Quadratic

Differentiate \(y=(x^2+2x)^3\). Identify the inner function \(g(x)=x^2+2x\) and the outer function \(F(u)=u^3\).

First differentiate the outer function:

$$ F'(u)=3u^2. $$

Substitute the inner expression for \(u\):

$$ F'(g(x))=3(x^2+2x)^2. $$

Next differentiate the inner function:

$$ g'(x)=2x+2. $$

Multiply the outer derivative by the inner derivative:

$$ \frac{dy}{dx}=3(x^2+2x)^2(2x+2). $$

To check, expand the original polynomial. First, \((x^2+2x)^2=x^4+4x^3+4x^2\), so

$$ (x^2+2x)^3 =(x^4+4x^3+4x^2)(x^2+2x) =x^6+6x^5+12x^4+8x^3. $$

Differentiate this expanded form term by term:

$$ \frac{d}{dx}(x^6+6x^5+12x^4+8x^3) =6x^5+30x^4+48x^3+24x^2. $$

Expanding the chain-rule answer gives the same result:

$$ \begin{aligned} 3(x^2+2x)^2(2x+2) &=3(x^4+4x^3+4x^2)(2x+2)\\ &=6x^5+30x^4+48x^3+24x^2. \end{aligned} $$

The two derivatives agree, so the chain-rule result is checked.

Worked Example: Differentiating a Squared Cubic

Differentiate \(y=(2x^3-x+4)^2\). Here \(g(x)=2x^3-x+4\), and \(F(u)=u^2\).

The outer derivative is \(F'(u)=2u\). Substituting \(g(x)\) gives \(2(2x^3-x+4)\). The inner derivative is

$$ g'(x)=6x^2-1. $$

Therefore the chain rule gives

$$ \frac{dy}{dx}=2(2x^3-x+4)(6x^2-1). $$

Check by expanding the original expression. Squaring each term and including the pairwise cross terms gives

$$ \begin{aligned} (2x^3-x+4)^2 &=(2x^3)^2+(-x)^2+4^2\\ &\quad+2(2x^3)(-x)+2(2x^3)(4)+2(-x)(4)\\ &=4x^6+x^2+16-4x^4+16x^3-8x\\ &=4x^6-4x^4+16x^3+x^2-8x+16. \end{aligned} $$

Differentiating the expanded form gives

$$ 24x^5-16x^3+48x^2+2x-8. $$

Expanding the chain-rule answer confirms it:

$$ \begin{aligned} 2(2x^3-x+4)(6x^2-1) &=(4x^3-2x+8)(6x^2-1)\\ &=24x^5-12x^3+48x^2-4x^3+2x-8\\ &=24x^5-16x^3+48x^2+2x-8. \end{aligned} $$

This matches the derivative found from expansion.

Worked Example: A Polynomial Applied to a Polynomial

Differentiate \(y=(x^2+1)^3+2(x^2+1)^2-(x^2+1)\). The repeated inner expression is \(g(x)=x^2+1\). Describe the outer function as \(F(u)=u^3+2u^2-u\).

Differentiate the outer polynomial with respect to \(u\):

$$ F'(u)=3u^2+4u-1. $$

Substitute \(g(x)=x^2+1\) into this derivative:

$$ F'(g(x))=3(x^2+1)^2+4(x^2+1)-1. $$

The inner derivative is \(g'(x)=2x\). Multiplying gives

$$ \frac{dy}{dx} = \bigl(3(x^2+1)^2+4(x^2+1)-1\bigr)(2x). $$

For a check, simplify the original expression by setting \(q=x^2+1\). Then \(q^3=x^6+3x^4+3x^2+1\) and \(2q^2=2x^4+4x^2+2\), so

$$ \begin{aligned} q^3+2q^2-q &=(x^6+3x^4+3x^2+1)+(2x^4+4x^2+2)-(x^2+1)\\ &=x^6+5x^4+6x^2+2. \end{aligned} $$

Its derivative is \(6x^5+20x^3+12x\). The chain-rule expression simplifies to the same polynomial:

$$ \begin{aligned} \bigl(3(x^2+1)^2+4(x^2+1)-1\bigr)(2x) &=\bigl(3x^4+6x^2+3+4x^2+4-1\bigr)(2x)\\ &=(3x^4+10x^2+6)(2x)\\ &=6x^5+20x^3+12x. \end{aligned} $$

The independent differentiation agrees with the chain-rule result.

Common Mistake: Omitting the Inner Derivative

A frequent error is to differentiate the outer power and stop. For \(y=(x^2+2x)^3\), this incorrect calculation treats the inner expression as though it changed at rate \(1\):

$$ \text{Incorrect:}\qquad \frac{dy}{dx}=3(x^2+2x)^2. $$

But the inner expression has derivative \(2x+2\), not \(1\). The chain rule therefore requires that factor:

$$ \text{Correct:}\qquad \frac{dy}{dx}=3(x^2+2x)^2(2x+2). $$

The incorrect answer can also be exposed by expansion. The original polynomial expands to \(x^6+6x^5+12x^4+8x^3\), whose derivative is \(6x^5+30x^4+48x^3+24x^2\), not \(3(x^2+2x)^2\). A useful final check is to ask: Have I multiplied by the derivative of the entire inner expression?

Why the Chain Rule Is Useful

Expanding a composition before differentiating can create many terms, especially when the inner polynomial has several terms or the outer power is large. The chain rule preserves the structure of the expression and often gives a concise factored derivative. That form can be easier to read and may be useful in later calculations.

For a nested polynomial, the main discipline is to keep the two derivatives distinct: first find the derivative of the outer polynomial, evaluated at the inner expression; then multiply by the derivative of the inner polynomial. The inner derivative is not an optional simplification. It is part of the rule.

Check Your Understanding

Try each question by identifying the inner and outer functions before differentiating.

  1. Differentiate \((x^2-3x+1)^3\) using the chain rule. What is the inner derivative?
  2. For \((3x^2+1)^2\), write the outer derivative evaluated at the inner expression, before multiplying by the inner derivative.
  3. Differentiate \((x^2+2)^3+4(x^2+2)\) by treating \(x^2+2\) as a single inner function.
  4. What factor is missing from the incorrect derivative \(4(2x^2-x)^3\) of \((2x^2-x)^4\)?
  5. For a manageable nested polynomial, describe one way to check that a chain-rule derivative is correct.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): 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