Key idea of this section
f(a + h) = f(a) + Df(a)h + o(|h|), Df(a) a linear map ℝⁿ → ℝᵐ Inverse function theorem: f ∈ C¹ and det Df(a) ≠ 0 ⇒ f is locally invertible with C¹ inverse
The total derivative
For functions of several variables, the difference quotient cannot be formed (one cannot divide by a vector), so the derivative is defined as a linear approximation. Let U ⊆ ℝⁿ be open and f: U → ℝᵐ. f is differentiable at a ∈ U if there is a linear map T: ℝⁿ → ℝᵐ with
lim (h → 0) |f(a + h) − f(a) − Th| / |h| = 0.
T is unique, written Df(a), and its matrix with respect to the standard bases is the Jacobian matrix of partial derivatives (∂fᵢ/∂xⱼ)(a). If f is differentiable at a then it is continuous at a and every directional derivative exists: Dᵤf(a) = Df(a)u. For real-valued f this is ∇f(a)·u, which shows that ∇f points in the direction of steepest increase.
Partial derivatives are not enough
The existence of all partial derivatives does not imply differentiability, or even continuity. Let
f(x, y) = xy/(x² + y²) for (x, y) ≠ (0, 0), f(0, 0) = 0.
f vanishes on both axes, so ∂f/∂x(0, 0) = ∂f/∂y(0, 0) = 0. But f(t, t) = 1/2 for every t ≠ 0, so f is not even continuous at the origin. The right sufficient condition is:
Theorem 12.1. If all partial derivatives of f exist near a and are continuous at a, then f is differentiable at a.
Proof idea. Move from a to a + h one coordinate at a time and apply the one-variable mean value theorem along each step; continuity of the partials at a makes the error o(|h|). ∎
Such f are called C¹. The chain rule takes the form D(g ∘ f)(a) = Dg(f(a)) Df(a), a product of matrices; its proof is the multivariable version of Carathéodory's argument.
Mixed partial derivatives
Theorem 12.2 (Schwarz–Clairaut). If ∂²f/∂x∂y and ∂²f/∂y∂x exist near a and are continuous at a, they are equal at a.
Continuity cannot be dropped. Let f(x, y) = xy(x² − y²)/(x² + y²) with f(0, 0) = 0. Then ∂f/∂x(0, y) = −y and ∂f/∂y(x, 0) = x, so
∂/∂y (∂f/∂x)(0, 0) = −1, ∂/∂x (∂f/∂y)(0, 0) = 1.
The inverse function theorem
Theorem 12.3 (Inverse function theorem). Let f: U → ℝⁿ be C¹ on an open U ⊆ ℝⁿ, and suppose Df(a) is invertible. Then there are open sets V ∋ a and W ∋ f(a) such that f maps V bijectively onto W, the inverse g: W → V is C¹, and Dg(f(a)) = Df(a)⁻¹.
Proof sketch. Replacing f by Df(a)⁻¹(f(a + x) − f(a)), we may assume a = 0, f(0) = 0 and Df(0) = I. For y near 0, solving f(x) = y is the same as finding a fixed point of φᵧ(x) = x − f(x) + y. Since Dφᵧ(x) = I − Df(x) is small near 0 (continuity of Df), the mean value inequality makes φᵧ a contraction on a small closed ball, which it maps into itself when |y| is small. By the Banach fixed point theorem it has a unique fixed point. Differentiability of the inverse then follows from the definition, and Dg = (Df ∘ g)⁻¹ is continuous because matrix inversion is. ∎
The theorem is purely local. The map f(x, y) = (eˣ cos y, eˣ sin y) has Jacobian determinant e²ˣ > 0 everywhere, so it is locally invertible at every point, but it is not globally injective (f is 2π-periodic in y).
The implicit function theorem
Theorem 12.4 (Implicit function theorem). Let F: ℝⁿ × ℝᵐ → ℝᵐ be C¹ near (a, b), with F(a, b) = 0 and the m × m matrix DyF(a, b) invertible. Then there is a C¹ function g defined near a with g(a) = b such that, near (a, b), F(x, y) = 0 iff y = g(x). Its derivative is
Dg(a) = −DyF(a, b)⁻¹ DxF(a, b).
Proof. Apply the inverse function theorem to (x, y) ↦ (x, F(x, y)), whose Jacobian is block triangular with determinant det DyF(a, b) ≠ 0. ∎
Worked example: the circle x² + y² = 1 near (0.6, 0.8). Here ∂F/∂y = 2y = 1.6 ≠ 0, so y is locally a C¹ function of x with dy/dx = −Fx/Fy = −x/y = −0.75. At (1, 0), ∂F/∂y = 0 and indeed y is not a function of x near that point.
Extrema and Lagrange multipliers
At an interior local extremum of a differentiable f: U → ℝ, ∇f = 0. If f is C², the Hessian matrix H = (∂²f/∂xᵢ∂xⱼ) decides the nature of a critical point: positive definite gives a strict local minimum, negative definite a strict local maximum, indefinite a saddle. For extrema of f subject to a constraint g = 0 with ∇g ≠ 0, the implicit function theorem lets one parametrise the constraint set locally, and one obtains the Lagrange condition ∇f = λ∇g. Example: on the sphere x² + y² + z² = 9, the maximum of x + 2y + 2z occurs where (1, 2, 2) = λ(2x, 2y, 2z), i.e. at (1, 2, 2), with value 1 + 4 + 4 = 9 (equivalently, by Cauchy–Schwarz, |(1, 2, 2)|·3 = 9).
Exercise
- (a)Compute the Jacobian determinant of (u, v) = (x² − y², 2xy).
- (b)The equation xyz + x + y + z = 4 defines z as a function of (x, y) near (1, 1, 1). Find ∂z/∂x there.
- (c)Find the directional derivative of f(x, y) = x²y at (1, 2) in the direction of (3, 4).
Show solution
Answers: (a) det [[2x, −2y], [2y, 2x]] = 4x² + 4y² = 4(x² + y²). (b) ∂z/∂x = −Fx/Fz = −(yz + 1)/(xy + 1) = −2/2 = −1. (c) ∇f = (2xy, x²) = (4, 1), and the unit vector is (3/5, 4/5), so the derivative is 12/5 + 4/5 = 16/5 = 3.2.