AP Calculus AB and BC

Chain Rule Step Trainer: You Pick the Decomposition

The chain rule's hard part is decomposition: naming the outer and inner function before you differentiate. Use the last-operation test: whatever you compute last is the outer function, everything inside it is the inner. Differentiate the outer with the inside untouched, then multiply by the inner's derivative.

Problem
1 / 10
Differentiate
y = \sin(3x^2)

Step 1: which is the outer function? (Take the inner function to be everything inside the last operation.)

The chain rule itself is one line. The step that actually decides whether you get the derivative right is decomposition: splitting a composite function like f(x)=g(h(x))f(x) = g(h(x)) into an outer function gg and an inner function hh before you differentiate anything. This trainer makes you commit to that split from a set of choices, then assembles the derivative one step at a time so you can see how your pick drives every factor. That is the exact skill AP Calculus Topic 3.1 is built around: skill 1.C, choosing a procedure based on how an expression is put together rather than memorizing a formula.

f(x)=g(h(x))h(x)f'(x) = g'(h(x)) \cdot h'(x)

Read the formula as a recipe with three slots: the derivative of the outer function evaluated at the untouched inside, then multiplied by the derivative of the inside. Every slot depends on naming gg and hh correctly first, which is why the trainer asks you to choose the outer and inner function before it will build anything. To find them, use the last-operation test: imagine plugging in a number and running the arithmetic. Whatever you would do last is the outer function; everything you did before that is the inner function.

The last-operation test

For 7x1\sqrt{7x - 1} you would compute 7x17x - 1 first and take the square root last, so the outer function is the square root and the inner is 7x17x - 1. For ex2e^{x^2} you would compute x2x^2 first and exponentiate last, so the outer function is eue^{u} and the inner is x2x^2. Say the split out loud before you differentiate.

Once the split is named, the single habit that keeps chain-rule work clean is leaving the inside untouched while you differentiate the outside. The derivative of (3x2+5x)4(3x^2 + 5x)^4 keeps 3x2+5x3x^2 + 5x intact as 4(3x2+5x)34(3x^2 + 5x)^3; only afterward do you multiply by the inner derivative 6x+56x + 5. The trainer enforces this order, so a wrong pick shows up immediately as a factor that does not belong, which is the fastest way to feel the difference between the two candidate functions.

ExpressionOuter function (last step)Inner function
(3x2+5x)4(3x^2 + 5x)^4raise to the 4th power, u4u^43x2+5x3x^2 + 5x
sin(4x)\sin(4x)sine, sinu\sin u4x4x
ex2e^{x^2}exponential, eue^{u}x2x^2
7x1\sqrt{7x - 1}square root, u1/2u^{1/2}7x17x - 1
sin2x\sin^2 xsquare, u2u^2sinx\sin x

The last row is the classic trap: sin2x\sin^2 x means (sinx)2(\sin x)^2, so squaring is the outer function and sinx\sin x is the inner, which is the opposite decomposition from sin(x2)\sin(x^2). Working several of these in the trainer trains your eye to read the notation before you commit. Aim to name the outer and inner function correctly on sight; the assembly that follows is mechanical once the split is right, and getting it solid here pays off in implicit differentiation (Topic 3.2), related rates (Topic 4.4), and uu-substitution, all of which are the chain rule wearing a different hat.

Worked example

Decompose, then assemble a square-root composition

Differentiate f(x)=x2+1f(x) = \sqrt{x^2 + 1}.

  1. Rewrite the root as a power so the outer function is easy to name: x2+1=(x2+1)1/2\sqrt{x^2 + 1} = (x^2 + 1)^{1/2}. This is the same rewrite the trainer prompts before you choose, because a radical hides the fact that the last operation is a power.
  2. Run the last-operation test. Evaluating at a number, you would compute x2+1x^2 + 1 first and raise it to the 1/21/2 power last. So the outer function is g(u)=u1/2g(u) = u^{1/2} and the inner function is h(x)=x2+1h(x) = x^2 + 1, giving f(x)=g(h(x))f(x) = g(h(x)).
  3. Differentiate the outer function, leaving the inside untouched. Since g(u)=u1/2g(u) = u^{1/2}, we have g(u)=12u1/2g'(u) = \tfrac{1}{2} u^{-1/2}, so g(h(x))=12(x2+1)1/2g'(h(x)) = \tfrac{1}{2}(x^2 + 1)^{-1/2}. Notice the inside stays exactly x2+1x^2 + 1.
  4. Differentiate the inner function on its own: h(x)=2xh'(x) = 2x.
  5. Multiply the two pieces per the chain rule: f(x)=g(h(x))h(x)=12(x2+1)1/22xf'(x) = g'(h(x)) \cdot h'(x) = \tfrac{1}{2}(x^2 + 1)^{-1/2} \cdot 2x.
  6. Simplify. The 12\tfrac{1}{2} and the 2x2x combine to xx, and the negative exponent moves the factor into a denominator: f(x)=xx2+1f'(x) = \dfrac{x}{\sqrt{x^2 + 1}}.

f(x)=xx2+1f'(x) = \dfrac{x}{\sqrt{x^2 + 1}}

Frequently asked questions

How do I decide which function is the outer and which is the inner?

Use the last-operation test. Imagine evaluating the expression at a number and watch the order of operations: whatever you would do last is the outer function, and everything you computed before that is the inner function. For cos(3x1)\cos(3x - 1) you subtract inside first and take cosine last, so cosine is outer and 3x13x - 1 is inner.

What happens if I pick the outer and inner functions backwards?

You differentiate the wrong function and the factors come out mismatched. If you treated sin(x2)\sin(x^2) as though squaring were the outer step (as in sin2x\sin^2 x), you would differentiate (sinx)2(\sin x)^2 and get 2sinxcosx2\sin x \cos x, instead of the correct derivative 2xcos(x2)2x\cos(x^2), which is a different function entirely. The trainer surfaces this right away so you can see why the split has to come first.

Do I need to rewrite roots and reciprocals before decomposing?

Yes, and it makes the outer function obvious. Rewrite u\sqrt{u} as u1/2u^{1/2} and 1u\dfrac{1}{u} as u1u^{-1} so the last operation reads as a power. Then g(u)=u1/2g(u) = u^{1/2} or g(u)=u1g(u) = u^{-1} is the outer function and the power rule handles gg', with the chain rule multiplying by the inner derivative.