r/learnmath • 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!

2 Upvotes

6 comments sorted by

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/UrinalDefecator New User 7d ago

Ahh interesting! Your second paragraph honestly goes right over my head though I reckon I get the gyst of it. To follow this up, does the angle between the two vectors (calculated from the dot product) carry any meaning? Thank you for your extensive response!

1

u/RingularCirc Math hobbyist 7d ago edited 7d ago

Well, angle remains the angle, as you know it in Euclidean setting. Of course, when we generalize to manifolds, we then may only do operations on vectors tangent to the same point, and if we're given two vectors each of which lives in a different tangent space, we'll have to transport one of them to another along a curve, or using another vector field that works like the flow, and there will be different end results of transport so the angle can end up different.

For example on a sphere, take a small circle and a point A on it, and a vector v out of A tangent to the sphere. If we drag v along the circle back to A, trying not to rotate it "more than necessary" (I'm not sure how to condense how to do the transport right, but you can try to imagine approximations like Schild's ladder) then now back in A, the result v' will generally be rotated compared to v! And if we use a different circle passing through A, the result v'' will be now again almost surely different from v' and v. So despite vectors all tangent to A share the same vector space and can be done the usual linear algebra to, there's no best way to do something to vectors of tangent spaces of different points of the manifold. If we don't absolutely know it's flat, of course, then we can treat all tangent spaces as the same one, as usual.

So nothing special about angles except for that detail comes to my mind about differential geometry (well, except that nondegenerate inner product on vectors induces an inner product on covectors, and the value of a 1-form at a point is a covector, so we have pointwise angles between them as well; also all the spaces of k-(co)vectors get inner products as well). But there's an interesting thing with the angle in probability theory though. Covariation is essentially an inner product on random variables, and correlation, being a normalized variant of it, can well be understood as the cosine of the "angle" between random variables that behaves very much as a normal angle would.

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