Chapter VII · Additional theorems in the differential and integral calculus

The mean value theorem in two variables

§159 35 min

The increment of f(x,y)f(x, y) is fx δx+fy δyf_x\,\delta x + f_y\,\delta y up to an error small compared with the step, and what it means for such a function to be differentiable.

Why this matters

For one variable, the mean value theorem f(x+h)−f(x)=hf′(x+θh)f(x + h) - f(x) = h f'(x + \theta 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)z = f(x, y) is, up to a small error, a linear function of the changes in xx and yy,

δz≈fx δx+fy δy.\delta z \approx f_x\,\delta x + f_y\,\delta y.

Geometrically, the surface z=f(x,y)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+Bkz = 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))(a, b, f(a, b)) must have slopes A=fx(a,b)A = f_x(a, b) and B=fy(a,b)B = f_y(a, b) along the two axes, so there is only one candidate. The question is whether the error δz−(fxh+fyk)\delta z - (f_x h + f_y k) is small compared with the size of the step (h,k)(h, k).

Explore Zoom until the surface is flat, or not

Try this. With sin⁡xcos⁡y\sin x\cos y, drag the zoom from r=1r = 1 down to r=0.01r = 0.01 and watch both panels. Then choose xy/x2+y2xy/\sqrt{x^2 + y^2} at the origin and do the same. Finally try Hardy's §158 function and his §159 example.

f(x,y)=sin⁡xcos⁡yf(x, y) = \sin x\cos y near P=(0.6, 0.4)P = (0.6,\ 0.4), window ∣h∣,∣k∣≤1|h|, |k| \le 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 rmax |error| / r
10.8905
0.10.08746
0.010.00845
Tangent-plane coefficients at PP: fx=0.7602f_x = 0.7602, fy=−0.2199f_y = -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 sin⁡xcos⁡y\sin x \cos y the left panel turns into straight parallel stripes and the right panel (error divided by rr) fades away: the function is differentiable. For xy/x2+y2xy/\sqrt{x^2+y^2} nothing changes as you zoom, the picture is the same at every scale, and the error stays a fixed fraction of rr; both partial derivatives exist (and are 00), 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=yx = y.

Precise statements

Theorem Mean value theorem for two variables Hardy: §159

Suppose that fxf_x and fyf_y are continuous. Then

f(x+h,y+k)−f(x,y)=h fx(x+θh, y+θk)+k fy(x+θh, y+θk)f(x + h, y + k) - f(x, y) = h\,f_x(x + \theta h,\ y + \theta k) + k\,f_y(x + \theta h,\ y + \theta k)

for some θ\theta with 0<θ<10 < \theta < 1. The same θ\theta appears in both terms: the derivatives are taken at one point on the segment from (x,y)(x, y) to (x+h,y+k)(x + h, y + k).

Corollary The increment is approximately linear Hardy: §159 (1)

Under the same hypotheses, writing δx=h\delta x = h, δy=k\delta y = k, δz=f(x+h,y+k)−f(x,y)\delta z = f(x + h, y + k) - f(x, y),

δz=(fx+ε) δx+(fy+η) δy,\delta z = (f_x + \varepsilon)\,\delta x + (f_y + \eta)\,\delta y,

where fx,fyf_x, f_y are taken at (x,y)(x, y) and ε,η→0\varepsilon, \eta \to 0 as δx,δy→0\delta x, \delta y \to 0. So the equation δz=fx δx+fy δy\delta z = f_x\,\delta x + f_y\,\delta y is approximately true: the error is small compared with the larger of ∣δx∣|\delta x| and ∣δy∣|\delta y|.

Theorem Only the partial derivatives can serve Hardy: §159

If δz=λ δx+μ δy\delta z = \lambda\,\delta x + \mu\,\delta y is approximately true in this sense, then λ=fx\lambda = f_x and μ=fy\mu = f_y.

Continuity of the partial derivatives is sufficient for (1), not necessary. Hardy’s example: let ϕ\phi be any continuous function and z=(x+y) ϕ(x,y)z = (x + y)\,\phi(x, y). At the origin, z=ϕ(0,0) (x+y)+(x+y){ϕ(x,y)−ϕ(0,0)}z = \phi(0,0)\,(x + y) + (x + y)\{\phi(x, y) - \phi(0, 0)\}, and the bracket tends to 00; so (1) holds at the origin with fx=fy=ϕ(0,0)f_x = f_y = \phi(0, 0), although ϕ\phi need not have partial derivatives anywhere.

Definition Differentiable function of two variables Hardy: §159

ff is differentiable at (x,y)(x, y) if there are numbers AA and BB such that

f(x+h,y+k)−f(x,y)=Ah+Bk+εh+ηk,ε,η→0 as h,k→0.f(x + h, y + k) - f(x, y) = Ah + Bk + \varepsilon h + \eta k, \qquad \varepsilon, \eta \to 0 \text{ as } h, k \to 0.

Then fxf_x and fyf_y exist at (x,y)(x, y) and equal AA and BB.

So there are three hypotheses of increasing strength: the partial derivatives exist (too weak to give even continuity, by §158), ff is differentiable, and the partial derivatives are continuous. Hardy works with the last for simplicity.

Proofs

Proof Mean value theorem for two variables
Strategy

Restrict ff 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)F(t) = f(x + ht,\ y + kt) for 0≤t≤10 \le t \le 1. Then F(0)=f(x,y)F(0) = f(x, y) and F(1)=f(x+h,y+k)F(1) = f(x + h, y + k).

Apply the one-variable mean value theorem

F(1)−F(0)=F′(θ)F(1) - F(0) = F'(\theta) for some 0<θ<10 < \theta < 1.

Compute F′F' by the chain rule

Here x(t)=x+htx(t) = x + ht and y(t)=y+kty(t) = y + kt have derivatives hh and kk, and fx,fyf_x, f_y are continuous, so F′(t)=hfx(x+ht,y+kt)+kfy(x+ht,y+kt)F'(t) = h f_x(x + ht, y + kt) + k f_y(x + ht, y + kt). Putting t=θt = \theta gives the theorem.

Deduce the approximate form

Write fx(x+θh,y+θk)=fx(x,y)+εf_x(x + \theta h, y + \theta k) = f_x(x, y) + \varepsilon and fy(x+θh,y+θk)=fy(x,y)+ηf_y(x + \theta h, y + \theta k) = f_y(x, y) + \eta. As h,k→0h, k \to 0 the point (x+θh,y+θk)(x + \theta h, y + \theta k) tends to (x,y)(x, y), so by continuity ε,η→0\varepsilon, \eta \to 0. That is (1).

Proof Only the partial derivatives can serve
Strategy

Subtract the two approximate equations for δz\delta z; the difference (λ−fx)δx+(μ−fy)δy(\lambda - f_x)\delta x + (\mu - f_y)\delta 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\delta z = (f_x + \varepsilon)\delta x + (f_y + \eta)\delta y and δz=(λ+ε′)δx+(μ+η′)δy\delta z = (\lambda + \varepsilon')\delta x + (\mu + \eta')\delta y we get (λ−fx) δx+(μ−fy) δy=ρ δx+σ δy(\lambda - f_x)\,\delta x + (\mu - f_y)\,\delta y = \rho\,\delta x + \sigma\,\delta y, where ρ=ε−ε′\rho = \varepsilon - \varepsilon' and σ=η−η′\sigma = \eta - \eta' tend to 00.

Take a step along the xx-axis

Given ζ>0\zeta > 0, choose ω\omega so that ∣ρ∣,∣σ∣<ζ|\rho|, |\sigma| < \zeta whenever ∣δx∣,∣δy∣<ω|\delta x|, |\delta y| < \omega. With δy=0\delta y = 0 and 0<∣δx∣<ω0 < |\delta x| < \omega, we get ∣λ−fx∣ ∣δx∣<ζ∣δx∣|\lambda - f_x|\,|\delta x| < \zeta|\delta x|, so ∣λ−fx∣<ζ|\lambda - f_x| < \zeta.

Conclude

Since ζ\zeta was arbitrary, λ=fx\lambda = f_x. Taking δx=0\delta x = 0 instead gives μ=fy\mu = f_y.

The same argument shows that in the definition of a differentiable function, AA and BB must be fxf_x and fyf_y. And it explains the widget’s verdict for xy/x2+y2xy/\sqrt{x^2+y^2}: its partial derivatives at the origin are 00, so the only possible plane is z=0z = 0, and the function does not stay close to it in proportion to the step.

Worked examples and exercises

Exercise Finding θ\theta for f=xyf = xy ●○○ Hardy: §159

For f(x,y)=xyf(x, y) = xy, find the θ\theta of the mean value theorem explicitly.

Hint
Expand both sides; they are polynomials in hh and kk.

Solution

The left side is (x+h)(y+k)−xy=yh+xk+hk(x + h)(y + k) - xy = yh + xk + hk. The right side is h(y+θk)+k(x+θh)=yh+xk+2θhkh(y + \theta k) + k(x + \theta h) = yh + xk + 2\theta hk. So θ=12\theta = \tfrac12 (when hk≠0hk \ne 0; otherwise every θ\theta works). For this function the derivatives are taken at the midpoint of the segment.

Exercise Partial derivatives without differentiability ●●○ Hardy: §159; cf. §158

Let f(x,y)=xy/x2+y2f(x, y) = xy/\sqrt{x^2 + y^2}, with f(0,0)=0f(0, 0) = 0. Show that ff is continuous at the origin and that fx(0,0)=fy(0,0)=0f_x(0, 0) = f_y(0, 0) = 0, but that ff is not differentiable there.

Hint
Use ∣xy∣≤12(x2+y2)|xy| \le \tfrac12(x^2 + y^2) for continuity. For non-differentiability, the only candidates are A=B=0A = B = 0; look at h=kh = k.

Solution

∣f(x,y)∣≤12x2+y2→0|f(x, y)| \le \tfrac12\sqrt{x^2 + y^2} \to 0, so ff is continuous at 00. On the axes f=0f = 0, so both partial derivatives at the origin are 00. If ff were differentiable there, then A=B=0A = B = 0 (by the uniqueness theorem) and f(h,k)=εh+ηkf(h, k) = \varepsilon h + \eta k with ε,η→0\varepsilon, \eta \to 0. But with h=k>0h = k > 0, f(h,h)=h2/(2h)=h/2f(h, h) = h^2/(\sqrt2 h) = h/\sqrt2, so ε+η=1/2\varepsilon + \eta = 1/\sqrt2 for every hh, which does not tend to 00. So ff 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)f(th, tk) = |t|\,f(h, k)), with no tangent plane there.

Exercise Hardy's example ●●○ Hardy: §159

Let ϕ\phi be continuous and z=f(x,y)=(x+y) ϕ(x,y)z = f(x, y) = (x + y)\,\phi(x, y). Show that fx(0,0)=fy(0,0)=ϕ(0,0)f_x(0, 0) = f_y(0, 0) = \phi(0, 0) and that ff is differentiable at the origin. Give an example of such a ϕ\phi for which fxf_x fails to exist at points arbitrarily close to the origin.

Hint
f(h,0)=h ϕ(h,0)f(h, 0) = h\,\phi(h, 0).

Solution

f(h,0)/h=ϕ(h,0)→ϕ(0,0)f(h, 0)/h = \phi(h, 0) \to \phi(0, 0), so fx(0,0)=ϕ(0,0)f_x(0, 0) = \phi(0, 0), and similarly for fyf_y. Next, f(h,k)−f(0,0)=ϕ(0,0)(h+k)+{ϕ(h,k)−ϕ(0,0)}(h+k)f(h, k) - f(0, 0) = \phi(0, 0)(h + k) + \{\phi(h, k) - \phi(0, 0)\}(h + k), which is the definition with A=B=ϕ(0,0)A = B = \phi(0, 0) and ε=η=ϕ(h,k)−ϕ(0,0)→0\varepsilon = \eta = \phi(h, k) - \phi(0, 0) \to 0.

For example, ϕ=1+∣x−y∣\phi = 1 + \sqrt{|x - y|} (the last function in the widget). At a point (t,t)(t, t) with t≠0t \ne 0, f(t+h,t)−f(t,t)=(2t+h)(1+∣h∣)−2tf(t + h, t) - f(t, t) = (2t + h)(1 + \sqrt{|h|}) - 2t, and dividing by hh gives a term 2t∣h∣/h2t\sqrt{|h|}/h, which is unbounded as h→0h \to 0. So fxf_x does not exist anywhere on the line x=yx = y except at the origin.

Exercise Differentiable implies continuous ●○○ Hardy: §159

Show that a function differentiable at (x,y)(x, y) is continuous there. Why does this not contradict §158?

Hint
Let h,k→0h, k \to 0 in the definition.

Solution

f(x+h,y+k)−f(x,y)=(A+ε)h+(B+η)k→0f(x + h, y + k) - f(x, y) = (A + \varepsilon)h + (B + \eta)k \to 0 as h,k→0h, k \to 0. Hardy’s discontinuous example of §158 has partial derivatives at the origin but is not differentiable there; mere existence of fxf_x and fyf_y is a weaker hypothesis than differentiability.

Check yourself

Check yourself Choose 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+y2xy/\sqrt{x^2+y^2} has partial derivatives but is not differentiable at 00; (x+y)(1+∣x−y∣)(x + y)(1 + \sqrt{|x - y|}) is differentiable at 00 without continuous partial derivatives.

Check yourself True or false?

If ff is differentiable at PP, then fxf_x and fyf_y are continuous at PP.

Why

False. Hardy’s example (x+y) ϕ(x,y)(x + y)\,\phi(x, y) is differentiable at the origin for every continuous ϕ\phi, while fxf_x may not even exist at nearby points. Differentiability is a condition at one point; continuity of fxf_x involves all nearby points.

Check yourself Enter a number

Use δz≈fx δx+fy δy\delta z \approx f_x\,\delta x + f_y\,\delta y for z=x2+y2z = \sqrt{x^2 + y^2} at (3,4)(3, 4) to estimate 3.022+3.972\sqrt{3.02^2 + 3.97^2}.

Why

z=5z = 5, fx=x/z=0.6f_x = x/z = 0.6, fy=y/z=0.8f_y = y/z = 0.8, δx=0.02\delta x = 0.02, δy=−0.03\delta y = -0.03. So z≈5+0.012−0.024=4.988z \approx 5 + 0.012 - 0.024 = 4.988. The true value is 4.98812…4.98812\ldots; the error is about 10−410^{-4}, small compared with the steps of size 0.030.03.

Check yourself True or false?

In Hardy’s mean value theorem for two variables, the same θ\theta appears in fx(x+θh,y+θk)f_x(x + \theta h, y + \theta k) and in fy(x+θh,y+θk)f_y(x + \theta h, y + \theta 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)F(t) = f(x + ht, y + kt), which yields a single θ\theta. (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+kfyf(x + h, y + k) - f(x, y) = h f_x + k f_y, both evaluated at one point of the segment; proof by restricting ff to the segment.
  • Hence δz=fx δx+fy δy\delta z = f_x\,\delta x + f_y\,\delta y up to an error small compared with the step, when fxf_x and fyf_y are continuous.
  • If any linear formula λ δx+μ δy\lambda\,\delta x + \mu\,\delta y is approximately right, then λ=fx\lambda = f_x, μ=fy\mu = f_y.
  • Differentiable means “approximately linear”; it lies strictly between “partial derivatives exist” and “partial derivatives are continuous”.