Partial Derivatives

The derivative of a function $y = f(x)$ tells us about the rate of change of f. If $z = f(x, y)$ is a function with 2 inputs and 1 output, what does "rate of change" mean?

The graph of $z = f(x, y)$ is a surface in 3 dimensions. Imagine standing somewhere on the surface. How steep is the surface there?

A little thought shows that the question is ambiguous. For example, if you're standing on the side of a hill, the slope is steep in the uphill and downhill directions. On the other hand, the slope is gentle if you walk along the side of the hill at a constant altitude.

You can see that in order to discuss the rate of change of a function of several variables, you need to specify the direction in which the change occurs. This may seem to be a complicated proposition. At a given point $(x, y)$ , you can move in infinitely many directions.

For simplicity, suppose I'll consider changes in the x- and y-directions first. If you're at the point $(x, y)$ and you move in the x-direction by a small amount h, you wind up at the point $(x
   + h, y)$ . The change in f is

$$\Delta f = f(x + h, y) - f(x, y).$$

The average rate of change is

$$\dfrac{f(x + h, y) - f(x, y)}{h}.$$

As usual, you can take the limit as $h \to 0$ to obtain the instantaneous rate of change:

$$\pder f x = \lim_{h \to 0} \dfrac{f(x + h, y) - f(x, y)}{h}.$$

This is the partial derivative of f with respect to x; notice that the notation $\pder f x$ is a little different than the $\der y
   x$ notation for ordinary derivatives. Likewise, the partial derivative of f with respect to y is

$$\pder f y = \lim_{h \to 0} \dfrac{f(x, y + h) - f(x, y)}{h}.$$

It measures the rate at which f changes as y changes.

Subscripts can also be used to denote partial derivatives. Thus,

$$f_x \quad\hbox{means}\quad \pder f x \quad\hbox{and}\quad f_y \quad\hbox{means}\quad \pder f y.$$

To see what partial derivatives mean pictorially, consider the graph of a surface $z = f(x, y)$ :

$$\hbox{\epsfysize=1.75 in \epsffile{partial-derivatives-1.eps}}$$

The partial derivatives of f at a point on the surface are the rates of change of f in the x- and y-directions. Draw curves through the point in the x- and y-directions. Then $\pder f x$ and $\pder
   f y$ are just the slopes of these curves at the point.

$$\hbox{\epsfysize=1.75 in \epsffile{partial-derivatives-2.eps}}$$

Notice that in computing these partial derivatives, you change one variable at a time, holding the other constant. This is the key to computing partial derivatives: You differentiate as usual with respect to one variable at a time, holding the others constant.

Example. Compute the partial derivatives of $z = f(x, y) = x e^{xy}$ .

The partial derivatives are

$$\pder z x = x \cdot y e^{x y} + 1 \cdot e^{xy} \quad\hbox{and}\quad \pder f y = x^2 e^{x y}.$$

Notice that I used the product rule in computing $\pder f x$ , because f is a product (x times $e^{x y}$ ) with respect to x. But I don't need the product rule to compute $\pder f
   y$ : with respect to y, the first factor x is constant.

Example. Compute the partial derivatives of $z = (x + 2)^3(y - 3)^4$ .

$$\pder z x = 3(x + 2)2(y - 3)^4 \quad\hbox{and}\quad \pder z y = 4(x + 2)^3(y - 3)^3.\quad\halmos$$

Example. Suppose $f(x)$ is a function of x alone and $g(y)$ is a function of y alone. Compute the partial derivatives of $h(x, y) =
   \sin \left(f(x) + g(y)\right)$ .

$$h_x = f'(x) \cos \left(f(x) + g(y)\right) \quad\hbox{and}\quad h_y = g'(y) \cos \left(f(x) + g(y)\right).\quad\halmos$$

The same idea applies to computing partial derivatives of functions of more than two variables. For example, the partial derivatives of $w = f(x, y, z)$ are

$$\pder f x = f_x, \quad \pder f y = f_y, \quad\hbox{and}\quad \pder f z = f_z.$$

In each case, you compute the partial derivative with respect to the variable FOO by differentiating with respect to FOO while holding the other variables constant.

Here's the general definition for a function $f(x_1, x_2, \ldots x_n)$ of n variables. Assume $f: U \to \real$ , where U is a subset of $\real^n$ . We usually assume U is an open set, but you don't need to worry about it in this course.

Definition. The partial derivative of f with respect to $x_k$ is

$$\pder f {x_k} = \lim_{h \to 0} \dfrac{f(x_1, x_2, \ldots x_k + h, \ldots x_n) - f(x_1, x_2, \ldots x_k, \ldots x_n)}{h}.$$

Since this is just the derivative of the single variable function $x_k \to f(x_1, x_2, \ldots
   x_k, \ldots x_n)$ , all your usual derivative formulas from single-variable calculus work. I won't them all, but here are some examples.

Proposition. Suppose $U \subset \real^n$ , $f, g: U \to \real$ are functions of n variables $x_1$ , $x_2$ , ... $x_n$ , and c is a number.

(a) $\pder {} {x_k} (x) =
   \pder {} {x_k} f(x) + \pder {} {x_k} g(x)$ .

(b) $\pder {} {x_k} (c
   \cdot f(x)) = c \cdot \pder {} {x_k} f(x)$ .

(c) $\pder {} {x_k} (f(x)
   \cdot g(x)) = f(x) \cdot \pder {} {x_k} g(x) + g(x) \cdot \pder {}
   {x_k} f(x)$ .

(d) $\pder {} {x_k}
   \dfrac{f(x)}{g(x)} = \dfrac{g(x) \pder {} {x_k} f(x) - f(x) \pder {}
   {x_k} g(x)}{g(x)^2}$ , provided that $g(x) \ne 0$ .

I've written $x = (x_1,
   x_2, \ldots x_n)$ for short.

Example. Compute the partial derivatives of $w = \dfrac{x^2 + 3
   y^2}{z}$ .

$$\pder w x = \dfrac{2 x}{z}, \quad \pder w y = \dfrac{6 y}{z}, \quad \pder w z = -\dfrac{x^2 + 3 y^2}{z^2}.\quad\halmos$$

Example. Compute the partial derivatives of $f(x, y, z) = 2 x y + 3 y z
   - 5 x z$ .

$$f_x = 2 y - 5 z, \quad f_y = 2 x + 3 z, \quad f_z = 3 y - 5 x.\quad\halmos$$

There are also have higher order derivatives, and here some complications can arise. Suppose $z = f(x, y)$ . The second derivatives should be the derivatives of the first derivatives. There are two first derivatives, $\pder f x$ and $\pder f y$ , and each of these may be differentiated with respect to x and to y. So there seem to be 4 second-order partials,

$$\pder {} x \left(\pder f x\right) = \dfrac{\partial^2 f}{\partial x^2} = f_{x x},$$

$$\pder {} x \left(\pder f y\right) = \dfrac{\partial^2 f}{\partial x \partial y} = f_{y x},$$

$$\pder {} y \left(\pder f x\right) = \dfrac{\partial^2 f}{\partial y \partial x} = f_{x y},$$

$$\pder {} y \left(\pder f y\right) = \dfrac{\partial^2 f}{\partial y^2} = f_{y y}.$$

(Notice that the subscript notation has the bottom variables in the opposite order from the fractional notation. The rationale is that in the subscript notation, variables "pile up" on the right side as you take more derivatives.)

Example. Compute the second partial derivatives of $z = x^2 - 3
   x y + y^4$ .

$$z_x = 2 x - 3 y, \quad z_y = -3 x + 4 y^3,$$

$$z_{x x} = 2, \quad z_{x y} = -3, \quad z_{y x} = -3, \quad z_{y y} = 12 y^2.\quad\halmos$$

Notice that the two mixed partials $z_{xy}$ and $z_{yx}$ are equal. In fact, this fact (which is called equality of mixed partials is true for most "nice" functions. The technical definition of "niceness" is that the function $f(x, y)$ have continuous second-order partial derivatives. Here's the result stated in all its technical glory.

Theorem. Suppose U is an open subset of $\real^n$ and $f: U
   \to \real$ is a function of n variables. If the second-order partial derivatives of f are continuous, then for $1 \le
   i < j \le n$ ,

$$\pdertwom f {x_i} {x_j} = \pdertwom f {x_j} {x_i}.$$

With appropriate assumptions, higher-order mixed partials involving the same variables to the same orders are also equal. For example, for a function of 3 variables satisfying the right assumptions,

$$\dfrac{\partial^3 f}{\partial x \partial z \partial x} = \dfrac{\partial^3 f}{\partial z \partial x \partial z}.$$

Example. Compute the second partial derivatives of $w = 2 x y +
   \dfrac{3 y}{z}$ .

There are 3 first-order partials, each of which has 3 partial derivatives, so there are 9 second-order partials. But equality of mixed partials implies that some of these will be the same; for example, $w_{xz} = w_{zx}$ . There are actually only 6 distinct second-order partials.

$$w_x = 2 y, \quad w_y = 2 x + \dfrac{3}{z}, \quad w_z = -\dfrac{3 y}{z^2},$$

$$w_{x x} = 0, \quad w_{x y} = w_{y x} = 2, \quad w_{x z} = w_{z x} = 0,$$

$$w_{y y} = 0, \quad w_{y z} = w_{z y} = -\dfrac{3}{z^2}, \quad w_{z z} = \dfrac{6 y}{z^3}.\quad\halmos$$

Contact information

Bruce Ikenaga's Home Page

Copyright 2018 by Bruce Ikenaga