Unit 3, lesson 15

Partial Derivatives

How to differentiate a function of several variables in one coordinate direction at a time, what those slopes mean on the graph, and when mixed second partials agree.

  • Theory part 29
  • Practice part 30
  • Functions, Limits, and Partial Derivatives

Stand on a hillside and face due east. The ground in front of you has a slope. Turn to face due north and the slope is different. A function of two variables has no single rate of change at a point, but if you move along one coordinate direction and hold the other fixed, you are back to an ordinary derivative. That derivative is a partial derivative.

Key terms

Varying one coordinate

Definition Let ff be a function of xx and yy and let (a,b)(a, b) be an interior point of its domain. The partial derivative of ff with respect to xx at (a,b)(a, b) is

fx(a,b)=lim⁡h→0f(a+h,b)−f(a,b)hf_x(a, b) = \lim_{h \to 0} \frac{f(a + h, b) - f(a, b)}{h}

and the partial derivative with respect to yy is

fy(a,b)=lim⁡h→0f(a,b+h)−f(a,b)hf_y(a, b) = \lim_{h \to 0} \frac{f(a, b + h) - f(a, b)}{h}

provided these limits exist. For three or more variables, change one coordinate by hh and keep all the others fixed. In practice fxf_x is computed by treating yy as a constant and differentiating in xx with the one-variable rules. Existence of both partial derivatives at a point says nothing about other directions, and it does not even make ff continuous there.

In plain words Freeze every input but one, then take the ordinary derivative in the one that is still moving.

Example For f(x,y)=3x2yf(x, y) = 3x^2 y at (1,3)(1, 3), only xx changes in the quotient,

f(1+h,3)−f(1,3)h=9(1+h)2−9h=18+9h,\begin{aligned} &\frac{f(1 + h, 3) - f(1, 3)}{h} \\[0.4em] &\quad = \frac{9(1 + h)^2 - 9}{h} = 18 + 9h, \end{aligned}

so fx(1,3)=18f_x(1, 3) = 18. The shortcut gives the same answer. With yy held constant, fx=6xyf_x = 6xy, and at (1,3)(1, 3) that is 1818.

Slopes of traces

Definition Let fx(a,b)f_x(a, b) exist. The trace of the graph z=f(x,y)z = f(x, y) in the vertical plane y=by = b is the curve z=f(x,b)z = f(x, b), and fx(a,b)f_x(a, b) is the slope of its tangent line at x=ax = a, measured in the xx direction. Likewise fy(a,b)f_y(a, b) is the slope at y=by = b of the trace z=f(a,y)z = f(a, y) in the plane x=ax = a. Both are rates of change of the output per unit change of one input.

In plain words Slice the surface parallel to one axis. The partial derivative is the steepness of the cut, read off like any single-variable slope.

Example For f(x,y)=4−x2−2y2f(x, y) = 4 - x^2 - 2y^2 at (1,1)(1, 1) the height is f(1,1)=1f(1, 1) = 1, and

fx=−2x,fy=−4y.f_x = -2x, \qquad f_y = -4y.

So fx(1,1)=−2f_x(1, 1) = -2 and fy(1,1)=−4f_y(1, 1) = -4. Walking in the positive xx direction from the point (1,1,1)(1, 1, 1) the surface drops 22 units per unit step, and in the positive yy direction it drops 44. The tangent line to the trace in the plane y=1y = 1 is z=1−2(x−1)z = 1 - 2(x - 1).

Partial derivative notation

Definition For z=f(x,y)z = f(x, y) the following all denote the partial derivative with respect to xx,

fx=∂f∂x=∂z∂x=zx=D1f,f_x = \frac{\partial f}{\partial x} = \frac{\partial z}{\partial x} = z_x = D_1 f,

and similarly for yy, with D2fD_2 f for the second input. The curly symbol ∂\partial signals that other variables are held fixed. A value at a point is written fx(a,b)f_x(a, b) or ∂f∂x(a,b)\frac{\partial f}{\partial x}(a, b). The partial derivatives are themselves functions, defined at the points where the limits exist.

In plain words Several notations, one idea. The subscript or the letter under ∂\partial names the variable that moves.

Example For f(x,y,z)=xeyzf(x, y, z) = x e^{yz}, defined on all of R3\mathbb{R}^3,

∂f∂x=eyz,∂f∂y=xzeyz,∂f∂z=xyeyz.\begin{gathered} \frac{\partial f}{\partial x} = e^{yz}, \qquad \frac{\partial f}{\partial y} = xz e^{yz}, \\[0.4em] \frac{\partial f}{\partial z} = xy e^{yz}. \end{gathered}

Domains matter too. For g(x,y)=ln⁡(x−y)g(x, y) = \ln(x - y), defined on the open set x>yx > y, the partials gx=1x−yg_x = \frac{1}{x - y} and gy=−1x−yg_y = -\frac{1}{x - y} hold only on that set.

Higher partial derivatives

Definition The partial derivatives of fxf_x and fyf_y, where they exist, are the second partial derivatives of ff. Writing the variables of differentiation in the order they are applied,

fxx=∂2f∂x2,fxy=∂2f∂y ∂x,fyx=∂2f∂x ∂y,fyy=∂2f∂y2.\begin{aligned} f_{xx} &= \frac{\partial^2 f}{\partial x^2}, & f_{xy} &= \frac{\partial^2 f}{\partial y \, \partial x}, \\[0.4em] f_{yx} &= \frac{\partial^2 f}{\partial x \, \partial y}, & f_{yy} &= \frac{\partial^2 f}{\partial y^2}. \end{aligned}

So fxy=(fx)yf_{xy} = (f_x)_y means differentiate first in xx, then in yy. In the ∂\partial notation the order reads from right to left. Third and higher partials are defined by repeating the process.

In plain words Take a partial derivative, then take a partial derivative of the result. Subscripts are read left to right in the order you differentiate.

Example Let f(x,y)=x3+x2y3−2y2f(x, y) = x^3 + x^2 y^3 - 2y^2. Then

fx=3x2+2xy3,fy=3x2y2−4y,\begin{aligned} f_x &= 3x^2 + 2xy^3, \\[0.4em] f_y &= 3x^2 y^2 - 4y, \end{aligned}

and

fxx=6x+2y3,fxy=6xy2,fyx=6xy2,fyy=6x2y−4.\begin{aligned} f_{xx} &= 6x + 2y^3, & f_{xy} &= 6xy^2, \\[0.4em] f_{yx} &= 6xy^2, & f_{yy} &= 6x^2 y - 4. \end{aligned}

At (2,1)(2, 1) these give fxx=14f_{xx} = 14, fyy=20f_{yy} = 20 and fxy=fyx=12f_{xy} = f_{yx} = 12.

Mixed partials

Definition The mixed partial derivatives of f(x,y)f(x, y) are fxyf_{xy} and fyxf_{yx}. They come from differentiating in the two variables in opposite orders. Without extra hypotheses they need not be equal, even at a single point.

In plain words Changing the order of differentiation usually changes nothing, but not always, so equality has to be justified.

Example Let

f(x,y)=xy(x2−y2)x2+y2,(x,y)≠(0,0),f(0,0)=0.\begin{gathered} f(x, y) = \frac{xy(x^2 - y^2)}{x^2 + y^2}, \\[0.4em] (x, y) \ne (0, 0), \qquad f(0, 0) = 0. \end{gathered}

Fix y≠0y \ne 0. Since f(0,y)=0f(0, y) = 0, the definition gives

fx(0,y)=lim⁡h→0f(h,y)h=lim⁡h→0y(h2−y2)h2+y2=−y.\begin{aligned} f_x(0, y) &= \lim_{h \to 0} \frac{f(h, y)}{h} \\[0.4em] &= \lim_{h \to 0} \frac{y(h^2 - y^2)}{h^2 + y^2} = -y. \end{aligned}

The same formula holds at y=0y = 0, because ff is 00 on the whole xx-axis and so fx(0,0)=0f_x(0, 0) = 0. A similar computation gives fy(x,0)=xf_y(x, 0) = x for every xx. Now fxy(0,0)f_{xy}(0, 0) is the derivative of fx(0,y)f_x(0, y) in yy at y=0y = 0, and fyx(0,0)f_{yx}(0, 0) is the derivative of fy(x,0)f_y(x, 0) in xx at x=0x = 0, so

fxy(0,0)=−1,fyx(0,0)=1.f_{xy}(0, 0) = -1, \qquad f_{yx}(0, 0) = 1.

The mixed partials disagree at the origin.

Clairaut’s theorem

Definition Let ff be defined on an open disk DD containing the point (a,b)(a, b). If the mixed partials fxyf_{xy} and fyxf_{yx} both exist at every point of DD and are continuous on DD, then

fxy(a,b)=fyx(a,b).f_{xy}(a, b) = f_{yx}(a, b).

More generally, if all partial derivatives of ff of order up to kk are continuous on an open set, then on that set any partial derivative of order at most kk is the same whatever the order of differentiation, so for example fxyy=fyxy=fyyxf_{xyy} = f_{yxy} = f_{yyx} when k≥3k \ge 3.

In plain words When the mixed partials are continuous, order does not matter. The counterexample above escapes the theorem because its mixed partials are not continuous at the origin. Away from the origin its fxyf_{xy} equals 11 on the xx-axis and −1-1 on the yy-axis, while fxy(0,0)=−1f_{xy}(0, 0) = -1.

Example Take f(x,y)=sin⁡(xy)f(x, y) = \sin(xy). Then fx=ycos⁡(xy)f_x = y\cos(xy) and fy=xcos⁡(xy)f_y = x\cos(xy), so

fxy=cos⁡(xy)−xysin⁡(xy)=fyx.f_{xy} = \cos(xy) - xy\sin(xy) = f_{yx}.

Both are continuous on all of R2\mathbb{R}^2, exactly as Clairaut’s theorem predicts.

Partial differential equations

Definition A partial differential equation is an equation relating an unknown function of two or more variables to some of its partial derivatives. A solution on an open set is a function with the needed partial derivatives there that makes the equation true at every point of the set. Three classical examples, with constants α≠0\alpha \ne 0 and c≠0c \ne 0, are

uxx+uyy=0(Laplace),ut=α2uxx(heat),utt=c2uxx(wave).\begin{gathered} u_{xx} + u_{yy} = 0 \quad \text{(Laplace)}, \\[0.4em] u_t = \alpha^2 u_{xx} \quad \text{(heat)}, \\[0.4em] u_{tt} = c^2 u_{xx} \quad \text{(wave)}. \end{gathered}

In plain words The unknown is a whole function, and the equation constrains how its partial derivatives fit together. Checking a proposed solution is just computing partials and substituting.

Example The function u(x,t)=e−tsin⁡xu(x, t) = e^{-t} \sin x solves the heat equation with α=1\alpha = 1 on all of R2\mathbb{R}^2. Indeed ut=−e−tsin⁡xu_t = -e^{-t}\sin x, and ux=e−tcos⁡xu_x = e^{-t}\cos x gives uxx=−e−tsin⁡xu_{xx} = -e^{-t}\sin x, the same function. It describes a sine-shaped temperature profile that fades over time.

Check yourself

  1. Let f(x,y)=xy2+3xf(x, y) = xy^2 + 3x. Find the slope of the trace of its graph in the plane x=2x = 2 at y=1y = 1, and the slope of the trace in the plane y=1y = 1 at x=2x = 2.
Show the answer

The trace in the plane x=2x = 2 is controlled by fy=2xyf_y = 2xy, so its slope at y=1y = 1 is fy(2,1)=4f_y(2, 1) = 4. The trace in the plane y=1y = 1 is controlled by fx=y2+3f_x = y^2 + 3, so its slope at x=2x = 2 is fx(2,1)=4f_x(2, 1) = 4.

  1. Show that u(x,y)=ln⁡(x2+y2)u(x, y) = \ln(x^2 + y^2) satisfies Laplace’s equation on its domain.
Show the answer

The domain is R2\mathbb{R}^2 without the origin, an open set. There ux=2xx2+y2u_x = \frac{2x}{x^2 + y^2}, and the quotient rule gives

uxx=2(y2−x2)(x2+y2)2,uyy=2(x2−y2)(x2+y2)2.\begin{aligned} u_{xx} &= \frac{2(y^2 - x^2)}{(x^2 + y^2)^2}, \\[0.4em] u_{yy} &= \frac{2(x^2 - y^2)}{(x^2 + y^2)^2}. \end{aligned}

Their sum is 00 at every point of the domain.

  1. Let f(x,y)=xyx2+y2f(x, y) = \dfrac{xy}{x^2 + y^2} for (x,y)≠(0,0)(x, y) \ne (0, 0) and f(0,0)=0f(0, 0) = 0. Find fx(0,0)f_x(0, 0) and fy(0,0)f_y(0, 0). Is ff continuous at the origin?
Show the answer

On the xx-axis f(h,0)=0f(h, 0) = 0, so the difference quotient f(h,0)−f(0,0)h\frac{f(h, 0) - f(0, 0)}{h} is 00 and fx(0,0)=0f_x(0, 0) = 0. In the same way fy(0,0)=0f_y(0, 0) = 0. Yet ff is not continuous at the origin, because along y=xy = x its values are 12\frac{1}{2}. Both partial derivatives exist and ff is still discontinuous.

How this lesson connects

It also uses Single-variable differentiation and chain rule and Functions, domains, and traces.