Multivariate calculus from first principles
The sum-over-paths formula is really matrix multiplication written out term by term. When functions are vector-valued, the chain rule collapses into a clean product of Jacobians, and this is the form that powers real autograd systems.
For a composition f ∘ g, the Jacobian of the whole is the Jacobian of the outer map (evaluated at the inner output) times the Jacobian of the inner map:
The shape check is what makes it click. If g: Rⁿ → Rᵏ and f: Rᵏ → Rᵐ, then J_g is k×n, J_f is m×k, and their product is m×n, exactly the shape the overall map Rⁿ → Rᵐ demands. The inner dimension k cancels, just as in ordinary matrix multiplication.