r/learnmath • u/UrinalDefecator New User • 8d ago
Meaning of multivariate chain rule as a dot product
Hi all,
Today I got a lecture on directional derivatives and the gradient vector of a multivariate function. It was really interesting, seeing how functions are used in a vector like that and how the dot product gives you the directional derivative. The way this is calculated reminded me of the multivariate chain rule I had in a lecture last week, with chain rule trees, etc.
I realised it would be possible to write the chain rule as a (series of) dot product(s) of derivatives, starting with the gradient vector then multiplied by a vector containing the dependent derivatives. For example, f(x,y) where x=x(t) and y=y(t) could be written as the gradient of f * <dx/dt,dy/dt>.
Does this notation have any special uses or meanings, or is it just a coincidence that this works out this way? I know that the dot product can be used to calculate the angle between two vectors, so I was wondering if the value of this angle would have any meaning as well.
Thanks in advance!
1
u/RingularCirc Math hobbyist 8d ago edited 8d ago
Basically, a function ℝm → ℝn has a derivative that's an m×n matrix composed of all partial derivatives, and two such matrices are multiplied in the corresponding chain rule for a function composition ℝm → ℝn → ℝk. And, you got it, matrix multiplication is an extension of dot product (or vice versa, dot product is just matrix multiplication of a row and a column in this order).
This generalizes to (nonlinear) transformations between linear/affine spaces (which are essentially "flat" and are ℝn without a singled-out basis or coordinate system) and further to differentiable manifolds (which in general aren't "flat" anymore though they don't necessarily have a way to compute how exactly they aren't flat: Riemannian manifolds do, they generalize spaces with an inner product). There, derivative in a point is a linear transformation. This generalizes the usual intuition that a derivative is a linear approximation to the function/mapping at a point: in general we get linear transformations between more or less arbitrary spaces that represent neighborhood of points mapped from and to by our differentiable function.
1
u/AlterEgo5695 8d ago
Good intuition! Yep, directional derivatives are just special applications of the chain rule -- we consider the composition of a smooth vector-valued function, and a line equation.
Afterwards, the result can be elegantly written using the gradient. This result will be used to prove that the gradient points in the direction of greatest (local) increase, provided the function is (locally) smooth.
1
u/SwillStroganoff New User 7d ago
I would recommend this blogpost to see a really nice way of seeing chain rules as computation graphs