Apply the Mean Value Theorem again to the function g(t)=fx(a+θ1h,t) on [b,b+k]. There exists θ2∈(0,1) such that
Δ(h,k)=hk⋅fxy(a+θ1h,b+θ2k)
Similarly, by reversing the order of application, there exist θ3,θ4∈(0,1) such That
Δ(h,k)=hk⋅fyx(a+θ3h,b+θ4k)
For h,k=0 we have
fxy(a+θ1h,b+θ2k)=fyx(a+θ3h,b+θ4k)
Taking the limit as (h,k)→(0,0) and using continuity of fxy and fyxWe obtain fxy(a,b)=fyx(a,b). ■
Intuition. Clairaut’s theorem tells us that, under a mild regularity condition (continuity of the Mixed second partials), the order in which we differentiate does not matter. Without this Condition, the mixed partials may differ.
1.3 Differentiability
Definition.f:D⊆Rn→R is differentiable at a if There exists a linear map L:Rn→R such that
limh→0∥h∥f(a+h)−f(a)−L(h)=0
When f is differentiable at aThe linear map L is given by the gradient.
Remark. Existence of all partial derivatives at a point does not imply differentiability at That point. The canonical counterexample is
Both fx(0,0) and fy(0,0) exist (and equal 0), yet f is not even continuous at the origin, Hence not differentiable.
1.4 The Gradient
The gradient of f at a is
∇f(a)=(∂x1∂f(a),…,∂xn∂f(a))
The linear approximation of f near a is
f(a+h)≈f(a)+∇f(a)⋅h
Theorem 1.2. If all partial derivatives of f exist and are continuous in a neighbourhood of aThen f is differentiable at a.
Remark. Functions whose partial derivatives exist and are continuous on an open set U are called C1(U). Theorem 1.2 says C1⟹ differentiable. The converse is false: there exist Differentiable functions whose partial derivatives are not continuous.
Proposition. If f is differentiable at aThen f is continuous at a.
Proof. From the definition of differentiability:
f(a+h)−f(a)=L(h)+ε(h)∥h∥
Where L is linear and ε(h)→0 as h→0. As h→0 Both terms on the right vanish, so f(a+h)→f(a). ■
1.5 Directional Derivatives
The directional derivative of f at a in the direction of a unit vector u is
Duf(a)=limh→0hf(a+hu)−f(a)
Theorem 1.3. If f is differentiable at aThen
Duf(a)=∇f(a)⋅u
Proof. Since f is differentiable at a
hf(a+hu)−f(a)=h∇f(a)⋅(hu)+ε(hu)∥hu∥
=∇f(a)⋅u+ε(hu)∥u∥
Where ε(h)→0 as h→0. Taking h→0 gives the result. ■
Corollary 1.4. The gradient points in the direction of steepest ascent, and ∥∇f∥ Is the rate of steepest ascent.
Proof. By the Cauchy—Schwarz inequality, ∣∇f⋅u∣≤∥∇f∥⋅∥u∥=∥∇f∥ With equality when u is parallel to ∇f. ■
1.6 Chain Rule
Theorem 1.5 (Multivariable Chain Rule). If g:Rm→Rn is Differentiable at a and f:Rn→R is differentiable at g(a)Then
∇(f∘g)(a)=Jg(a)T∇f(g(a))
Where Jg is the Jacobian matrix of g.
Proof. Write h(t)=f(g(a+tv)) for a fixed direction v. Then
th(t)−h(0)=tf(g(a+tv))−f(g(a))
Let k=g(a+tv)−g(a). By differentiability of gk=Jg(a)(tv)+o(t)And k→0 as t→0. By Differentiability of f:
f(g(a)+k)−f(g(a))=∇f(g(a))⋅k+o(∥k∥)
=∇f(g(a))⋅[Jg(a)(tv)+o(t)]+o(t)
Dividing by t and taking t→0:
h′(0)=∇f(g(a))⋅Jg(a)v=[Jg(a)T∇f(g(a))]⋅v
Since v was arbitrary, ∇h(0)=Jg(a)T∇f(g(a)). ■
1.7 Chain Rule Worked Example
Problem. Let f(x,y)=x2y and let x=cost, y=sint. Find dtdf(cost,sint) Using the chain rule, and verify by direct substitution.
Solution
Via the chain rule:
dtdf(x(t),y(t))=fx⋅x′(t)+fy⋅y′(t)
=2xy⋅(−sint)+x2⋅cost=−2costsin2t+cos3t
Via direct substitution:f(cost,sint)=cos2tsint.
dtd[cos2tsint]=−2costsin2t+cos3t
Both methods agree. ■
1.8 Worked Example
Problem. Let f(x,y)=x2y+sin(xy). Compute ∇f and find the directional derivative At (1,π) in the direction u=(1/2,1/2).
Solution.
∂x∂f=2xy+ycos(xy)
∂y∂f=x2+xcos(xy)
∇f(1,π)=(2π+πcos(π),1+cos(π))=(2π−π,1−1)=(π,0)
Duf(1,π)=∇f(1,π)⋅u=π⋅21+0=2π■
1.9 Additional Worked Examples
Problem. Let f(x,y,z)=x2yez+sin(xz). Compute ∇f and evaluate it at (1,0,π).
Problem. Find the directional derivative of f(x,y)=x2y3 at (1,−1) in the direction of v=(3,−4).
Solution
First normalise v: ∥v∥=9+16=5So u=(3/5,−4/5).
∇f=(2xy3,3x2y2)
∇f(1,−1)=(2⋅1⋅(−1),3⋅1⋅1)=(−2,3)
Duf(1,−1)=(−2)(3/5)+(3)(−4/5)=5−6−12=−518
■
1.10 Implicit Differentiation
Suppose F(x,y,z)=0 defines z implicitly as a function of x and y near a point (a,b,c) with Fz(a,b,c)=0. By the Implicit Function Theorem, there exists a C1 function φ defined on a neighbourhood of (a,b) such that φ(a,b)=c and F(x,y,φ(x,y))=0.
Differentiating F(x,y,φ(x,y))=0 with respect to x:
Fx+Fz⋅∂x∂z=0⟹∂x∂z=−FzFx
Similarly, ∂y∂z=−FzFy.
Proposition 1.6 (Implicit Function Theorem, special case). If F:R3→R is C1 and F(a,b,c)=0 with Fz(a,b,c)=0Then there exist neighbourhoods U of (a,b) and V of c and a unique C1 function φ:U→V with φ(a,b)=c and F(x,y,φ(x,y))=0 for all (x,y)∈U.
Problem. If x2y+y2z+z2x=3Find ∂x∂z and ∂y∂z at the point (1,1,1).
Solution
Let F(x,y,z)=x2y+y2z+z2x−3. Then Fx=2xy+z2Fy=x2+2yz, Fz=y2+2zx.
At (1,1,1): Fx=3, Fy=3, Fz=3.
∂x∂z=−FzFx=−33=−1,∂y∂z=−FzFy=−33=−1
■
1.11 Taylor’s Theorem for Multivariable Functions
Theorem 1.7 (Taylor’s Theorem). Let f:U⊆Rn→R be of class Ck+1 On an open convex set UAnd let a∈U. Then for all x∈U:
f(x)=f(a)+∇f(a)⋅(x−a)+2!1(x−a)THf(a)(x−a)+⋯+Rk
Where Hf is the Hessian matrix and the remainder Rk can be written in Lagrange form:
Rk=(k+1)!1∑∣α∣=k+1α!(k+1)!Dαf(c)(x−a)α
For some c on the line segment joining a and x.
For n=2 and k=2The second-order Taylor expansion is:
For some τ∈(0,1). By the multivariable chain rule, ϕ′(t)=∇f(a+t(x−a))⋅(x−a)And higher Derivatives involve higher-order partial derivatives of f. Substituting c=a+τ(x−a) yields the result. ■
1.12 Common Pitfalls
:::caution Common Pitfalls
Existence = continuity of partials. A function can have all partial derivatives at a point yet fail to be continuous (hence not differentiable) there.
Existence = differentiability. Even if all partials exist at a point, the function need not be differentiable. Continuity of the partials in a neighbourhood (i.e., C1) is sufficient but not necessary.
Clairaut’s theorem requires continuity. Without continuity of the mixed partials, the equality fxy=fyx can fail.
Normalise the direction vector. The formula Duf=∇f⋅u assumes ∥u∥=1. If the direction is given by a non-unit vector vDivide by ∥v∥ first.