If one field is fed into another, the derivative of the composite is the product of the two Jacobian matrices, the outer one evaluated at the image point. This one rule gives the derivative along a path, the formulas for changing coordinates, the derivative of an inverse (the inverse matrix), and, applied twice, the second derivatives of a composite.
Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 8.20 to 8.22 (Theorem 8.11) and 8.24 #6Spagnolie, Lectures 22 and 23 and the Final ReviewMATH 375 Practice Final 2013 (problems 9 and 10) and the Fall 2025 final (problem 5)Jacobi, De determinantibus functionalibus (1841)
A temperature depends on where you are. Where you are depends on the time. How fast does the temperature you feel change? In one variable (1.4) the answer is a product of slopes. In many variables the “slopes” are the Jacobian matrices of 5.3, and the answer is a product of matrices. This chapter proves that, and then spends the proof: the same rule gives the derivative along a path, the formulas for changing from (x,y) to polar coordinates, the derivative of an inverse map, and, used twice, every second-derivative computation in the course.
Before you start
5.3: the Jacobian matrix of a differentiable field, rows are gradients. 2.5: the matrix of a composition of linear maps is the product of the matrices. 1.4: the one-variable chain rule.
Quick checkg:R2→R3 and f:R3→R4 are differentiable. What shape is the Jacobian of f∘g?
f∘g takes 2 numbers in and gives 4 out, so its Jacobian has 4 rows (outputs) and 2 columns (inputs). It must equal an m×n matrix times an n×p matrix, here (4×3)(3×2).Review: shape of the Jacobian
Quick checkTwo linear maps have matrices A (apply first) and B (apply second). What is the matrix of 'first A, then B'?
The vector x goes to Ax and then to B(Ax)=(BA)x. The map applied first sits on the right. The chain rule will have the same order: the Jacobian of the outer map is on the left.Review: the matrix of a composition
Quick checkIn one variable, h(x)=sin(x2). At which point is the outer derivative cos evaluated?
h′(x)=cos(x2)⋅2x. The outer derivative is taken at the image of the inner function. In many variables this becomes 'evaluate Df at g(a), not at a', the most common slip.Review: the chain rule in one variable
The picture: circles into ellipses into ellipses
Drag the dot in the left plane and shrink the radius ρ. A tiny circle of steps around a is sent by g to a curve that is almost an ellipse (the blue curve in the middle: this is the picture of 5.3, zoomed). Then f sends that ellipse to another one. The right-hand picture compares the true image of the circle under the composite f∘g (purple) with the unit circle sent by the product Df(g(a))Dg(a) (green dashed). The “largest gap” in the box under the picture falls towards 0 with ρ. The two ellipses are the same shape once the circle is small: a composite of two things that look linear looks linear, and its matrix is the product. Switch to the other pairs of maps and move the point around. The matrices change from point to point; the product rule between them does not.
The idea, in words
In one variable the proof of 1.4 runs: near a, g is a line; near g(a), f is a line; so f∘g is a line of slope f′(g(a))g′(a), with an error that is still small. In many variables nothing changes except the meaning of “line”. Near a the field g is a constant plus a linear map plus a small error (the definition of differentiable, 5.3); near b=g(a) the field f is the same. Substitute the first into the second. A linear map applied to a linear map is a linear map (the product of the matrices). A linear map applied to a small error is a small error. A small error inside an error that is small compared with its input stays small.
Why· Why the outer Jacobian sits on the left and is evaluated at g(a)
Follow a tiny step y at a. The map g turns it into the step Dg(a)y at the point b=g(a). That step now lives where f is being looked at, so f turns it into Df(b)(Dg(a)y). The matrix that acts first is on the right, the one that acts second is on the left, and the second one is the derivative of f at the place where the step lands, which is b.
Where this came from· The curly d
The symbol ∂ for a partial derivative is older than its use in this chapter’s formulas. Condorcet used it in 1770, for partial differences. Legendre created the modern partial-derivative notation in 1786 and then dropped it, and Jacobi revived it in 1841, in the paper whose determinant appears in 5.3. The multivariable chain rule is usually written ∂s∂h=∂x∂f∂s∂x+∂y∂f∂s∂y, which looks like cancelling fractions as in Leibniz’s one-variable dxdz=dydzdxdy. The cancelling picture is a good memory aid and a bad proof: the sum over the routes from s to h is the matrix product, and the proof below does not cancel anything. The trap section shows where the aid fails.
Let g map a set in Rp into Rn and f map a set in Rn into Rm, and suppose h=f∘g is defined on a ball around a. If g is differentiable at a with total derivative g′(a), and f is differentiable at b=g(a) with total derivative f′(b), then h is differentiable at a and its total derivative is the composition of linear maps
h′(a)=f′(b)∘g′(a).
In Jacobian matrices, Dh(a)=Df(b)Dg(a), an m×p matrix equal to an m×n matrix times an n×p matrix. Entry by entry,
In one lineIf g is differentiable at a and f is differentiable at b=g(a), then h=f∘g is differentiable at a and h′(a)=f′(b)∘g′(a); in matrices, Dh(a)=Df(b)Dg(a).
Why it is trueIt makes the derivative of any composition computable from the derivatives of the pieces, and it turns 'compose the maps' into 'multiply the matrices', which is the reason matrices were the right tool.
The idea: Write the change in g as a linear part plus a small error, and feed that change into the first-order formula for f. The linear parts compose to the product of the matrices. The leftover is two terms, each small compared with the step, because linear maps are continuous and because the change in g is no more than a constant times the step.
Let v=g(a+y)−g(a). Then v=Dg(a)y+∥y∥Eg(a,y) with Eg(a,y)→0 as y→0.
Name the small step y at a and the resulting step v at b; g is differentiable at a (definition in 5.3).
f(b+v)−f(b)=Df(b)v+∥v∥Ef(b,v) with Ef(b,v)→0 as v→0, and Ef(b,O)=O.
f is differentiable at b. Differentiable fields are continuous (5.3), so v→O as y→0 and b+v stays inside the ball where the formula holds. We set Ef(b,O)=O because v can be O even when y=O (if g happens to take the same value twice), and then the term ∥v∥Ef is 0 whatever Ef is.This is where the hypothesis 'h is defined near a' is used: we need b + v in the domain of f.
h(a+y)−h(a)=f(g(a+y))−f(g(a))=f(b+v)−f(b); substitute step 1 into the linear term of step 2 and use linearity of Df(b).
So h(a+y)−h(a)=Df(b)Dg(a)y+∥y∥E(a,y), where E(a,y)=Df(b)Eg(a,y)+∥y∥∥v∥Ef(b,v) for y=O, and E(a,O)=O.
Pull out ∥y∥ from the last two terms. This is the form of the definition in 5.3 with the linear map Df(b)Dg(a), which is linear because a product of matrices is a matrix.
The first term of E tends to O as y→0.
A linear map is continuous at O: ∥Df(b)w∥≤K∥w∥ for a constant K (the bound used in the proof of 'Differentiable fields are continuous', 5.3), and Eg→O.
The quotient ∥v∥/∥y∥ is at most M+1, a constant.
From step 1 and the triangle inequality, ∥v∥≤∥Dg(a)y∥+∥y∥∥Eg∥≤(M+∥Eg∥)∥y∥. Here M is a constant with ∥Dg(a)w∥≤M∥w∥ for every w (a linear map has one, as in step 5), and ∥Eg∥≤1 for small y because Eg→O.The danger is the quotient: dividing by the small number ‖y‖. Step 1 shows v is itself no bigger than a constant times ‖y‖, so the quotient cannot blow up.
So the second term of E tends to O as well.
v→O as y→0 (step 2), so Ef(b,v)→O; a bounded number times something tending to O tends to O.
Hence E(a,y)→O, and Dh(a)=Df(b)Dg(a). ■
Both terms of E(a,y) tend to O, so h satisfies the definition of differentiable with total derivative Df(b)Dg(a). The entrywise formula is the definition of a matrix product.
Proof workshopRebuild the proof of the chain ruleApostol 8.20
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
The definition of differentiable for g at a, applied to the step y.
The definition of differentiable for f at b = g(a), applied to the step v.
You need the step v to exist before you can feed it into f.
Substitute the first line into the linear term of the second, using that Df(b) is linear.
Both first-order formulas must be written down before you can substitute one into the other.
Take out the common factor of the length of y from the last two terms.
First you need the combined expression for the change in h.
From the first line, v is a linear part, bounded by a constant times the length of y, plus an error that is at most the length of y.
This uses the formula for v from the first line, and is needed before you can say the quotient is harmless.
Linear maps are continuous at the origin, the quotient is bounded, and the error of f tends to zero as v does.
This is the conclusion: it needs the form of E and the bound on the quotient.
Quick checkIn h=f∘g, at which point is the Jacobian Df evaluated in the chain rule?
The step produced by g lands at g(a), and f is differentiated where that step lands. For h(x)=sin(x2) the cosine is evaluated at x2.
Special cases
Every formula in the lectures is the matrix product for a particular choice of the shapes p, n, m.
Inner field g
Outer field f
Shapes
The chain rule says
a path r:R→Rn
scalar field
(1×n)(n×1)
dtdf(r(t))=∇f(r(t))⋅r′(t)
(s,t)↦(x,y), a change of coordinates
scalar field of x,y
(1×2)(2×2)
hs=fxxs+fyys, ht=fxxt+fyyt
a field g:Rp→Rn
scalar field
(1×n)(n×p)
∇h(a)T=∇f(b)TDg(a)
a scalar field g
a function F of one variable
(1×1)(1×n)
∇(F∘g)=F′(g)∇g
g:Rp→Rn
f:Rn→Rm
(m×n)(n×p)
Dh=DfDg
The first row is the theorem “Rate of change along a curve” of 5.3, now a consequence of this chapter’s theorem: a row times a column is a dot product. The third row, transposed, is the form that backpropagation uses.
Corollary AApostol 8.22 #12
The gradient of a composite
Under the hypotheses of the chain rule with m=1, ∇h(a)=∑kDkf(b)∇gk(a). In matrix form ∇h(a)=Dg(a)T∇f(b).
In one lineIf f is a scalar field and g=(g1,…,gn) a vector field, then ∇(f∘g)(a)=∑k=1nDkf(g(a))∇gk(a)=Dg(a)T∇f(g(a)).
Why it is trueIt says the gradient of the composite is a combination of the gradients of the pieces of g, weighted by the partials of f, and it is the vector-times-Jacobian-transpose form that reverse-mode differentiation computes.
ProofApostol 8.22 #12
The idea: Take the transpose of the matrix equation Dh = Df Dg.
∇h(a)T=∇f(b)TDg(a).
The chain rule with m=1: Dh(a) is the row ∇h(a)T and Df(b) is the row ∇f(b)T.
Reading the product column by column gives ∑kDkf(b)∇gk(a).
The j-th entry of DgT∇f is ∑kDjgkDkf; so the vector is ∑kDkf(b) times the k-th row of Dg, which is ∇gk(a). ■
Worked example
Differentiate f(x,y,z)=x2+y2+z2 along the helix r(t)=(cost,sint,t) by the chain rule for a path, and check by composing first.
Solution.
Identify the pieces.f(x,y,z)=x2+y2+z2, so ∇f=(2x,2y,2z). The path is r(t)=(cost,sint,t) with r′(t)=(−sint,cost,1). The inner field has one input and three outputs, so Dg is 3×1 and Df is 1×3.
Evaluate ∇f at r(t), not at t.∇f(r(t))=(2cost,2sint,2t). The outer derivative is evaluated at the image point.
Multiply.dtdf(r(t))=2cost(−sint)+2sintcost+2t⋅1=2t. A row times a column is a dot product.
Check by composing first.f(r(t))=cos2t+sin2t+t2=1+t2, with derivative 2t. Same answer.
Answer.2t. The first two terms cancel because the point moves around a circle, at constant distance from the z-axis; only the climb in z changes ∥r∥2.
Worked example Apostol 8.22 #14
Apostol 8.22 #14. Let f(x,y)=(ex+2y,sin(y+2x)) and g(u,v,w)=(u+2v2+3w3,2v−u2). Find Df, Dg, and Dh(1,−1,1) for h=f∘g.
Solution.
Jacobian of f (2×2). Df(x,y)=[ex+2y2cos(y+2x)2ex+2ycos(y+2x)]. Row 1 is the gradient of ex+2y, row 2 the gradient of sin(y+2x).
Jacobian of g (2×3). Dg(u,v,w)=[1−2u4v29w20]. Two outputs, three inputs.
Where does a=(1,−1,1) go?g(1,−1,1)=(1+2+3,−2−1)=(6,−3). This is the point b at which Df must be evaluated.
Evaluate both matrices. At b=(6,−3): x+2y=0 and y+2x=9, so Df(b)=[12cos92cos9]. At a: Dg(a)=[1−2−4290]. Every entry is now a number.
Multiply, outer first.Dh(a)=[12cos92cos9][1−2−4290]=[−300−6cos9918cos9]. (2×2)(2×3)=2×3. For example the (2,2) entry is 2cos9⋅(−4)+cos9⋅2=−6cos9.
Answer.Dh(1,−1,1)=[−300−6cos9918cos9]. (Computing h explicitly and differentiating gives the same matrix; the product is far shorter.)
Your answerIn the example above, what is the entry in row 2, column 3 of Dh(1,−1,1)? (Give a decimal.)
Row 2 of the left matrix times column 3 of the right matrix.
Row 2 of Df(b) is (2cos9,cos9) and column 3 of Dg(a) is (9,0). Their dot product is 18cos9≈−16.40.
Worked example Apostol 8.22 #15
Apostol 8.22 #15. Let f(x,y,z)=(x2+y+z,2x+y+z2) and g(u,v,w)=(uv2w2,w2sinv,u2ev). Find Dh(u,0,w) for h=f∘g.
Solution.
Jacobians.Df=[2x21112z] (2×3) and Dg=v2w202uev2uvw2w2cosvu2ev2uv2w2wsinv0 (3×3). f:R3→R2 and g:R3→R3.
Set v=0 in g first.g(u,0,w)=(0,0,u2). So Df is needed at (x,y,z)=(0,0,u2). Evaluate the outer matrix at the image point.
The two numerical matrices.Df(0,0,u2)=[021112u2] and Dg(u,0,w)=002u0w2u2000. cos0=1, sin0=0, e0=1.
Multiply.Dh(u,0,w)=[2u4u3u2+w22u4+w200]. For example the (2,2) entry is 2⋅0+1⋅w2+2u2⋅u2.
Answer.Dh(u,0,w)=[2u4u3u2+w22u4+w200]. The zero last column says h does not change in the w direction at v=0: in g the w derivative is a multiple of sinv and v2.
Changing variables
Worked example Lecture 23
Polar coordinates. Let h(r,θ)=f(rcosθ,rsinθ) for a differentiable scalar field f. Express hr and hθ by fx and fy, and then express fx and fy by hr and hθ.
Solution.
The inner map and its Jacobian.P(r,θ)=(rcosθ,rsinθ) has DP=[cosθsinθ−rsinθrcosθ] (computed in 5.3). xr=cosθ, xθ=−rsinθ, yr=sinθ, yθ=rcosθ.
Apply the chain rule.[hrhθ]=[fxfy][cosθsinθ−rsinθrcosθ], that is
hr=cosθfx+sinθfy,hθ=−rsinθfx+rcosθfy.
Row times matrix. The partials fx, fy are evaluated at (rcosθ,rsinθ).
3. Meaning.hr is the rate of change of f per unit of distance moving straight outward; hθ/r is the rate per unit of distance moving round the circle. A step of angle dθ moves a point at radius r a distance rdθ, which is the factor r in hθ.
4. Invert to get the other direction.[fxfy]=[hrhθ](DP)−1 and (DP)−1=r1[rcosθ−sinθrsinθcosθ], so
fx=cosθhr−rsinθhθ,fy=sinθhr+rcosθhθ.
Multiply the chain rule on the right by the inverse matrix (2.6); it exists when r=0, since detDP=r.
5. Check on f=x2y. Then h=r3cos2θsinθ. At r=2, θ=π/6: x=3, y=1, fx=2xy=23, fy=x2=3, so hθ=−2⋅21⋅23+2⋅23⋅3=3. Differentiating h directly: hθ=r3(cos3θ−2cosθsin2θ), which is 8⋅(833−43)=3. Two routes, one number.
Answer.hr=cosθfx+sinθfy and hθ=−rsinθfx+rcosθfy; the reverse formulas are in step 4.
Your answerFor f(x,y)=x2y and h(r,θ)=f(rcosθ,rsinθ), find hθ at r=2, θ=π/6. (Give a decimal.)
Find the point first: x=rcosθ, y=rsinθ.
hθ=−rsinθfx+rcosθfy with fx=2xy=23 and fy=x2=3 at the point (3,1): −2⋅21⋅23+2⋅23⋅3=−23+33=3≈1.732.
Worked example Practice Final 2013, problem 9
Practice Final 2013, problem 9. Let w=f(u,v) with u=xy and v=x/y. Using the chain rule, (a) find wx and wy; (b) find wxx.
Solution.
The inner Jacobian.(x,y)↦(u,v)=(xy,x/y) has ux=y, uy=x, vx=1/y, vy=−x/y2. Ordinary partial derivatives of the two formulas.
(a) First derivatives.wx=fuux+fvvx=yfu+y1fv and wy=fuuy+fvvy=xfu−y2xfv. Row (fu,fv) times the matrix.
(b) Differentiate wx in x, by the product rule. In wx=yfu+y−1fv the factors y and y−1 do not depend on x, but fu and fv do, through u and v. This is the step students forget: fu(xy,x/y) is a composite field, so it needs its own chain rule.
Chain rule on fu and fv.∂x(fu)=fuuux+fuvvx=yfuu+y1fuv and ∂x(fv)=yfuv+y1fvv (using fuv=fvu). Same rule as step 2, with fu and fv in place of f.
Assemble.wxx=y(yfuu+y1fuv)+y1(yfuv+y1fvv)=y2fuu+2fuv+y21fvv. The two fuv terms add.
Answer.wx=yfu+y−1fv, wy=xfu−xy−2fv, wxx=y2fuu+2fuv+y−2fvv. Test with f=u2v: then w=x3y and wxx=6xy, while the formula gives y2⋅2v+2⋅2u+0=2y2⋅yx+4xy=6xy.
Your answerWith w=f(u,v)=u2v, u=xy, v=x/y, compute wx at (x,y)=(2,1) by the chain rule formula wx=yfu+fv/y.
At (2,1): u=2, v=2, fu=2uv=8, fv=u2=4, so wx=1⋅8+4/1=12. Directly, w=x3y and wx=3x2y=12.
Worked example MATH 375 Final Review, 8.21
Let h(u,v)=f(x(u,v),y(u,v)). Find the mixed second derivative huv=∂v(hu): differentiate in u first, then in v.
Solution.
First derivative in u.hu=fxxu+fyyu. Chain rule; fx and fy are evaluated at (x(u,v),y(u,v)).
Differentiate in v, product rule on each term.∂v(hu)=(∂vfx)xu+fxxuv+(∂vfy)yu+fyyuv. xu is a function of (u,v) too, so it is differentiated with the product rule.
Chain rule on the two partials.∂vfx=fxxxv+fxyyv and ∂vfy=fyxxv+fyyyv. fx and fy are themselves composite fields, and each gets its own chain rule.
Answer. The formula in step 4, which is the one on the Final Review. With fxy=fyx it collects as fxxxuxv+fxy(xuyv+xvyu)+fyyyuyv+fxxuv+fyyuv.
The inverse of a field has the inverse matrix as its derivative
Definition T
Jacobian determinant
When m=n, the Jacobian matrix JF(a) is square and its determinant (2.7) is the Jacobian determinantdetJF(a)=∂(x1,…,xn)∂(F1,…,Fn). A tiny cube of side ϵ at a goes to a tiny parallelepiped of volume about ∣detJF(a)∣ϵn. For polar coordinates it is r (5.3).
In one lineFor a field F:Rn→Rn with the same number of inputs and outputs, detJF(a): the factor by which F scales small volumes near a.
Why it existsIt is the one number that records whether F locally squashes space, flips it, or stretches it, and it is the correction factor in the change of variables formula for integrals.
Corollary Tchain rule and the product rule for determinants, 2.7
Jacobian determinants multiply
For h=f∘g with f,g:Rn→Rn, detDh(a)=detDf(g(a))⋅detDg(a).
In one lineIf f and g both map Rn to Rn, then detD(f∘g)(a)=detDf(g(a))⋅detDg(a).
Why it is trueIt says volume scalings multiply along a composition, which is the geometric meaning of the chain rule for square Jacobians.
Proof2.7
The idea: Take the determinant of the matrix identity Dh = Df Dg and use that the determinant of a product is the product of the determinants.
A diffeomorphism is a bijection F:U→V of open sets U,V⊆Rn such that F and F−1 are both differentiable. (Authors who want second derivatives require continuously differentiable, and the name is usually reserved for that stronger case. The proofs below use only differentiability.)
In one lineA differentiable field F:U→V between open sets of Rn that has a differentiable inverse F−1:V→U.
Why it existsIt is a change of coordinates that can be undone without losing differentiability, which is the kind of map along which one may substitute variables freely.
Theorem TMATH 375 Practice Final 2013, problem 10; Apostol 8.22
The derivative of an inverse field
Let F:U→V be a bijection of open sets in Rn with F differentiable at x and G=F−1 differentiable at F(x). Then DF(x) is invertible and DG(F(x))=(DF(x))−1.
In one lineIf F:U→V is a diffeomorphism, then DF(x) is an invertible matrix for every x, and D(F−1)(F(x))=(DF(x))−1.
Why it is trueIt tells you the derivative of an inverse without finding the inverse: invert a matrix instead. It also shows that a differentiable inverse forces detDF=0.
ProofPractice Final 2013, problem 10 (hint: apply the chain rule)
The idea: Apply the chain rule to the two identities G∘F = identity and F∘G = identity. The derivative of the identity is the identity matrix, so the two Jacobians multiply to I in both orders.
The composite G∘F is the identity field on U, whose Jacobian is the identity matrix I (5.3: the derivative of x↦x).
G(F(x))=x for x∈U.
So DG(F(x))DF(x)=I.
The chain rule, with the outer field G evaluated at the image point F(x).
Likewise DF(x)DG(F(x))=I.
F(G(y))=y for y∈V; the same two steps with the roles swapped, at y=F(x) where G(y)=x.
So DF(x) is invertible and DG(F(x))=DF(x)−1. ■
A matrix with a two-sided inverse is invertible and the inverse is unique (2.4). Only one identity is needed for square matrices, since a left inverse of a square matrix is two-sided.
Quick checkF(x)=x3 is a differentiable bijection of R onto R. What does the theorem say about its inverse G(y)=y1/3 at y=0?
If G were differentiable at 0, the chain rule applied to G(F(x))=x at x=0 would give G′(0)⋅F′(0)=1, impossible since F′(0)=0. Indeed y1/3 has a vertical tangent at 0. A bijection that is differentiable need not have a differentiable inverse; the theorem assumes it does.
Worked example Practice Final 2013, problem 10; Apostol 8.17 #5
Practice Final 2013, problem 10, in numbers. The field F(x,y)=(excosy,exsiny) is a diffeomorphism from the strip 0<y<π onto the upper half plane, with inverse G(X,Y)=(21ln(X2+Y2),arg(X+iY)). Find DG at F(ln2,π/6) without differentiating G.
Solution.
The image point.F(ln2,π/6)=(2cos6π,2sin6π)=(3,1). eln2=2.
DF at (ln2,π/6).DF=[excosyexsiny−exsinyexcosy]=[31−13]. 2⋅23 and 2⋅21.
Invert it. The determinant is 3+1=4, so (DF)−1=41[3−113]. The 2×2 inverse swaps the diagonal, negates the off-diagonal, and divides by the determinant.
Check with the real inverse.DG=[X2+Y2XX2+Y2−YX2+Y2YX2+Y2X], which at (3,1) (where X2+Y2=4) is 41[3−113]. Differentiate 21ln(X2+Y2) and arctan(Y/X).
Answer.DG(3,1)=41[3−113]. Because the rows of DG are ∇u and ∇v for u=21ln(X2+Y2) and v=arg, and they are perpendicular, this is also Apostol 8.17 #5: the gradients of u and v are perpendicular at each point.
Your answerIn the example above, what is the entry in row 1, column 1 of DG(3,1)? (Give a decimal.)
Invert [31−13].
DG=(DF)−1=41[3−113], so the entry is 3/4≈0.433.
Worked example Lecture 23, with the inverse theorem
Find D(P−1) for polar coordinates at the point (x,y)=(1,1) by inverting DP, and compare with differentiating r=x2+y2, θ=arctan(y/x).
Solution.
The point in polar coordinates.(1,1) is r=2, θ=π/4. Distance from the origin and angle.
Invert.DP(2,4π)=[2222−11] has determinant 2=r, so its inverse is 21[1−22122]=[22−212221]. Same 2×2 inverse recipe.
Differentiate the inverse map.rx=x/r=22, ry=22, θx=−y/r2=−21, θy=x/r2=21. θ=arctan(y/x) has θx=1+y2/x2−y/x2=x2+y2−y.
Answer.[22−212221] both ways. The first row says ∇r is the unit vector (1,1)/2 pointing away from the origin, as in 5.2.
Beyond the course: for understanding· A preview: a nonzero Jacobian determinant is also enough, locally
The theorem above assumes an inverse and concludes detDF=0. The inverse function theorem goes the other way: if F is continuously differentiable near a and detDF(a)=0, then F has a differentiable inverse on some small ball around a. It is proved in 5.7 by a contraction argument (4.2). The example F(x,y)=(excosy,exsiny) shows why “locally” is the right word: detDF=e2x=0 everywhere, but F is not one-to-one on the whole plane, since y and y+2π give the same point.
Second derivatives of a composite
The chain rule applied once gives first derivatives. The first partials of f are again functions of position, so inside a composite they are composites, and the rule applies to them. The whole difficulty is bookkeeping: a product rule at every stage. Two sentences carry it: differentiate; then differentiate each partial of f that appears, by the chain rule again.
Theorem TApostol 8.17 #1; Spagnolie Lecture 23; Fall 2025 final problem 5
Second derivative along a path
Let r:(α,β)→Rn be twice differentiable, f a scalar field whose first partials are differentiable (continuous second partials suffice), and g(t)=f(r(t)). Then
With the matrix H=[DjDif] of second partials, this reads g′′=r′THr′+∇f⋅r′′.
In one lineIf r is twice differentiable and f has continuous second partials, then dt2d2f(r(t))=∑i,jDjDif(r(t))ri′(t)rj′(t)+∇f(r(t))⋅r′′(t).
Why it is trueIt splits the acceleration of the value of f into the part due to the curvature of f (the quadratic form of the matrix of second partials, which 5.6 calls the Hessian) and the part due to the acceleration of the path.
ProofApostol 8.17 #1(b)
The idea: The first derivative is a sum of products of two functions of t. Differentiate with the product rule. One factor is r_i′, giving r_i″. The other factor is D_i f evaluated along the path, which is a composite field, so apply the first chain rule to it.
Dif is a differentiable scalar field, so the chain rule for a path applies to it: dtdDif(r(t))=∑jDjDif(r(t))rj′(t). This is the step the homework warned about.Skipping it is the standard error: f_x(X(t), Y(t)) depends on t, even though f_x is a partial derivative.
g′′=∑i,jDjDifri′rj′+∑iDifri′′.
The result is the formula claimed; the quadratic form of H is the same whether H or its transpose is used, so the order of the indices does not matter in the double sum. ■
Worked example MATH 375 Fall 2025 final, problem 5
Fall 2025 final, problem 5. A buoy at (X(t),Y(t)) measures a temperature f(x,y,t) that also changes in time. Let g(t)=f(X(t),Y(t),t). Find g′ and g′′.
Solution.
The path in space-time.r(t)=(X(t),Y(t),t), so r′=(X′,Y′,1) and r′′=(X′′,Y′′,0). Time is the third coordinate; its velocity is 1 and its acceleration 0.
First derivative.g′=fxX′+fyY′+ft, with the partials evaluated at (X(t),Y(t),t). Already in 5.3.
Differentiate each term, product rule.g′′=(dtdfx)X′+fxX′′+(dtdfy)Y′+fyY′′+dtdft. The factor 1 in front of ft is constant.
Chain rule on each partial.dtdfx=fxxX′+fxyY′+fxt, dtdfy=fyxX′+fyyY′+fyt, dtdft=ftxX′+ftyY′+ftt. The velocity of the path has three entries, so each partial has three terms. The last entry 1 is why the lone fxt, fyt, ftt appear.
Answer. The formula in step 5. For the final’s example f=xt, X=t, Y=0: fxt=1 and all other second partials vanish, g=t2, so g′′=2fxtX′=2, which is dt2d2t2.
Worked example Lecture 23 (left unfinished on the page); Apostol 8.22 #5
Lecture 23, finished. For h(r,θ)=f(rcosθ,rsinθ) find hθθ, hrr and hrθ, and deduce the Laplacian fxx+fyy in polar coordinates.
Solution.
Start from hθ.hθ=−rsinθfx+rcosθfy (previous example). Differentiate this in θ, with r held fixed.
Product rule on each term.hθθ=−rcosθfx−rsinθ∂θ(fx)−rsinθfy+rcosθ∂θ(fy). The coefficients depend on θ and so do fx, fy. The two terms −rcosθfx and −rsinθfy carry minus signs; the unfinished page of Lecture 23 had the opposite overall sign on this line.
Chain rule on fx and fy, with ∂θ(x)=−rsinθ and ∂θ(y)=rcosθ.∂θ(fx)=−rsinθfxx+rcosθfxy and ∂θ(fy)=−rsinθfxy+rcosθfyy. Same rule as for hθ with fx in place of f.
Collect.hθθ=−rcosθfx−rsinθfy+r2sin2θfxx−2r2sinθcosθfxy+r2cos2θfyy. The two cross terms r2sinθcosθfxy each come with a minus sign and add.
The other two. Differentiating hr=cosθfx+sinθfy in r (the coefficients do not depend on r): hrr=cos2θfxx+2sinθcosθfxy+sin2θfyy. Differentiating it in θ: hrθ=−sinθfx+cosθfy+r(−sinθcosθfxx+(cos2θ−sin2θ)fxy+sinθcosθfyy). Same two sentences, applied to hr.
Add hrr, r1hr and r21hθθ. The fxy terms cancel, the fxx terms give cos2θ+sin2θ=1, likewise for fyy, and the first-order terms give r1(cosθfx+sinθfy)−r1(cosθfx+sinθfy)=0. Check the fx terms: from r1hr we get rcosθfx, from r21hθθ we get −rcosθfx.
Answer.hθθ as in step 4, and
fxx+fyy=hrr+r1hr+r21hθθ.
Check with f=x2−y2, so h=r2cos2θ: 2cos2θ+2cos2θ−4cos2θ=0, and fxx+fyy=2−2=0.
Theorem Bthe compact form of Apostol 8.22 #3 and 8.24 #7
Second derivatives of a composite field
Let g:Rp→Rn and f:Rn→R have continuous second partials and h=f∘g, b=g(a). Write Hf(b)=[DlDkf(b)]k,l, an n×n matrix, and Hgk(a)=[DjDigk(a)]i,j, a p×p matrix. Then the p×p matrix of second partials of h at a is
Hh(a)=Dg(a)THf(b)Dg(a)+k=1∑nDkf(b)Hgk(a).
In one lineIf h=f∘g with f a scalar field and g:Rp→Rn, all C2, then the matrix of second partials of h is Dg(a)T[DlDkf(b)]Dg(a)+∑k=1nDkf(b)[DjDigk(a)].
Why it is trueIt packages every polar, cylindrical and homework computation into one matrix identity, and it shows what happens at a critical point of f (the second sum vanishes), which is the reason the type of a critical point does not depend on the coordinates (5.6).
Proofthe proof of the previous theorem, entrywise
The idea: Differentiate the entrywise first-derivative formula once more: the product rule splits each term into a part where the partial of f is differentiated and a part where the partial of g is.
Dkf is a differentiable scalar field; chain rule: Dj(Dkf∘g)=∑lDlDkf(g)Djgl.
Written as matrices this is the claimed identity.
The first double sum is entry (i,j) of DgTHfDg, since Digk is entry (k,i) of Dg and Djgl is entry (l,j). ■
Worked example Apostol 8.24 #6
Apostol 8.24 #6. The change of variables x=u+v, y=uv2 transforms f(x,y) into g(u,v). Find ∂v∂u∂2g at u=v=1, given that at the corresponding point fy=fxx=fyy=fxy=fyx=1.
Solution.
The point and the partials of the change.u=v=1 gives (x,y)=(2,1). xu=1, xv=1, yu=v2, yv=2uv. Differentiate x=u+v and y=uv2.
First derivative in u.gu=fx⋅1+fyv2. Chain rule.
Differentiate in v, product rule on the second term.∂v(gu)=∂v(fx)+2vfy+v2∂v(fy). v2 is a function of v as well.
Chain rule on fx and fy (the v-derivatives).∂vfx=fxxxv+fxyyv=fxx+2uvfxy and ∂vfy=fyx+2uvfyy. xv=1 and yv=2uv.
Substitute the numbers at u=v=1.∂v(gu)=(1+2⋅1)+2⋅1+1⋅(1+2⋅1)=3+2+3=8.
Answer.8.
Your answerIn the example above, what is ∂2g/∂v∂u at u=v=1?
guv=(fxx+2uvfxy)+2vfy+v2(fyx+2uvfyy), and each partial equals 1 at the point: 3+2+3=8.
Worked example Apostol 8.22 #3 and #4(a) (MATH 375 HW 13)
Homework 13, Apostol 8.22 #3 and #4(a). The equations x=X(s,t), y=Y(s,t) turn f(x,y) into F(s,t). Find Fs, Fss, Fst, Ftt in general, then for X=s+t, Y=st.
Solution.
First derivatives.Fs=fxXs+fyYs and Ft=fxXt+fyYt. The chain rule with the row (fx,fy) times the matrix with columns (Xs,Ys) and (Xt,Yt).
Differentiate Fs in s, product rule on each term.Fss=(∂sfx)Xs+fxXss+(∂sfy)Ys+fyYss. Xs and Ys are functions of (s,t) too.
Chain rule on fx and fy.∂sfx=fxxXs+fxyYs and ∂sfy=fyxXs+fyyYs. Each partial of f is a composite field, as in the previous examples.
Collect, with fxy=fyx.Fss=fxxXs2+2fxyXsYs+fyyYs2+fxXss+fyYss. The same steps, differentiating Fs in t and Ft in t, give Fst=fxxXsXt+fxy(XsYt+XtYs)+fyyYsYt+fxXst+fyYst and Ftt=fxxXt2+2fxyXtYt+fyyYt2+fxXtt+fyYtt. Compare with the matrix identity of the theorem above: the quadratic parts are DgTHfDg, the rest is the sum with the second derivatives of X and Y.
Insert X=s+t, Y=st. Then Xs=Xt=1, Ys=t, Yt=s, all second derivatives of X vanish, and Yss=Ytt=0, Yst=1. Differentiate the two formulas.
Read off.Fs=fx+tfy, Ft=fx+sfy, Fss=fxx+2tfxy+t2fyy, Ftt=fxx+2sfxy+s2fyy, Fst=fxx+(s+t)fxy+stfyy+fy. The only first-order term that survives is fyYst. Test with f=xy: F=(s+t)st, Fst=2s+2t, and the formula gives 0+(s+t)⋅1+0+fy=(s+t)+(s+t), since fy=x=s+t.
Answer. The general formulas of step 4, and the special case of step 6.
Worked example Apostol 8.9 #3 (MATH 375 HW 11 style)
Apostol 8.9 #3. For a linear map T:Rn→Rn and the scalar field f(x)=x⋅T(x), compute f′(x;y) and ∇f.
Solution.
Write f as a composite.f=m∘G where G(x)=(x,T(x)) goes from Rn to Rn×Rn and m(u,w)=u⋅w is the dot product. The pieces are simple: G is linear and m is bilinear.
Derivative of the dot product.m(u+p,w+q)=u⋅w+(p⋅w+u⋅q)+p⋅q, so Dm(u,w)(p,q)=p⋅w+u⋅q. As for xy in 5.3: the cross term p⋅q is second order.
Chain rule.f′(x;y)=Dm(G(x))(DG(x)y)=Dm(x,Tx)(y,Ty)=y⋅T(x)+x⋅T(y). DG(x)y=(y,T(y)) because G is linear.
The gradient. If T has the matrix A, then f(x)=xTAx and f′(x;y)=yTAx+xTAy=y⋅(A+AT)x, so ∇f=(A+AT)x. Compare 3.8: the rule for ∇(xTAx), now proved from the chain rule instead of by expanding sums.
Answer.f′(x;y)=x⋅T(y)+y⋅T(x), and ∇f=(A+AT)x, which is 2Ax when T is symmetric.
Quick checkFor g(t)=f(X(t),Y(t)), what is dtd[fx(X(t),Y(t))]?
fx(X(t),Y(t)) is a composite field: it depends on t through the point. Its derivative is its gradient (fxx,fxy) dotted with the velocity (X′,Y′). Forgetting this is the most common error in second-derivative chain rule problems.
Quick checkIn the polar formula for hθθ there are terms −rcosθfx−rsinθfy with no second derivative. Where do they come from?
hθ=−rsinθfx+rcosθfy is a sum of products. The product rule differentiates each factor: the coefficients give the first-order terms, the partials fx, fy give the second-order ones.
Proof workshopGive the reason for each line of the second derivative along a pathApostol 8.17 #1
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
Used inside maths· Inside maths: changing variables to solve a PDE, and the Laplacian in polar coordinates
The wave equation utt=c2uxx describes a vibrating string. Put ξ=x−ct, η=x+ct and write u(x,t)=U(ξ,η). By the second-derivative chain rule (the example with ξx=ηx=1, ξt=−c, ηt=c): uxx=Uξξ+2Uξη+Uηη and utt=c2(Uξξ−2Uξη+Uηη), so
utt−c2uxx=−4c2Uξη.
The equation becomes Uξη=0, whose solutions are U=F(ξ)+G(η) (integrate in η, then in ξ; 5.5 says when this is legitimate). That is d’Alembert’s solution u=F(x−ct)+G(x+ct): a wave of any shape moving right plus a wave moving left. The polar Laplacian of the example above does the same job for Laplace’s equation on a disc: fxx+fyy=0 becomes r2hrr+rhr+hθθ=0, which separates into one-variable equations and has solutions rncosnθ and rnsinnθ, the real parts and imaginary parts of zn from 0.6. The chain rule turns a problem about a disc into a problem about a rectangle.
Used in the real world· AI: backpropagation is this chapter's product, multiplied from the left
Take the small network of 3.8 with a vector input: x=(1,2), a weight matrix W=[12−11], z=Wx=(−1,4), a ReLU h=max(0,z)=(0,4), an output y=v⋅h with v=(1,−1), so y=−4, and a loss ℓ=21(y−1)2=12.5. The loss is a composite of four fields, so its derivative with respect to the input is a product of four Jacobians:
Multiplying from the left, every intermediate result is a row of two numbers (the work of backpropagation); a finite-difference check of the loss agrees with (10,5) to nine digits. This product is a gradient of the input, and the transpose form ∇h=DgT∇f of the corollary is what the library computes: a row (or column) times each Jacobian, never a Jacobian times a Jacobian.
The size of that product is also why deep networks are hard to train. With L layers, the gradient is a product of L Jacobians. If each shrinks lengths by a factor 0.9, after L=50 layers the signal is 0.950≈0.005 of its size (vanishing gradients); if each stretches by 1.1, it is 1.150≈117 times larger (exploding gradients). The conditioning of 3.5 controls which happens. Libraries compute either Df(x)v (forward mode, one input direction at a time, for example JAX’s jvp) or uTDf(x) (reverse mode, one output at a time, vjp). For a loss, with a million inputs and one output, reverse mode gets the whole gradient in one sweep.
Python labCheck the chain rule numerically, then count the cost of the product
import numpy as npdef jac(F, x, h=1e-6): x = np.asarray(x, float); cols = [] for j in range(len(x)): e = np.zeros_like(x); e[j] = h cols.append((F(x + e) - F(x - e)) / (2 * h)) return np.array(cols).Tg = lambda p: np.array([p[0] + 2 * p[1]**2 + 3 * p[2]**3, 2 * p[1] - p[0]**2])f = lambda q: np.array([np.exp(q[0] + 2 * q[1]), np.sin(q[1] + 2 * q[0])])a = np.array([1.0, -1.0, 1.0])Dh = jac(lambda p: f(g(p)), a) # Jacobian of the composite, numericallyprod = jac(f, g(a)) @ jac(g, a) # Df at g(a), times Dg at aprint(np.round(Dh, 6)); print(np.round(prod, 6))print("largest difference:", abs(Dh - prod).max(), " exact (2,3) entry:", 18 * np.cos(9))# a chain of L square Jacobians, multiplied in two ordersrng = np.random.default_rng(0)n, L = 300, 10Js = [rng.normal(size=(n, n)) / np.sqrt(n) for _ in range(L)]row = rng.normal(size=(1, n))left = rowfor J in Js: left = left @ J # row times matrix, L timesright = Js[-1]for J in reversed(Js[:-1]): right = J @ right # matrix times matrix, L - 1 timesprint("same answer:", np.allclose(left, row @ right))mults_left, mults_right = L * n * n, (L - 1) * n**3 + n * nprint("multiplications:", mults_left, "versus", mults_right, " ratio", round(mults_right / mults_left))
Try this.Run it. The finite-difference Jacobian of the composite and the product of the two Jacobians agree to about nine digits, and the entry in row 2, column 3 matches the exact value 18 cos 9 = -16.40 of the worked example. Change the evaluation point a and the difference stays tiny. Change the step h=1e-6 to 1e-2: the largest difference jumps to about 0.07 (a large step measures the curve, not the tangent). In the second half, the left-to-right and right-to-left products agree, but the count of multiplications differs by a factor of about 270: this is the reason backpropagation multiplies from the output end, when the output is a single number.
Traps
Watch out· Evaluate the outer derivative at g(a), not at a
For h(x)=f(g(x)) the matrix Df is taken at the point g(a). In Apostol 8.22 #14 the point a=(1,−1,1) goes to b=(6,−3), and the cosines in Df are cos(y+2x)=cos9, not cos(−1+2). Compute g(a) first, always.
Watch out· The order of the matrices is not up to you
Dh=DfDg and not DgDf. The shapes tell you: (m×n)(n×p) works, and the other order usually does not even have matching sizes. When it does (both square), the answer is still different, because matrix multiplication does not commute (2.5).
Watch out· The partial of f inside a composite is itself a composite
When differentiating fx(X(t),Y(t)) or fu(xy,x/y) again, apply the chain rule to it. Leaving it as "fxx" loses the term fxyY′. This was the content of 8.17 #1(b), of the unfinished page of Lecture 23, and of the second half of the Fall 2025 final’s problem 5.
Watch out· Total and partial derivatives: say which variables move
If f(x,y) is composed with y=Y(x), the derivative of F(x)=f(x,Y(x)) is F′=fx+fyY′. The symbol ∂x∂f means “hold y fixed”, and dxdF means “let y move with x”. They are different numbers, and cancelling ”∂x with ∂x” in the fraction picture would give F′=fyY′ or fx alone. In the buoy problem the forgotten term was ft, the change of the temperature at a place that the buoy does not even leave.
Watch out· A differentiable bijection need not have a differentiable inverse
x↦x3 is differentiable and one-to-one onto R, and its inverse y1/3 is not differentiable at 0. The derivative-of-an-inverse theorem assumes a differentiable inverse, and the example shows the assumption is doing work. The test that detDF=0 is necessary for a differentiable inverse; sufficient only locally, with continuous partials (the inverse function theorem, previewed above).
Watch out· Mixed partials: equal only under a continuity hypothesis
Every second-derivative formula above collected fxy and fyx into 2fxy. That is legitimate when the second partials are continuous. 5.5 proves it and gives the function where it fails.
Problems
checkApostol 8.22 #1
Let F(t)=esint, g(x,y)=cos(x2+y2) and f(x,y)=F(g(x,y)). Find fx and fy by the chain rule.
Solution
The outer function is of one variable, so by the corollary ∇f=F′(g)∇g. F′(t)=esintcost, and ∇g=−sin(x2+y2)(2x,2y). Hence fx=−2xsin(x2+y2)esingcosg and fy=−2ysin(x2+y2)esingcosg, where g=cos(x2+y2). Check: along x at y=0, f=esincos(x2) and the one-variable chain rule gives the same.
check
g:R3→R2 and f:R2→R4 are differentiable. What shape is D(f∘g)? Is g∘f defined?
Solution
D(f∘g)=DfDg is (4×2)(2×3)=4×3. The composite g∘f would feed the four outputs of f into g, which takes three inputs, so it is not defined.
checkApostol 8.22 #2
The substitution u=(x−y)/2, v=(x+y)/2 changes f(u,v) into F(x,y). Express Fx and Fy by fu and fv.
Solution
ux=21, uy=−21, vx=21, vy=21. So Fx=21(fu+fv) and Fy=21(−fu+fv). (Then Fx2−Fy2=fufv.)
checkApostol 8.17 #3(c)
Evaluate the directional derivative of f(x,y,z)=x2+y2−z2 at (3,4,5) along the curve of intersection of the surfaces 2x2+2y2−z2=25 and x2+y2=z2.
Solution
The point lies on both surfaces (18+32−25=25 and 9+16=25). The tangent direction is the cross product of the two normals, (12,16,−10)×(6,8,−10)=(−80,60,0), which is parallel to (−4,3,0). And ∇f(3,4,5)=(6,8,−10), so ∇f⋅(−4,3,0)/5=(−24+24)/5=0. In fact f=x2+y2−z2=0 on the second surface, hence on the whole curve (a horizontal circle of radius 5 at height 5), so its derivative along the curve is 0.
useApostol 8.22 #4(b) and (c)
The equations x=st, y=s/t turn f(x,y) into F(s,t). Find Fs, Ft and Fss. Repeat for x=(s−t)/2, y=(s+t)/2, and find Fss+Ftt and Fst. Assume equal mixed partials.
Solution
First substitution: xs=t, ys=1/t, xt=s, yt=−s/t2. Fs=tfx+t1fy, Ft=sfx−t2sfy. For Fss, the coefficients t and 1/t do not depend on s, so Fss=t(tfxx+t1fxy)+t1(tfxy+t1fyy)=t2fxx+2fxy+t21fyy. Second substitution: Fs=21(fx+fy), Ft=21(−fx+fy), Fss=41(fxx+2fxy+fyy), Ftt=41(fxx−2fxy+fyy), Fst=41(−fxx+fyy). So Fss+Ftt=21(fxx+fyy), a rotation of the axes by 45∘ and a scaling by 21 in each, which multiplies the Laplacian by 21.
useApostol 8.9 #19
Let z=u(x,y)eax+by where uxy=0. Find constants a,b such that zxy−zx−zy+z=0.
Solution
Product rule with the chain rule on the exponential: zx=eax+by(ux+au), zy=eax+by(uy+bu), and zxy=eax+by(uxy+bux+auy+abu)=eax+by(bux+auy+abu). So
Taking a=b=1 makes every coefficient zero, whatever u is. (For u with ux, uy, u independent, such as u=x+y and u=1, the choice a=b=1 is also forced.)
useApostol 8.22 #5
For h(r,θ)=f(rcosθ,rsinθ) find hrθ in terms of the partials of f. Check it on f=x2y at r=1, θ=π/2.
Solution
Differentiate hr=cosθfx+sinθfy in θ: hrθ=−sinθfx+cosθfy+cosθ(−rsinθfxx+rcosθfxy)+sinθ(−rsinθfxy+rcosθfyy), which collects to −sinθfx+cosθfy+r(−sinθcosθfxx+(cos2θ−sin2θ)fxy+sinθcosθfyy). For f=x2y: h=r3cos2θsinθ, hr=3r2cos2θsinθ, hrθ=3r2(cos3θ−2cosθsin2θ), which is 0 at θ=π/2. By the formula at (x,y)=(0,1): fx=0, fy=0, fxx=2y=2, fxy=2x=0, fyy=0, and the cross coefficient sinθcosθ=0: all terms vanish, giving 0.
useApostol 8.17 #5
The equations eucosv=x and eusinv=y define u and v as functions of (x,y). Find explicit formulas, valid for x>0, and show that ∇u and ∇v are perpendicular at each point.
Solution
Square and add: e2u=x2+y2, so u=21ln(x2+y2). Divide: tanv=y/x, so v=arctan(y/x) for x>0. Then ∇u=x2+y2(x,y) and ∇v=x2+y2(−y,x), whose dot product is (x2+y2)2−xy+yx=0. Another route, by the theorem of this chapter: the rows of DG are ∇u and ∇v, and DG=(DF)−1 for F(u,v)=(eucosv,eusinv), where DF=eu[cosvsinv−sinvcosv] is a scaled rotation; the inverse of a scaled rotation is a scaled rotation, whose rows are perpendicular.
proveApostol 8.22 #12
Let h(x)=f(g(x)) with g=(g1,…,gn) differentiable at a and f a scalar field differentiable at g(a). Prove ∇h(a)=∑k=1nDkf(g(a))∇gk(a).
Solution
Plan. Apply the chain rule coordinate by coordinate. For each j the chain rule gives Djh(a)=∑kDkf(b)Djgk(a), where b=g(a). The vector whose j-th entry is this sum is ∑kDkf(b)(D1gk(a),…,Dngk(a))=∑kDkf(b)∇gk(a), since ∇gk(a) has Djgk(a) as its j-th entry. ■
prove
Use the chain rule to prove the product rule ∇(uv)=u∇v+v∇u for differentiable scalar fields u,v.
Solution
Plan. Write uv=m(u,v) with m(s,t)=st.
Let g(x)=(u(x),v(x)), so uv=m∘g. ∇m=(t,s), so Dm(g(x))=(v(x),u(x)) and Dg has rows ∇uT and ∇vT. By the chain rule D(uv)=(v,u)[∇uT∇vT]=v∇uT+u∇vT. Transposing, ∇(uv)=v∇u+u∇v. ■
provenew (Euler's identity)
A scalar field f on Rn is homogeneous of degree k if f(tx)=tkf(x) for all t>0. If f is differentiable, prove x⋅∇f(x)=kf(x).
Solution
Plan. Differentiate t↦f(tx) at t=1 in two ways.
Fix x and let r(t)=tx, so r′(t)=x. By the chain rule for a path, dtdf(tx)=∇f(tx)⋅x, which at t=1 is ∇f(x)⋅x. On the other side, f(tx)=tkf(x) has derivative ktk−1f(x), which at t=1 is kf(x). Equating the two gives x⋅∇f(x)=kf(x). ■ (Example: f=x2y+y3 has degree 3 and xfx+yfy=2x2y+x2y+3y3=3f.)
prove
Prove that if F:U→V is a diffeomorphism, then detD(F−1)(F(x))=1/detDF(x), and detDF(x)=0 for every x.
Solution
Plan. Take determinants in the identity D(F−1)(F(x))DF(x)=I.
By the theorem of this chapter, DG(F(x))DF(x)=I with G=F−1. Both matrices are n×n, so the product rule for determinants gives detDG(F(x))⋅detDF(x)=detI=1. A product of two numbers equals 1, so neither is 0, and detDG(F(x))=1/detDF(x). ■ For polar coordinates: detDP=r, so the inverse map (x,y)↦(r,θ) has Jacobian determinant 1/r=1/x2+y2, which at (1,1) is 1/2; the matrix [22−212221] has determinant 42+42=22=1/2. ✓
provenew (uses 5.2)
If f is differentiable on a ball and f(x) depends only on ∥x∥, say f(x)=ϕ(∥x∥) for a differentiable function ϕ of one variable, show ∇f(x)=ϕ′(∥x∥)∥x∥x for x=O. What does this say about the level sets?
Solution
Plan. Compose ϕ with the field ∥x∥, whose gradient was found in 5.2.
By the fourth row of the table, ∇(ϕ∘∥⋅∥)=ϕ′(∥x∥)∇∥x∥, and ∇∥x∥=x/∥x∥ (5.2, the cone). So ∇f points along the radius, and the level sets of f are spheres, to which the gradient is perpendicular. ■ (For f=ln∥x∥, ϕ=ln, we get ∇f=x/∥x∥2, matching the u of 8.17 #5.)
stretch
Suppose F:U→V is a bijection from an open set of Rn to an open set of Rm which is differentiable with a differentiable inverse. Prove that n=m.
Solution
Plan. The chain rule gives two matrix identities whose sizes force n=m.
Write G=F−1. Then DGDF=In (G∘F is the identity on U) and DFDG=Im (F∘G is the identity on V), where DF is m×n and DG is n×m. The first identity says DF has rank n (it has a left inverse, so it is one-to-one), which needs n≤m. The second says DG has rank m, which needs m≤n. Therefore n=m. ■ This is a baby case of the theorem that open subsets of Rn and Rm are not diffeomorphic for n=m; the statement for homeomorphisms is much harder (invariance of domain, MATH 551).
stretchd'Alembert, via the second-derivative chain rule
Let u(x,t) have continuous second partials on R2 and satisfy utt=c2uxx. Prove u(x,t)=F(x−ct)+G(x+ct) for some twice differentiable F,G.
Solution
Plan. Change variables to ξ=x−ct, η=x+ct, where the equation becomes Uξη=0, then integrate twice.
Put U(ξ,η)=u(2ξ+η,2cη−ξ), so u(x,t)=U(x−ct,x+ct). By the second-derivative chain rule (Application above), utt−c2uxx=−4c2Uξη, so Uξη=0 on R2. Then Uη has ∂ξ(Uη)=0 on the whole plane, so for each fixed η, ξ↦Uη(ξ,η) has derivative 0 on all of R and is constant (1.4): Uη(ξ,η)=ψ(η) for a function ψ of η alone. Let G be an antiderivative of ψ. Then ∂η(U−G(η))=0, so for each ξ the function η↦U(ξ,η)−G(η) is constant: U(ξ,η)=F(ξ)+G(η) with F(ξ)=U(ξ,0)−G(0). ■
Summary
Chain rule. If g is differentiable at a and f at b=g(a), then f∘g is differentiable at a and D(f∘g)(a)=Df(g(a))Dg(a): the matrices multiply, the outer one evaluated at the image point and written on the left. The proof substitutes one first-order formula into the other; the leftovers are small because linear maps are continuous and ∥g(a+y)−g(a)∥≤M∥y∥.
Every formula in the lectures is a shape of this product: a path into a scalar field (∇f⋅r′), a change of variables (hs=fxxs+fyys), polar coordinates (hθ=−rsinθfx+rcosθfy), the gradient of a composite (∇h=DgT∇f).
Inverse. If F has a differentiable inverse G then DG(F(x))=DF(x)−1 and detDF=0 (Practice Final 10). A differentiable bijection like x3 need not have a differentiable inverse.
The Jacobian determinant is the local volume scaling; the chain rule makes it multiply along a composition, and invert along an inverse.
Second derivatives. Differentiate, then apply the chain rule again to each partial of f, with the product rule throughout. Along a path, g′′=r′THr′+∇f⋅r′′; for a change of variables, Hh=DgTHfDg+∑kfkHgk. Mixed partials were taken equal; 5.5 says when that is legal.
Applications: polar Laplacian fxx+fyy=hrr+hr/r+hθθ/r2, d’Alembert’s solution of the wave equation, and backpropagation as a product of Jacobians multiplied from the output end (0.950≈0.005, 1.150≈117).
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
MATH 375: Lectures 22 and 23 and Apostol 8.15 to 8.22. The chain rule for a path was derived in lecture; the proof for vector fields (8.20) was left with the words 'Read it!', and is given in full below. The second-derivative computation of Lecture 23, left unfinished on the page, is finished here for polar coordinates. Practice Final problems 9 and 10, Final Review problem 8.21, the buoy of Fall 2025 final problem 5, and homework 13 are all worked: 8.17 #1 and 8.22 #3, #4 here, and 8.17 #2, #4, #8, #10 and 8.22 #13 in 5.3.
MATH 521: The chain rule is the first theorem proved about the Fréchet derivative, and the inverse function theorem is proved by combining it with a fixed point argument (the contraction of 4.2). The statement 'the derivative of a composition is the composition of the derivatives' is the definition of a functor in 551 and later.
MATH 340 / CS 532: Backpropagation is this chapter's product of Jacobians, multiplied from the loss backwards. Automatic differentiation libraries compute either a Jacobian times a vector (forward mode) or a row vector times a Jacobian (reverse mode), and nothing else.
Physics: Changing variables in a partial differential equation (polar coordinates for Laplace's equation, x − ct and x + ct for the wave equation) is the second-derivative chain rule of this chapter.