Survey of Mathematics

5.4 The chain rule for fields

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)(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→R3g: \mathbb R^2 \to \mathbb R^3 and f:R3→R4f: \mathbb R^3 \to \mathbb R^4 are differentiable. What shape is the Jacobian of f∘gf \circ g?
Quick checkTwo linear maps have matrices AA (apply first) and BB (apply second). What is the matrix of 'first AA, then BB'?
Quick checkIn one variable, h(x)=sin⁡(x2)h(x) = \sin(x^2). At which point is the outer derivative cos⁡\cos evaluated?

The picture: circles into ellipses into ellipses

Drag the dot in the left plane and shrink the radius ρ\rho. A tiny circle of steps around aa is sent by gg to a curve that is almost an ellipse (the blue curve in the middle: this is the picture of 5.3, zoomed). Then ff sends that ellipse to another one. The right-hand picture compares the true image of the circle under the composite f∘gf \circ g (purple) with the unit circle sent by the product Df(g(a)) Dg(a)Df(g(a))\,Dg(a) (green dashed). The “largest gap” in the box under the picture falls towards 00 with ρ\rho. 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 aa, gg is a line; near g(a)g(a), ff is a line; so f∘gf \circ g is a line of slope f′(g(a)) g′(a)f'(g(a))\,g'(a), with an error that is still small. In many variables nothing changes except the meaning of “line”. Near aa the field gg is a constant plus a linear map plus a small error (the definition of differentiable, 5.3); near b=g(a)b = g(a) the field ff 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 yy at aa. The map gg turns it into the step Dg(a) yDg(a)\,y at the point b=g(a)b = g(a). That step now lives where ff is being looked at, so ff turns it into Df(b) (Dg(a) y)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 ff at the place where the step lands, which is bb.

Where this came from· The curly d

The symbol ∂\partial 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 ∂h∂s=∂f∂x∂x∂s+∂f∂y∂y∂s\frac{\partial h}{\partial s} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial s}, which looks like cancelling fractions as in Leibniz’s one-variable dzdx=dzdydydx\frac{dz}{dx} = \frac{dz}{dy}\frac{dy}{dx}. The cancelling picture is a good memory aid and a bad proof: the sum over the routes from ss to hh is the matrix product, and the proof below does not cancel anything. The trap section shows where the aid fails.

The chain rule

Theorem T Apostol Thm 8.11 (8.20); Spagnolie Lecture 23

The chain rule for fields

Let gg map a set in Rp\mathbb R^p into Rn\mathbb R^n and ff map a set in Rn\mathbb R^n into Rm\mathbb R^m, and suppose h=f∘gh = f \circ g is defined on a ball around aa. If gg is differentiable at aa with total derivative g′(a)g'(a), and ff is differentiable at b=g(a)b = g(a) with total derivative f′(b)f'(b), then hh is differentiable at aa and its total derivative is the composition of linear maps

h′(a)=f′(b)∘g′(a).h'(a) = f'(b) \circ g'(a).

In Jacobian matrices, Dh(a)=Df(b) Dg(a)Dh(a) = Df(b)\,Dg(a), an m×pm \times p matrix equal to an m×nm \times n matrix times an n×pn \times p matrix. Entry by entry,

Djhi(a)=∑k=1nDkfi(b) Djgk(a),i=1,…,m,j=1,…,p.D_jh_i(a) = \sum_{k=1}^n D_kf_i(b)\,D_jg_k(a), \qquad i = 1, \dots, m,\quad j = 1, \dots, p.

In one lineIf gg is differentiable at aa and ff is differentiable at b=g(a)b = g(a), then h=f∘gh = f \circ g is differentiable at aa and h′(a)=f′(b)∘g′(a)h'(a) = f'(b) \circ g'(a); in matrices, Dh(a)=Df(b) Dg(a)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.

ProofApostol 8.20; Spagnolie Lecture 23 ('Read it!')
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)v = g(a + y) - g(a). Then v=Dg(a) y+∥y∥ Eg(a,y)v = Dg(a)\,y + \lVert y \rVert\,E_g(a, y) with Eg(a,y)→0E_g(a, y) \to 0 as y→0y \to 0.
Name the small step yy at aa and the resulting step vv at bb; gg is differentiable at aa (definition in 5.3).
f(b+v)−f(b)=Df(b) v+∥v∥ Ef(b,v)f(b + v) - f(b) = Df(b)\,v + \lVert v \rVert\,E_f(b, v) with Ef(b,v)→0E_f(b, v) \to 0 as v→0v \to 0, and Ef(b,O)=OE_f(b, O) = O.
ff is differentiable at bb. Differentiable fields are continuous (5.3), so v→Ov \to O as y→0y \to 0 and b+vb + v stays inside the ball where the formula holds. We set Ef(b,O)=OE_f(b, O) = O because vv can be OO even when y≠Oy \ne O (if gg happens to take the same value twice), and then the term ∥v∥Ef\lVert v \rVert E_f is 00 whatever EfE_f 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)=Df(b) Dg(a) y+∥y∥ Df(b) Eg(a,y)+∥v∥ Ef(b,v)h(a + y) - h(a) = Df(b)\,Dg(a)\,y + \lVert y \rVert\,Df(b)\,E_g(a, y) + \lVert v \rVert\,E_f(b, v).
h(a+y)−h(a)=f(g(a+y))−f(g(a))=f(b+v)−f(b)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)Df(b).
So h(a+y)−h(a)=Df(b) Dg(a) y+∥y∥ E(a,y)h(a + y) - h(a) = Df(b)\,Dg(a)\,y + \lVert y \rVert\,E(a, y), where E(a,y)=Df(b) Eg(a,y)+∥v∥∥y∥ Ef(b,v)E(a, y) = Df(b)\,E_g(a, y) + \dfrac{\lVert v \rVert}{\lVert y \rVert}\,E_f(b, v) for y≠Oy \ne O, and E(a,O)=OE(a, O) = O.
Pull out ∥y∥\lVert y \rVert from the last two terms. This is the form of the definition in 5.3 with the linear map Df(b) Dg(a)Df(b)\,Dg(a), which is linear because a product of matrices is a matrix.
The first term of EE tends to OO as y→0y \to 0.
A linear map is continuous at OO: ∥Df(b) w∥≤K∥w∥\lVert Df(b)\,w \rVert \le K\lVert w \rVert for a constant KK (the bound used in the proof of 'Differentiable fields are continuous', 5.3), and Eg→OE_g \to O.
The quotient ∥v∥/∥y∥\lVert v \rVert / \lVert y \rVert is at most M+1M + 1, a constant.
From step 1 and the triangle inequality, ∥v∥≤∥Dg(a) y∥+∥y∥ ∥Eg∥≤(M+∥Eg∥)∥y∥\lVert v \rVert \le \lVert Dg(a)\,y \rVert + \lVert y \rVert\,\lVert E_g \rVert \le (M + \lVert E_g \rVert)\lVert y \rVert. Here MM is a constant with ∥Dg(a) w∥≤M∥w∥\lVert Dg(a)\,w \rVert \le M\lVert w \rVert for every ww (a linear map has one, as in step 5), and ∥Eg∥≤1\lVert E_g \rVert \le 1 for small yy because Eg→OE_g \to 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 EE tends to OO as well.
v→Ov \to O as y→0y \to 0 (step 2), so Ef(b,v)→OE_f(b, v) \to O; a bounded number times something tending to OO tends to OO.
Hence E(a,y)→OE(a, y) \to O, and Dh(a)=Df(b) Dg(a)Dh(a) = Df(b)\,Dg(a). ■\blacksquare
Both terms of E(a,y)E(a, y) tend to OO, so hh satisfies the definition of differentiable with total derivative Df(b) Dg(a)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.

    Quick checkIn h=f∘gh = f \circ g, at which point is the Jacobian DfDf evaluated in the chain rule?

    Special cases

    Every formula in the lectures is the matrix product for a particular choice of the shapes pp, nn, mm.

    Inner field ggOuter field ffShapesThe chain rule says
    a path r:R→Rnr: \mathbb R \to \mathbb R^nscalar field(1×n)(n×1)(1 \times n)(n \times 1)ddtf(r(t))=∇f(r(t))⋅r′(t)\dfrac{d}{dt}f(r(t)) = \nabla f(r(t))\cdot r'(t)
    (s,t)↦(x,y)(s, t) \mapsto (x, y), a change of coordinatesscalar field of x,yx, y(1×2)(2×2)(1 \times 2)(2 \times 2)hs=fx xs+fy ysh_s = f_x\,x_s + f_y\,y_s, ht=fx xt+fy yth_t = f_x\,x_t + f_y\,y_t
    a field g:Rp→Rng: \mathbb R^p \to \mathbb R^nscalar field(1×n)(n×p)(1 \times n)(n \times p)∇h(a)T=∇f(b)T Dg(a)\nabla h(a)^{\mathsf T} = \nabla f(b)^{\mathsf T}\,Dg(a)
    a scalar field gga function FF of one variable(1×1)(1×n)(1 \times 1)(1 \times n)∇(F∘g)=F′(g) ∇g\nabla(F \circ g) = F'(g)\,\nabla g
    g:Rp→Rng: \mathbb R^p \to \mathbb R^nf:Rn→Rmf: \mathbb R^n \to \mathbb R^m(m×n)(n×p)(m \times n)(n \times p)Dh=Df DgDh = Df\,Dg

    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 A Apostol 8.22 #12

    The gradient of a composite

    Under the hypotheses of the chain rule with m=1m = 1, ∇h(a)=∑kDkf(b) ∇gk(a)\nabla h(a) = \sum_{k} D_kf(b)\,\nabla g_k(a). In matrix form ∇h(a)=Dg(a)T ∇f(b)\nabla h(a) = Dg(a)^{\mathsf T}\,\nabla f(b).

    In one lineIf ff is a scalar field and g=(g1,…,gn)g = (g_1, \dots, g_n) a vector field, then ∇(f∘g)(a)=∑k=1nDkf(g(a)) ∇gk(a)=Dg(a)T ∇f(g(a))\nabla(f \circ g)(a) = \sum_{k=1}^n D_kf(g(a))\,\nabla g_k(a) = Dg(a)^{\mathsf T}\,\nabla f(g(a)).

    Why it is trueIt says the gradient of the composite is a combination of the gradients of the pieces of gg, weighted by the partials of ff, 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)T Dg(a)\nabla h(a)^{\mathsf T} = \nabla f(b)^{\mathsf T}\,Dg(a).
    The chain rule with m=1m = 1: Dh(a)Dh(a) is the row ∇h(a)T\nabla h(a)^{\mathsf T} and Df(b)Df(b) is the row ∇f(b)T\nabla f(b)^{\mathsf T}.
    ∇h(a)=Dg(a)T ∇f(b)\nabla h(a) = Dg(a)^{\mathsf T}\,\nabla f(b).
    Transpose of a product reverses the order (2.5).
    Reading the product column by column gives ∑kDkf(b) ∇gk(a)\sum_k D_kf(b)\,\nabla g_k(a).
    The jj-th entry of DgT∇fDg^{\mathsf T}\nabla f is ∑kDjgk Dkf\sum_k D_jg_k\,D_kf; so the vector is ∑kDkf(b)\sum_k D_kf(b) times the kk-th row of DgDg, which is ∇gk(a)\nabla g_k(a). ■\blacksquare
    Worked example
    Differentiate f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2 along the helix r(t)=(cos⁡t,sin⁡t,t)r(t) = (\cos t, \sin t, t) by the chain rule for a path, and check by composing first.

    Solution.

    1. Identify the pieces. f(x,y,z)=x2+y2+z2f(x, y, z) = x^2 + y^2 + z^2, so ∇f=(2x,2y,2z)\nabla f = (2x, 2y, 2z). The path is r(t)=(cos⁡t,sin⁡t,t)r(t) = (\cos t, \sin t, t) with r′(t)=(−sin⁡t,cos⁡t,1)r'(t) = (-\sin t, \cos t, 1). The inner field has one input and three outputs, so DgDg is 3×13 \times 1 and DfDf is 1×31 \times 3.
    2. Evaluate ∇f\nabla f at r(t)r(t), not at tt. ∇f(r(t))=(2cos⁡t,2sin⁡t,2t)\nabla f(r(t)) = (2\cos t, 2\sin t, 2t). The outer derivative is evaluated at the image point.
    3. Multiply. ddtf(r(t))=2cos⁡t(−sin⁡t)+2sin⁡tcos⁡t+2t⋅1=2t\dfrac{d}{dt}f(r(t)) = 2\cos t(-\sin t) + 2\sin t\cos t + 2t\cdot1 = 2t. A row times a column is a dot product.
    4. Check by composing first. f(r(t))=cos⁡2t+sin⁡2t+t2=1+t2f(r(t)) = \cos^2t + \sin^2t + t^2 = 1 + t^2, with derivative 2t2t. Same answer.

    Answer. 2t2t. The first two terms cancel because the point moves around a circle, at constant distance from the zz-axis; only the climb in zz changes ∥r∥2\lVert r \rVert^2.

    Worked example Apostol 8.22 #14
    Apostol 8.22 #14. Let f(x,y)=(ex+2y, sin⁡(y+2x))f(x, y) = (e^{x + 2y},\ \sin(y + 2x)) and g(u,v,w)=(u+2v2+3w3, 2v−u2)g(u, v, w) = (u + 2v^2 + 3w^3,\ 2v - u^2). Find DfDf, DgDg, and Dh(1,−1,1)Dh(1, -1, 1) for h=f∘gh = f \circ g.

    Solution.

    1. Jacobian of ff (2×22 \times 2). Df(x,y)=[ex+2y2ex+2y2cos⁡(y+2x)cos⁡(y+2x)]Df(x, y) = \begin{bmatrix} e^{x + 2y} & 2e^{x + 2y}\\ 2\cos(y + 2x) & \cos(y + 2x)\end{bmatrix}. Row 1 is the gradient of ex+2ye^{x + 2y}, row 2 the gradient of sin⁡(y+2x)\sin(y + 2x).
    2. Jacobian of gg (2×32 \times 3). Dg(u,v,w)=[14v9w2−2u20]Dg(u, v, w) = \begin{bmatrix} 1 & 4v & 9w^2\\ -2u & 2 & 0\end{bmatrix}. Two outputs, three inputs.
    3. Where does a=(1,−1,1)a = (1, -1, 1) go? g(1,−1,1)=(1+2+3, −2−1)=(6,−3)g(1, -1, 1) = (1 + 2 + 3,\ -2 - 1) = (6, -3). This is the point bb at which DfDf must be evaluated.
    4. Evaluate both matrices. At b=(6,−3)b = (6, -3): x+2y=0x + 2y = 0 and y+2x=9y + 2x = 9, so Df(b)=[122cos⁡9cos⁡9]Df(b) = \begin{bmatrix} 1 & 2\\ 2\cos9 & \cos9\end{bmatrix}. At aa: Dg(a)=[1−49−220]Dg(a) = \begin{bmatrix} 1 & -4 & 9\\ -2 & 2 & 0\end{bmatrix}. Every entry is now a number.
    5. Multiply, outer first. Dh(a)=[122cos⁡9cos⁡9][1−49−220]=[−3090−6cos⁡918cos⁡9]Dh(a) = \begin{bmatrix} 1 & 2\\ 2\cos9 & \cos9\end{bmatrix}\begin{bmatrix} 1 & -4 & 9\\ -2 & 2 & 0\end{bmatrix} = \begin{bmatrix} -3 & 0 & 9\\ 0 & -6\cos9 & 18\cos9\end{bmatrix}. (2×2)(2×3)=2×3(2 \times 2)(2 \times 3) = 2 \times 3. For example the (2,2)(2, 2) entry is 2cos⁡9⋅(−4)+cos⁡9⋅2=−6cos⁡92\cos9\cdot(-4) + \cos9\cdot2 = -6\cos9.

    Answer. Dh(1,−1,1)=[−3090−6cos⁡918cos⁡9]Dh(1, -1, 1) = \begin{bmatrix} -3 & 0 & 9\\ 0 & -6\cos9 & 18\cos9\end{bmatrix}. (Computing hh 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)Dh(1, -1, 1)? (Give a decimal.)
    Worked example Apostol 8.22 #15
    Apostol 8.22 #15. Let f(x,y,z)=(x2+y+z, 2x+y+z2)f(x, y, z) = (x^2 + y + z,\ 2x + y + z^2) and g(u,v,w)=(uv2w2, w2sin⁡v, u2ev)g(u, v, w) = (uv^2w^2,\ w^2\sin v,\ u^2e^v). Find Dh(u,0,w)Dh(u, 0, w) for h=f∘gh = f \circ g.

    Solution.

    1. Jacobians. Df=[2x11212z]Df = \begin{bmatrix} 2x & 1 & 1\\ 2 & 1 & 2z\end{bmatrix} (2×32 \times 3) and Dg=[v2w22uvw22uv2w0w2cos⁡v2wsin⁡v2uevu2ev0]Dg = \begin{bmatrix} v^2w^2 & 2uvw^2 & 2uv^2w\\ 0 & w^2\cos v & 2w\sin v\\ 2ue^v & u^2e^v & 0\end{bmatrix} (3×33 \times 3). f:R3→R2f: \mathbb R^3 \to \mathbb R^2 and g:R3→R3g: \mathbb R^3 \to \mathbb R^3.
    2. Set v=0v = 0 in gg first. g(u,0,w)=(0,0,u2)g(u, 0, w) = (0, 0, u^2). So DfDf is needed at (x,y,z)=(0,0,u2)(x, y, z) = (0, 0, u^2). Evaluate the outer matrix at the image point.
    3. The two numerical matrices. Df(0,0,u2)=[011212u2]Df(0, 0, u^2) = \begin{bmatrix} 0 & 1 & 1\\ 2 & 1 & 2u^2\end{bmatrix} and Dg(u,0,w)=[0000w202uu20]Dg(u, 0, w) = \begin{bmatrix} 0 & 0 & 0\\ 0 & w^2 & 0\\ 2u & u^2 & 0\end{bmatrix}. cos⁡0=1\cos0 = 1, sin⁡0=0\sin0 = 0, e0=1e^0 = 1.
    4. Multiply. Dh(u,0,w)=[2uu2+w204u32u4+w20]Dh(u, 0, w) = \begin{bmatrix} 2u & u^2 + w^2 & 0\\ 4u^3 & 2u^4 + w^2 & 0\end{bmatrix}. For example the (2,2)(2, 2) entry is 2⋅0+1⋅w2+2u2⋅u22\cdot0 + 1\cdot w^2 + 2u^2\cdot u^2.

    Answer. Dh(u,0,w)=[2uu2+w204u32u4+w20]Dh(u, 0, w) = \begin{bmatrix} 2u & u^2 + w^2 & 0\\ 4u^3 & 2u^4 + w^2 & 0\end{bmatrix}. The zero last column says hh does not change in the ww direction at v=0v = 0: in gg the ww derivative is a multiple of sin⁡v\sin v and v2v^2.

    Changing variables

    Worked example Lecture 23
    Polar coordinates. Let h(r,θ)=f(rcos⁡θ, rsin⁡θ)h(r, \theta) = f(r\cos\theta,\ r\sin\theta) for a differentiable scalar field ff. Express hrh_r and hθh_\theta by fxf_x and fyf_y, and then express fxf_x and fyf_y by hrh_r and hθh_\theta.

    Solution.

    1. The inner map and its Jacobian. P(r,θ)=(rcos⁡θ,rsin⁡θ)P(r, \theta) = (r\cos\theta, r\sin\theta) has DP=[cos⁡θ−rsin⁡θsin⁡θrcos⁡θ]DP = \begin{bmatrix}\cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta\end{bmatrix} (computed in 5.3). xr=cos⁡θx_r = \cos\theta, xθ=−rsin⁡θx_\theta = -r\sin\theta, yr=sin⁡θy_r = \sin\theta, yθ=rcos⁡θy_\theta = r\cos\theta.
    2. Apply the chain rule. [hrhθ]=[fxfy][cos⁡θ−rsin⁡θsin⁡θrcos⁡θ]\begin{bmatrix} h_r & h_\theta\end{bmatrix} = \begin{bmatrix} f_x & f_y\end{bmatrix}\begin{bmatrix}\cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta\end{bmatrix}, that is
    hr=cos⁡θ fx+sin⁡θ fy,hθ=−rsin⁡θ fx+rcos⁡θ fy.h_r = \cos\theta\,f_x + \sin\theta\,f_y,\qquad h_\theta = -r\sin\theta\,f_x + r\cos\theta\,f_y.

    Row times matrix. The partials fxf_x, fyf_y are evaluated at (rcos⁡θ,rsin⁡θ)(r\cos\theta, r\sin\theta). 3. Meaning. hrh_r is the rate of change of ff per unit of distance moving straight outward; hθ/rh_\theta/r is the rate per unit of distance moving round the circle. A step of angle dθd\theta moves a point at radius rr a distance r dθr\,d\theta, which is the factor rr in hθh_\theta. 4. Invert to get the other direction. [fxfy]=[hrhθ](DP)−1\begin{bmatrix} f_x & f_y\end{bmatrix} = \begin{bmatrix} h_r & h_\theta\end{bmatrix}(DP)^{-1} and (DP)−1=1r[rcos⁡θrsin⁡θ−sin⁡θcos⁡θ](DP)^{-1} = \dfrac1r\begin{bmatrix} r\cos\theta & r\sin\theta\\ -\sin\theta & \cos\theta\end{bmatrix}, so

    fx=cos⁡θ hr−sin⁡θr hθ,fy=sin⁡θ hr+cos⁡θr hθ.f_x = \cos\theta\,h_r - \frac{\sin\theta}{r}\,h_\theta,\qquad f_y = \sin\theta\,h_r + \frac{\cos\theta}{r}\,h_\theta.

    Multiply the chain rule on the right by the inverse matrix (2.6); it exists when r≠0r \ne 0, since det⁡DP=r\det DP = r. 5. Check on f=x2yf = x^2y. Then h=r3cos⁡2θsin⁡θh = r^3\cos^2\theta\sin\theta. At r=2r = 2, θ=π/6\theta = \pi/6: x=3x = \sqrt3, y=1y = 1, fx=2xy=23f_x = 2xy = 2\sqrt3, fy=x2=3f_y = x^2 = 3, so hθ=−2⋅12⋅23+2⋅32⋅3=3h_\theta = -2\cdot\frac12\cdot2\sqrt3 + 2\cdot\frac{\sqrt3}2\cdot3 = \sqrt3. Differentiating hh directly: hθ=r3(cos⁡3θ−2cos⁡θsin⁡2θ)h_\theta = r^3(\cos^3\theta - 2\cos\theta\sin^2\theta), which is 8⋅(338−34)=38\cdot\big(\frac{3\sqrt3}8 - \frac{\sqrt3}4\big) = \sqrt3. Two routes, one number.

    Answer. hr=cos⁡θ fx+sin⁡θ fyh_r = \cos\theta\,f_x + \sin\theta\,f_y and hθ=−rsin⁡θ fx+rcos⁡θ fyh_\theta = -r\sin\theta\,f_x + r\cos\theta\,f_y; the reverse formulas are in step 4.

    Your answerFor f(x,y)=x2yf(x, y) = x^2y and h(r,θ)=f(rcos⁡θ,rsin⁡θ)h(r, \theta) = f(r\cos\theta, r\sin\theta), find hθh_\theta at r=2r = 2, θ=π/6\theta = \pi/6. (Give a decimal.)
    Worked example Practice Final 2013, problem 9
    Practice Final 2013, problem 9. Let w=f(u,v)w = f(u, v) with u=xyu = xy and v=x/yv = x/y. Using the chain rule, (a) find wxw_x and wyw_y; (b) find wxxw_{xx}.

    Solution.

    1. The inner Jacobian. (x,y)↦(u,v)=(xy,x/y)(x, y) \mapsto (u, v) = (xy, x/y) has ux=yu_x = y, uy=xu_y = x, vx=1/yv_x = 1/y, vy=−x/y2v_y = -x/y^2. Ordinary partial derivatives of the two formulas.
    2. (a) First derivatives. wx=fuux+fvvx=y fu+1y fvw_x = f_uu_x + f_vv_x = y\,f_u + \dfrac1y\,f_v and wy=fuuy+fvvy=x fu−xy2 fvw_y = f_uu_y + f_vv_y = x\,f_u - \dfrac{x}{y^2}\,f_v. Row (fu,fv)(f_u, f_v) times the matrix.
    3. (b) Differentiate wxw_x in xx, by the product rule. In wx=y fu+y−1fvw_x = y\,f_u + y^{-1}f_v the factors yy and y−1y^{-1} do not depend on xx, but fuf_u and fvf_v do, through uu and vv. This is the step students forget: fu(xy,x/y)f_u(xy, x/y) is a composite field, so it needs its own chain rule.
    4. Chain rule on fuf_u and fvf_v. ∂x(fu)=fuuux+fuvvx=y fuu+1y fuv\partial_x(f_u) = f_{uu}u_x + f_{uv}v_x = y\,f_{uu} + \dfrac1y\,f_{uv} and ∂x(fv)=y fuv+1y fvv\partial_x(f_v) = y\,f_{uv} + \dfrac1y\,f_{vv} (using fuv=fvuf_{uv} = f_{vu}). Same rule as step 2, with fuf_u and fvf_v in place of ff.
    5. Assemble. wxx=y(y fuu+1y fuv)+1y(y fuv+1y fvv)=y2fuu+2fuv+1y2fvvw_{xx} = y\Big(y\,f_{uu} + \dfrac1y\,f_{uv}\Big) + \dfrac1y\Big(y\,f_{uv} + \dfrac1y\,f_{vv}\Big) = y^2f_{uu} + 2f_{uv} + \dfrac1{y^2}f_{vv}. The two fuvf_{uv} terms add.

    Answer. wx=yfu+y−1fvw_x = yf_u + y^{-1}f_v, wy=xfu−xy−2fvw_y = xf_u - xy^{-2}f_v, wxx=y2fuu+2fuv+y−2fvvw_{xx} = y^2f_{uu} + 2f_{uv} + y^{-2}f_{vv}. Test with f=u2vf = u^2v: then w=x3yw = x^3y and wxx=6xyw_{xx} = 6xy, while the formula gives y2⋅2v+2⋅2u+0=2y2⋅xy+4xy=6xyy^2\cdot2v + 2\cdot2u + 0 = 2y^2\cdot\frac xy + 4xy = 6xy.

    Your answerWith w=f(u,v)=u2vw = f(u, v) = u^2v, u=xyu = xy, v=x/yv = x/y, compute wxw_x at (x,y)=(2,1)(x, y) = (2, 1) by the chain rule formula wx=yfu+fv/yw_x = y f_u + f_v/y.
    Worked example MATH 375 Final Review, 8.21
    Let h(u,v)=f(x(u,v),y(u,v))h(u, v) = f(x(u, v), y(u, v)). Find the mixed second derivative huv=∂v(hu)h_{uv} = \partial_v(h_u): differentiate in uu first, then in vv.

    Solution.

    1. First derivative in uu. hu=fx xu+fy yuh_u = f_x\,x_u + f_y\,y_u. Chain rule; fxf_x and fyf_y are evaluated at (x(u,v),y(u,v))(x(u, v), y(u, v)).
    2. Differentiate in vv, product rule on each term. ∂v(hu)=(∂vfx)xu+fx xuv+(∂vfy)yu+fy yuv\partial_v(h_u) = \big(\partial_vf_x\big)x_u + f_x\,x_{uv} + \big(\partial_vf_y\big)y_u + f_y\,y_{uv}. xux_u is a function of (u,v)(u, v) too, so it is differentiated with the product rule.
    3. Chain rule on the two partials. ∂vfx=fxxxv+fxyyv\partial_vf_x = f_{xx}x_v + f_{xy}y_v and ∂vfy=fyxxv+fyyyv\partial_vf_y = f_{yx}x_v + f_{yy}y_v. fxf_x and fyf_y are themselves composite fields, and each gets its own chain rule.
    4. Assemble. huv=[fxxxv+fxyyv]xu+fx xuv+[fyxxv+fyyyv]yu+fy yuvh_{uv} = \big[f_{xx}x_v + f_{xy}y_v\big]x_u + f_x\,x_{uv} + \big[f_{yx}x_v + f_{yy}y_v\big]y_u + f_y\,y_{uv}.

    Answer. The formula in step 4, which is the one on the Final Review. With fxy=fyxf_{xy} = f_{yx} it collects as fxxxuxv+fxy(xuyv+xvyu)+fyyyuyv+fxxuv+fyyuvf_{xx}x_ux_v + f_{xy}(x_uy_v + x_vy_u) + f_{yy}y_uy_v + f_xx_{uv} + f_yy_{uv}.

    The inverse of a field has the inverse matrix as its derivative

    Definition T

    Jacobian determinant

    When m=nm = n, the Jacobian matrix JF(a)J_F(a) is square and its determinant (2.7) is the Jacobian determinant det⁡JF(a)=∂(F1,…,Fn)∂(x1,…,xn)\det J_F(a) = \dfrac{\partial(F_1, \dots, F_n)}{\partial(x_1, \dots, x_n)}. A tiny cube of side ϵ\epsilon at aa goes to a tiny parallelepiped of volume about ∣det⁡JF(a)∣ ϵn|\det J_F(a)|\,\epsilon^n. For polar coordinates it is rr (5.3).

    In one lineFor a field F:Rn→RnF: \mathbb R^n \to \mathbb R^n with the same number of inputs and outputs, det⁡JF(a)\det J_F(a): the factor by which FF scales small volumes near aa.

    Why it existsIt is the one number that records whether FF locally squashes space, flips it, or stretches it, and it is the correction factor in the change of variables formula for integrals.

    Corollary T chain rule and the product rule for determinants, 2.7

    Jacobian determinants multiply

    For h=f∘gh = f \circ g with f,g:Rn→Rnf, g: \mathbb R^n \to \mathbb R^n, det⁡Dh(a)=det⁡Df(g(a))⋅det⁡Dg(a)\det Dh(a) = \det Df(g(a))\cdot\det Dg(a).

    In one lineIf ff and gg both map Rn\mathbb R^n to Rn\mathbb R^n, then det⁡D(f∘g)(a)=det⁡Df(g(a))⋅det⁡Dg(a)\det D(f \circ g)(a) = \det Df(g(a))\cdot\det Dg(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.
    Dh(a)=Df(g(a)) Dg(a)Dh(a) = Df(g(a))\,Dg(a).
    The chain rule.
    det⁡Dh(a)=det⁡Df(g(a))⋅det⁡Dg(a)\det Dh(a) = \det Df(g(a))\cdot\det Dg(a).
    Product rule for determinants, valid since both matrices are n×nn \times n. ■\blacksquare
    Definition B

    Diffeomorphism

    A diffeomorphism is a bijection F:U→VF: U \to V of open sets U,V⊆RnU, V \subseteq \mathbb R^n such that FF and F−1F^{-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→VF: U \to V between open sets of Rn\mathbb R^n that has a differentiable inverse F−1:V→UF^{-1}: V \to 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 T MATH 375 Practice Final 2013, problem 10; Apostol 8.22

    The derivative of an inverse field

    Let F:U→VF: U \to V be a bijection of open sets in Rn\mathbb R^n with FF differentiable at xx and G=F−1G = F^{-1} differentiable at F(x)F(x). Then DF(x)DF(x) is invertible and DG(F(x))=(DF(x))−1DG(F(x)) = \big(DF(x)\big)^{-1}.

    In one lineIf F:U→VF: U \to V is a diffeomorphism, then DF(x)DF(x) is an invertible matrix for every xx, and D(F−1)(F(x))=(DF(x))−1D(F^{-1})(F(x)) = \big(DF(x)\big)^{-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 det⁡DF≠0\det DF \ne 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∘FG \circ F is the identity field on UU, whose Jacobian is the identity matrix II (5.3: the derivative of x↦xx \mapsto x).
    G(F(x))=xG(F(x)) = x for x∈Ux \in U.
    So DG(F(x)) DF(x)=IDG(F(x))\,DF(x) = I.
    The chain rule, with the outer field GG evaluated at the image point F(x)F(x).
    Likewise DF(x) DG(F(x))=IDF(x)\,DG(F(x)) = I.
    F(G(y))=yF(G(y)) = y for y∈Vy \in V; the same two steps with the roles swapped, at y=F(x)y = F(x) where G(y)=xG(y) = x.
    So DF(x)DF(x) is invertible and DG(F(x))=DF(x)−1DG(F(x)) = DF(x)^{-1}. ■\blacksquare
    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)=x3F(x) = x^3 is a differentiable bijection of R\mathbb R onto R\mathbb R. What does the theorem say about its inverse G(y)=y1/3G(y) = y^{1/3} at y=0y = 0?
    Worked example Practice Final 2013, problem 10; Apostol 8.17 #5
    Practice Final 2013, problem 10, in numbers. The field F(x,y)=(excos⁡y, exsin⁡y)F(x, y) = (e^x\cos y,\ e^x\sin y) is a diffeomorphism from the strip 0<y<π0 < y < \pi onto the upper half plane, with inverse G(X,Y)=(12ln⁡(X2+Y2), arg⁡(X+iY))G(X, Y) = \big(\tfrac12\ln(X^2 + Y^2),\ \arg(X + iY)\big). Find DGDG at F(ln⁡2,π/6)F(\ln2, \pi/6) without differentiating GG.

    Solution.

    1. The image point. F(ln⁡2,π/6)=(2cos⁡π6, 2sin⁡π6)=(3,1)F(\ln2, \pi/6) = (2\cos\frac\pi6,\ 2\sin\frac\pi6) = (\sqrt3, 1). eln⁡2=2e^{\ln2} = 2.
    2. DFDF at (ln⁡2,π/6)(\ln2, \pi/6). DF=[excos⁡y−exsin⁡yexsin⁡yexcos⁡y]=[3−113]DF = \begin{bmatrix} e^x\cos y & -e^x\sin y\\ e^x\sin y & e^x\cos y\end{bmatrix} = \begin{bmatrix}\sqrt3 & -1\\ 1 & \sqrt3\end{bmatrix}. 2⋅322\cdot\frac{\sqrt3}2 and 2⋅122\cdot\frac12.
    3. Invert it. The determinant is 3+1=43 + 1 = 4, so (DF)−1=14[31−13](DF)^{-1} = \dfrac14\begin{bmatrix}\sqrt3 & 1\\ -1 & \sqrt3\end{bmatrix}. The 2×22 \times 2 inverse swaps the diagonal, negates the off-diagonal, and divides by the determinant.
    4. Check with the real inverse. DG=[XX2+Y2YX2+Y2−YX2+Y2XX2+Y2]DG = \begin{bmatrix}\frac{X}{X^2 + Y^2} & \frac{Y}{X^2 + Y^2}\\ \frac{-Y}{X^2 + Y^2} & \frac{X}{X^2 + Y^2}\end{bmatrix}, which at (3,1)(\sqrt3, 1) (where X2+Y2=4X^2 + Y^2 = 4) is 14[31−13]\frac14\begin{bmatrix}\sqrt3 & 1\\ -1 & \sqrt3\end{bmatrix}. Differentiate 12ln⁡(X2+Y2)\frac12\ln(X^2 + Y^2) and arctan⁡(Y/X)\arctan(Y/X).

    Answer. DG(3,1)=14[31−13]DG(\sqrt3, 1) = \frac14\begin{bmatrix}\sqrt3 & 1\\ -1 & \sqrt3\end{bmatrix}. Because the rows of DGDG are ∇u\nabla u and ∇v\nabla v for u=12ln⁡(X2+Y2)u = \frac12\ln(X^2 + Y^2) and v=arg⁡v = \arg, and they are perpendicular, this is also Apostol 8.17 #5: the gradients of uu and vv are perpendicular at each point.

    Your answerIn the example above, what is the entry in row 1, column 1 of DG(3,1)DG(\sqrt3, 1)? (Give a decimal.)
    Worked example Lecture 23, with the inverse theorem
    Find D(P−1)D(P^{-1}) for polar coordinates at the point (x,y)=(1,1)(x, y) = (1, 1) by inverting DPDP, and compare with differentiating r=x2+y2r = \sqrt{x^2 + y^2}, θ=arctan⁡(y/x)\theta = \arctan(y/x).

    Solution.

    1. The point in polar coordinates. (1,1)(1, 1) is r=2r = \sqrt2, θ=π/4\theta = \pi/4. Distance from the origin and angle.
    2. Invert. DP(2,π4)=[22−1221]DP(\sqrt2, \tfrac\pi4) = \begin{bmatrix}\frac{\sqrt2}2 & -1\\ \frac{\sqrt2}2 & 1\end{bmatrix} has determinant 2=r\sqrt2 = r, so its inverse is 12[11−2222]=[2222−1212]\dfrac1{\sqrt2}\begin{bmatrix}1 & 1\\ -\frac{\sqrt2}2 & \frac{\sqrt2}2\end{bmatrix} = \begin{bmatrix}\frac{\sqrt2}2 & \frac{\sqrt2}2\\ -\frac12 & \frac12\end{bmatrix}. Same 2×22 \times 2 inverse recipe.
    3. Differentiate the inverse map. rx=x/r=22r_x = x/r = \frac{\sqrt2}2, ry=22r_y = \frac{\sqrt2}2, θx=−y/r2=−12\theta_x = -y/r^2 = -\frac12, θy=x/r2=12\theta_y = x/r^2 = \frac12. θ=arctan⁡(y/x)\theta = \arctan(y/x) has θx=−y/x21+y2/x2=−yx2+y2\theta_x = \frac{-y/x^2}{1 + y^2/x^2} = \frac{-y}{x^2 + y^2}.

    Answer. [2222−1212]\begin{bmatrix}\frac{\sqrt2}2 & \frac{\sqrt2}2\\ -\frac12 & \frac12\end{bmatrix} both ways. The first row says ∇r\nabla r is the unit vector (1,1)/2(1, 1)/\sqrt2 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 det⁡DF≠0\det DF \ne 0. The inverse function theorem goes the other way: if FF is continuously differentiable near aa and det⁡DF(a)≠0\det DF(a) \ne 0, then FF has a differentiable inverse on some small ball around aa. It is proved in 5.7 by a contraction argument (4.2). The example F(x,y)=(excos⁡y,exsin⁡y)F(x, y) = (e^x\cos y, e^x\sin y) shows why “locally” is the right word: det⁡DF=e2x≠0\det DF = e^{2x} \ne 0 everywhere, but FF is not one-to-one on the whole plane, since yy and y+2πy + 2\pi give the same point.

    Second derivatives of a composite

    The chain rule applied once gives first derivatives. The first partials of ff 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 ff that appears, by the chain rule again.

    Theorem T Apostol 8.17 #1; Spagnolie Lecture 23; Fall 2025 final problem 5

    Second derivative along a path

    Let r:(α,β)→Rnr: (\alpha, \beta) \to \mathbb R^n be twice differentiable, ff a scalar field whose first partials are differentiable (continuous second partials suffice), and g(t)=f(r(t))g(t) = f(r(t)). Then

    g′(t)=∑iDif(r(t)) ri′(t),g′′(t)=∑i=1n∑j=1nDjDif(r(t)) ri′(t) rj′(t)+∑i=1nDif(r(t)) ri′′(t).g'(t) = \sum_i D_if(r(t))\,r_i'(t), \qquad g''(t) = \sum_{i=1}^n\sum_{j=1}^n D_jD_if(r(t))\,r_i'(t)\,r_j'(t) + \sum_{i=1}^n D_if(r(t))\,r_i''(t).

    With the matrix H=[DjDif]H = [D_jD_if] of second partials, this reads g′′=r′TH r′+∇f⋅r′′g'' = r'^{\mathsf T}H\,r' + \nabla f\cdot r''.

    In one lineIf rr is twice differentiable and ff has continuous second partials, then d2dt2f(r(t))=∑i,jDjDif(r(t)) ri′(t) rj′(t)+∇f(r(t))⋅r′′(t)\dfrac{d^2}{dt^2}f(r(t)) = \sum_{i,j} D_jD_if(r(t))\,r_i'(t)\,r_j'(t) + \nabla f(r(t))\cdot r''(t).

    Why it is trueIt splits the acceleration of the value of ff into the part due to the curvature of ff (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.
    g′(t)=∑iDif(r(t)) ri′(t)g'(t) = \sum_i D_if(r(t))\,r_i'(t).
    The chain rule for a path.
    g′′(t)=∑i[ddtDif(r(t))]ri′(t)+∑iDif(r(t)) ri′′(t)g''(t) = \sum_i\Big[\dfrac{d}{dt}D_if(r(t))\Big]r_i'(t) + \sum_iD_if(r(t))\,r_i''(t).
    Product rule on each term of the sum.
    Substitute for the bracket.
    DifD_if is a differentiable scalar field, so the chain rule for a path applies to it: ddtDif(r(t))=∑jDjDif(r(t)) rj′(t)\frac{d}{dt}D_if(r(t)) = \sum_jD_jD_if(r(t))\,r_j'(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,jDjDif ri′rj′+∑iDif ri′′g'' = \sum_{i,j}D_jD_if\,r_i'r_j' + \sum_iD_if\,r_i''.
    The result is the formula claimed; the quadratic form of HH is the same whether HH or its transpose is used, so the order of the indices does not matter in the double sum. ■\blacksquare
    Worked example MATH 375 Fall 2025 final, problem 5
    Fall 2025 final, problem 5. A buoy at (X(t),Y(t))(X(t), Y(t)) measures a temperature f(x,y,t)f(x, y, t) that also changes in time. Let g(t)=f(X(t),Y(t),t)g(t) = f(X(t), Y(t), t). Find g′g' and g′′g''.

    Solution.

    1. The path in space-time. r(t)=(X(t),Y(t),t)r(t) = (X(t), Y(t), t), so r′=(X′,Y′,1)r' = (X', Y', 1) and r′′=(X′′,Y′′,0)r'' = (X'', Y'', 0). Time is the third coordinate; its velocity is 11 and its acceleration 00.
    2. First derivative. g′=fxX′+fyY′+ftg' = f_xX' + f_yY' + f_t, with the partials evaluated at (X(t),Y(t),t)(X(t), Y(t), t). Already in 5.3.
    3. Differentiate each term, product rule. g′′=(ddtfx)X′+fxX′′+(ddtfy)Y′+fyY′′+ddtftg'' = \big(\tfrac{d}{dt}f_x\big)X' + f_xX'' + \big(\tfrac{d}{dt}f_y\big)Y' + f_yY'' + \tfrac{d}{dt}f_t. The factor 11 in front of ftf_t is constant.
    4. Chain rule on each partial. ddtfx=fxxX′+fxyY′+fxt\tfrac{d}{dt}f_x = f_{xx}X' + f_{xy}Y' + f_{xt}, ddtfy=fyxX′+fyyY′+fyt\tfrac{d}{dt}f_y = f_{yx}X' + f_{yy}Y' + f_{yt}, ddtft=ftxX′+ftyY′+ftt\tfrac{d}{dt}f_t = f_{tx}X' + f_{ty}Y' + f_{tt}. The velocity of the path has three entries, so each partial has three terms. The last entry 11 is why the lone fxtf_{xt}, fytf_{yt}, fttf_{tt} appear.
    5. Collect, assuming equal mixed partials. g′′=fxxX′2+fyyY′2+ftt+2fxyX′Y′+2fxtX′+2fytY′+fxX′′+fyY′′g'' = f_{xx}X'^2 + f_{yy}Y'^2 + f_{tt} + 2f_{xy}X'Y' + 2f_{xt}X' + 2f_{yt}Y' + f_xX'' + f_yY''.

    Answer. The formula in step 5. For the final’s example f=xtf = xt, X=tX = t, Y=0Y = 0: fxt=1f_{xt} = 1 and all other second partials vanish, g=t2g = t^2, so g′′=2fxtX′=2g'' = 2f_{xt}X' = 2, which is d2dt2t2\frac{d^2}{dt^2}t^2.

    Worked example Lecture 23 (left unfinished on the page); Apostol 8.22 #5
    Lecture 23, finished. For h(r,θ)=f(rcos⁡θ,rsin⁡θ)h(r, \theta) = f(r\cos\theta, r\sin\theta) find hθθh_{\theta\theta}, hrrh_{rr} and hrθh_{r\theta}, and deduce the Laplacian fxx+fyyf_{xx} + f_{yy} in polar coordinates.

    Solution.

    1. Start from hθh_\theta. hθ=−rsin⁡θ fx+rcos⁡θ fyh_\theta = -r\sin\theta\,f_x + r\cos\theta\,f_y (previous example). Differentiate this in θ\theta, with rr held fixed.
    2. Product rule on each term. hθθ=−rcos⁡θ fx−rsin⁡θ ∂θ(fx)−rsin⁡θ fy+rcos⁡θ ∂θ(fy)h_{\theta\theta} = -r\cos\theta\,f_x - r\sin\theta\,\partial_\theta(f_x) - r\sin\theta\,f_y + r\cos\theta\,\partial_\theta(f_y). The coefficients depend on θ\theta and so do fxf_x, fyf_y. The two terms −rcos⁡θ fx-r\cos\theta\,f_x and −rsin⁡θ fy-r\sin\theta\,f_y carry minus signs; the unfinished page of Lecture 23 had the opposite overall sign on this line.
    3. Chain rule on fxf_x and fyf_y, with ∂θ(x)=−rsin⁡θ\partial_\theta(x) = -r\sin\theta and ∂θ(y)=rcos⁡θ\partial_\theta(y) = r\cos\theta. ∂θ(fx)=−rsin⁡θ fxx+rcos⁡θ fxy\partial_\theta(f_x) = -r\sin\theta\,f_{xx} + r\cos\theta\,f_{xy} and ∂θ(fy)=−rsin⁡θ fxy+rcos⁡θ fyy\partial_\theta(f_y) = -r\sin\theta\,f_{xy} + r\cos\theta\,f_{yy}. Same rule as for hθh_\theta with fxf_x in place of ff.
    4. Collect. hθθ=−rcos⁡θ fx−rsin⁡θ fy+r2sin⁡2θ fxx−2r2sin⁡θcos⁡θ fxy+r2cos⁡2θ fyyh_{\theta\theta} = -r\cos\theta\,f_x - r\sin\theta\,f_y + r^2\sin^2\theta\,f_{xx} - 2r^2\sin\theta\cos\theta\,f_{xy} + r^2\cos^2\theta\,f_{yy}. The two cross terms r2sin⁡θcos⁡θ fxyr^2\sin\theta\cos\theta\,f_{xy} each come with a minus sign and add.
    5. The other two. Differentiating hr=cos⁡θ fx+sin⁡θ fyh_r = \cos\theta\,f_x + \sin\theta\,f_y in rr (the coefficients do not depend on rr): hrr=cos⁡2θ fxx+2sin⁡θcos⁡θ fxy+sin⁡2θ fyyh_{rr} = \cos^2\theta\,f_{xx} + 2\sin\theta\cos\theta\,f_{xy} + \sin^2\theta\,f_{yy}. Differentiating it in θ\theta: hrθ=−sin⁡θ fx+cos⁡θ fy+r(−sin⁡θcos⁡θ fxx+(cos⁡2θ−sin⁡2θ)fxy+sin⁡θcos⁡θ fyy)h_{r\theta} = -\sin\theta\,f_x + \cos\theta\,f_y + r\big(-\sin\theta\cos\theta\,f_{xx} + (\cos^2\theta - \sin^2\theta)f_{xy} + \sin\theta\cos\theta\,f_{yy}\big). Same two sentences, applied to hrh_r.
    6. Add hrrh_{rr}, 1rhr\frac1rh_r and 1r2hθθ\frac1{r^2}h_{\theta\theta}. The fxyf_{xy} terms cancel, the fxxf_{xx} terms give cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1, likewise for fyyf_{yy}, and the first-order terms give 1r(cos⁡θfx+sin⁡θfy)−1r(cos⁡θfx+sin⁡θfy)=0\frac1r(\cos\theta f_x + \sin\theta f_y) - \frac1r(\cos\theta f_x + \sin\theta f_y) = 0. Check the fxf_x terms: from 1rhr\frac1rh_r we get cos⁡θrfx\frac{\cos\theta}rf_x, from 1r2hθθ\frac1{r^2}h_{\theta\theta} we get −cos⁡θrfx-\frac{\cos\theta}rf_x.

    Answer. hθθh_{\theta\theta} as in step 4, and

    fxx+fyy=hrr+1r hr+1r2 hθθ.f_{xx} + f_{yy} = h_{rr} + \frac1r\,h_r + \frac1{r^2}\,h_{\theta\theta}.

    Check with f=x2−y2f = x^2 - y^2, so h=r2cos⁡2θh = r^2\cos2\theta: 2cos⁡2θ+2cos⁡2θ−4cos⁡2θ=02\cos2\theta + 2\cos2\theta - 4\cos2\theta = 0, and fxx+fyy=2−2=0f_{xx} + f_{yy} = 2 - 2 = 0.

    Theorem B the compact form of Apostol 8.22 #3 and 8.24 #7

    Second derivatives of a composite field

    Let g:Rp→Rng: \mathbb R^p \to \mathbb R^n and f:Rn→Rf: \mathbb R^n \to \mathbb R have continuous second partials and h=f∘gh = f \circ g, b=g(a)b = g(a). Write Hf(b)=[DlDkf(b)]k,lH_f(b) = [D_lD_kf(b)]_{k,l}, an n×nn \times n matrix, and Hgk(a)=[DjDigk(a)]i,jH_{g_k}(a) = [D_jD_ig_k(a)]_{i,j}, a p×pp \times p matrix. Then the p×pp \times p matrix of second partials of hh at aa is

    Hh(a)=Dg(a)T Hf(b) Dg(a)+∑k=1nDkf(b) Hgk(a).H_h(a) = Dg(a)^{\mathsf T}\,H_f(b)\,Dg(a) + \sum_{k=1}^n D_kf(b)\,H_{g_k}(a).

    In one lineIf h=f∘gh = f \circ g with ff a scalar field and g:Rp→Rng: \mathbb R^p \to \mathbb R^n, all C2C^2, then the matrix of second partials of hh is Dg(a)T [DlDkf(b)] Dg(a)+∑k=1nDkf(b) [DjDigk(a)]Dg(a)^{\mathsf T}\,[D_lD_kf(b)]\,Dg(a) + \sum_{k=1}^n D_kf(b)\,[D_jD_ig_k(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 ff (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.
    Dih(a)=∑kDkf(g(a)) Digk(a)D_ih(a) = \sum_kD_kf(g(a))\,D_ig_k(a).
    Chain rule, entrywise.
    DjDih=∑k[Dj(Dkf∘g)]Digk+∑kDkf(g) DjDigkD_jD_ih = \sum_k\big[D_j\big(D_kf\circ g\big)\big]D_ig_k + \sum_kD_kf(g)\,D_jD_ig_k.
    Product rule in the variable xjx_j.
    DjDih=∑k,lDlDkf(g) Djgl Digk+∑kDkf(g) DjDigkD_jD_ih = \sum_{k,l}D_lD_kf(g)\,D_jg_l\,D_ig_k + \sum_kD_kf(g)\,D_jD_ig_k.
    DkfD_kf is a differentiable scalar field; chain rule: Dj(Dkf∘g)=∑lDlDkf(g) DjglD_j(D_kf\circ g) = \sum_lD_lD_kf(g)\,D_jg_l.
    Written as matrices this is the claimed identity.
    The first double sum is entry (i,j)(i, j) of DgTHfDgDg^{\mathsf T}H_fDg, since DigkD_ig_k is entry (k,i)(k, i) of DgDg and DjglD_jg_l is entry (l,j)(l, j). ■\blacksquare
    Worked example Apostol 8.24 #6
    Apostol 8.24 #6. The change of variables x=u+vx = u + v, y=uv2y = uv^2 transforms f(x,y)f(x, y) into g(u,v)g(u, v). Find ∂2g∂v ∂u\dfrac{\partial^2g}{\partial v\,\partial u} at u=v=1u = v = 1, given that at the corresponding point fy=fxx=fyy=fxy=fyx=1f_y = f_{xx} = f_{yy} = f_{xy} = f_{yx} = 1.

    Solution.

    1. The point and the partials of the change. u=v=1u = v = 1 gives (x,y)=(2,1)(x, y) = (2, 1). xu=1x_u = 1, xv=1x_v = 1, yu=v2y_u = v^2, yv=2uvy_v = 2uv. Differentiate x=u+vx = u + v and y=uv2y = uv^2.
    2. First derivative in uu. gu=fx⋅1+fy v2g_u = f_x\cdot1 + f_y\,v^2. Chain rule.
    3. Differentiate in vv, product rule on the second term. ∂v(gu)=∂v(fx)+2v fy+v2 ∂v(fy)\partial_v(g_u) = \partial_v(f_x) + 2v\,f_y + v^2\,\partial_v(f_y). v2v^2 is a function of vv as well.
    4. Chain rule on fxf_x and fyf_y (the vv-derivatives). ∂vfx=fxxxv+fxyyv=fxx+2uv fxy\partial_vf_x = f_{xx}x_v + f_{xy}y_v = f_{xx} + 2uv\,f_{xy} and ∂vfy=fyx+2uv fyy\partial_vf_y = f_{yx} + 2uv\,f_{yy}. xv=1x_v = 1 and yv=2uvy_v = 2uv.
    5. Substitute the numbers at u=v=1u = v = 1. ∂v(gu)=(1+2⋅1)+2⋅1+1⋅(1+2⋅1)=3+2+3=8\partial_v(g_u) = (1 + 2\cdot1) + 2\cdot1 + 1\cdot(1 + 2\cdot1) = 3 + 2 + 3 = 8.

    Answer. 88.

    Your answerIn the example above, what is ∂2g/∂v ∂u\partial^2g/\partial v\,\partial u at u=v=1u = v = 1?
    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)x = X(s, t), y=Y(s,t)y = Y(s, t) turn f(x,y)f(x, y) into F(s,t)F(s, t). Find FsF_s, FssF_{ss}, FstF_{st}, FttF_{tt} in general, then for X=s+tX = s + t, Y=stY = st.

    Solution.

    1. First derivatives. Fs=fx Xs+fy YsF_s = f_x\,X_s + f_y\,Y_s and Ft=fx Xt+fy YtF_t = f_x\,X_t + f_y\,Y_t. The chain rule with the row (fx,fy)(f_x, f_y) times the matrix with columns (Xs,Ys)(X_s, Y_s) and (Xt,Yt)(X_t, Y_t).
    2. Differentiate FsF_s in ss, product rule on each term. Fss=(∂sfx)Xs+fx Xss+(∂sfy)Ys+fy YssF_{ss} = \big(\partial_sf_x\big)X_s + f_x\,X_{ss} + \big(\partial_sf_y\big)Y_s + f_y\,Y_{ss}. XsX_s and YsY_s are functions of (s,t)(s, t) too.
    3. Chain rule on fxf_x and fyf_y. ∂sfx=fxxXs+fxyYs\partial_sf_x = f_{xx}X_s + f_{xy}Y_s and ∂sfy=fyxXs+fyyYs\partial_sf_y = f_{yx}X_s + f_{yy}Y_s. Each partial of ff is a composite field, as in the previous examples.
    4. Collect, with fxy=fyxf_{xy} = f_{yx}. Fss=fxxXs2+2fxyXsYs+fyyYs2+fx Xss+fy YssF_{ss} = f_{xx}X_s^2 + 2f_{xy}X_sY_s + f_{yy}Y_s^2 + f_x\,X_{ss} + f_y\,Y_{ss}. The same steps, differentiating FsF_s in tt and FtF_t in tt, give Fst=fxxXsXt+fxy(XsYt+XtYs)+fyyYsYt+fx Xst+fy YstF_{st} = f_{xx}X_sX_t + f_{xy}(X_sY_t + X_tY_s) + f_{yy}Y_sY_t + f_x\,X_{st} + f_y\,Y_{st} and Ftt=fxxXt2+2fxyXtYt+fyyYt2+fx Xtt+fy YttF_{tt} = f_{xx}X_t^2 + 2f_{xy}X_tY_t + f_{yy}Y_t^2 + f_x\,X_{tt} + f_y\,Y_{tt}. Compare with the matrix identity of the theorem above: the quadratic parts are DgTHfDgDg^{\mathsf T}H_fDg, the rest is the sum with the second derivatives of XX and YY.
    5. Insert X=s+tX = s + t, Y=stY = st. Then Xs=Xt=1X_s = X_t = 1, Ys=tY_s = t, Yt=sY_t = s, all second derivatives of XX vanish, and Yss=Ytt=0Y_{ss} = Y_{tt} = 0, Yst=1Y_{st} = 1. Differentiate the two formulas.
    6. Read off. Fs=fx+t fyF_s = f_x + t\,f_y, Ft=fx+s fyF_t = f_x + s\,f_y, Fss=fxx+2t fxy+t2fyyF_{ss} = f_{xx} + 2t\,f_{xy} + t^2f_{yy}, Ftt=fxx+2s fxy+s2fyyF_{tt} = f_{xx} + 2s\,f_{xy} + s^2f_{yy}, Fst=fxx+(s+t)fxy+st fyy+fyF_{st} = f_{xx} + (s + t)f_{xy} + st\,f_{yy} + f_y. The only first-order term that survives is fy Ystf_y\,Y_{st}. Test with f=xyf = xy: F=(s+t)stF = (s + t)st, Fst=2s+2tF_{st} = 2s + 2t, and the formula gives 0+(s+t)⋅1+0+fy=(s+t)+(s+t)0 + (s + t)\cdot1 + 0 + f_y = (s + t) + (s + t), since fy=x=s+tf_y = 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→RnT: \mathbb R^n \to \mathbb R^n and the scalar field f(x)=x⋅T(x)f(x) = x\cdot T(x), compute f′(x;y)f'(x; y) and ∇f\nabla f.

    Solution.

    1. Write ff as a composite. f=m∘Gf = m \circ G where G(x)=(x,T(x))G(x) = (x, T(x)) goes from Rn\mathbb R^n to Rn×Rn\mathbb R^n \times \mathbb R^n and m(u,w)=u⋅wm(u, w) = u\cdot w is the dot product. The pieces are simple: GG is linear and mm is bilinear.
    2. Derivative of the dot product. m(u+p,w+q)=u⋅w+(p⋅w+u⋅q)+p⋅qm(u + p, w + q) = u\cdot w + (p\cdot w + u\cdot q) + p\cdot q, so Dm(u,w)(p,q)=p⋅w+u⋅qDm(u, w)(p, q) = p\cdot w + u\cdot q. As for xyxy in 5.3: the cross term p⋅qp\cdot q is second order.
    3. Chain rule. f′(x;y)=Dm(G(x))(DG(x) y)=Dm(x,Tx)(y,Ty)=y⋅T(x)+x⋅T(y)f'(x; y) = Dm(G(x))(DG(x)\,y) = Dm(x, Tx)(y, Ty) = y\cdot T(x) + x\cdot T(y). DG(x) y=(y,T(y))DG(x)\,y = (y, T(y)) because GG is linear.
    4. The gradient. If TT has the matrix AA, then f(x)=xTAxf(x) = x^{\mathsf T}Ax and f′(x;y)=yTAx+xTAy=y⋅(A+AT)xf'(x; y) = y^{\mathsf T}Ax + x^{\mathsf T}Ay = y\cdot(A + A^{\mathsf T})x, so ∇f=(A+AT)x\nabla f = (A + A^{\mathsf T})x. Compare 3.8: the rule for ∇(xTAx)\nabla(x^{\mathsf T}Ax), now proved from the chain rule instead of by expanding sums.

    Answer. f′(x;y)=x⋅T(y)+y⋅T(x)f'(x; y) = x\cdot T(y) + y\cdot T(x), and ∇f=(A+AT)x\nabla f = (A + A^{\mathsf T})x, which is 2Ax2Ax when TT is symmetric.

    Quick checkFor g(t)=f(X(t),Y(t))g(t) = f(X(t), Y(t)), what is ddt[fx(X(t),Y(t))]\dfrac{d}{dt}\big[f_x(X(t), Y(t))\big]?
    Quick checkIn the polar formula for hθθh_{\theta\theta} there are terms −rcos⁡θ fx−rsin⁡θ fy-r\cos\theta\,f_x - r\sin\theta\,f_y with no second derivative. Where do they come from?
    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.

    1. g′(t)=∑iDif(r(t)) ri′(t)g'(t) = \sum_i D_i f(r(t))\,r_i'(t).
    2. g′′(t)=∑i[ddtDif(r(t))]ri′(t)+∑iDif(r(t)) ri′′(t)g''(t) = \sum_i \big[\tfrac{d}{dt} D_i f(r(t))\big] r_i'(t) + \sum_i D_i f(r(t))\, r_i''(t).
    3. ddtDif(r(t))=∑jDjDif(r(t)) rj′(t)\tfrac{d}{dt} D_i f(r(t)) = \sum_j D_j D_i f(r(t))\, r_j'(t).
    4. g′′=∑i,jDjDif  ri′rj′+∑iDif  ri′′g'' = \sum_{i,j} D_j D_i f\; r_i' r_j' + \sum_i D_i f\; r_i''.

    Where it is used

    Used inside maths· Inside maths: changing variables to solve a PDE, and the Laplacian in polar coordinates

    The wave equation utt=c2uxxu_{tt} = c^2u_{xx} describes a vibrating string. Put ξ=x−ct\xi = x - ct, η=x+ct\eta = x + ct and write u(x,t)=U(ξ,η)u(x, t) = U(\xi, \eta). By the second-derivative chain rule (the example with ξx=ηx=1\xi_x = \eta_x = 1, ξt=−c\xi_t = -c, ηt=c\eta_t = c): uxx=Uξξ+2Uξη+Uηηu_{xx} = U_{\xi\xi} + 2U_{\xi\eta} + U_{\eta\eta} and utt=c2(Uξξ−2Uξη+Uηη)u_{tt} = c^2\big(U_{\xi\xi} - 2U_{\xi\eta} + U_{\eta\eta}\big), so

    utt−c2uxx=−4c2 Uξη.u_{tt} - c^2u_{xx} = -4c^2\,U_{\xi\eta}.

    The equation becomes Uξη=0U_{\xi\eta} = 0, whose solutions are U=F(ξ)+G(η)U = F(\xi) + G(\eta) (integrate in η\eta, then in ξ\xi; 5.5 says when this is legitimate). That is d’Alembert’s solution u=F(x−ct)+G(x+ct)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=0f_{xx} + f_{yy} = 0 becomes r2hrr+rhr+hθθ=0r^2h_{rr} + rh_r + h_{\theta\theta} = 0, which separates into one-variable equations and has solutions rncos⁡nθr^n\cos n\theta and rnsin⁡nθr^n\sin n\theta, the real parts and imaginary parts of znz^n 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)x = (1, 2), a weight matrix W=[1−121]W = \begin{bmatrix}1 & -1\\ 2 & 1\end{bmatrix}, z=Wx=(−1,4)z = Wx = (-1, 4), a ReLU h=max⁡(0,z)=(0,4)h = \max(0, z) = (0, 4), an output y=v⋅hy = v\cdot h with v=(1,−1)v = (1, -1), so y=−4y = -4, and a loss ℓ=12(y−1)2=12.5\ell = \frac12(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:

    Dxℓ=(y−1)⏟1×1 vT⏟1×2 diag⁡(1[z>0])⏟2×2 W⏟2×2=(−5) (1,−1)[0001][1−121]=(−5)(0,−1)[1−121]=(10,5).D_x\ell = \underbrace{(y - 1)}_{1 \times 1}\ \underbrace{v^{\mathsf T}}_{1 \times 2}\ \underbrace{\operatorname{diag}(\mathbf 1[z > 0])}_{2 \times 2}\ \underbrace{W}_{2 \times 2} = (-5)\,(1, -1)\begin{bmatrix}0 & 0\\ 0 & 1\end{bmatrix}\begin{bmatrix}1 & -1\\ 2 & 1\end{bmatrix} = (-5)(0, -1)\begin{bmatrix}1 & -1\\ 2 & 1\end{bmatrix} = (10, 5).

    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)(10, 5) to nine digits. This product is a gradient of the input, and the transpose form ∇h=DgT∇f\nabla h = Dg^{\mathsf T}\nabla 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 LL layers, the gradient is a product of LL Jacobians. If each shrinks lengths by a factor 0.90.9, after L=50L = 50 layers the signal is 0.950≈0.0050.9^{50} \approx 0.005 of its size (vanishing gradients); if each stretches by 1.11.1, it is 1.150≈1171.1^{50} \approx 117 times larger (exploding gradients). The conditioning of 3.5 controls which happens. Libraries compute either Df(x) vDf(x)\,v (forward mode, one input direction at a time, for example JAX’s jvp) or uTDf(x)u^{\mathsf T}Df(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 np
    
    def 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).T
    
    g = 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, numerically
    prod = jac(f, g(a)) @ jac(g, a)         # Df at g(a), times Dg at a
    print(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 orders
    rng = np.random.default_rng(0)
    n, L = 300, 10
    Js = [rng.normal(size=(n, n)) / np.sqrt(n) for _ in range(L)]
    row = rng.normal(size=(1, n))
    left = row
    for J in Js: left = left @ J                  # row times matrix, L times
    right = Js[-1]
    for J in reversed(Js[:-1]): right = J @ right # matrix times matrix, L - 1 times
    print("same answer:", np.allclose(left, row @ right))
    mults_left, mults_right = L * n * n, (L - 1) * n**3 + n * n
    print("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))h(x) = f(g(x)) the matrix DfDf is taken at the point g(a)g(a). In Apostol 8.22 #14 the point a=(1,−1,1)a = (1, -1, 1) goes to b=(6,−3)b = (6, -3), and the cosines in DfDf are cos⁡(y+2x)=cos⁡9\cos(y + 2x) = \cos9, not cos⁡(−1+2)\cos(-1 + 2). Compute g(a)g(a) first, always.

    Watch out· The order of the matrices is not up to you

    Dh=Df DgDh = Df\,Dg and not Dg DfDg\,Df. The shapes tell you: (m×n)(n×p)(m \times n)(n \times 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))f_x(X(t), Y(t)) or fu(xy,x/y)f_u(xy, x/y) again, apply the chain rule to it. Leaving it as "fxxf_{xx}" loses the term fxyY′f_{xy}Y'. 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)f(x, y) is composed with y=Y(x)y = Y(x), the derivative of F(x)=f(x,Y(x))F(x) = f(x, Y(x)) is F′=fx+fyY′F' = f_x + f_yY'. The symbol ∂f∂x\frac{\partial f}{\partial x} means “hold yy fixed”, and dFdx\frac{dF}{dx} means “let yy move with xx”. They are different numbers, and cancelling ”∂x\partial x with ∂x\partial x” in the fraction picture would give F′=fyY′F' = f_y Y' or fxf_x alone. In the buoy problem the forgotten term was ftf_t, 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↦x3x \mapsto x^3 is differentiable and one-to-one onto R\mathbb R, and its inverse y1/3y^{1/3} is not differentiable at 00. The derivative-of-an-inverse theorem assumes a differentiable inverse, and the example shows the assumption is doing work. The test that det⁡DF≠0\det DF \ne 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 fxyf_{xy} and fyxf_{yx} into 2fxy2f_{xy}. 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)=esin⁡tF(t) = e^{\sin t}, g(x,y)=cos⁡(x2+y2)g(x, y) = \cos(x^2 + y^2) and f(x,y)=F(g(x,y))f(x, y) = F(g(x, y)). Find fxf_x and fyf_y by the chain rule.

    Solution

    The outer function is of one variable, so by the corollary ∇f=F′(g) ∇g\nabla f = F'(g)\,\nabla g. F′(t)=esin⁡tcos⁡tF'(t) = e^{\sin t}\cos t, and ∇g=−sin⁡(x2+y2) (2x,2y)\nabla g = -\sin(x^2 + y^2)\,(2x, 2y). Hence fx=−2xsin⁡(x2+y2) esin⁡gcos⁡gf_x = -2x\sin(x^2 + y^2)\,e^{\sin g}\cos g and fy=−2ysin⁡(x2+y2) esin⁡gcos⁡gf_y = -2y\sin(x^2 + y^2)\,e^{\sin g}\cos g, where g=cos⁡(x2+y2)g = \cos(x^2 + y^2). Check: along xx at y=0y = 0, f=esin⁡cos⁡(x2)f = e^{\sin\cos(x^2)} and the one-variable chain rule gives the same.

    check

    g:R3→R2g: \mathbb R^3 \to \mathbb R^2 and f:R2→R4f: \mathbb R^2 \to \mathbb R^4 are differentiable. What shape is D(f∘g)D(f \circ g)? Is g∘fg \circ f defined?

    Solution

    D(f∘g)=Df DgD(f \circ g) = Df\,Dg is (4×2)(2×3)=4×3(4 \times 2)(2 \times 3) = 4 \times 3. The composite g∘fg \circ f would feed the four outputs of ff into gg, which takes three inputs, so it is not defined.

    checkApostol 8.22 #2

    The substitution u=(x−y)/2u = (x - y)/2, v=(x+y)/2v = (x + y)/2 changes f(u,v)f(u, v) into F(x,y)F(x, y). Express FxF_x and FyF_y by fuf_u and fvf_v.

    Solution

    ux=12u_x = \frac12, uy=−12u_y = -\frac12, vx=12v_x = \frac12, vy=12v_y = \frac12. So Fx=12(fu+fv)F_x = \frac12(f_u + f_v) and Fy=12(−fu+fv)F_y = \frac12(-f_u + f_v). (Then Fx2−Fy2=fufvF_x^2 - F_y^2 = f_uf_v.)

    checkApostol 8.17 #3(c)

    Evaluate the directional derivative of f(x,y,z)=x2+y2−z2f(x, y, z) = x^2 + y^2 - z^2 at (3,4,5)(3, 4, 5) along the curve of intersection of the surfaces 2x2+2y2−z2=252x^2 + 2y^2 - z^2 = 25 and x2+y2=z2x^2 + y^2 = z^2.

    Solution

    The point lies on both surfaces (18+32−25=2518 + 32 - 25 = 25 and 9+16=259 + 16 = 25). The tangent direction is the cross product of the two normals, (12,16,−10)×(6,8,−10)=(−80,60,0)(12, 16, -10)\times(6, 8, -10) = (-80, 60, 0), which is parallel to (−4,3,0)(-4, 3, 0). And ∇f(3,4,5)=(6,8,−10)\nabla f(3, 4, 5) = (6, 8, -10), so ∇f⋅(−4,3,0)/5=(−24+24)/5=0\nabla f\cdot(-4, 3, 0)/5 = (-24 + 24)/5 = 0. In fact f=x2+y2−z2=0f = x^2 + y^2 - z^2 = 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 00.

    useApostol 8.22 #4(b) and (c)

    The equations x=stx = st, y=s/ty = s/t turn f(x,y)f(x, y) into F(s,t)F(s, t). Find FsF_s, FtF_t and FssF_{ss}. Repeat for x=(s−t)/2x = (s - t)/2, y=(s+t)/2y = (s + t)/2, and find Fss+FttF_{ss} + F_{tt} and FstF_{st}. Assume equal mixed partials.

    Solution

    First substitution: xs=tx_s = t, ys=1/ty_s = 1/t, xt=sx_t = s, yt=−s/t2y_t = -s/t^2. Fs=t fx+1t fyF_s = t\,f_x + \frac1t\,f_y, Ft=s fx−st2fyF_t = s\,f_x - \frac s{t^2}f_y. For FssF_{ss}, the coefficients tt and 1/t1/t do not depend on ss, so Fss=t(tfxx+1tfxy)+1t(tfxy+1tfyy)=t2fxx+2fxy+1t2fyyF_{ss} = t\big(tf_{xx} + \frac1tf_{xy}\big) + \frac1t\big(tf_{xy} + \frac1tf_{yy}\big) = t^2f_{xx} + 2f_{xy} + \frac1{t^2}f_{yy}. Second substitution: Fs=12(fx+fy)F_s = \frac12(f_x + f_y), Ft=12(−fx+fy)F_t = \frac12(-f_x + f_y), Fss=14(fxx+2fxy+fyy)F_{ss} = \frac14(f_{xx} + 2f_{xy} + f_{yy}), Ftt=14(fxx−2fxy+fyy)F_{tt} = \frac14(f_{xx} - 2f_{xy} + f_{yy}), Fst=14(−fxx+fyy)F_{st} = \frac14(-f_{xx} + f_{yy}). So Fss+Ftt=12(fxx+fyy)F_{ss} + F_{tt} = \frac12(f_{xx} + f_{yy}), a rotation of the axes by 45∘45^\circ and a scaling by 12\frac1{\sqrt2} in each, which multiplies the Laplacian by 12\frac12.

    useApostol 8.9 #19

    Let z=u(x,y) eax+byz = u(x, y)\,e^{ax + by} where uxy=0u_{xy} = 0. Find constants a,ba, b such that zxy−zx−zy+z=0z_{xy} - z_x - z_y + z = 0.

    Solution

    Product rule with the chain rule on the exponential: zx=eax+by(ux+au)z_x = e^{ax + by}(u_x + au), zy=eax+by(uy+bu)z_y = e^{ax + by}(u_y + bu), and zxy=eax+by(uxy+bux+auy+abu)=eax+by(bux+auy+abu)z_{xy} = e^{ax + by}(u_{xy} + bu_x + au_y + abu) = e^{ax + by}(bu_x + au_y + abu). So

    zxy−zx−zy+z=eax+by[(b−1)ux+(a−1)uy+(ab−a−b+1)u]=eax+by[(b−1)ux+(a−1)uy+(a−1)(b−1)u].z_{xy} - z_x - z_y + z = e^{ax + by}\big[(b - 1)u_x + (a - 1)u_y + (ab - a - b + 1)u\big] = e^{ax + by}\big[(b - 1)u_x + (a - 1)u_y + (a - 1)(b - 1)u\big].

    Taking a=b=1a = b = 1 makes every coefficient zero, whatever uu is. (For uu with uxu_x, uyu_y, uu independent, such as u=x+yu = x + y and u=1u = 1, the choice a=b=1a = b = 1 is also forced.)

    useApostol 8.22 #5

    For h(r,θ)=f(rcos⁡θ,rsin⁡θ)h(r, \theta) = f(r\cos\theta, r\sin\theta) find hrθh_{r\theta} in terms of the partials of ff. Check it on f=x2yf = x^2y at r=1r = 1, θ=π/2\theta = \pi/2.

    Solution

    Differentiate hr=cos⁡θ fx+sin⁡θ fyh_r = \cos\theta\,f_x + \sin\theta\,f_y in θ\theta: hrθ=−sin⁡θ fx+cos⁡θ fy+cos⁡θ(−rsin⁡θ fxx+rcos⁡θ fxy)+sin⁡θ(−rsin⁡θ fxy+rcos⁡θ fyy)h_{r\theta} = -\sin\theta\,f_x + \cos\theta\,f_y + \cos\theta(-r\sin\theta\,f_{xx} + r\cos\theta\,f_{xy}) + \sin\theta(-r\sin\theta\,f_{xy} + r\cos\theta\,f_{yy}), which collects to −sin⁡θ fx+cos⁡θ fy+r(−sin⁡θcos⁡θ fxx+(cos⁡2θ−sin⁡2θ)fxy+sin⁡θcos⁡θ fyy)-\sin\theta\,f_x + \cos\theta\,f_y + r\big(-\sin\theta\cos\theta\,f_{xx} + (\cos^2\theta - \sin^2\theta)f_{xy} + \sin\theta\cos\theta\,f_{yy}\big). For f=x2yf = x^2y: h=r3cos⁡2θsin⁡θh = r^3\cos^2\theta\sin\theta, hr=3r2cos⁡2θsin⁡θh_r = 3r^2\cos^2\theta\sin\theta, hrθ=3r2(cos⁡3θ−2cos⁡θsin⁡2θ)h_{r\theta} = 3r^2(\cos^3\theta - 2\cos\theta\sin^2\theta), which is 00 at θ=π/2\theta = \pi/2. By the formula at (x,y)=(0,1)(x, y) = (0, 1): fx=0f_x = 0, fy=0f_y = 0, fxx=2y=2f_{xx} = 2y = 2, fxy=2x=0f_{xy} = 2x = 0, fyy=0f_{yy} = 0, and the cross coefficient sin⁡θcos⁡θ=0\sin\theta\cos\theta = 0: all terms vanish, giving 00.

    useApostol 8.17 #5

    The equations eucos⁡v=xe^u\cos v = x and eusin⁡v=ye^u\sin v = y define uu and vv as functions of (x,y)(x, y). Find explicit formulas, valid for x>0x > 0, and show that ∇u\nabla u and ∇v\nabla v are perpendicular at each point.

    Solution

    Square and add: e2u=x2+y2e^{2u} = x^2 + y^2, so u=12ln⁡(x2+y2)u = \frac12\ln(x^2 + y^2). Divide: tan⁡v=y/x\tan v = y/x, so v=arctan⁡(y/x)v = \arctan(y/x) for x>0x > 0. Then ∇u=(x,y)x2+y2\nabla u = \dfrac{(x, y)}{x^2 + y^2} and ∇v=(−y,x)x2+y2\nabla v = \dfrac{(-y, x)}{x^2 + y^2}, whose dot product is −xy+yx(x2+y2)2=0\dfrac{-xy + yx}{(x^2 + y^2)^2} = 0. Another route, by the theorem of this chapter: the rows of DGDG are ∇u\nabla u and ∇v\nabla v, and DG=(DF)−1DG = (DF)^{-1} for F(u,v)=(eucos⁡v,eusin⁡v)F(u, v) = (e^u\cos v, e^u\sin v), where DF=eu[cos⁡v−sin⁡vsin⁡vcos⁡v]DF = e^u\begin{bmatrix}\cos v & -\sin v\\ \sin v & \cos v\end{bmatrix} 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))h(x) = f(g(x)) with g=(g1,…,gn)g = (g_1, \dots, g_n) differentiable at aa and ff a scalar field differentiable at g(a)g(a). Prove ∇h(a)=∑k=1nDkf(g(a)) ∇gk(a)\nabla h(a) = \sum_{k=1}^n D_kf(g(a))\,\nabla g_k(a).

    Solution

    Plan. Apply the chain rule coordinate by coordinate. For each jj the chain rule gives Djh(a)=∑kDkf(b) Djgk(a)D_jh(a) = \sum_kD_kf(b)\,D_jg_k(a), where b=g(a)b = g(a). The vector whose jj-th entry is this sum is ∑kDkf(b) (D1gk(a),…,Dngk(a))=∑kDkf(b) ∇gk(a)\sum_kD_kf(b)\,(D_1g_k(a), \dots, D_ng_k(a)) = \sum_kD_kf(b)\,\nabla g_k(a), since ∇gk(a)\nabla g_k(a) has Djgk(a)D_jg_k(a) as its jj-th entry. ■\blacksquare

    prove

    Use the chain rule to prove the product rule ∇(uv)=u∇v+v∇u\nabla(uv) = u\nabla v + v\nabla u for differentiable scalar fields u,vu, v.

    Solution

    Plan. Write uv=m(u,v)uv = m(u, v) with m(s,t)=stm(s, t) = st.

    Let g(x)=(u(x),v(x))g(x) = (u(x), v(x)), so uv=m∘guv = m \circ g. ∇m=(t,s)\nabla m = (t, s), so Dm(g(x))=(v(x),u(x))Dm(g(x)) = (v(x), u(x)) and DgDg has rows ∇uT\nabla u^{\mathsf T} and ∇vT\nabla v^{\mathsf T}. By the chain rule D(uv)=(v,u)[∇uT∇vT]=v∇uT+u∇vTD(uv) = (v, u)\begin{bmatrix}\nabla u^{\mathsf T}\\ \nabla v^{\mathsf T}\end{bmatrix} = v\nabla u^{\mathsf T} + u\nabla v^{\mathsf T}. Transposing, ∇(uv)=v∇u+u∇v\nabla(uv) = v\nabla u + u\nabla v. ■\blacksquare

    provenew (Euler's identity)

    A scalar field ff on Rn\mathbb R^n is homogeneous of degree kk if f(tx)=tkf(x)f(tx) = t^kf(x) for all t>0t > 0. If ff is differentiable, prove x⋅∇f(x)=k f(x)x\cdot\nabla f(x) = k\,f(x).

    Solution

    Plan. Differentiate t↦f(tx)t \mapsto f(tx) at t=1t = 1 in two ways.

    Fix xx and let r(t)=txr(t) = tx, so r′(t)=xr'(t) = x. By the chain rule for a path, ddtf(tx)=∇f(tx)⋅x\frac{d}{dt}f(tx) = \nabla f(tx)\cdot x, which at t=1t = 1 is ∇f(x)⋅x\nabla f(x)\cdot x. On the other side, f(tx)=tkf(x)f(tx) = t^kf(x) has derivative ktk−1f(x)kt^{k-1}f(x), which at t=1t = 1 is kf(x)k f(x). Equating the two gives x⋅∇f(x)=kf(x)x\cdot\nabla f(x) = kf(x). ■\blacksquare (Example: f=x2y+y3f = x^2y + y^3 has degree 3 and xfx+yfy=2x2y+x2y+3y3=3fx f_x + y f_y = 2x^2y + x^2y + 3y^3 = 3f.)

    prove

    Prove that if F:U→VF: U \to V is a diffeomorphism, then det⁡D(F−1)(F(x))=1/det⁡DF(x)\det D(F^{-1})(F(x)) = 1/\det DF(x), and det⁡DF(x)≠0\det DF(x) \ne 0 for every xx.

    Solution

    Plan. Take determinants in the identity D(F−1)(F(x)) DF(x)=ID(F^{-1})(F(x))\,DF(x) = I.

    By the theorem of this chapter, DG(F(x)) DF(x)=IDG(F(x))\,DF(x) = I with G=F−1G = F^{-1}. Both matrices are n×nn \times n, so the product rule for determinants gives det⁡DG(F(x))⋅det⁡DF(x)=det⁡I=1\det DG(F(x))\cdot\det DF(x) = \det I = 1. A product of two numbers equals 11, so neither is 00, and det⁡DG(F(x))=1/det⁡DF(x)\det DG(F(x)) = 1/\det DF(x). ■\blacksquare For polar coordinates: det⁡DP=r\det DP = r, so the inverse map (x,y)↦(r,θ)(x, y) \mapsto (r, \theta) has Jacobian determinant 1/r=1/x2+y21/r = 1/\sqrt{x^2 + y^2}, which at (1,1)(1, 1) is 1/21/\sqrt2; the matrix [2222−1212]\begin{bmatrix}\frac{\sqrt2}2 & \frac{\sqrt2}2\\ -\frac12 & \frac12\end{bmatrix} has determinant 24+24=22=1/2\frac{\sqrt2}4 + \frac{\sqrt2}4 = \frac{\sqrt2}2 = 1/\sqrt2. ✓

    provenew (uses 5.2)

    If ff is differentiable on a ball and f(x)f(x) depends only on ∥x∥\lVert x \rVert, say f(x)=ϕ(∥x∥)f(x) = \phi(\lVert x \rVert) for a differentiable function ϕ\phi of one variable, show ∇f(x)=ϕ′(∥x∥) x∥x∥\nabla f(x) = \phi'(\lVert x \rVert)\,\dfrac{x}{\lVert x \rVert} for x≠Ox \ne O. What does this say about the level sets?

    Solution

    Plan. Compose ϕ\phi with the field ∥x∥\lVert x \rVert, whose gradient was found in 5.2.

    By the fourth row of the table, ∇(ϕ∘∥⋅∥)=ϕ′(∥x∥) ∇∥x∥\nabla(\phi\circ\lVert\cdot\rVert) = \phi'(\lVert x \rVert)\,\nabla\lVert x \rVert, and ∇∥x∥=x/∥x∥\nabla\lVert x \rVert = x/\lVert x \rVert (5.2, the cone). So ∇f\nabla f points along the radius, and the level sets of ff are spheres, to which the gradient is perpendicular. ■\blacksquare (For f=ln⁡∥x∥f = \ln\lVert x \rVert, ϕ=ln⁡\phi = \ln, we get ∇f=x/∥x∥2\nabla f = x/\lVert x \rVert^2, matching the uu of 8.17 #5.)

    stretch

    Suppose F:U→VF: U \to V is a bijection from an open set of Rn\mathbb R^n to an open set of Rm\mathbb R^m which is differentiable with a differentiable inverse. Prove that n=mn = m.

    Solution

    Plan. The chain rule gives two matrix identities whose sizes force n=mn = m.

    Write G=F−1G = F^{-1}. Then DG DF=InDG\,DF = I_n (G∘FG \circ F is the identity on UU) and DF DG=ImDF\,DG = I_m (F∘GF \circ G is the identity on VV), where DFDF is m×nm \times n and DGDG is n×mn \times m. The first identity says DFDF has rank nn (it has a left inverse, so it is one-to-one), which needs n≤mn \le m. The second says DGDG has rank mm, which needs m≤nm \le n. Therefore n=mn = m. ■\blacksquare This is a baby case of the theorem that open subsets of Rn\mathbb R^n and Rm\mathbb R^m are not diffeomorphic for n≠mn \ne 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)u(x, t) have continuous second partials on R2\mathbb R^2 and satisfy utt=c2uxxu_{tt} = c^2u_{xx}. Prove u(x,t)=F(x−ct)+G(x+ct)u(x, t) = F(x - ct) + G(x + ct) for some twice differentiable F,GF, G.

    Solution

    Plan. Change variables to ξ=x−ct\xi = x - ct, η=x+ct\eta = x + ct, where the equation becomes Uξη=0U_{\xi\eta} = 0, then integrate twice.

    Put U(ξ,η)=u(ξ+η2,η−ξ2c)U(\xi, \eta) = u\big(\frac{\xi + \eta}2, \frac{\eta - \xi}{2c}\big), so u(x,t)=U(x−ct,x+ct)u(x, t) = U(x - ct, x + ct). By the second-derivative chain rule (Application above), utt−c2uxx=−4c2Uξηu_{tt} - c^2u_{xx} = -4c^2U_{\xi\eta}, so Uξη=0U_{\xi\eta} = 0 on R2\mathbb R^2. Then UηU_\eta has ∂ξ(Uη)=0\partial_\xi(U_\eta) = 0 on the whole plane, so for each fixed η\eta, ξ↦Uη(ξ,η)\xi \mapsto U_\eta(\xi, \eta) has derivative 00 on all of R\mathbb R and is constant (1.4): Uη(ξ,η)=ψ(η)U_\eta(\xi, \eta) = \psi(\eta) for a function ψ\psi of η\eta alone. Let GG be an antiderivative of ψ\psi. Then ∂η(U−G(η))=0\partial_\eta\big(U - G(\eta)\big) = 0, so for each ξ\xi the function η↦U(ξ,η)−G(η)\eta \mapsto U(\xi, \eta) - G(\eta) is constant: U(ξ,η)=F(ξ)+G(η)U(\xi, \eta) = F(\xi) + G(\eta) with F(ξ)=U(ξ,0)−G(0)F(\xi) = U(\xi, 0) - G(0). ■\blacksquare

    Summary

    • Chain rule. If gg is differentiable at aa and ff at b=g(a)b = g(a), then f∘gf \circ g is differentiable at aa and D(f∘g)(a)=Df(g(a)) Dg(a)D(f \circ 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∥\lVert g(a + y) - g(a) \rVert \le M\lVert y \rVert.
    • Every formula in the lectures is a shape of this product: a path into a scalar field (∇f⋅r′\nabla f\cdot r'), a change of variables (hs=fx xs+fy ysh_s = f_x\,x_s + f_y\,y_s), polar coordinates (hθ=−rsin⁡θ fx+rcos⁡θ fyh_\theta = -r\sin\theta\,f_x + r\cos\theta\,f_y), the gradient of a composite (∇h=DgT∇f\nabla h = Dg^{\mathsf T}\nabla f).
    • Inverse. If FF has a differentiable inverse GG then DG(F(x))=DF(x)−1DG(F(x)) = DF(x)^{-1} and det⁡DF≠0\det DF \ne 0 (Practice Final 10). A differentiable bijection like x3x^3 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 ff, with the product rule throughout. Along a path, g′′=r′TH r′+∇f⋅r′′g'' = r'^{\mathsf T}H\,r' + \nabla f\cdot r''; for a change of variables, Hh=DgTHfDg+∑kfkHgkH_h = Dg^{\mathsf T}H_fDg + \sum_kf_kH_{g_k}. Mixed partials were taken equal; 5.5 says when that is legal.
    • Applications: polar Laplacian fxx+fyy=hrr+hr/r+hθθ/r2f_{xx} + f_{yy} = h_{rr} + h_r/r + h_{\theta\theta}/r^2, d’Alembert’s solution of the wave equation, and backpropagation as a product of Jacobians multiplied from the output end (0.950≈0.0050.9^{50} \approx 0.005, 1.150≈1171.1^{50} \approx 117).

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    1.4 The derivative as best linear approximation
    2.4 Inverses, one-to-one maps, isomorphism
    2.5 Matrices as maps, multiplication, change of basis
    3.8 Matrix calculus and backpropagation
    5.3 The total derivative, the Jacobian matrix and tangent planes
    Leads to
    5.5 Higher partial derivatives and the equality of mixed partials
    5.6 Taylor's formula, the Hessian and extrema
    Same idea elsewhere
    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.