5.3 The total derivative, the Jacobian matrix and tangent planes
A field is differentiable at a point when, near it, the field equals a constant plus a linear map plus an error that is small compared with the step. That linear map is the total derivative; its matrix is the Jacobian, which for a scalar field is the gradient. It implies continuity, it contains every directional derivative, and it gives tangent planes and linear approximations.
Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 8.11 to 8.13 and 8.15 to 8.19Spagnolie, Lectures 21 to 23 and Lecture 19 (first version)Abbott, Understanding Analysis, ch. 5 (the one-variable idea)Jacobi, De determinantibus functionalibus (1841)
In one variable (1.4) a function is differentiable at a when it looks like a line near a: f(a+h)=f(a)+f′(a)h+hE(h) with E(h)→0. The number f′(a) is the slope, and multiplying by it is a linear map from R to R (2.3). In many variables the right object is a linear map from Rn to Rm, and its matrix is the Jacobian. The chapter before showed that having a derivative in each direction is not enough (it did not even give continuity). Demanding a good linear approximation is, and it gives everything we wanted: continuity, a gradient that works in every direction, tangent planes, and the chain rule of 5.4. Chapter 3.8 used the gradient and the Jacobian without definitions; this chapter supplies them.
Before you start
1.4: the derivative as the slope of the best line. 2.5: a linear map is a matrix whose columns are the images of the unit vectors. 5.2: directional derivatives, partial derivatives and the gradient, and the example where they exist without continuity.
Quick checkIn f(a+h)=f(a)+mh+E(h), what does 'differentiable at a with derivative m' say about E(h)?
Every continuous f has E(h)→0. Differentiability is the stronger statement that the error shrinks faster than h. This is the form that generalises.Review: the two forms of differentiability
Quick checkA linear map T:R3→R2 has a matrix of what shape, and what are its columns?
The matrix has one row for each output coordinate and one column for each input coordinate. Column j is the image of the j-th unit vector. We will see the Jacobian is exactly this.Review: the matrix of a linear map
Quick checkFor f(x,y)=x2+y4xy2 (with f(0,y)=0), all directional derivatives exist at the origin. What went wrong in 5.2?
The directional derivative is q2/p for y=(p,q) with p=0, which is not a linear function of y, and along the parabola x=y2 the function equals 21. A good linear approximation would need the first to be linear and would force the second not to happen.Review: the warning in 5.2
The picture: zoom until it is flat
Drag the dot to a point of the surface and look at the green patch: the tangent plane, the graph of the best linear approximation. Slide the step length down. The vertical purple segment (true value minus plane value) shrinks much faster than the step itself, and the number “error divided by step” in the box under the picture falls towards 0. Do this for cos(x+y) and the saddle too. For a vector field the same idea says that a tiny disc around a is sent by F to something that looks like an ellipse, the image of the disc under a matrix:
The purple curve is the true image of the tiny circle (after subtracting F(a) and dividing by the radius). The dashed green ellipse is what the Jacobian matrix J does to the unit circle. Make the radius ρ small, and they are the same curve. Try the “swirl” field and move the dot around: the matrix changes from point to point, but at each point the circle becomes an ellipse.
The idea, in words
The one-variable equation says: near a, f is a constant f(a), plus a linear function of the step h, plus an error. In many variables, the step v=x−a is a vector, the linear function is a linear map Ta(v), and the error must be small compared with the length of the step. You cannot divide by a vector, so the one-variable condition "E(h)/h→0" is rewritten as “error =∥v∥E(a,v) with E→0”. This is Apostol’s 8.11, Spagnolie’s Lecture 21, and Young’s and Fréchet’s idea.
Why· Why a linear map, and why 'all directions at once'
If you walk from a in the direction y, the error condition says f(a+hy)−f(a)=Ta(hy)+o(h)=hTa(y)+o(h). So Ta(y) must be the directional derivative f′(a;y). The total derivative is the map that remembers all the directional derivatives at once and insists that they depend linearly on y and that the approximation is good uniformly in the direction. The sneaky function of 5.2 failed exactly these two demands: its directional derivative q2/p is not linear in y, and its approximation is good along each line but not along the parabola.
Where this came from· Jacobi's functional determinants, and Young and Fréchet
Carl Jacobi’s 1841 paper “De determinantibus functionalibus” in Crelle’s journal studied the determinant of the square array of partial derivatives of n functions of n variables: the determinant that now carries his name. He showed that n functions of n variables are mutually dependent exactly when this determinant vanishes identically. The same determinant is the number that says how a small region is stretched, the area scaling in the picture above. The idea of a derivative of a function of several variables as a linear map approximating it, uniformly in the direction, came later: Apostol’s text credits W. H. Young (1908) and Maurice Fréchet (1911), the latter “in a more general context”, meaning that Fréchet’s definition works on any normed space. That generality is why 521 states it that way.
The definition
Definition T
Differentiable field
Let F:S→Rm with S⊆Rn, and let a be an interior point of S, so a ball B(a,r) lies in S. We say F is differentiable at a if there is a linear map Ta:Rn→Rm and a function E(a,v) (with values in Rm, defined for ∥v∥<r, with E(a,0)=0) such that
F(a+v)=F(a)+Ta(v)+∥v∥E(a,v)(∥v∥<r),E(a,v)→0 as v→0.
An equivalent form, with no E: v→0lim∥v∥∥F(a+v)−F(a)−Ta(v)∥=0. (Define E(a,v) as the quotient inside, for v=0.) For m=1 this is Apostol’s definition of a differentiable scalar field.
In one lineF is differentiable at the interior point a if F(a+v)=F(a)+Ta(v)+∥v∥E(a,v) for small v, where Ta is a linear map and E(a,v)→0 as v→0.
Why it existsIt says that near a the field is a constant plus a linear map plus an error that is small compared with the step, which is the one-variable zoom picture in n dimensions and the definition that supports the chain rule.
Definition T
Total derivative
When F is differentiable at a, the linear map Ta is called the total derivative of F at a, written F′(a) (Apostol) or DF(a) (Spagnolie), so F′(a)(v)=Ta(v). Note (Apostol’s warning): the total derivative is a linear map, not a number; the value Ta(v) is a vector for each v. It is unique, by the theorem below. In one variable (n=m=1) every linear map is multiplication by a number, Ta(h)=f′(a)h, and the definition is the form of 1.4.
In one lineThe linear map Ta in the definition of a differentiable field; it is unique, and it is written F′(a) or DF(a).
Why it existsIt is the object that plays the role of the number f′(a): the best linear approximation of F at a, with the error beyond first order.
Worked example new (this is the product rule)
Show from the definition that f(x,y)=xy is differentiable at every a=(a1,a2) with total derivative Ta(v)=a2v1+a1v2.
Solution.
Expand f(a+v).f(a+v)=(a1+v1)(a2+v2)=a1a2+a2v1+a1v2+v1v2. Multiply out; a is fixed, v is the small step.
Read off the pieces.f(a)=a1a2; Ta(v)=a2v1+a1v2 is linear in v (a row times a column); the leftover is v1v2. Constant plus linear plus error.
Bound the error.∣v1v2∣≤21(v12+v22)=21∥v∥2. (v1−v2)2≥0, that is, 2v1v2≤v12+v22, and the same with v2→−v2.
Divide by the length.∥v∥∣v1v2∣≤21∥v∥→0. So E(a,v)=∥v∥v1v2 tends to 0 as v→0.
Answer.xy is differentiable everywhere, with Ta(v)=(a2,a1)⋅v. The error v1v2 is of second order, and it is the cross term that the product rule of 1.4 treated with the add-and-subtract trick.
Worked example new (compare 3.8, Problems)
Find the total derivative of a linear field F(x)=Ax+b, where A is m×n.
Solution.
Expand.F(a+v)=A(a+v)+b=(Aa+b)+Av=F(a)+Av. A is linear.
Read off. The error term is 0 exactly, so E≡0, and Ta(v)=Av for every a. There is nothing nonlinear left to estimate.
Answer.F′(a)=A at every point: a linear map is its own best linear approximation, and its derivative does not depend on where you are.
What the total derivative contains
Theorem TApostol Thm 8.5 and 8.12; Spagnolie Lecture 21
Directional derivative as a dot product with the gradient
Suppose f:S→R is differentiable at a with total derivative Ta. Then for every y∈Rn the derivative f′(a;y) exists and
Ta(y)=f′(a;y)=k=1∑nykDkf(a)=∇f(a)⋅y.
In particular all the partial derivatives exist, Ta is the only linear map that works, and it is the linear function y↦∇f(a)⋅y.
In one lineIf a scalar field f is differentiable at a, then f′(a;y) exists for every y and equals Ta(y)=∇f(a)⋅y; in particular Ta is unique.
Why it is trueIt proves the formula borrowed in 5.2, shows the total derivative is determined by the field, and shows it is the gradient read as a linear function.
ProofApostol 8.5; Spagnolie Lecture 21
The idea: Take the step v = hy along a line. By linearity, T_a(hy) = h T_a(y), so dividing by h leaves T_a(y) plus a term that goes to 0. The sum formula then follows from writing y in the unit vectors.
Let y=O and h=0 small. Put v=hy in the definition.
The case y=O: both sides are 0.
f(a+hy)−f(a)=hTa(y)+∣h∣∥y∥E(a,hy).
Definition of a differentiable field with v=hy; linearity gives Ta(hy)=hTa(y); ∥hy∥=∣h∣∥y∥.
hf(a+hy)−f(a)=Ta(y)±∥y∥E(a,hy).
Divide by h. Here ∣h∣/h=±1.
As h→0 the right side tends to Ta(y). So f′(a;y) exists and equals Ta(y).
hy→O as h→0, so E(a,hy)→0. The sign ± and the factor ∥y∥ are bounded.This is where 'small compared with ‖v‖' is used: the error survives division by h and still vanishes.
So any two total derivatives agree on every y: Ta is unique. ■
Ta(y) equals a quantity, f′(a;y), that does not depend on Ta.
Proof workshopGive the reason for each line: the total derivative contains all directional derivativesApostol 8.5
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
f(a+hy)−f(a)=Ta(hy)+∥hy∥E(a,hy).
Ta(hy)=hTa(y) and ∥hy∥=∣h∣∥y∥.
hf(a+hy)−f(a)=Ta(y)±∥y∥E(a,hy).
As h→0, E(a,hy)→0, so the quotient tends to Ta(y).
Hence f′(a;y)=Ta(y)=∑kykDkf(a)=∇f(a)⋅y.
Theorem TApostol 8.18; Spagnolie Lecture 23
A vector field is differentiable exactly when its components are
Let F:S→Rm. Then F is differentiable at a if and only if each component Fi is. In that case F′(a)(y)=F′(a;y)=(F1′(a;y),…,Fm′(a;y)) (for a vector field, F′(a;y) means limh→0hF(a+hy)−F(a), which exists exactly when each component’s limit does) and, in the standard bases, the matrix of F′(a) is the m×n matrix whose i-th row is ∇Fi(a).
In one lineF=(F1,…,Fm) is differentiable at a if and only if every Fi is, and then F′(a)(y)=(∇F1(a)⋅y,…,∇Fm(a)⋅y), whose matrix is the Jacobian.
Why it is trueIt reduces the vector case to the scalar case already done, and tells you how to compute F′(a): take the gradient of each component and stack them as rows.
ProofApostol 8.18
The idea: A vector is small exactly when all its components are small (the norm comparison of 5.1), so the error E tends to 0 if and only if each component of E does; and a map into R^m is linear exactly when each component is.
Fi(a+v)=Fi(a)+Ta,i(v)+∥v∥Ei(a,v), where Ta,i is the i-th component of Ta and Ei that of E.
Take components of the defining equation: the i-th component of ∥v∥E(a,v) is ∥v∥Ei(a,v).
If F is differentiable, each Ta,i is linear, and E→0 forces Ei→0 since ∣Ei∣≤∥E∥. So each Fi is differentiable.
Ta is linear exactly when each component Ta,i is a linear function.
Conversely, if each Fi is differentiable with total derivative Ta,i, put Ta=(Ta,1,…,Ta,m), linear, and E=(E1,…,Em)→O.
∥E∥≤∑i∣Ei∣, as in the proof of the component theorem of 5.1.
So Ta(y)=(∇Fi(a)⋅y)i, the matrix-times-vector with rows ∇Fi(a). ■
Theorem above for each scalar field Fi: Ta,i(y)=∇Fi(a)⋅y, which is row i of a matrix times y.
Definition T
Jacobian matrix
For F:S→Rm with all partial derivatives of all components existing at a, the Jacobian matrix of F at a is
Row i is ∇Fi(a). Column j is F′(a;ej), the image of the j-th unit vector, as in 2.5. When F is differentiable, JF(a) is the matrix of F′(a), so F′(a)(y)=JF(a)y. For a scalar field (m=1) it is the single row ∇f(a)T: the gradient is a column and the Jacobian is a row, the distinction flagged in 3.8. When m=n its determinant (2.7) is the Jacobian determinant, the factor by which F scales small areas or volumes.
In one lineThe m×n matrix JF(a) of partial derivatives whose entry in row i and column j is DjFi(a): the matrix of the total derivative.
Why it existsIt turns the abstract linear map F′(a) into a table of numbers you can compute and multiply, which is what the chain rule and backpropagation do.
Worked example Lecture 23
Find the Jacobian matrix of F(x,y,z)=(xysinz,x2) and evaluate F′(a;y) at a=(2,0,π/2).
Solution.
Components and gradients.F1=xysinz has ∇F1=(ysinz,xsinz,xycosz). F2=x2 has ∇F2=(2x,0,0). Each row of the Jacobian is the gradient of one component.
Stack as rows.DF=[ysinz2xxsinz0xycosz0], a 2×3 matrix. Two outputs, three inputs: m×n=2×3.
Plug in a. At (2,0,2π): sinz=1, cosz=0, so DF(a)=[042000]. The derivative at a fixed point is a matrix of numbers, with no x,y,z left in it.
Apply to a direction.F′(a;y)=DF(a)y=(2y2,4y1). Matrix times vector.
Answer.DF(a)=[042000] and F′(a;y)=(2y2,4y1). (This F has continuous partials, so by the theorem later in this chapter it is differentiable.)
Your answerFor F(x,y)=(x2y,x+y), what is the entry in row 1, column 1 of the Jacobian matrix at (1,2)?
Row i, column j is DjFi: differentiate the i-th output in the j-th input.
Row 1 is ∇(x2y)=(2xy,x2), which at (1,2) is (4,1). The entry in row 1, column 1 is D1F1=2xy=4. (The whole matrix is [4111].)
Worked example Practice Final 2013, problem 4
Compute the Jacobian matrix of f(x,y,z)=(log(x+y),cos(2xy),ex2y).
Solution.
Row 1.∇log(x+y)=(x+y1,x+y1,0). z does not appear.
Row 2.∇cos(2xy)=(−2ysin(2xy),−2xsin(2xy),0). Chain rule: derivative of cosu is −sinu times ∂x∂u=2y.
Row 3.∇ex2y=(2xyex2y,x2ex2y,0). Chain rule: eu times ∂x∂u=2xy and ∂y∂u=x2.
Answer.Df=x+y1−2ysin2xy2xyex2yx+y1−2xsin2xyx2ex2y000. The zero column says that f does not change at all in the z direction.
Differentiable implies continuous
Theorem TApostol Thm 8.6 and 8.19; Spagnolie Lecture 21
Differentiable fields are continuous
If F:S→Rm is differentiable at the interior point a, then F is continuous at a.
In one lineIf F is differentiable at a, then F is continuous at a.
Why it is trueIt is the property directional derivatives lacked in 5.2; with it the idea of 'derivative' behaves as in one variable.
ProofApostol 8.6, 8.19
The idea: The change F(a+v) − F(a) equals T_a(v) plus an error. Both are bounded by a constant times ‖v‖ (Cauchy–Schwarz for the linear part), so both vanish as v goes to 0.
F(a+v)−F(a)=Ta(v)+∥v∥E(a,v).
Definition of a differentiable field.
So ∥F(a+v)−F(a)∥≤K∥v∥+∥v∥∥E(a,v)∥.
By the proof of part (c) of 'Building continuous fields' in 5.1, a linear map T satisfies ∥T(v)∥≤K∥v∥ for a constant K. For a scalar field, K=∥∇f(a)∥ by Cauchy–Schwarz: ∣Ta(v)∣=∣∇f(a)⋅v∣≤∥∇f(a)∥∥v∥.
The right side is ∥v∥(K+∥E∥), which tends to 0 as ∥v∥→0.
K is a fixed number and ∥E(a,v)∥→0.
So F(a+v)→F(a): F is continuous at a. ■
Definition of continuity at a.
Quick checkWhich of these is a correct implication for a scalar field at an interior point a?
Differentiable implies continuous, and implies that all directional derivatives exist: that is the theorem. 'Continuous implies differentiable' fails for ∥x∥ at the origin, and 'all directional derivatives exist implies continuous' fails for the field x2+y4xy2 of 5.2.
When does the total derivative exist?
Checking the definition is rarely necessary, because of the following test, which Apostol proves in 8.13 and the lecture left to the book.
Definition A
Continuously differentiable field
A scalar field f is continuously differentiable at a if the partial derivatives D1f,…,Dnf exist in some ball B(a) and are continuous at a. A vector field is if each component is. It is continuously differentiable on a set if it is at every point of it (the class often called C1). Every field built from polynomials, exp, sin, log and so on by sums, products, quotients and composition is continuously differentiable where it is defined, because its partials are again such expressions.
In one lineA scalar field is continuously differentiable at a if its partial derivatives exist in some ball around a and are continuous at a.
Why it existsIt is the condition that is easy to check by looking at the formula, and it is strong enough to give differentiability.
Suppose the partial derivatives D1f,…,Dnf exist in a ball B(a) and are continuous at a. Then f is differentiable at a and f(a+v)=f(a)+∇f(a)⋅v+∥v∥E(a,v) with E(a,v)→0 as v→0.
In one lineIf f is continuously differentiable at a, then f is differentiable at a, with Ta(v)=∇f(a)⋅v.
Why it is trueIt is the practical test: look at the partial derivatives, and if they are continuous, you have a total derivative and every consequence of it.
ProofApostol 8.13
The idea: Move from a to a + v one coordinate at a time. Each move changes only one variable, so the one-variable mean value theorem applies, and produces a partial derivative at a point near a. Continuity of the partials at a makes those partial derivatives close to their values at a.
Define the points p0=a, pk=a+λ(u1e1+⋯+ukek), so pn=a+v.
Let λ=∥v∥>0 and u=v/λ, a unit vector; take v so small that B(a,λ) lies in the ball B(a).
f(a+v)−f(a)=∑k=1n[f(pk)−f(pk−1)].
Telescoping sum: the intermediate values cancel in pairs.
f(pk)−f(pk−1)=λukDkf(ck) for some ck on the segment from pk−1 to pk.
pk and pk−1 differ only in coordinate k, by λuk. The function t↦f(pk−1+tek) is differentiable for t between 0 and λuk, with derivative Dkf there (the partials exist in the ball); so the one-variable mean value theorem of 1.4 applies.If uk=0 the difference is 0 and any point works.
So f(a+v)−f(a)−∇f(a)⋅v=λ∑kuk[Dkf(ck)−Dkf(a)]=∥v∥E(a,v), where E(a,v)=∑kuk[Dkf(ck)−Dkf(a)].
∇f(a)⋅v=λ∑kukDkf(a).
Hence ∣E(a,v)∣≤∑k∣Dkf(ck)−Dkf(a)∣→0 as v→0. ■
Every ck lies within λ=∥v∥ of a (all the points of the path are), so ck→a as v→0; each Dkf is continuous at a; and ∣uk∣≤1.
Proof workshopRebuild the proof that continuous partials give differentiabilityApostol 8.13
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
Walk from a to a + v changing one coordinate at a time.
A telescoping sum: the intermediate values cancel in pairs.
The points p k must be defined before you can write the sum over them.
The two points differ in one coordinate only, so the one-variable mean value theorem applies to that coordinate.
You need the telescoping sum first; this line deals with one term of it.
Substitute the mean value form into the sum and subtract the gradient dot v, which is lambda times the sum of u k times D k f at a.
The mean value form for each term is needed to substitute.
All the points c k lie within the length of v of a, and continuity of the partials at a makes each bracket small.
This is the conclusion; it needs the formula for the error as a sum of brackets.
Watch out· The sufficient condition is not necessary
The converse is false: differentiable does not require continuous partials (example below), and Spagnolie’s Lecture 21 version, ”f is differentiable if f′ is continuous”, is a sufficient condition, not an equivalence (the instructor’s own slip, flagged in the digest). Continuous partials imply differentiable implies continuous, and none of the arrows reverses.
The implication table of homework 12
Worked example MATH 375 HW 12 (Apostol 8.14 #11); the printed keys have errors
For a scalar field f at an interior point a, consider (a) f continuous at a; (b) f differentiable at a; (c) f′(a;y) exists for every y; (d) all first-order partials exist in a neighbourhood of a and are continuous at a; (e) ∇f(a)=O; (f) f(x)=∥x−a∥ for all x. Fill in the table of which statement always implies which.
Solution.
Collect the implications that are theorems. (b) implies (a) and (c): differentiable implies continuous, and implies all directional derivatives exist. (d) implies (b): continuous partials imply differentiable; so (d) implies (a), (b), (c). Theorems of this chapter, plus transitivity.
Find a witness field for each kind of failure. Work at a=O in R2.
F1(x,y)=x: differentiable with continuous partials, and ∇F1=(1,0)=O. It satisfies (a), (b), (c), (d), and fails (e) and (f).
F2=∣xy∣: continuous, both partials are 0 at O (so (e) holds), but F2′(O;(1,1))=limh∣h∣ does not exist. So (c) fails, hence (b) and (d) fail.
F3=x2+y2xy with F3(O)=0: both partials are 0 (so (e) holds), but F3 is not continuous at O (it is 21 on y=x). So (a) fails, and with it (b), (c), (d).
F4=x2+y4xy2 with F4(0,y)=0 (from 5.2): all directional derivatives exist (so (c) holds), the gradient is O (so (e) holds), but it is not continuous, so (a), (b), (d) fail.
F5(x)=∥x∥ (this is (f)): continuous, but F5′(O;y)=limh∣h∣∥y∥ does not exist for y=O. So (c), (b), (d) fail, and the partials do not exist, so (e) fails.
F6=(x2+y2)sinx2+y21 with F6(O)=0: differentiable at O with T=0 (shown below), so (a), (b), (c), (e) hold, but its partial derivatives are not continuous at O, so (d) fails.
Each non-implication needs one example; six fields give all of them.
Read the table off. Row = hypothesis, column = conclusion; a tick means “always implies”.
(a)
(b)
(c)
(d)
(e)
(f)
(a) continuous
✓
(b) differentiable
✓
✓
✓
(c) all f′(a;y) exist
✓
(d) continuous partials
✓
✓
✓
✓
(e) ∇f(a)=O
✓
(f) f=∥x−a∥
✓
✓
Why the blanks are blank: (a) does not imply (b), (c), (d) by F2 or F5, nor (e), (f) by F1. (b) does not imply (d) by F6, nor (e), (f) by F1. (c) does not imply (a) by F4 (so not (b), (d)), nor (e), (f) by F1. (d) does not imply (e), (f) by F1. (e) implies nothing else, by F3. (f) does not imply (b), (c), (d), (e) by F5.
Answer. The table above. The differentiability of F6: ∣F6(v)∣≤∥v∥2, so F6(v)=0+0⋅v+∥v∥E with E=∥v∥sin∥v∥21→0; yet ∂x∂F6=2xsinx2+y21−x2+y22xcosx2+y21, which on the x-axis at xn=1/2πn equals −xn2→−∞. The definition matters for (f). Apostol’s definition of f′(a;y) (8.6) takes h→0 from both sides, and that is the definition of 5.2. With it, hf(a+hy)−f(a)=h∣h∣∥y∥ is +∥y∥ for h>0 and −∥y∥ for h<0, so the limit does not exist. A one-sided derivative would exist and equal ∥y∥, and (f) would then imply (c). The printed keys differ from this table: both versions mark (b) implies (d), which is false (witness F6); both mark row (e) with ticks beyond (e) itself, false (witness F3); and both tick (c) in row (f), which holds only for a one-sided derivative, not for the two-sided limit f′(a;y) used here (witness F5). Apostol’s printed answer, “(b) implies (a) and (c); (d) implies (a), (b), (c); (f) implies (a)”, agrees with the table.
Quick checkWhich field is differentiable at the origin but has partial derivatives that are not continuous there?
Its error is at most ∥v∥2, so the total derivative is 0 and the field is differentiable. Its partials oscillate with growing amplitude near the origin, so they are not continuous. The other two are not differentiable at the origin: the cone has a corner, and x2+y2xy is not even continuous.
The linearization and its error
Definition T
Linearization
If F is differentiable at a, its linearization (linear approximation) at a is L(x)=F(a)+F′(a)(x−a). For a scalar field, L(x)=f(a)+∇f(a)⋅(x−a). The definition says F(x)−L(x)=∥x−a∥E(a,x−a), which is small compared with ∥x−a∥.
In one lineThe affine function L(x)=F(a)+F′(a)(x−a) that approximates a differentiable field F near a.
Why it existsIt replaces a complicated field by a constant plus a matrix times the displacement, which is easy to compute with, and it is exactly the function whose graph is the tangent plane.
Worked example Lecture 21
Linearize F(x,y,z)=x2yez2 about a=(1,2,0) and test it at (1.1,1.9,0.1).
Solution.
Value and partials at a.F(a)=12⋅2⋅e0=2. Fx=2xyez2=4, Fy=x2ez2=1, Fz=x2yez2⋅2z=0. The lecture’s slip: the printed evaluation point (1,1,0) does not give these values; a=(1,2,0) does.
Form the linearization.L(x)=2+4(x−1)+1⋅(y−2)+0⋅z. F(a)+∇F(a)⋅(x−a).
Test at (1.1,1.9,0.1).L=2+0.4−0.1=2.3; the true value is 1.21×1.9×e0.01=2.3221. Error 0.0221.
Error relative to the step.∥v∥=0.01+0.01+0.01=0.1732, so error/∥v∥=0.128. At one tenth of the step, v=(0.01,−0.01,0.01), the point is (1.01,1.99,0.01): the true value is 2.03020, the plane says 2.03, the error is 2.0×10−4 and ∥v∥=0.01732, so the ratio is 0.0117. Shrinking v by a factor of 10 shrinks the error by about 100 and the ratio by about 10: the ratio is proportional to ∥v∥ for a smooth field, which is the second-order behaviour 5.6 explains.
Answer.L(x)=2+4(x−1)+(y−2); L(1.1,1.9,0.1)=2.3 against the true 2.3221.
Your answerUse the linearization L(x)=2+4(x−1)+(y−2) of the example to estimate F(0.9,2.1,0.05).
Substitute x=0.9, y=2.1; the z term has coefficient 0.
L=2+4(−0.1)+0.1=1.7. (The true value is 0.81×2.1×e0.0025≈1.7053.)
Worked example MATH 375 Final Review, 8.18
Linearize the vector field F(x,y,z)=(xyz,x+y+z) about a=(1,2,2).
Solution.
Value.F(a)=(1⋅2⋅2,1+2+2)=(4,5).
Jacobian.DF=[yz1xz1xy1], so DF(a)=[412121]. Gradients of the two components as rows.
Linearization.F(x)≈F(a)+DF(a)(x−a)=(4+4(x−1)+2(y−2)+2(z−2),5+(x−1)+(y−2)+(z−2)). Matrix times the displacement vector (x−1,y−2,z−2).
Check numerically. At (1.1,2.1,1.9) the true value is (4.389,5.1) and the linearization gives (4.4,5.1). Agreement to the first order; the first component is off by 0.011 because xyz has second-order terms.
Answer. As in step 3. The linearization of a vector field is a pair of tangent planes, one for each component.
Python labWatch the error shrink faster than the step, or fail to
import numpy as nprng = np.random.default_rng(1)def smooth(x, y): return x**2 * ydef cone(x, y): return np.hypot(x, y)def sneaky(x, y): return np.where(x == 0, 0.0, x * y**2 / (x**2 + y**4 + 1e-300))def wiggle(x, y): s = x**2 + y**2 return np.where(s == 0, 0.0, s * np.sin(1 / np.where(s == 0, 1, s)))cases = [("x^2 y at (1,2), gradient (4,1)", smooth, (1.0, 2.0), (4.0, 1.0)), ("cone at 0, 'gradient' (0,0)", cone, (0.0, 0.0), (0.0, 0.0)), ("sneaky at 0, gradient (0,0)", sneaky, (0.0, 0.0), (0.0, 0.0)), ("(x^2+y^2) sin(1/(x^2+y^2)) at 0, gradient (0,0)", wiggle, (0.0, 0.0), (0.0, 0.0))]th = rng.uniform(0, 2 * np.pi, 4000)print("worst error/|v| over 4000 random directions and the two parabolas x = +-y^2")print(f"{'':52s}" + "".join(f" |v|={r:7.0e}" for r in (1e-1, 1e-2, 1e-3, 1e-4)))for name, f, a, g in cases: row = [] for r in (1e-1, 1e-2, 1e-3, 1e-4): vx, vy = r * np.cos(th), r * np.sin(th) # also points on the parabolas x = +-y^2 at distance about r vx = np.concatenate([vx, [r**2, -r**2]]); vy = np.concatenate([vy, [r, r]]) err = np.abs(f(a[0] + vx, a[1] + vy) - f(*a) - (g[0] * vx + g[1] * vy)) / np.hypot(vx, vy) row.append(err.max()) print(f"{name:52s}" + "".join(f" {e:11.2e}" for e in row))
Try this.Run it. For x²y the ratio error/|v| falls by 10 each time |v| falls by 10: the error is of second order. For the cone and the sneaky function it does not fall: no linear map approximates them. Notice for the cone that the ratio is exactly 1 for every |v|: whatever 'gradient' you guess, the corner defeats it. For (x²+y²) sin(1/(x²+y²)) the ratio falls even though the partials misbehave. Try changing the guessed gradient for the smooth case to (4.1, 1): the ratio then stops falling and levels off near 0.1, because a wrong linear map leaves a first-order error.
Let r:(α,β)→Rn be differentiable at t (each coordinate has a derivative, r′(t) is the vector of those derivatives) and let f be a scalar field differentiable at a=r(t). Then g=f∘r is differentiable at t and
g′(t)=∇f(r(t))⋅r′(t).
In one lineIf r is differentiable at t and f is differentiable at r(t), then g(t)=f(r(t)) has g′(t)=∇f(r(t))⋅r′(t).
Why it is trueIt is the chain rule for a path, and the tool that proves the gradient is perpendicular to level sets; it is the special case m=1, ninput=1 of the chain rule of 5.4.
ProofSpagnolie Lecture 22; Apostol 8.15
The idea: Put v = r(t+h) − r(t) into the first-order formula for f at a, divide by h, and let h go to 0. The linear part gives the dot product with r′; the error part is a bounded ratio times a quantity that goes to 0.
g(t+h)−g(t)=∇f(a)⋅v(h)+∥v(h)∥E(a,v(h)).
Differentiability of f at a=r(t), with the step v(h)=r(t+h)−r(t).
hg(t+h)−g(t)=∇f(a)⋅hv(h)+h∥v(h)∥E(a,v(h)).
Divide by h.
The first term tends to ∇f(a)⋅r′(t).
r is differentiable at t, so hv(h)→r′(t) (componentwise, then the dot product is a limit by the limit laws of 5.1).
The second term has absolute value at most (bounded) ×∥E(a,v(h))∥→0.
∣h∣∥v(h)∥=hv(h)→∥r′(t)∥ is bounded, and v(h)→O (since r is continuous at t), so E(a,v(h))→0.If v(h)=O the term is 0 because E(a,O)=0 by convention.
So g′(t)=∇f(r(t))⋅r′(t). ■
Sum of the two limits.
Worked example Lecture 22
Let r(t)=(t,1/t) for t>0 and f(x,y)=x2+y2. Find g′(t) for g=f∘r, and interpret it.
Solution.
Gradient and velocity.∇f=(2x,2y), which at r(t) is (2t,t2). r′(t)=(1,−t21). Differentiate each coordinate.
Dot.g′(t)=2t⋅1+t2⋅(−t21)=2t−t32. The path rule.
Check directly.g(t)=t2+t−2, so g′(t)=2t−2t−3. Same answer, as it must be.
Interpret.g′(t)=0 at t=1, the point (1,1) of the hyperbola closest to the origin; g′(t)→−∞ as t→0+ and +∞ as t→∞. g is the squared distance from the origin to the moving point: it falls, reaches its minimum 2 at (1,1), then rises.
Answer.g′(t)=2t−t32, zero exactly when the path touches a level circle of f tangentially (at (1,1)).
Your answerFor r(t)=(t,1/t) and f=x2+y2, what is dtdf(r(t)) at t=2?
g′(t)=2t−t32=4−82=3.75.
Worked example MATH 375 HW 13 (Apostol 8.17 #1 and #2a)
With u=f(x,y), x=X(t), y=Y(t) and F(t)=f(X(t),Y(t)), express F′ and F′′; then evaluate for f=x2+y2, X=t, Y=t2.
Solution.
First derivative. By the path theorem with r=(X,Y): F′(t)=fxX′+fyY′, the partials evaluated at (X(t),Y(t)). Gradient dotted with velocity.
Second derivative: product rule.F′′=(dtdfx)X′+fxX′′+(dtdfy)Y′+fyY′′. Each product fx⋅X′ is a product of two functions of t.
The partials are themselves composite. Apply the path theorem again, to the scalar fields fx and fy: dtdfx=fxxX′+fxyY′ and dtdfy=fyxX′+fyyY′ (with the order of differentiation as in 5.2). This is the step the homework warned about: fx(X(t),Y(t)) also depends on t.
Collect. If fxy=fyx (true when they are continuous): F′′=fxxX′2+2fxyX′Y′+fyyY′2+fxX′′+fyY′′.
The example.fx=2x, fy=2y, fxx=fyy=2, fxy=0; X′=1, X′′=0, Y′=2t, Y′′=2. So F′=2t⋅1+2t2⋅2t=2t+4t3 and F′′=2⋅1+2⋅(2t)2+0+2t2⋅2=2+12t2. Check: F=t2+t4 directly.
Answer.F′=fxX′+fyY′; F′′=fxxX′2+2fxyX′Y′+fyyY′2+fxX′′+fyY′′; for the example F′=2t+4t3 and F′′=2+12t2, as in Apostol’s answers.
Worked example MATH 375 Fall 2025 final, problem 5
A buoy at position (X(t),Y(t)) measures a temperature f(x,y,t) that also changes in time. Find dtdf(X(t),Y(t),t); evaluate for f=xt and (X,Y)=(t,0).
Solution.
The curve in (x,y,t) space.r(t)=(X(t),Y(t),t), with velocity r′(t)=(X′,Y′,1). Time is also a coordinate; its velocity is 1.
Apply the path theorem.g′(t)=fxX′+fyY′+ft, all evaluated at (X(t),Y(t),t). Gradient in three variables dotted with (X′,Y′,1).
Meaning.fxX′+fyY′ is the change due to the buoy’s motion; ft is the change that the temperature has at a fixed place even if the buoy sits still. Stand outside for a while and see the temperature change without moving.
The example.f=xt: fx=t, fy=0, ft=x. With X=t, Y=0: g′=t⋅1+0+t=2t. Check: g(t)=t⋅t=t2, g′=2t.
Answer.g′=fxX′+fyY′+ft. The forgotten term on the exam was ft.
Level sets, normals and tangent planes
Theorem TApostol 8.16; Spagnolie Lecture 22
The gradient is perpendicular to level sets
Let f be differentiable on an open set S and let r be a differentiable curve with f(r(t))=c for all t near t0. Put a=r(t0). Then ∇f(a)⋅r′(t0)=0.
In one lineIf f is differentiable at a and r is a curve in the level set f=c through a, then ∇f(a)⋅r′(t0)=0: the gradient is perpendicular to the tangent vector of every such curve.
Why it is trueIt is the geometric content of 'steepest ascent': since f does not change along a level curve, the direction in which it changes most must be at right angles to it.
ProofApostol 8.16; Lecture 22
The idea: The function g(t) = f(r(t)) is constant, so its derivative is 0; the path theorem says that derivative is the dot product.
g(t)=f(r(t)) is constant near t0, so g′(t0)=0.
By hypothesis f(r(t))=c.
Also g′(t0)=∇f(r(t0))⋅r′(t0).
Rate of change along a curve.
So ∇f(a)⋅r′(t0)=0. ■
Equate the two.
Definition T
Tangent plane
Let a lie on the level surface L(c)={f=c} of a differentiable scalar field on R3 with ∇f(a)=O. By the theorem, the tangent vectors at a of all curves lying in L(c) are perpendicular to ∇f(a), so they all lie in the plane through a with normal vector ∇f(a). (That they fill the whole plane, that is, that every direction in the plane is the velocity of some curve on the surface, is the content of the implicit function theorem, which comes later; Apostol assumes it in 8.16.) This plane is the tangent plane of the surface at a:
For a level curve of a field on R2 the same formula gives the tangent line. For the graph z=f(x,y), view it as the level set F=0 of F(x,y,z)=f(x,y)−z, with ∇F=(fx,fy,−1): the tangent plane is z=f(a1,a2)+∇f(a1,a2)⋅((x,y)−(a1,a2)), the graph of the linearization.
In one lineFor a level surface f(x,y,z)=c and a point a on it with ∇f(a)=O, the tangent plane is {x:∇f(a)⋅(x−a)=0}; in the plane the tangent line to a level curve is defined the same way.
Why it existsIt is the plane that contains the tangent vector of every curve on the surface through a; for a graph it is the plane of the linearization.
Quick checkFor f(x,y)=xy, the level curve through (1,1) is xy=1. In which direction does it run at (1,1)?
The gradient (1,1) points away from the origin, and the hyperbola xy=1 crosses the diagonal at a right angle at (1,1), so its direction is (1,−1) (slope −1: from y=1/x, y′=−1/x2=−1).
Worked example Lecture 22
Find the tangent plane to x2+y2+(z/2)2=49 at a=(1,1,1).
Solution.
Check that a is on the surface.1+1+41=49. f(x,y,z)=x2+y2+(z/2)2 and c=49.
Gradient.∇f=(2x,2y,z/2), so ∇f(a)=(2,2,21). The normal vector.
Plane.2(x−1)+2(y−1)+21(z−1)=0, that is 2x+2y+21z=29. 2+2+21=29.
Answer.2x+2y+21z=29. (It is linear in x,y,z; if yours has squares, you made a slip, as Spagnolie said. And it does not pass through the origin, so it is not a subspace.)
Worked example Practice Final 2013, problem 5
Write an equation of the plane tangent to the surface x3y+z2=3 at a=(−1,1,2).
Solution.
Check.(−1)3⋅1+4=3. a lies on the surface.
Gradient.∇(x3y+z2)=(3x2y,x3,2z), which at a is (3,−1,4).
Plane.3(x+1)−(y−1)+4(z−2)=0, that is 3x−y+4z=4. −3−1+8=4 is the check that a satisfies the equation.
Answer.3x−y+4z=4.
Worked example MATH 375 HW 13 (Apostol 8.17 #4)
Find a normal vector to the surface z=x2+y2+(x2+y2)3/2 at a general point other than the origin, and the limit of the cosine of its angle with the z-axis as the point tends to the origin.
Solution.
Make it a level set.G(x,y,z)=x2+y2+(x2+y2)3/2−z=0. A graph z=h(x,y) is the zero level set of h−z.
Gradient. With ρ=x2+y2: Gx=ρx+3ρx=ρx(1+3ρ2), similarly Gy=ρy(1+3ρ2), and Gz=−1. ∂x∂ρ=ρx (5.2).
Normal vector.V=∇G=ρ1+3ρ2(x,y,0)+(0,0,−1); any scalar multiple will do. Normal to the tangent plane at each point.
Length.∥(Gx,Gy)∥=ρ(1+3ρ2)⋅ρ=1+3ρ2, so ∥V∥2=(1+3ρ2)2+1. ∥(x,y)∥=ρ.
Cosine with the z-axis.cosθ=∥V∥∣V⋅k∣=(1+3ρ2)2+11 (taking the angle with the upward normal), which tends to 21 as ρ→0. Set ρ=0.
Answer.V=(ρ(1+3ρ2)x,ρ(1+3ρ2)y,−1) and cosθ→21, so θ→4π: near the origin the surface is cone-like, with slope 45∘ (it behaves like z≈ρ).
Worked example MATH 375 HW 13 (Apostol 8.17 #8); the printed key writes $a^2$ for $a^3$ by mistake
Find the tangent plane to xyz=a3 at (x0,y0,z0) and show the tetrahedron it cuts from the first octant has volume 29a3.
Solution.
Gradient.∇(xyz)=(yz,xz,xy), so at the point it is (y0z0,x0z0,x0y0). The normal vector.
Plane.y0z0(x−x0)+x0z0(y−y0)+x0y0(z−z0)=0. Expand and use x0y0z0=a3: y0z0x+x0z0y+x0y0z=3x0y0z0. Each of the three terms contributes −x0y0z0 on the right.
Divide by x0y0z0.x0x+y0y+z0z=3. The intercept form of a plane.
Intercepts.(3x0,0,0), (0,3y0,0), (0,0,3z0). Set two of x,y,z to 0.
Volume.31⋅base⋅height=31⋅21(3x0)(3y0)⋅3z0=627x0y0z0=29a3. A tetrahedron with three mutually perpendicular edges of lengths p,q,s has volume 6pqs.
Answer.x0x+y0y+z0z=3; the volume is 29a3, independent of the point.
Worked example
Find the tangent plane to the graph z=excosy at the point (0,0,1).
Solution.
Check the point.e0cos0=1, so (0,0,1) is on the graph. The third coordinate must equal f(0,0).
Partials of f(x,y)=excosy.fx=excosy and fy=−exsiny, which at (0,0) are 1 and 0. Both partials are continuous, so f is differentiable there and the linearization is the tangent plane.
Use the graph formula.z=f(0,0)+fx(0,0)(x−0)+fy(0,0)(y−0)=1+x. The tangent plane of a graph is the graph of the linearization.
Cross-check as a level surface. With G(x,y,z)=excosy−z we have ∇G(0,0,1)=(1,0,−1), and 1⋅x+0⋅y−1⋅(z−1)=0 gives the same plane z=1+x. The two descriptions of a tangent plane agree, as the definition promised.
Answer.z=1+x, that is x−z=−1.
Worked example Apostol 8.17 #3(a); the printed answer is $-\frac23$
Find the directional derivative of f(x,y,z)=3x−5y+2z at (2,2,1) in the direction of the outward normal to the sphere x2+y2+z2=9.
Solution.
Check the point is on the sphere.4+4+1=9. Otherwise “the normal to the sphere at the point” would make no sense.
Find the normal. The sphere is the level set g=9 of g(x,y,z)=x2+y2+z2, and ∇g=(2x,2y,2z) is (4,4,2) at the point. The gradient is perpendicular to the level surface. It points outward because g grows as we move away from the origin.
Make it a unit vector.∥(4,4,2)∥=36=6, so u=6(4,4,2)=3(2,2,1). A directional derivative needs a unit vector. Here the outward normal is the position vector divided by the radius 3.
Gradient of f.f is linear, so ∇f=(3,−5,2) at every point. The linear field a⋅x has gradient a (example in 5.2).
Dot.f′(a;u)=∇f⋅u=33⋅2−5⋅2+2⋅1=3−2. Differentiable, so f′(a;u)=∇f(a)⋅u.
Answer.−32, which is the answer printed at the back of the book. The negative sign says f decreases as we leave the sphere in the outward direction.
Worked example Apostol 8.17 #10, with new numbers
Find c so that the spheres x2+y2+z2=4 and (x−c)2+y2+z2=1 meet at right angles: at every common point their tangent planes are perpendicular.
Solution.
Normals. Take the spheres as level sets. The normal of the first at (x,y,z) is V1=2(x,y,z), and of the second V2=2(x−c,y,z). Gradients of the two defining expressions.
Perpendicular planes. Two planes are perpendicular exactly when their normals are, so we need V1⋅V2=0: x(x−c)+y2+z2=0, that is (x2+y2+z2)−cx=0. Dot product of the normals.
Use the first sphere.x2+y2+z2=4, so the condition is 4−cx=0, that is cx=4 at every common point. The point is on the first sphere.
Use the second sphere. Expanding, x2+y2+z2−2cx+c2=1, so 4−2cx+c2=1. With cx=4 this is 4−8+c2=1. The point is also on the second sphere, and step 3 gives the value of cx.
Solve.c2=5, so c=±5. Check with geometry: spheres meet at right angles when the distance between centres satisfies d2=r12+r22, here c2=4+1.
Answer.c=±5.
Worked example Apostol 8.17 #9, with new surfaces
Find a pair of linear equations for the line tangent to both surfaces x2+y2+z2=3 and z=xy at the point (1,1,1).
Solution.
Check the point.1+1+1=3 and 1⋅1=1. It lies on both surfaces.
First tangent plane.∇(x2+y2+z2)=(2,2,2) at the point, so the plane is 2(x−1)+2(y−1)+2(z−1)=0, that is x+y+z=3. Tangent plane of a level surface.
Second tangent plane. Write z=xy as the level set of G=xy−z at 0: ∇G=(y,x,−1)=(1,1,−1), so (x−1)+(y−1)−(z−1)=0, that is x+y−z=1. The graph is a level set of f(x,y)−z.
The common tangent line lies in both planes. Its equations are the two plane equations together. A line tangent to both surfaces has its direction perpendicular to both normals, so it lies in both tangent planes.
Check the direction. A direction (p,q,r) perpendicular to both normals needs p+q+r=0 and p+q−r=0, so r=0 and q=−p: the line runs in the direction (−1,1,0). Moving by (−1,1,0) keeps both x+y+z and x+y−z fixed, so we stay in both planes.
Answer.x+y+z=3 and x+y−z=1 (the line through (1,1,1) with direction (−1,1,0)).
Watch out· Partial derivatives are not enough for a tangent plane
For f=∣xy∣ both partial derivatives are 0 at the origin, which suggests the tangent plane z=0. But cutting the graph by the plane x=y gives z=∣x∣, which has a corner (5.2, stretch problem; Apostol 8.17 #6). The surface has no tangent plane at the origin because f is not differentiable there. The tangent plane exists exactly when the field is differentiable.
Vector fields and the Jacobian at work
Worked example Lecture 23 (polar coordinates); Jacobi 1841
Find the Jacobian matrix of the polar-coordinate map P(r,θ)=(rcosθ,rsinθ) and its determinant.
Solution.
Components.x=rcosθ, y=rsinθ. P:R2→R2, so the Jacobian is 2×2.
Matrix.JP=[cosθsinθ−rsinθrcosθ]. Row 1: gradient of x; row 2: gradient of y.
Determinant.detJP=rcos2θ+rsin2θ=r. cos2+sin2=1.
Answer.detJP=r. A small rectangle of sides dr and dθ is sent to a patch of area about rdrdθ: the factor r in the area element of polar coordinates. For example the quarter-annulus 1≤r≤2, 0≤θ≤2π has area ∫∫rdrdθ=2π⋅24−1=43π, which is 41π(22−12).
Your answerThe Jacobian determinant of the polar-coordinate map is r. At the point r=3, by what factor are small areas multiplied?
detJP=r=3. A tiny square of side ϵ in the (r,θ) plane has area ϵ2; its image in the (x,y) plane is nearly a rectangle with sides ϵ and 3ϵ, of area 3ϵ2.
Worked example MATH 375 HW 13 (Apostol 8.22 #13)
(a) If f(x,y,z)=(x,y,z), show Df=I. (b) Find all differentiable f:R3→R3 with Df=I. (c) Find all those with Df diagonal, diag(p(x),q(y),r(z)).
Solution.
(a)(Df)ij=Djfi with f1=x, f2=y, f3=z: Djfi=1 if i=j and 0 otherwise. So Df=I. The identity field has the identity matrix as its derivative, as a linear map is its own derivative.
(b) Row by row.Df=I means D1f1=1, D2f1=D3f1=0. The last two say f1 does not depend on y or z (a field with D2f1=D3f1=0 is constant in those variables on a ball, by the mean value theorem of 5.2), so f1=g(x); then g′=1, g=x+c1. Integrate the one-variable equation.
(b) The other rows. Likewise f2=y+c2 and f3=z+c3. So f(x,y,z)=(x,y,z)+c for a constant vector c. Translations are the only fields whose derivative is the identity everywhere.
(c) Off-diagonal entries 0 mean f1 depends only on x, f2 only on y, f3 only on z, with f1′=p, f2′=q, f3′=r. So f=(P(x),Q(y),R(z)) with P′=p, Q′=q, R′=r: antiderivatives, each up to a constant. The key stops at “f_i depends on one variable”; the last step is the fundamental theorem of calculus (1.5).
Answer. (a) Df=I. (b) f(x)=x+c. (c) f(x,y,z)=(P(x),Q(y),R(z)) where P,Q,R are antiderivatives of p,q,r.
Same idea elsewhere· Lecture 19's fluid flow was a Jacobian all along
In the first Lecture 19, the velocity of a steady linear flow is u(x)=xA for a matrix A (a row vector times A). As a column, u=ATx, a linear field, so by the example above its Jacobian is the constant matrix AT. Splitting A into its symmetric and antisymmetric parts E+R is splitting the Jacobian of the velocity field into stretching (the symmetric part, whose eigenvectors are the axes along which a ball of fluid is stretched or squeezed) and rotation (the antisymmetric part). The picture above, with the field (2x+y,x+2y), is exactly the lecture’s example: A=[2112], eigenvalues 3 and 1, directions (1,1) and (1,−1). A circle of fluid becomes an ellipse stretched most along the diagonal.
Where it is used
Used inside maths· Inside maths: the chain rule, the inverse function theorem, and changes of variables
The next chapter (5.4) proves the chain rule D(F∘G)(a)=DF(G(a))DG(a): the Jacobian of a composition is the product of the Jacobians, with the same proof idea as the one-variable chain rule of 1.4 now that “derivative” means “linear map”. The inverse function theorem says a C1 map F:Rn→Rn with detDF(a)=0 is invertible near a: a map that is locally a good linear map with an invertible matrix is locally invertible. The determinant is the factor in the change of variables formula for integrals (the r of polar coordinates). Total derivatives also give the second-order Taylor formula (the Hessian, 5.6), and the second-derivative test combines this with the eigenvalues of 3.1 and 3.2.
Used in the real world· Robotics, fluids and AI: the Jacobian as 'speed in, speed out'
A robot arm with two links of length 1 m has joint angles θ1,θ2 and hand position (x,y)=(cosθ1+cos(θ1+θ2),sinθ1+sin(θ1+θ2)). Its Jacobian is
At θ1=0, θ2=2π the matrix is [−11−10] and joint speeds (0.1,0.2) rad/s move the hand at J(0.1,0.2)=(−0.3,0.1) m/s. When the arm is stretched out straight (θ2=0), detJ=0: the hand cannot move along the arm, and no joint speeds produce such a motion. These are the singular positions that robot controllers avoid, found by solving detJ=0.
In fluid mechanics (Lecture 19) the Jacobian of the velocity field is the velocity gradient: its trace is the rate at which volume grows, and for u=xA with A=210120000 (eigenvalues 3,1,0) a unit ball of fluid becomes, after time t, an ellipsoid with semi-axes e3t,et,1; at t=0.5 they are 4.48,1.65,1 and the volume has grown by e4t=e2≈7.39. In machine learning, a layer h↦σ(Wh+b) is a differentiable map whose Jacobian is diag(σ′)W; backpropagation (3.8) multiplies these Jacobians from the loss backwards.
Traps
Watch out· The derivative is a map, not a number
For F:Rn→Rm the derivative at a is a linear map (an m×n matrix of numbers). The gradient ∇f(a) is a column (n×1), the Jacobian of the same f is the row ∇f(a)T (1×n). Check shapes before multiplying.
Watch out· Existing partial derivatives do not give the total derivative
Having ∇f(a) is not the same as being differentiable. Differentiability needs the error to be small along every path. Continuous partials near a is a quick sufficient test; it is not necessary, and failing it proves nothing.
Watch out· Non-smooth level sets do not mean non-differentiable
Fall 2025 final, true or false: “if the level sets of f are not smooth then f is not differentiable” is false. Take f(x)=e−1/x for x>0 and f(x)=0 for x≤0, infinitely differentiable, whose zero level set is a half-line that stops abruptly; and f(x)f(y) has level sets with corners. The theorem that level sets are smooth surfaces needs ∇f=O (the implicit function theorem), and the theorem says nothing when ∇f=O.
Watch out· Divide by the length of the step, not by the step
The error condition is ∥v∥∥error∥→0. You cannot divide by a vector. A bound such as “error ≤C∥v∥2” suffices.
Watch out· Do not forget the explicit time variable
If the field depends on time as well as position, the derivative along the path has an extra term ft (the buoy on the final). The velocity of the curve (X(t),Y(t),t) in space-time has a last entry 1.
Watch out· A tangent plane needs a nonzero gradient
If ∇f(a)=O then ∇f(a)⋅(x−a)=0 is not a plane. The level set can have a corner or a crossing there: the level set of x2−y2 through the origin is two crossing lines.
Problems
check
State F′(a) (as a matrix) for F(x,y)=(3x−y,2y,x+5y).
Solution
F is linear, F(x)=Ax with A=301−125, so F′(a)=A for every a. It is 3×2: three outputs, two inputs.
check
Find the Jacobian of F(x,y)=(x2y,x+y) at (1,2) and the linearization there.
Solution
DF=[2xy1x21], so DF(1,2)=[4111] and F(1,2)=(2,3). L(x,y)=(2+4(x−1)+(y−2),3+(x−1)+(y−2)).
check
Find the tangent plane to the graph z=x2+y2 at (1,2,5).
Solution
f=x2+y2, ∇f(1,2)=(2,4), so z=5+2(x−1)+4(y−2), that is 2x+4y−z=5.
checkMATH 375 HW 12 (Apostol 8.14 #11)
True or false: if f has continuous partial derivatives near a, then f is continuous at a. Is the converse true?
Solution
True: continuous partials imply differentiable, and differentiable implies continuous. The converse is false: ∥x∥ is continuous at the origin but its partials do not exist there.
useMATH 375 HW 13 (Apostol 8.17 #10)
Find the constant c such that at any intersection point of the spheres (x−c)2+y2+z2=3 and x2+(y−1)2+z2=1 the tangent planes are perpendicular.
Solution
Normals: V1=2(x−c,y,z) and V2=2(x,y−1,z). The planes are perpendicular exactly when V1⋅V2=0, that is x(x−c)+y(y−1)+z2=0. Expanding the second sphere, x2+y2−2y+1+z2=1, gives x2+y2+z2=2y. Substituting this into the condition: 2y−cx−y=0, so y=cx. So every intersection point must lie on the plane y=cx. Now expand the first sphere, x2−2cx+c2+y2+z2=3, and substitute x2+y2+z2=2y: 2y−2cx+c2=3. With y=cx the x-terms cancel and c2=3, so c=±3. (Check: two spheres meet at right angles exactly when d2=r12+r22 for the distance d between their centres (c,0,0) and (0,1,0); here c2+1=3+1. Apostol’s answer is the same.)
useApostol 8.17 #9
Find a pair of linear equations for the line tangent to both surfaces x2+y2+2z2=4 and z=ex−y at the point (1,1,1).
Solution
Both surfaces pass through (1,1,1) (1+1+2=4 and e0=1). First surface G1=x2+y2+2z2: ∇G1=(2x,2y,4z)=(2,2,4), tangent plane 2(x−1)+2(y−1)+4(z−1)=0, that is x+y+2z=4. Second surface G2=z−ex−y: ∇G2=(−ex−y,ex−y,1)=(−1,1,1), tangent plane −(x−1)+(y−1)+(z−1)=0, that is −x+y+z=1. The common tangent line lies in both planes: x+y+2z=4, −x+y+z=1.
useApostol 8.17 #7
Show that the tangent plane to the surface z=xy at a point (x0,y0,z0) contains the two lines y=y0,z=y0x and x=x0,z=x0y.
Solution
Plane: z=x0y0+y0(x−x0)+x0(y−y0) (graph of the linearization, ∇(xy)=(y,x)). The first line has points (x,y0,y0x): substituting, the right side is x0y0+y0(x−x0)+0=y0x, which equals z. The second line has points (x0,y,x0y): the right side is x0y0+0+x0(y−y0)=x0y, equal to z. Both lines lie in the plane (and on the surface).
useApostol 8.17 #3(b)
Find the directional derivative of f(x,y,z)=x2−y2 at a general point of the sphere x2+y2+z2=4, in the direction of the outward normal at that point.
Solution
The outward normal is ∇(x2+y2+z2)=2(x,y,z), of length 2x2+y2+z2=4 on the sphere, so u=2(x,y,z). Also ∇f=(2x,−2y,0). So f′(a;u)=22x⋅x−2y⋅y+0=x2−y2, which is Apostol’s answer.
stretchApostol 8.17 #3(c)
Find 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
Both surfaces contain (3,4,5): 18+32−25=25 and 9+16=25. The curve lies on both, so its tangent is perpendicular to both gradients (a curve in a level set has velocity perpendicular to the gradient). The normals are N1=(4x,4y,−2z)=(12,16,−10) and N2=(2x,2y,−2z)=(6,8,−10). We need T=(p,q,r) with N1⋅T=12p+16q−10r=0 and N2⋅T=6p+8q−10r=0. Subtracting gives 6p+8q=0, so (p,q)=t(−4,3), and then r=0. So the unit tangent is ±(−4,3,0)/5. Now ∇f=(2x,2y,−2z)=(6,8,−10), and ∇f⋅(−4,3,0)/5=5−24+24=0. The answer is 0, as in Apostol. (The reason: f=x2+y2−z2 is 0 on the second surface, so f is constant along the curve.)
use
Using the Jacobian of the polar map, find the area of the region {1≤x2+y2≤4,x≥0,y≥0}. How does the result relate to the area of a full disc of radius 2?
Solution
In polar coordinates the region is 1≤r≤2, 0≤θ≤2π and the area element is rdrdθ (the Jacobian determinant). Area =∫0π/2∫12rdrdθ=2π⋅24−1=43π. A full disc of radius 2 has area 4π; the region is the quarter (π) of the disc minus the quarter of the unit disc (4π): π−4π=43π. Same.
prove
Prove that if f and g are differentiable at a with total derivatives Ta and Sa, then f+g is differentiable at a with total derivative Ta+Sa.
Solution
Plan. Add the two defining equations.
f(a+v)=f(a)+Ta(v)+∥v∥Ef and g(a+v)=g(a)+Sa(v)+∥v∥Eg with Ef,Eg→0. Adding: (f+g)(a+v)=(f+g)(a)+(Ta+Sa)(v)+∥v∥(Ef+Eg). The sum of two linear maps is linear and Ef+Eg→0. ■
proveMATH 375 HW 12 (Apostol 8.14 #10a) via 5.2
Prove: if f is differentiable at every point of a ball B(a,r) and ∇f(x)=O for every x in the ball, then f is constant on the ball.
Solution
Plan. A differentiable field has f′(x;y)=∇f(x)⋅y; here that is 0 for every y, so the result of 5.2 applies.
By the dot-product theorem, f′(x;y)=∇f(x)⋅y=0 for all x in the ball and all y. By the problem of 5.2 (mean value theorem for scalar fields applied on the segment from a to x, which lies in the ball), f(x)−f(a)=f′(z;x−a)=0. So f(x)=f(a) for every x in the ball. ■
proveApostol 8.17 #11
If r1,r2 are the distances from a point (x,y) of an ellipse to its foci F1,F2, then r1+r2 is constant. Show that the unit tangent T satisfies T⋅∇(r1+r2)=0, and deduce that the tangent makes equal angles with the lines to the two foci.
Solution
Plan. The ellipse is a level curve of r1+r2; the gradient of a distance is a unit vector pointing away from the focus.
The ellipse is the level set r1+r2=const, so by the theorem of this chapter the gradient is perpendicular to the tangent: T⋅∇(r1+r2)=0. By Apostol 8.14 #8 (5.2), ∇ri=ui, the unit vector from the focus Fi to the point. So T⋅u1=−T⋅u2, that is cosα1=−cosα2 for the angles αi between T and ui. The angle between the tangent line and the segment from the point back to focus 1 equals the angle between the tangent line and the segment back to focus 2. This is the reflection property: light from one focus bounces off the ellipse to the other. ■
proveApostol 8.17 #12
If ∇f(x,y,z) is always parallel to r=(x,y,z), show that f(0,0,a)=f(0,0,−a).
Solution
Plan. Walk along a half-circle on the sphere of radius a from (0,0,a) to (0,0,−a) and show f does not change.
Let r(t)=(asint,0,acost), 0≤t≤π. Then ∇f(r(t))=λ(t)r(t) for some scalar λ(t) (parallel to the position vector), and r′(t)=(acost,0,−asint). By the path theorem dtdf(r(t))=λ(t)r(t)⋅r′(t)=λ(t)(a2sintcost−a2costsint)=0. So f(r(t)) is constant on [0,π] (1.4), and f(r(0))=f(0,0,a)=f(r(π))=f(0,0,−a). ■
proveMATH 375 HW 12 style (Apostol 8.14 #11, the non-implication (b) does not imply (d))
Prove that f(x,y)=(x2+y2)sinx2+y21 (with f(0,0)=0) is differentiable at the origin but its partial derivatives are not continuous there.
Solution
Plan. Differentiability by the size of f; discontinuity by the explicit formula for fx on the axis.
Since ∣sin∣≤1, ∣f(v)∣≤∥v∥2. So f(v)=f(0)+0⋅v+∥v∥E(v) with E(v)=∥v∥sin∥v∥21, and ∣E∣≤∥v∥→0: differentiable at O with TO=0, so ∇f(O)=O. For (x,y)=O, with ρ2=x2+y2: fx=2xsinρ21−ρ22xcosρ21. On the x-axis at xn=(2πn)−1/2: sinxn21=sin2πn=0 and cos2πn=1, so fx(xn,0)=−xn2→−∞, not tending to fx(O)=0. So fx is not continuous at the origin. ■
stretch
Show that F(x,y)=(x2−y2,2xy) has Jacobian determinant 4(x2+y2) and that JF is always a scalar multiple of a rotation matrix. (Hint: compare F with z↦z2 for z=x+iy in the complex numbers of 0.6.)
Solution
JF=[2x2y−2y2x] and detJF=4x2+4y2. Writing 2x2+y2=s, JF=s[cosϕsinϕ−sinϕcosϕ] with (cosϕ,sinϕ)=(x,y)/x2+y2: a rotation by ϕ scaled by s. So F maps every tiny circle to a tiny circle, rotated by the argument of z and scaled by 2∣z∣: this is the derivative of z2, which is multiplication by 2z. The map preserves angles (is conformal), a property that holds for every complex-differentiable function.
stretchPractice Final 2013, extra credit
Is every C1 vector field g:R2→R2 the gradient of some scalar field? Show that g(x,y)=(−y,x) is not a gradient of any twice continuously differentiable f.
Solution
If g=∇f with f having continuous second partials, then g1=fx, g2=fy, so D2g1=fxy and D1g2=fyx, which are equal for continuous second partials (the equality theorem of 5.2’s box). For g=(−y,x): D2g1=−1 but D1g2=+1. They differ, so no such f exists. The condition Djgi=Digj is necessary; the field (−y,x) is the rotation field of the first picture, and going once around the origin with it never returns to the same “height”, which is why it cannot be the gradient of a function.
Summary
A field F is differentiable at a if F(a+v)=F(a)+Ta(v)+∥v∥E(a,v) with Ta linear and E→0 as v→0. The linear map Ta is the total derivativeF′(a): the best linear approximation, with an error that is small compared with ∥v∥.
If f is differentiable, then f′(a;y) exists for every y and f′(a;y)=Ta(y)=∇f(a)⋅y. So Ta is unique and the gradient formula of 5.2 is a theorem. Differentiable fields are continuous.
A vector field is differentiable exactly when its components are, and the matrix of F′(a) is the Jacobian matrixJF(a) with (i,j) entry DjFi(a): rows are gradients, columns are F′(a;ej). For a scalar field it is the row ∇fT.
Continuous partial derivatives near a imply differentiable at a (Apostol 8.13, proved by moving one coordinate at a time with the one-variable mean value theorem). The converse fails. Chain of implications: C1⇒ differentiable ⇒ continuous and all directional derivatives exist; no arrow reverses (the table of HW 12).
The linearizationL(x)=F(a)+F′(a)(x−a) is the best affine approximation; for a scalar field its graph is the tangent planez=f(a)+∇f(a)⋅(x−a).
Along a curve, dtdf(r(t))=∇f(r(t))⋅r′(t). Hence the gradient is perpendicular to every level set, and the tangent plane to f=c at a is ∇f(a)⋅(x−a)=0 (when ∇f(a)=O).
The Jacobian determinant is the local area or volume scaling (the r of polar coordinates); the chain rule of 5.4 multiplies Jacobians.
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
MATH 375: Lectures 21 to 23 and Apostol 8.11 to 8.19. The total derivative, differentiable implies continuous, the gradient and the Jacobian, tangent planes, the table of implications of homework 12 (8.14 #11), the derivative along a path of Lecture 22, and the linearisations of the final review are all worked below. Apostol's proof that continuous partials imply differentiability (8.13), which the lecture skipped, is given in full.
MATH 521: 521 calls this the Fréchet derivative and proves the inverse and implicit function theorems from it. The statement 'the derivative is the unique linear map with error o(‖v‖)' is the definition there, in any normed space.
MATH 340 / CS 532: A neural network layer is a differentiable map; its Jacobian is what backpropagation (3.8) multiplies. Newton's method for systems of equations solves J Δx = −F.
Robotics: The Jacobian of the map from joint angles to hand position gives hand speed from joint speeds, and the places where its determinant is zero are the singular arm positions.