Suppose h(x) = f(g(x)), where g is an inner function and f is an outer function applied to g's output. Which expression correctly gives h'(x)?
Select an answer to reveal the explanation.
Short Explanation and Infographic
This is just the chain rule, and it's the backbone of backpropagation, so let's nail it. You take the derivative of the outer function, but you evaluate it at g(x), not at x — because that's actually what f is looking at. Then you multiply by the derivative of the inner function, g'(x), since a tiny wiggle in x also changes g(x) before it ever reaches f. So the right answer is f'(g(x)) · g'(x). The trap answers either forget to evaluate f' at g(x) (using f'(x) instead), or swap multiplication for addition — but rates of change through a composition stack multiplicatively, not additively.
Full explanation below image
Full Explanation
The chain rule states that for a composite function h(x) = f(g(x)), the derivative is h'(x) = f'(g(x)) · g'(x). Intuitively, a small change in x produces a change in g(x) scaled by g'(x), and that change in g(x) then produces a change in f's output scaled by f'(evaluated at the current value of g(x), i.e., f'(g(x))). Multiplying these two local rates of change together gives the overall sensitivity of h to x. This is the mathematical engine behind backpropagation: each layer's gradient is the product of the upstream gradient (from the loss down through later layers) and the local derivative of that layer's own function, chained together across every layer in the network. The option f'(x) · g'(x) is wrong because it evaluates the outer derivative at x instead of at g(x) — a very common mistake, since f is never actually applied to x directly, only to g(x); if f' is evaluated at the wrong point, the resulting slope is wrong except in the special case where g(x) = x. The option f'(g(x)) + g'(x) incorrectly adds the two derivatives rather than multiplying them; addition would be appropriate for the derivative of a sum of functions (like f(x) + g(x)), not a composition where one function's output feeds into another. The option f'(x) + g(x) compounds both errors: it uses the wrong evaluation point for f' and adds the raw function g(x) rather than its derivative, which doesn't correspond to any calculus rule. A solid memory aid: 'outer derivative evaluated at the inner function, times inner derivative' — or picture peeling an onion from the outside in, multiplying the rate of change at each layer as you go.