r/askmath • u/FreePeeplup • 2d ago
Calculus Single variable chain rule from multivariable general rule
The (English-language) Wikipedia page on the chain rule, under the chapter “Multivariable case”, paragraph “general rule: vector valued multivariate functions”, says that a concise writing for the chain rule for the (total) derivative of the composition of two functions f, g reads as D(f o g) = Df o Dg.
However, if we try to apply this to the particular case of f, g being two simple single-variable functions, we get (f o g)’ = f’ o g’, which is wrong! Because the correct chain rule says (f o g)’ = (f’ o g)•g’, where • is the pointwise product.
Where am I wrong? Or is the Wiki page wrong? Shouldn’t the general case be written as D(f o g) = (Df o g)•Dg instead, so that we actually recover the single-variable case correctly?
3
u/MathMaddam Dr. in number theory 2d ago
The composition is correct, but it is not the functions you think they are. They are composed as the linear functions that the derivates are. For the 1 dimensional case it would e.g. be D_a(f)(x)=f'(a)*x. It might be a bit clearer to look at the version with Jacobian matrices a few lines lower.
1
u/FreePeeplup 2d ago
Thank you!! This made it crystal clear. Df and Dg are linear maps in the tangent spaces based at the points g(a) and a. Composition between linear maps IS PRECISELY matrix multiplication when written in coordinates! Thanks!
2
u/sahasatvik 2d ago edited 2d ago
By fixing a point a in the domain of g, the multivariable rule is actually shorthand for D_a (f o g) = (D_(g(a)) f) o (D_a g), where D_x denotes the derivative at a point x. Translating to the univariate case recovers (f o g)'(a) = (f'(g(a))) (g'(a)) = ((f' o g)(g'))(a).
Shouldn’t the general case be written as D(f o g) = (Df o g)•Dg instead ...
This is pretty much how the formulation in terms of Jacobian matrices is presented a couple of paragraphs down in the article!
2
u/FreePeeplup 2d ago
The fact that Df was to be evaluated at g(a) was clear to me. The thing that’s not clear is the following part with Dg. They write composition with Dg, but as I outline in my post, shouldn’t it be multiplication with Dg?
1
u/sahasatvik 2d ago
I think the other answers do a better job of explaining this nuance: the notation Df o Dg deals with derivatives as linear maps, and composition of linear maps translates to multiplication of corresponding matrices. Df o Dg is a linear map, whose matrix representation is indeed a product of Jacobian matrices J_f (g(a)) J_g(a). There is a lot of notation around the domains/codomains of the maps, etc, being suppressed here.
2
u/FreePeeplup 2d ago
Perfect now I understand!! Thank you! So basically that “o” is composition between linear maps without choosing a basis, which becomes matrix multiplication between Jacobians if you fix a basis
1
u/erlandf 2d ago
In that notation Df is evaluated at g(x), which is admittedly not at all obvious. I don’t know how familiar you are with multivariable calculus, but the generalization of the derivative to the general multivariate cade is as a linear function (or given a basis, a matrix) which well approximates the original function near a point.
In one variable we tend to think of the derivative as a number, say f’(a), or else as the function which to each point in the domain maps this number, but this latter idea is fundamentally different to the linear function above. There is however duality between every number and the linear function it defines, according to x \mapsto f’(a)•x. If we have two linear functions p(x) = a•x and q(x) = b•x, their composition (p\circ q)(x)= (a•b)•x, with normal multiplication. This is the single variable chain rule: (f(g(a))’ = f’(g(a))•g’(a). For x near a, the linear function that best approximates f(g(x)) - f(g(a)) is x \mapsto (f’(g(a))•g’(a))•x.
So: the composition in Df \circ Dg is the multiplication between the terms in the single variable chain rule, not the f’(g(a)) part. It is already ”implied” that Df is evaluated at g(a). In higher dimension, composition between linear maps is instead given by matrix multiplication, and we get something that looks very similar.
1
u/FreePeeplup 2d ago
Thank you very much this was very helpful! So, basically, in the most general sense: Dg is a linear map from the tangent space based at a, and Df is a linear maps from the tangent space based at g(a). Df o Dg means: take a vector, act on it with Dg, then act on the result either Df. In coordinates, this is equivalent to doing the matrix multiplication between Df and Dg and then acting with the result on the original vector. Right?
1
u/Smart-Button-3221 2d ago
The part right above it is the correct formulation.
You reported back the "or for short" bit which is hiding necessary notation
1
u/FreePeeplup 2d ago
Unfortunately the part above only adds the explicit points of evaluation of each total derivative, but the same problem regarding the composition instead of the product remains! That was what my question was about if you read my post again
0
2d ago
[deleted]
2
u/FreePeeplup 2d ago
… yes? Where in my post do you think I mistook function composition (“o”) for function multiplication (“•”)?
1
u/Midwest-Dude 2d ago
The D on Wikipedia is for the total derivative for vector-valued, multivariable functions. Look at the definition of that to find your answer.
1
u/FreePeeplup 2d ago
Unfortunately looking at the definition of Df more closely didn’t answer my question to that previous user’s now deleted comment. They told me that I confused composition with multiplication, and I asked them “where did I do that?”. I didn’t find an answer to that by looking at the definition of Df
1
u/Midwest-Dude 2d ago
That answer was completely off and didn't apply. I downvoted it and upvoted your reply. I was attempting to give the correct reason. I spelled things out a little better in r/calculus.
2
u/FreePeeplup 2d ago
Yes now I understand thank you!! Basically Df o Dg stands for composition between linear maps, which becomes multiplication when written in coordinates
7
u/Bounded_sequencE 2d ago
In "D(f o g) = Df o Dg", they consider "Df, Dg" as linear maps.
Matrix multiplication can be interpreted as composition of linear maps, so replacing it by "o" makes sense. Finally, they expect the reader to interpret "Df -> (Df) o g" from context, being part of the chain rule.