13 Functions of Several Variables

13.3 Partial Derivatives

Let y be a function of x. We have studied in great detail the derivative of y with respect to x, that is, dydx, which measures the rate at which y changes with respect to x. Consider now z=f(x,y). It makes sense to want to know how z changes with respect to x and/or y. This section begins our investigation into these rates of change.

margin:
(fullscreen)
(a)
(fullscreen)
(b)
Figure 13.3.1: By fixing y=2, the surface f(x,y)=x2+2y2 is a curve in space. Λ

Consider the function z=f(x,y)=x2+2y2, as graphed in Figure 13.3.1(a). By fixing y=2, we focus our attention to all points on the surface where the y-value is 2, shown in both parts (a) and (b) of the figure. These points form a curve in space: z=f(x,2)=x2+8 which is a function of just one variable. We can take the derivative of z with respect to x along this curve and find equations of tangent lines, etc.

The key notion to extract from this example is: by treating y as constant (it does not vary) we can consider how z changes with respect to x. In a similar fashion, we can hold x constant and consider how z changes with respect to y. This is the underlying principle of partial derivatives. We state the formal, limit-based definition first, then show how to compute these partial derivatives without directly taking limits.

Definition 13.3.1 Partial Derivative

Let z=f(x,y) be a continuous function on an open set S in 2.

  1. (a)

    The partial derivative of f with respect to x is:

    fx(x,y)=limh0f(x+h,y)-f(x,y)h.

    Alternate notations for fx(x,y) include:

    xf(x,y)=fx=zx=zx.
  2. (b)

    The partial derivative of f with respect to y is:

    fy(x,y)=limh0f(x,y+h)-f(x,y)h.

    There are similar alternate notations for fy(x,y).

Example 13.3.1 Computing partial derivatives with the limit definition

Let f(x,y)=x2y+2x+y3. Find fx(x,y) using the limit definition.

SolutionUsing Definition 13.3.1, we have:

fx(x,y) =limh0f(x+h,y)-f(x,y)h
=limh0(x+h)2y+2(x+h)+y3-(x2y+2x+y3)h
=limh0x2y+2xhy+h2y+2x+2h+y3-(x2y+2x+y3)h
=limh02xhy+h2y+2hh
=limh0(2xy+hy+2)
=2xy+2.

We have found fx(x,y)=2xy+2.

Example 13.3.1 found a partial derivative using the formal, limit-based definition. Using limits is not necessary, though, as we can rely on our previous knowledge of derivatives to compute partial derivatives easily. When computing fx(x,y), we hold y fixed — it does not vary. Therefore we can compute the derivative with respect to x by treating y as a constant or coefficient.

Just as ddx(5x2)=10x, we compute x(x2y)=2xy. Here we are treating y as a coefficient.

Just as ddx(53)=0, we compute x(y3)=0. Here we are treating y as a constant. More examples will help make this clear.

Example 13.3.2 Finding partial derivatives

Find fx(x,y) and fy(x,y) in each of the following.

  1. (a)

    f(x,y)=x3y2+5y2-x+7

  2. (b)

    f(x,y)=cos(xy2)+sinx

  3. (c)

    f(x,y)=ex2y3x2+1

Solution

  1. (a)

    We have f(x,y)=x3y2+5y2-x+7.
    Begin with fx(x,y). Keep y fixed, treating it as a constant or coefficient, as appropriate:

    fx(x,y)=3x2y2-1.

    Note how the 5y2 and 7 terms go to zero. To compute fy(x,y), we hold x fixed:

    fy(x,y)=2x3y+10y.

    Note how the -x and 7 terms go to zero.

  2. (b)

    We have f(x,y)=cos(xy2)+sinx.
    Begin with fx(x,y). We need to apply the Chain Rule with the cosine term; y2 is the coefficient of the x-term inside the cosine function.

    fx(x,y)=-sin(xy2)(y2)+cosx=-y2sin(xy2)+cosx.

    To find fy(x,y), note that x is the coefficient of the y2 term inside of the cosine term; also note that since x is fixed, sinx is also fixed, and we treat it as a constant.

    fy(x,y)=-sin(xy2)(2xy)=-2xysin(xy2).
  3. (c)

    We have f(x,y)=ex2y3x2+1.
    Beginning with fx(x,y), note how we need to apply the Product Rule.

    fx(x,y) =ex2y3(2xy3)x2+1+ex2y312(x2+1)-1/2(2x)
    =2xy3ex2y3x2+1+xex2y3x2+1.

    Note that when finding fy(x,y) we do not have to apply the Product Rule; since x2+1 does not contain y, we treat it as fixed and hence becomes a coefficient of the ex2y3 term.

    fy(x,y)=ex2y3(3x2y2)x2+1=3x2y2ex2y3x2+1.

We have shown how to compute a partial derivative, but it may still not be clear what a partial derivative means. Given z=f(x,y), fx(x,y) measures the rate at which z changes as only x varies: y is held constant.

Imagine standing in a rolling meadow, then beginning to walk due east. Depending on your location, you might walk up, sharply down, or perhaps not change elevation at all. This is similar to measuring zx: you are moving only east (in the “x”-direction) and not north/south at all. Going back to your original location, imagine now walking due north (in the “y”-direction). Perhaps walking due north does not change your elevation at all. This is analogous to zy=0: z does not change with respect to y. We can see that zx and zy do not have to be the same, or even similar, as it is easy to imagine circumstances where walking east means you walk downhill, though walking north makes you walk uphill.

The following example helps us visualize this more.

Example 13.3.3 Evaluating partial derivatives

Let z=f(x,y)=-x2-12y2+xy+10. Find fx(2,1) and fy(2,1) and interpret their meaning.

SolutionWe begin by computing fx(x,y)=-2x+y and fy(x,y)=-y+x. Thus

fx(2,1)=-3andfy(2,1)=1.

It is also useful to note that f(2,1)=7.5. What does each of these numbers mean?

margin:
(fullscreen)
(a)
(fullscreen)
(b)
Figure 13.3.2: Illustrating the meaning of partial derivatives. Λ

Consider fx(2,1)=-3, along with Figure 13.3.2(a). If one “stands” on the surface at the point (2,1,7.5) and moves parallel to the x-axis (i.e., only the x-value changes, not the y-value), then the instantaneous rate of change is -3. Increasing the x-value will decrease the z-value; decreasing the x-value will increase the z-value.

Now consider fy(2,1)=1, illustrated in Figure 13.3.2(b). Moving along the curve drawn on the surface, i.e., parallel to the y-axis and not changing the x-values, increases the z-value instantaneously at a rate of 1. Increasing the y-value by 1 would increase the z-value by approximately 1.

Since the magnitude of fx is greater than the magnitude of fy at (2,1), it is “steeper” in the x-direction than in the y-direction.

Second Partial Derivatives

Let z=f(x,y). We have learned to find the partial derivatives fx(x,y) and fy(x,y), which are each functions of x and y. Therefore we can take partial derivatives of these, each with respect to x and y. We define these “second partials” along with the notation, give examples, then discuss their meaning.

Definition 13.3.2 Second Partial Derivative, Mixed Partial Derivative

Let z=f(x,y) be continuous on an open set S.

  1. (a)

    The second partial derivative of f with respect to x then x is

    x(fx)=2fx2=(fx)x=fxx
  2. (b)

    The second partial derivative of f with respect to x then y is

    y(fx)=2fyx=(fx)y=fxy

Similar definitions hold for 2fy2=fyy and 2fxy=fyx.

The second partial derivatives fxy and fyx are mixed partial derivatives.

margin: Note: The terms in Definition 13.3.2 all depend on limits, so each definition comes with the caveat “where the limit exists.” The way to keep track of the order is to start with the variable nearest to the function. Unfortunately, this means that while 2fyx=fxy both mean “differentiate with respect to x first”, the x and y appear in a different order. Fortunately Theorem 13.3.1 will soon tell us that the order doesn’t usually matter. Λ

The notation of second partial derivatives gives some insight into the notation of the second derivative of a function of a single variable. If y=f(x), then f′′(x)=d2ydx2. The “d2y” portion means “take the derivative of y twice,” while “dx2” means “with respect to x both times.” When we only know of functions of a single variable, this latter phrase seems silly: there is only one variable to take the derivative with respect to. Now that we understand functions of multiple variables, we see the importance of specifying which variables we are referring to.

Example 13.3.4 Second partial derivatives

For each of the following, find all six first and second partial derivatives. That is, find

fx,fy,fxx,fyy,fxyandfyx.
  1. (a)

    f(x,y)=x3y2+2xy3+cosx

  2. (b)

    f(x,y)=x3y2

SolutionIn each, we give fx and fy immediately and then spend time deriving the second partial derivatives.

  1. (a)

    f(x,y)=x3y2+2xy3+cosxfx(x,y)=3x2y2+2y3-sinxfy(x,y)=2x3y+6xy2fxx(x,y)=x(fx)=x(3x2y2+2y3-sinx)=6xy2-cosxfyy(x,y)=y(fy)=y(2x3y+6xy2)=2x3+12xyfxy(x,y)=y(fx)=y(3x2y2+2y3-sinx)=6x2y+6y2fyx(x,y)=x(fy)=x(2x3y+6xy2)=6x2y+6y2

  2. (b)

    f(x,y)=x3y2=x3y-2fx(x,y)=3x2y2fy(x,y)=-2x3y3fxx(x,y)=x(fx)=x(3x2y2)=6xy2fyy(x,y)=y(fy)=y(-2x3y3)=6x3y4fxy(x,y)=y(fx)=y(3x2y2)=-6x2y3fyx(x,y)=x(fy)=x(-2x3y3)=-6x2y3.

Notice how in both of the functions in Example 13.3.4, fxy=fyx. Due to the complexity of the examples, this likely is not a coincidence. The following theorem states that it is not.

Theorem 13.3.1 Clairaut’s Theorem: Mixed Partial Derivatives

Let f be defined such that fxy and fyx are continuous on an open set S. Then for each point (x,y) in S, fxy(x,y)=fyx(x,y).

Finding fxy and fyx independently and comparing the results provides a convenient way of checking our work.

Understanding Second Partial Derivatives

Now that we know how to find second partials, we investigate what they tell us.

Again we refer back to a function y=f(x) of a single variable. The second derivative of f is “the derivative of the derivative,” or “the rate of change of the rate of change.” The second derivative measures how much the derivative is changing. If f′′(x)<0, then the derivative is getting smaller (so the graph of f is concave down); if f′′(x)>0, then the derivative is growing, making the graph of f concave up.

Now consider z=f(x,y). Similar statements can be made about fxx and fyy as could be made about f′′(x) above. When taking derivatives with respect to x twice, we measure how much fx changes with respect to x. If fxx(x,y)<0, it means that as x increases, fx decreases, and the graph of f will be concave down in the x-direction. Using the analogy of standing in the rolling meadow used earlier in this section, fxx measures whether one’s path is concave up/down when walking due east.

Similarly, fyy measures the concavity in the y-direction. If fyy(x,y)>0, then fy is increasing with respect to y and the graph of f will be concave up in the y-direction. Appealing to the rolling meadow analogy again, fyy measures whether one’s path is concave up/down when walking due north.

We now consider the mixed partials fxy and fyx. The mixed partial fxy measures how much fx changes with respect to y. Once again using the rolling meadow analogy, fx measures the slope if one walks due east. Looking east, begin walking north (side-stepping). Is the path towards the east getting steeper? If so, fxy>0. Is the path towards the east not changing in steepness? If so, then fxy=0. A similar thing can be said about fyx: consider the steepness of paths heading north while side-stepping to the east.

The following example examines these ideas with concrete numbers and graphs.

Example 13.3.5 Understanding second partial derivatives

Let z=x2-y2+xy. Evaluate the 6 first and second partial derivatives at (-1/2,1/2) and interpret what each of these numbers mean.

SolutionWe find that:

fx(x,y)=2x+y, fy(x,y)=-2y+x, fxx(x,y)=2,  fyy(x,y)=-2 and fxy(x,y)=fyx(x,y)=1. Thus at (-1/2,1/2) we have

fx(-1/2,1/2)=-1/2,fy(-1/2,1/2)=-3/2.

The slope of the tangent line at (-1/2,1/2,-1/4) in the direction of x is -1/2: if one moves from that point parallel to the x-axis, the instantaneous rate of change will be -1/2. The slope of the tangent line at this point in the direction of y is -3/2: if one moves from this point parallel to the y-axis, the instantaneous rate of change will be -3/2. These tangents lines are graphed in Figure 13.3.3(a) and (b), respectively, where the tangent lines are drawn in a solid line.

margin:
(fullscreen)
(a)
(fullscreen)
(b)
Figure 13.3.3: Understanding the second partial derivatives in Example 13.3.5. Λ

Now consider only Figure 13.3.3(a). Three directed tangent lines are drawn (two are dashed), each in the direction of x; that is, each has a slope determined by fx. Note how as y increases, the slope of these lines get closer to 0. Since the slopes are all negative, getting closer to 0 means the slopes are increasing. The slopes given by fx are increasing as y increases, meaning fxy must be positive.

Since fxy=fyx, we also expect fy to increase as x increases. Consider Figure 13.3.3(b) where again three directed tangent lines are drawn, this time each in the direction of y with slopes determined by fy. As x increases, the slopes become less steep (closer to 0). Since these are negative slopes, this means the slopes are increasing.

Thus far we have a visual understanding of fx, fy, and fxy=fyx. We now interpret fxx and fyy. In Figure 13.3.3(a), we see a curve drawn where x is held constant at x=-1/2: only y varies. This curve is clearly concave down, corresponding to the fact that fyy<0. In part (b) of the figure, we see a similar curve where y is constant and only x varies. This curve is concave up, corresponding to the fact that fxx>0.

Partial Derivatives and Functions of Three Variables

The concepts underlying partial derivatives can be easily extend to more than two variables. We give some definitions and examples in the case of three variables and trust the reader can extend these definitions to more variables if needed.

Definition 13.3.3 Partial Derivatives with Three Variables

Let w=f(x,y,z) be a continuous function on an open set S in 3.

The partial derivative of f with respect to x is:

fx(x,y,z)=limh0f(x+h,y,z)-f(x,y,z)h.

Similar definitions hold for fy(x,y,z) and fz(x,y,z).

By taking partial derivatives of partial derivatives, we can find second partial derivatives of f with respect to z then y, for instance, just as before.

Example 13.3.6 Partial derivatives of functions of three variables

For each of the following, find fx,  fy,  fz,   fxz,   fyz, and fzz.

  1. (a)

    f(x,y,z)=x2y3z4+x2y2+x3z3+y4z4

  2. (b)

    f(x,y,z)=xsin(yz)

Solution

  1. (a)

    fx=2xy3z4+2xy2+3x2z3fy=3x2y2z4+2x2y+4y3z4fz=4x2y3z3+3x3z2+4y4z3fxz=8xy3z3+9x2z2fyz=12x2y2z3+16y3z3fzz=12x2y3z2+6x3z+12y4z2

  2. (b)

    fx=sin(yz)fy=xzcos(yz)fz=xycos(yz)fxz=ycos(yz)fyz=xcos(yz)-xyzsin(yz)fzz=-xy2sin(xy)

Higher Order Partial Derivatives

We can continue taking partial derivatives of partial derivatives of partial derivatives of …; we do not have to stop with second partial derivatives. These higher order partial derivatives do not have a tidy graphical interpretation; nevertheless they are not hard to compute and worthy of some practice.

We do not formally define each higher order derivative, but rather give just a few examples of the notation.

fxyx(x,y) =x(y(fx))and
fxyz(x,y,z) =z(y(fx)).
Example 13.3.7 Higher order partial derivatives


(a) Let f(x,y)=x2y2+sin(xy). Find fxxy and fyxx. (b) Let f(x,y,z)=x3exy+cos(z). Find fxyz.

Solution

  1. (a)

    To find fxxy, we first find fx, then fxx, then fxxy:

    fx =2xy2+ycos(xy)  fxx=2y2-y2sin(xy)
    fxxy =4y-2ysin(xy)-xy2cos(xy).

    To find fyxx, we first find fy, then fyx, then fyxx:

    fy =2x2y+xcos(xy)  fyx=4xy+cos(xy)-xysin(xy)
    fyxx =4y-ysin(xy)-(ysin(xy)+xy2cos(xy))
    =4y-2ysin(xy)-xy2cos(xy).

    Note how fxxy=fyxx.

  2. (b)

    To find fxyz, we find fx, then fxy, then fxyz:

    fx =3x2exy+x3yexy
    fxy =3x3exy+x3exy+x4yexy=4x3exy+x4yexy
    fxyz =0.

In the previous example we saw that fxxy=fyxx; this is not a coincidence. While we do not state this as a formal theorem, as long as each partial derivative is continuous, it does not matter the order in which the partial derivatives are taken. For instance, fxxy=fxyx=fyxx.

This can be useful at times. Had we known this, the second part of Example 13.3.7 would have been much simpler to compute. Instead of computing fxyz in the x, y then z orders, we could have applied the z, then x then y order (as fxyz=fzxy). It is easy to see that fz=-sinz; then fzx and fzxy are clearly 0 as fz does not contain an x or y.

We have seen that partial derivatives measure the instantaneous rate of change of a multivariable function with respect to one variable. With z=f(x,y), the partial derivatives fx and fy measure the instantaneous rate of change of z when moving parallel to the x- and y-axes, respectively. How do we measure the rate of change at a point when we do not move parallel to one of these axes? What if we move in the direction given by the vector 2,1? Can we measure that rate of change? The answer is, of course, yes, we can. This is the topic of Section 13.6. First, we need to define what it means for a function of two variables to be differentiable.

Exercises 13.3

 

Terms and Concepts

  1. 1.

    What is the difference between a constant and a coefficient?

  2. 2.

    Given a function z=f(x,y), explain in your own words how to compute fx.

  3. 3.

    In the expression fxy, which is computed first, fx or fy?

  4. 4.

    In the expression 2fxy, which is computed first, fx or fy?

Problems

In Exercises 5–8., evaluate fx(x,y) and fy(x,y) at the indicated point.

  1. 5.

    f(x,y)=x2y-x+2y+3 at (1,2)

  2. 6.

    f(x,y)=x3-3x+y2-6y at (-1,3)

  3. 7.

    f(x,y)=sinycosx at (π/3,π/3)

  4. 8.

    f(x,y)=ln(xy) at (-2,-3)

In Exercises 9–26., find fx,  fy,   fxx,   fyy,   fxy and fyx.

  1. 9.

    f(x,y)=x2y+3x2+4y-5

  2. 10.

    f(x,y)=y3+3xy2+3x2y+x3

  3. 11.

    f(x,y)=xy

  4. 12.

    f(x,y)=4xy

  5. 13.

    f(x,y)=ex2+y2

  6. 14.

    f(x,y)=ex+2y

  7. 15.

    f(x,y)=sinxcosy

  8. 16.

    f(x,y)=(x+y)3

  9. 17.

    f(x,y)=cos(5xy3)

  10. 18.

    f(x,y)=sin(5x2+2y3)

  11. 19.

    f(x,y)=4xy2+1

  12. 20.

    f(x,y)=(2x+5y)y

  13. 21.

    f(x,y)=1x2+y2+1

  14. 22.

    f(x,y)=5x-17y

  15. 23.

    f(x,y)=3x2+1

  16. 24.

    f(x,y)=ln(x2+y)

  17. 25.

    f(x,y)=lnx4y

  18. 26.

    f(x,y)=5exsiny+9

In Exercises 27–30., form a function z=f(x,y) such that fx and fy match those given.

  1. 27.

    fx=siny+1, fy=xcosy

  2. 28.

    fx=x+y, fy=x+y

  3. 29.

    fx=6xy-4y2, fy=3x2-8xy+2

  4. 30.

    fx=2xx2+y2, fy=2yx2+y2

In Exercises 31–34., find fx,  fy,  fz,  fyz and fzy.

  1. 31.

    f(x,y,z)=x2e2y-3z

  2. 32.

    f(x,y,z)=x3y2+x3z+y2z

  3. 33.

    f(x,y,z)=3x7y2z

  4. 34.

    f(x,y,z)=ln(xyz)

Omni CMS