1.6 Calculus: many variables
Open and closed sets
To make precise statements about functions of many variables, we need to generalize the notions of open and closed intervals to many dimensions.We want to say that a set of points in an n-dimensional set is “open” if it does not include its boundary. But how exactly can we define the boundary of an arbitrary set of n-vectors?
Our definition of boundary point for an interval can easily be extended. We say that a point x is a boundary point of a set of n-vectors if there are points in the set that are arbitrarily close to x, and also points outside the set that are arbitrarily close to x. A point x is an interior point of a set if we can find a (small) number ε such that all points within the distance ε of x are in the set.
The green point in the following figure, for example, is a boundary point of the (two-dimensional) blue set because every disk centered at the point, however small, contains both points in the set and points outside the set. The red point is an interior point because the gray disk around it (and all smaller disks, as well as some larger ones) contains exclusively points in the set.
Here is a more precise definition of the two notions.
- Definition
-
- A point x is a boundary point of a set S of vectors if for every number ε > 0 (however small), at least one point within the distance ε of x is in S, and at least one point within the distance ε of x is outside S.
- A point x is an interior point of a set S of vectors if there is a number ε > 0 such that all points within the distance ε of x are members of S.
- Example 1.6.1
- The set of interior points of the set {(x, y): x2 + y2 ≤ c2}, the disk of radius c centered at the origin, is {(x, y): x2 + y2 < c2}, and the set of its boundary points is {(x, y): x2 + y2 = c2}, the circle of radius c centered at the origin.
- Definition
-
- The set S of n-vectors is open if every point in S is an interior point of S.
- The set S of n-vectors is closed if every boundary point of S is a member of S.
- Example 1.6.2
- The set of boundary points of the set {(x, y): x2 + y2 ≤ c2}, the disk of radius c centered at the origin, is {(x, y): x2 + y2 = c2}, the circle of radius c centered at the origin, which is a subset of the disk. Thus the disk is closed.
- Example 1.6.3
- The set of interior points of the set {(x, y): x + y ≤ c, x ≥ 0, and y ≥ 0} is {(x, y): x + y < c, x > 0, and y > 0}, and the set of boundary points is {(x, y): x + y = c and 0 ≤ x ≤ c and 0 ≤ y ≤ c, or x = 0 and 0 ≤ y ≤ c, or y = 0 and 0 ≤ x ≤ c}. Thus the set is closed.
Differentiability
For a function f of a single variable and any point x in the domain of f, a line through (x, f(x)) with slope equal to the derivative f'(x) of f at the point x is a good approximation of the function around x (see this page). If no good linear approximation exists at some point x (as is the case if the graph of the function has a “kink” at x), then the function is not differentiable at x.The definition of differentiability for a function of many variables captures the same idea: a function of many variables is differentiable at a point if there exists a good linear approximation of the function around the point. Like the graph of a differentiable function of a single variable, the graph of a differentiable function of many variables is “smooth”, with no “kinks”.
To formulate a precise definition, first note that the definition of differentiability for a function of a single variable can be rewritten as follows: a function of a single variable defined on an open interval I is differentiable at the point a ∈ I if there is a number r such that
limh→0 |
|
Here is the definition for a function of many variables.
- Definition
-
The function f of n variables defined on an open set S is differentiable at the point a ∈ S if there is a vector r = (r1, ..., rn) such that
limh→0 f(a + h) − f(a) − r · h ∥h∥
i=1h2
i), and r · h is the inner product of r and h. In this case, r is the derivative of the function f at a. If f is differentiable at every point in S then it is differentiable on S.
- Definition
- The function f of many variables defined on an open set S is twice-differentiable on S if it is differentiable on S and its derivative is also differentiable on S.
Partial derivatives
- Definition
-
Let f be a function of n variables defined on an open set S and let (x1, ..., xn) be a point in S. If
limh→0 f(x1, ..., xi + h, ..., xn) − f(x1, ..., xn) h
- Example 1.6.4
- Let f(x1, x2) = (x1)3ln x2 with domain {(x1, x2): x2 > 0}. The partial derivative of f with respect to its first argument is the function f'1 defined by f'1(x1, x2) = 3(x1)2ln x2 and the partial derivative of f with respect to its second argument is the function f'2 defined by f'2(x1, x2) = (x1)3/x2.
The notation ∂f/∂x is also sometimes used. This notation has two major disadvantages. First, it is clumsy in using five symbols where three (Dif) suffice. Second, its reference to the variable with respect to which the function is being differentiated is imprecise. If f is a function of two variables, for example, and we want to denote its partial derivative with respect to its first argument at the point (a, b), what letter do we use to denote the first argument? Despite these limitations, the notation is often used by economists, and I sometimes follow suit.
Occasionally the argument of a function may be more conveniently referred to by its name than its index. If I have called the arguments of f by the names w and p, for example (writing f(w, p)), I may write fp(w, p) for the value of the partial derivative of f with respect to its second argument at the point (w, p).
If a function of many variables is differentiable at some point, then all of its partial derivatives exist at that point.
- Proposition 1.6.1 proof
- Let f be a function of many variables defined on an open set that is differentiable at x. Then all the partial derivatives of f exist at x and f is continuous at x.
- Proof hide
-
Let f be a function of n variables and choose i with 1 ≤ i ≤ n. In the definition of the derivative of f at x, take h to be a vector with hi = t and hj = 0 for all
j ≠ i. Then for any n-vector r, r · h = tri, so from the definition,
limt→0 f(x + h) − f(x) t = ri. To show that f is continuous at x, note that it follows from the definition of the derivative that there is a function K of n variables with limh→0 K(h)/|h| = 0 such that f(x + h) = f(x) + f'(x)h + K(h). Taking the limit as h → 0 on both sides, limh→0 f(x + h) = f(x), so that f is continuous.
However, the fact that all of the n partial derivatives of f exist at some point does not imply that f is differentiable, or even continuous, at that point. A simple example is the function f of two variables defined by f(x1, x2) = x1 + x2 if x1 = 0 or x2 = 0 and f(x1, x2) = 1 otherwise. Both partial derivatives of f exist at (0, 0) (they are equal to 1), but f is not continuous at (0, 0). Less obviously, a function that has partial derivatives at every point may not be differentiable, or even continuous. (See the example if you are curious.)
- Example
- Here is a function that has partial derivatives for all points in its domain but is not continuous at every point in its domain, and thus is not differentiable at every point in its domain. Define the function f of two variables by
f(x, y) = 0 if (x, y) = (0, 0) xy/(x2 + y2) if (x, y) ≠ (0, 0).
- Definition
- A function of many variables defined on an open set is continuously differentiable if it is differentiable and its derivative is a continuous function.
- Proposition 1.6.2 source
- Let f be a function of many variables defined on an open set S. Then f is continuously differentiable on S if and only if all its partial derivatives exist and are continuous on S.
Cross partial derivatives
Just as we can differentiate the derivative of a function (if the derivative is differentiable) to get the second derivative, we can partially differentiate the partial derivatives of a function (if the partial derivatives are differentiable). The functions produced by such operations are called “cross partial derivatives”.- Definition
- Let f be a function of many variables defined on an open set. Suppose that the partial derivative f'j of f with respect to its jth argument exists. Then if the derivative of f'j with respect to its ith argument exists, it is called the ijth cross partial derivative of f and is denoted f"ij.
- Proposition 1.6.3 (Young's theorem) source
-
Let f be a function of n variables defined on an open set and let 1 ≤ i ≤ n and 1 ≤ j ≤ n. If the partial derivatives f'i and
f'j of f exist in an open set S containing (x1, ..., xn) and both of these partial derivatives are differentiable at (x1, ..., xn)
then
f"ij(x1, ..., xn) = f"ji(x1, ..., xn).
- Example 1.6.5
-
Define the function f by f(x1, x2) = x1x2
2 for all (x1, x2). We have f'1(x1, x2) = x2
2, so that f'21(x1, x2) = 2x2, and f'2(x1, x2) = 2x1x2, so that f'12(x1, x2) = 2x2.
If you are wondering how the conclusion of the proposition can fail for a function that does not satisfy the assumptions, take a look at this example.
- Example
- Here is a function for which the cross-partials exist at (0, 0) but are not continuous at this point and the conclusion of the proposition fails: the cross-partials are not equal at (0, 0). Define the function f of two variables by
f(x, y) = 0 if (x, y) = (0, 0) xy(x2 − y2)/(x2 + y2) if (x, y) ≠ (0, 0).