where n is the number of variables and 1 is the dimension of the image/range/codomain of f.
Rules of Partial Differentiation
Product Rule:
∂x∂(f(x)g(x))=∂x∂fg(x)+f(x)∂x∂g(3)
Sum Rule:
∂x∂(f(x)+g(x))=∂x∂f+∂x∂g(4)
Chain Rule:
∂x∂(g∘f)(x)=∂x∂(g(f(x)))=∂f∂g∂x∂f(5)
Intuition
Chain Rule
Think of it as a dependency graph for rates of change. Imagine a simple computation graph like the one in Figure 5.10 from the text: an input x produces an intermediate value a, which produces b, which finally produces an output y. x→a→b→y. The chain rule answers the question: “If I slightly nudge the input x, how much does the final output y change?” It tells us that the total change in y with respect to x is the product of the rates of change at each step along the path.
dxdy=change in bchange in y×change in achange in b×change in xchange in a
If f is a function in two variables x1,x2 which in turn are functions of t, then the gradient of f w.r.t. t is
Connection to Backpropagation: A deep neural network is a deeply nested composite function, y=(fK∘fK−1∘⋯∘f1)(x). To train the network, we minimize a loss function L that depends on the final output. This requires computing the gradient of the loss with respect to the parameters θi of each function (layer) fi.