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.
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.
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
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.
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.
Write the expression depending on \(x\) as \(g(x)\).
Use a separate input, such as \(u\), to describe the polynomial applied to \(g(x)\).
Find \(F'(u)\), then substitute \(g(x)\) for \(u\).
Find \(g'(x)\) and include it as a factor.
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:
Substitute the inner expression for \(u\):
Next differentiate the inner function:
Multiply the outer derivative by the inner derivative:
To check, expand the original polynomial. First, \((x^2+2x)^2=x^4+4x^3+4x^2\), so
Differentiate this expanded form term by term:
Expanding the chain-rule answer gives the same result:
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
Therefore the chain rule gives
Check by expanding the original expression. Squaring each term and including the pairwise cross terms gives
Differentiating the expanded form gives
Expanding the chain-rule answer confirms it:
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\):
Substitute \(g(x)=x^2+1\) into this derivative:
The inner derivative is \(g'(x)=2x\). Multiplying gives
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
Its derivative is \(6x^5+20x^3+12x\). The chain-rule expression simplifies to the same polynomial:
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\):
But the inner expression has derivative \(2x+2\), not \(1\). The chain rule therefore requires that factor:
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.
- Differentiate \((x^2-3x+1)^3\) using the chain rule. What is the inner derivative?
- For \((3x^2+1)^2\), write the outer derivative evaluated at the inner expression, before multiplying by the inner derivative.
- Differentiate \((x^2+2)^3+4(x^2+2)\) by treating \(x^2+2\) as a single inner function.
- What factor is missing from the incorrect derivative \(4(2x^2-x)^3\) of \((2x^2-x)^4\)?
- For a manageable nested polynomial, describe one way to check that a chain-rule derivative is correct.