1.7 - Differentiating a function of a function

1.7 - Differentiating a function of a function

The expression inside a power may itself change with xx. You will use the chain rule to follow both stages of that change, including roots and reciprocal powers with nonlinear expressions inside. Expanding simple cases will help you check that no factor has been missed.

The inner and outer functions

Why is the derivative of (3x+1)4(3x+1)^4 not just 4(3x+1)34(3x+1)^3? The fourth-power operation acts on 3x+13x+1, and that inner expression changes three times as fast as xx.

Break the calculation into two stages: u=3x+1u=3x+1, then y=u4y=u^4. Near a particular input, a small change in xx produces a change in uu, which in turn produces a change in yy. The two local rates multiply.

Inner and outer functions

In y=[g(x)]ny=[g(x)]^n, the inner function is u=g(x)u=g(x), and the outer function is y=uny=u^n. A composite function applies the inner function first, then the outer function.

Keep the expression inside the power intact while differentiating the outer operation.

The chain rule

Where the required derivatives exist,

dydx=dydududx.\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}.

In particular, for constant rational nn,

ddx[g(x)]n=n[g(x)]n−1g′(x).\frac{d}{dx}[g(x)]^n=n[g(x)]^{n-1}g'(x).

Apply this where the original function and the derivative are defined.

Not stated separately in the formula booklet: learn it.

The notation resembles cancelling dudu, which is a helpful memory aid. The rule expresses the multiplication of local rates; the symbols are derivative notation, not ordinary fractions that can always be rearranged without checking conditions.

Worked example 1: an inner rate of one

Question. Differentiate y=(x+1)4y=(x+1)^4.

Plan. Differentiate the fourth power, then multiply by the derivative of x+1x+1.

u=x+1,dudx=1dydu=4u3,dydx=4(x+1)3×1.\begin{aligned} u&=x+1, &\frac{du}{dx}&=1\\ \frac{dy}{du}&=4u^3, &\frac{dy}{dx}&=4(x+1)^3\times1. \end{aligned}

Answer. dy/dx=4(x+1)3dy/dx=4(x+1)^3.

Check. Expanding gives x4+4x3+6x2+4x+1x^4+4x^3+6x^2+4x+1, whose derivative is 4x3+12x2+12x+4=4(x+1)34x^3+12x^2+12x+4=4(x+1)^3.

Change only the coefficient of xx inside the bracket. The inner rate is now 33.

Worked example 2: an inner rate of three

Question. Differentiate y=(3x+1)4y=(3x+1)^4.

Plan. Use the same outer derivative and multiply by the new inner derivative.

u=3x+1,dudx=3dydx=4u3×3=12(3x+1)3.\begin{aligned} u&=3x+1, &\frac{du}{dx}&=3\\ \frac{dy}{dx}&=4u^3\times3\\ &=12(3x+1)^3. \end{aligned}

Answer. dy/dx=12(3x+1)3dy/dx=12(3x+1)^3.

Check. At x=0x=0, the derivative is 1212. Expanding the original expression gives a linear term 12x12x; every higher-power term has derivative zero at 00, so the result agrees.

The opening question is resolved: 4(3x+1)34(3x+1)^3 measures change per unit change in the inner input; multiplying by 33 converts it to change per unit xx.

Watch out

d[(3x+1)4]/dx=12(3x+1)3d[(3x+1)^4]/dx=12(3x+1)^3, not 4(3x+1)34(3x+1)^3. Write the inner derivative as a separate factor before simplifying.

Try another linear inner function.

Nonlinear inner functions

The inner function does not have to be linear. For y=x3+4y=\sqrt{x^3+4}, the inside is u=x3+4u=x^3+4, whose rate of change is 3x23x^2. Rewrite the outer root as a power before using the same two-stage method.

For a square root, the real expression needs x3+4≥0x^3+4\ge0. The derivative formula obtained below has a square root in the denominator, so it applies where x3+4>0x^3+4>0. The endpoint where the root is zero needs separate attention; do not substitute it into a denominator.

Worked example 3: a root with a cubic inside

Question. Differentiate y=x3+4y=\sqrt{x^3+4}, where x3+4>0x^3+4>0, and find the derivative at x=2x=2.

Plan. Use outer exponent 1/21/2 and inner derivative 3x23x^2.

y=(x3+4)1/2dydx=12(x3+4)−1/2×3x2=3x22x3+4y′(2)=12212=3.\begin{aligned} y&=(x^3+4)^{1/2}\\ \frac{dy}{dx}&=\frac12(x^3+4)^{-1/2}\times3x^2\\ &=\frac{3x^2}{2\sqrt{x^3+4}}\\ y'(2)&=\frac{12}{2\sqrt{12}}=\sqrt3. \end{aligned}

Answer. dy/dx=3x2/(2x3+4)dy/dx=3x^2/(2\sqrt{x^3+4}), with y′(2)=3y'(2)=\sqrt3.

Check. At x=2x=2, the inside changes at rate 1212, while the square-root operation changes at rate 1/(212)1/(2\sqrt{12}). Their product is 3≈1.73205\sqrt3\approx1.73205. A chord to 2.0012.001 gives approximately 1.732481.73248.

Keep the same inner function and move the root to the denominator. Only the outer exponent changes, from 1/21/2 to −1/2-1/2.

Worked example 4: a reciprocal root

Question. Differentiate y=1/x3+4y=1/\sqrt{x^3+4}, where x3+4>0x^3+4>0, and find the derivative at x=2x=2.

Plan. Apply the power rule with exponent −1/2-1/2, then multiply by 3x23x^2.

y=(x3+4)−1/2dydx=−12(x3+4)−3/2×3x2=−3x22(x3+4)3/2y′(2)=−122(12)3/2=−143.\begin{aligned} y&=(x^3+4)^{-1/2}\\ \frac{dy}{dx}&=-\frac12(x^3+4)^{-3/2}\times3x^2\\ &=-\frac{3x^2}{2(x^3+4)^{3/2}}\\ y'(2)&=-\frac{12}{2(12)^{3/2}}=-\frac1{4\sqrt3}. \end{aligned}

Answer. dy/dx=−3x2/[2(x3+4)3/2]dy/dx=-3x^2/[2(x^3+4)^{3/2}], with y′(2)=−1/(43)y'(2)=-1/(4\sqrt3).

Check. The positive inner expression increases near 22; its reciprocal root decreases. The negative sign fits. The chord to 2.0012.001 has gradient approximately −0.144301-0.144301, close to −1/(43)≈−0.144338-1/(4\sqrt3)\approx-0.144338.

For an integer negative outer power, only a nonzero inner value is required. For example, (x2−9)−2(x^2-9)^{-2} is defined when x≠±3x\ne\pm3, and its derivative is −4x(x2−9)−3-4x(x^2-9)^{-3}. Always read the domain from the complete expression.

Problem-solving

Write three things before simplifying: the outer exponent, the unchanged inner expression, and the inner derivative. Then combine coefficients and rewrite negative powers if useful.

Apply the root method to a new cubic inside.

Checking the chain factor

An expanded special case gives an independent check on a chain-rule result. This is particularly useful when the inside contains a coefficient or a power of xx. Choose expansion when it is short; keep the composite form when expansion would create many terms or cannot remove the root.

Worked example 5: checking a linear inner function

Question. Find the derivative of y=(2x−1)2y=(2x-1)^2 in two ways.

Plan. Differentiate by the chain rule, then expand the original square and differentiate term by term.

Chain rule:y′=2(2x−1)×2=8x−4Expansion:y=4x2−4x+1y′=8x−4.\begin{aligned} \text{Chain rule:}\quad y'&=2(2x-1)\times2=8x-4\\ \text{Expansion:}\quad y&=4x^2-4x+1\\ y'&=8x-4. \end{aligned}

Answer. Both methods give 8x−48x-4.

Check. At x=1x=1, both give gradient 44. Omitting the inner factor would give 22, contradicting the expanded result.

Change only the inner function to a quadratic. The extra chain factor now varies with xx.

Worked example 6: checking a nonlinear inner function

Question. Find the derivative of y=(x2−1)2y=(x^2-1)^2 in two ways.

Plan. Keep the inner derivative 2x2x in the chain-rule method, then compare with expansion.

Chain rule:y′=2(x2−1)(2x)=4x(x2−1)Expansion:y=x4−2x2+1y′=4x3−4x.\begin{aligned} \text{Chain rule:}\quad y'&=2(x^2-1)(2x)\\ &=4x(x^2-1)\\ \text{Expansion:}\quad y&=x^4-2x^2+1\\ y'&=4x^3-4x. \end{aligned}

Answer. y′=4x(x2−1)=4x3−4xy'=4x(x^2-1)=4x^3-4x.

Check. At x=2x=2, the inner rate is 44, and the outer rate is 2(4−1)=62(4-1)=6; their product is 2424. The expanded derivative gives 32−8=2432-8=24.

You can also check the structure without expanding: differentiating a function of x2x^2 usually introduces a factor of xx. This is a useful warning signal, although agreement at a few inputs is not a proof of an identity.

Watch out

For y=(x2−1)2y=(x^2-1)^2, the line y′=2(x2−1)y'=2(x^2-1) has differentiated only the outer function. Multiply by 2x2x, not by x2−1x^2-1 again.

Find and repair an omitted factor in a new expression.

Quick Recap

  • Identify the inner function and the outer operation.
  • Differentiate the outer operation, leaving its input intact, then multiply by the inner derivative.
  • Rewrite roots and reciprocal powers before using the rule.
  • Check domains and denominators before evaluating a derivative.
  • Use a short expansion as an independent check when possible.

The missing factor in the opening question is 33: d[(3x+1)4]/dx=12(3x+1)3d[(3x+1)^4]/dx=12(3x+1)^3.