For one variable, the mean value theorem f(x+h)−f(x)=hf′(x+θh) is behind almost every result of Chapter VI. §159 proves its analogue for two variables and draws the key consequence: near a point, the change in z=f(x,y) is, up to a small error, a linear function of the changes in x and y,
δz≈fxδx+fyδy.
Geometrically, the surface z=f(x,y) is almost a plane, the tangent plane, when seen close enough. This “approximately true” equation is the idea behind the modern definition of a differentiable function of several variables, which Hardy also states.
The idea
For one variable, zooming in on a differentiable graph makes it look straight (as in §111). For two variables, zooming in on a well-behaved surface makes it look flat. A plane z=c+Ah+Bk has level lines that are straight, parallel and equally spaced, so on a colour map of the surface the bands become straight stripes as we zoom in.
A plane through (a,b,f(a,b)) must have slopes A=fx(a,b) and B=fy(a,b) along the two axes, so there is only one candidate. The question is whether the error δz−(fxh+fyk) is small compared with the size of the step(h,k).
ExploreZoom until the surface is flat, or not
Try this.With sinxcosy, drag the zoom from r=1 down to r=0.01 and watch both panels. Then choose xy/x2+y2 at the origin and do the same. Finally try Hardy's §158 function and his §159 example.
f(x,y)=sinxcosy near P=(0.6,0.4), window ∣h∣,∣k∣≤1
change δz = f(a + h, b + k) − f(a, b)
hk
error (δz − f_x h − f_y k) / r, fixed scale
hk
positive
negative
window r
max |error| / r
1
0.8905
0.1
0.08746
0.01
0.00845
Tangent-plane coefficients at P: fx=0.7602, fy=−0.2199. The error is small compared with r and keeps shrinking relative to r: f is differentiable at P.(continuous partial derivatives)
What to notice
For sinxcosy the left panel turns into straight parallel stripes and the right panel (error divided by r) fades away: the function is differentiable. For xy/x2+y2 nothing changes as you zoom, the picture is the same at every scale, and the error stays a fixed fraction of r; both partial derivatives exist (and are 0), yet no plane fits. Hardy's §159 example is differentiable at the origin even though its partial derivatives do not exist along the line x=y.
Precise statements
TheoremMean value theorem for two variablesHardy: §159
Suppose that fx and fy are continuous. Then
f(x+h,y+k)−f(x,y)=hfx(x+θh,y+θk)+kfy(x+θh,y+θk)
for some θ with 0<θ<1. The same θ appears in both terms: the derivatives are taken at one point on the segment from (x,y) to (x+h,y+k).
CorollaryThe increment is approximately linearHardy: §159 (1)
Under the same hypotheses, writing δx=h, δy=k, δz=f(x+h,y+k)−f(x,y),
δz=(fx+ε)δx+(fy+η)δy,
where fx,fy are taken at (x,y) and ε,η→0 as δx,δy→0. So the equation δz=fxδx+fyδy is approximately true: the error is small compared with the larger of ∣δx∣ and ∣δy∣.
TheoremOnly the partial derivatives can serveHardy: §159
If δz=λδx+μδy is approximately true in this sense, then λ=fx and μ=fy.
Continuity of the partial derivatives is sufficient for (1), not necessary. Hardy’s example: let ϕ be any continuous function and z=(x+y)ϕ(x,y). At the origin, z=ϕ(0,0)(x+y)+(x+y){ϕ(x,y)−ϕ(0,0)}, and the bracket tends to 0; so (1) holds at the origin with fx=fy=ϕ(0,0), although ϕ need not have partial derivatives anywhere.
DefinitionDifferentiable function of two variablesHardy: §159
f is differentiable at (x,y) if there are numbers A and B such that
f(x+h,y+k)−f(x,y)=Ah+Bk+εh+ηk,ε,η→0 as h,k→0.
Then fx and fy exist at (x,y) and equal A and B.
So there are three hypotheses of increasing strength: the partial derivatives exist (too weak to give even continuity, by §158), f is differentiable, and the partial derivatives are continuous. Hardy works with the last for simplicity.
Proofs
ProofMean value theorem for two variables
Strategy
Restrict f to the segment joining the two points. That turns it into a function of one variable, to which the ordinary mean value theorem applies, and the chain rule of §157 computes its derivative.
Restrict to the segment
Let F(t)=f(x+ht,y+kt) for 0≤t≤1. Then F(0)=f(x,y) and F(1)=f(x+h,y+k).
Apply the one-variable mean value theorem
F(1)−F(0)=F′(θ) for some 0<θ<1.
Compute F′ by the chain rule
Here x(t)=x+ht and y(t)=y+kt have derivatives h and k, and fx,fy are continuous, so F′(t)=hfx(x+ht,y+kt)+kfy(x+ht,y+kt). Putting t=θ gives the theorem.
Deduce the approximate form
Write fx(x+θh,y+θk)=fx(x,y)+ε and fy(x+θh,y+θk)=fy(x,y)+η. As h,k→0 the point (x+θh,y+θk) tends to (x,y), so by continuity ε,η→0. That is (1).
∎
ProofOnly the partial derivatives can serve
Strategy
Subtract the two approximate equations for δz; the difference (λ−fx)δx+(μ−fy)δy is then small compared with the step, for every small step. Choosing steps along the axes isolates each coefficient.
Subtract
From δz=(fx+ε)δx+(fy+η)δy and δz=(λ+ε′)δx+(μ+η′)δy we get (λ−fx)δx+(μ−fy)δy=ρδx+σδy, where ρ=ε−ε′ and σ=η−η′ tend to 0.
Take a step along the x-axis
Given ζ>0, choose ω so that ∣ρ∣,∣σ∣<ζ whenever ∣δx∣,∣δy∣<ω. With δy=0 and 0<∣δx∣<ω, we get ∣λ−fx∣∣δx∣<ζ∣δx∣, so ∣λ−fx∣<ζ.
Conclude
Since ζ was arbitrary, λ=fx. Taking δx=0 instead gives μ=fy.
∎
The same argument shows that in the definition of a differentiable function, A and B must be fx and fy. And it explains the widget’s verdict for xy/x2+y2: its partial derivatives at the origin are 0, so the only possible plane is z=0, and the function does not stay close to it in proportion to the step.
Worked examples and exercises
ExerciseFinding θ for f=xy●○○Hardy: §159
For f(x,y)=xy, find the θ of the mean value theorem explicitly.
Hint
Expand both sides; they are polynomials in h and k.
Solution
The left side is (x+h)(y+k)−xy=yh+xk+hk. The right side is h(y+θk)+k(x+θh)=yh+xk+2θhk. So θ=21 (when hk=0; otherwise every θ works). For this function the derivatives are taken at the midpoint of the segment.
ExercisePartial derivatives without differentiability●●○Hardy: §159; cf. §158
Let f(x,y)=xy/x2+y2, with f(0,0)=0. Show that f is continuous at the origin and that fx(0,0)=fy(0,0)=0, but that f is not differentiable there.
Hint
Use ∣xy∣≤21(x2+y2) for continuity. For non-differentiability, the only candidates are A=B=0; look at h=k.
Solution
∣f(x,y)∣≤21x2+y2→0, so f is continuous at 0. On the axes f=0, so both partial derivatives at the origin are 0. If f were differentiable there, then A=B=0 (by the uniqueness theorem) and f(h,k)=εh+ηk with ε,η→0. But with h=k>0, f(h,h)=h2/(2h)=h/2, so ε+η=1/2 for every h, which does not tend to 0. So f is not differentiable at the origin: its graph is a cone-like surface made of rays from the origin (since f(th,tk)=∣t∣f(h,k)), with no tangent plane there.
ExerciseHardy's example●●○Hardy: §159
Let ϕ be continuous and z=f(x,y)=(x+y)ϕ(x,y). Show that fx(0,0)=fy(0,0)=ϕ(0,0) and that f is differentiable at the origin. Give an example of such a ϕ for which fx fails to exist at points arbitrarily close to the origin.
Hint
f(h,0)=hϕ(h,0).
Solution
f(h,0)/h=ϕ(h,0)→ϕ(0,0), so fx(0,0)=ϕ(0,0), and similarly for fy. Next, f(h,k)−f(0,0)=ϕ(0,0)(h+k)+{ϕ(h,k)−ϕ(0,0)}(h+k), which is the definition with A=B=ϕ(0,0) and ε=η=ϕ(h,k)−ϕ(0,0)→0.
For example, ϕ=1+∣x−y∣ (the last function in the widget). At a point (t,t) with t=0, f(t+h,t)−f(t,t)=(2t+h)(1+∣h∣)−2t, and dividing by h gives a term 2t∣h∣/h, which is unbounded as h→0. So fx does not exist anywhere on the line x=y except at the origin.
Show that a function differentiable at (x,y) is continuous there. Why does this not contradict §158?
Hint
Let h,k→0 in the definition.
Solution
f(x+h,y+k)−f(x,y)=(A+ε)h+(B+η)k→0 as h,k→0. Hardy’s discontinuous example of §158 has partial derivatives at the origin but is not differentiable there; mere existence of fx and fy is a weaker hypothesis than differentiability.
Check yourself
Check yourselfChoose one
Which chain of implications is correct for a function of two variables at a point?
Why
§159 proves the first implication and notes the second. Neither reverses: xy/x2+y2 has partial derivatives but is not differentiable at 0; (x+y)(1+∣x−y∣) is differentiable at 0 without continuous partial derivatives.
Check yourselfTrue or false?
If f is differentiable at P, then fx and fy are continuous at P.
Why
False. Hardy’s example (x+y)ϕ(x,y) is differentiable at the origin for every continuous ϕ, while fx may not even exist at nearby points. Differentiability is a condition at one point; continuity of fx involves all nearby points.
Check yourselfEnter a number
Use δz≈fxδx+fyδy for z=x2+y2 at (3,4) to estimate 3.022+3.972.
Why
z=5, fx=x/z=0.6, fy=y/z=0.8, δx=0.02, δy=−0.03. So z≈5+0.012−0.024=4.988. The true value is 4.98812…; the error is about 10−4, small compared with the steps of size 0.03.
Check yourselfTrue or false?
In Hardy’s mean value theorem for two variables, the same θ appears in fx(x+θh,y+θk) and in fy(x+θh,y+θk).
Why
True. Both derivatives are evaluated at one point of the segment, because the proof applies the one-variable theorem to F(t)=f(x+ht,y+kt), which yields a single θ. (The proof of the chain rule in the last lesson, by contrast, used two different points.)
Hardy’s language
Summary
Summary
Mean value theorem: f(x+h,y+k)−f(x,y)=hfx+kfy, both evaluated at one point of the segment; proof by restricting f to the segment.
Hence δz=fxδx+fyδy up to an error small compared with the step, when fx and fy are continuous.
If any linear formula λδx+μδy is approximately right, then λ=fx, μ=fy.
Differentiable means “approximately linear”; it lies strictly between “partial derivatives exist” and “partial derivatives are continuous”.