## Section 14.1 Differentiability and the Total Differential

We studied *differentials* in SectionÂ 4.4, where DefinitionÂ 4.4.5 states that if \(y=f(x)\) and \(f\) is differentiable, then \(dy=\fp(x)dx\text{.}\) One important use of this differential is in Integration by Substitution. Another important application is approximation. Let \(\dx = dx\) represent a change in \(x\text{.}\) When \(dx\) is small, \(dy\approx \dy\text{,}\) the change in \(y\) resulting from the change in \(x\text{.}\) Fundamental in this understanding is this: as \(dx\) gets small, the difference between \(\dy\) and \(dy\) goes to 0. Another way of stating this: as \(dx\) goes to 0, the *error* in approximating \(\dy\) with \(dy\) goes to 0.

We extend this idea to functions of two variables. Let \(z=f(x,y)\text{,}\) and let \(\dx = dx\) and \(\dy=dy\) represent changes in \(x\) and \(y\text{,}\) respectively. Let \(\ddz = f(x+dx,y+dy) - f(x,y)\) be the change in \(z\) over the change in \(x\) and \(y\text{.}\) Recalling that \(f_x\) and \(f_y\) give the instantaneous rates of \(z\)-change in the \(x\)- and \(y\)-directions, respectively, we can approximate \(\ddz\) with \(dz = f_xdx+f_ydy\text{;}\) in words, the total change in \(z\) is approximately the change caused by changing \(x\) plus the change caused by changing \(y\text{.}\) In a moment we give an indication of whether or not this approximation is any good. First we give a name to \(dz\text{.}\)

### Subsection 14.1.1 The Total Differential

#### Definition 14.1.1. Total Differential.

Let \(z=f(x,y)\) be continuous on a set \(S\text{.}\) Let \(dx\) and \(dy\) represent changes in \(x\) and \(y\text{,}\) respectively. Where the partial derivatives \(f_x\) and \(f_y\) exist, the total differential of \(z\) is

#### Example 14.1.2. Finding the total differential.

Let \(z = x^4e^{3y}\text{.}\) Find \(dz\text{.}\)

We compute the partial derivatives: \(f_x = 4x^3e^{3y}\) and \(f_y = 3x^4e^{3y}\text{.}\) Following DefinitionÂ 14.1.1, we have

We *can* approximate \(\ddz\) with \(dz\text{,}\) but as with all approximations, there is error involved. A good approximation is one in which the error is small. At a given point \((x_0,y_0)\text{,}\) let \(E_x\) and \(E_y\) be functions of \(dx\) and \(dy\) such that \(E_xdx+E_ydy\) describes this error. Then

If the approximation of \(\ddz\) by \(dz\) is good, then as \(dx\) and \(dy\) get small, so does \(E_xdx+E_ydy\text{.}\) The approximation of \(\ddz\) by \(dz\) is even better if, as \(dx\) and \(dy\) go to 0, so do \(E_x\) and \(E_y\text{.}\) This leads us to our definition of differentiability.

#### Definition 14.1.3. Multivariable Differentiability.

Let \(z=f(x,y)\) be defined on a set \(S\) containing \((x_0,y_0)\) where \(f_x(x_0,y_0)\) and \(f_y(x_0,y_0)\) exist. Let \(dz\) be the total differential of \(z\) at \((x_0,y_0)\text{,}\) let \(\ddz = f(x_0+dx,y_0+dy) - f(x_0,y_0)\text{,}\) and let \(E_x\) and \(E_y\) be functions of \(dx\) and \(dy\) such that

We say \(f\) is

*differentiable at \((x_0,y_0)\)*if, given \(\varepsilon \gt 0\text{,}\) there is a \(\delta \gt 0\) such that if \(\norm{\la dx,dy\ra} \lt \delta\text{,}\) then \(\norm{\la E_x,E_y\ra} \lt \varepsilon\text{.}\) That is, as \(dx\) and \(dy\) go to 0, so do \(E_x\) and \(E_y\text{.}\)We say \(f\) is

*differentiable on \(S\)*if \(f\) is differentiable at every point in \(S\text{.}\) If \(f\) is differentiable on \(\mathbb{R}^2\text{,}\) we say that \(f\) is*differentiable everywhere*.

#### Example 14.1.5. Showing a function is differentiable.

Show \(f(x,y) = xy+3y^2\) is differentiable using DefinitionÂ 14.1.3.

We begin by finding \(f(x+dx,y+dy)\text{,}\) \(\ddz\text{,}\) \(f_x\) and \(f_y\text{.}\)

\(\ddz = f(x+dx,y+dy) - f(x,y)\text{,}\) so

It is straightforward to compute \(f_x = y\) and \(f_y = x+6y\text{.}\) Consider once more \(\ddz\text{:}\)

With \(E_x = dy\) and \(E_y = 3dy\text{,}\) it is clear that as \(dx\) and \(dy\) go to 0, \(E_x\) and \(E_y\) also go to 0. Since this did not depend on a specific point \((x_0,y_0)\text{,}\) we can say that \(f(x,y)\) is differentiable for all pairs \((x,y)\) in \(\mathbb{R}^2\text{,}\) or, equivalently, that \(f\) is differentiable everywhere.

Our intuitive understanding of differentiability of functions \(y=f(x)\) of one variable was that the graph of \(f\) was â€śsmooth.â€ť A similar intuitive understanding of functions \(z=f(x,y)\) of two variables is that the surface defined by \(f\) is also â€śsmooth,â€ť not containing cusps, edges, breaks, etc. The following theorem states that differentiable functions are continuous, followed by another theorem that provides a more tangible way of determining whether a great number of functions are differentiable or not.

#### Theorem 14.1.7. Continuity and Differentiability of Multivariable Functions.

Let \(z=f(x,y)\) be defined on a set \(S\) containing \((x_0,y_0)\text{.}\) If \(f\) is differentiable at \((x_0,y_0)\text{,}\) then \(f\) is continuous at \((x_0,y_0)\text{.}\)

#### Theorem 14.1.8. Differentiability of Multivariable Functions.

Let \(z=f(x,y)\) be defined on a set \(S\text{.}\) If \(f_x\) and \(f_y\) are both continuous on \(S\text{,}\) then \(f\) is differentiable on \(S\text{.}\)

The theorems assure us that essentially all functions that we see in the course of our studies here are differentiable (and hence continuous) on their natural domains. There is a difference between DefinitionÂ 14.1.3 and TheoremÂ 14.1.8, though: it is possible for a function \(f\) to be differentiable yet \(f_x\) and/or \(f_y\) is *not* continuous. Such strange behavior of functions is a source of delight for many mathematicians.

When \(f_x\) and \(f_y\) exist at a point but are not continuous at that point, we need to use other methods to determine whether or not \(f\) is differentiable at that point.

For instance, consider the function

We can find \(f_x(0,0)\) and \(f_y(0,0)\) using DefinitionÂ 13.3.3:

Both \(f_x\) and \(f_y\) *exist* at \((0,0)\text{,}\) but they are not continuous at \((0,0)\text{,}\) as

are not continuous at \((0,0)\text{.}\) (Take the limit of \(f_x\) as \((x,y)\to(0,0)\) along the \(x\)- and \(y\)-axes; they give different results.) So even though \(f_x\) and \(f_y\) *exist* at every point in the \(xy\)-plane, they are not continuous. Therefore it is possible, by TheoremÂ 14.1.8, for \(f\) to not be differentiable.

Indeed, it is not. One can show that \(f\) is not continuous at \((0,0)\) (see ExampleÂ 13.2.11), and by TheoremÂ 14.1.7, this means \(f\) is not differentiable at \((0,0)\text{.}\)

### Subsection 14.1.2 Approximating with the Total Differential

By the definition, when \(f\) is differentiable \(dz\) is a good approximation for \(\ddz\) when \(dx\) and \(dy\) are small. We give some simple examples of how this is used here.

#### Example 14.1.9. Approximating with the total differential.

Let \(z = \sqrt{x}\sin(y)\text{.}\) Approximate \(f(4.1,0.8)\text{.}\)

Recognizing that \(\pi/4 \approx 0.785\approx 0.8\text{,}\) we can approximate \(f(4.1,0.8)\) using \(f(4,\pi/4)\text{.}\) We can easily compute \(f(4,\pi/4) = \sqrt{4}\sin(\pi/4) = 2\left(\frac{\sqrt{2}}2\right) = \sqrt{2}\approx 1.414\text{.}\) Without calculus, this is the best approximation we could reasonably come up with. The total differential gives us a way of adjusting this initial approximation to hopefully get a more accurate answer.

We let \(\ddz = f(4.1,0.8) - f(4,\pi/4)\text{.}\) The total differential \(dz\) is approximately equal to \(\ddz\text{,}\) so

To find \(dz\text{,}\) we need \(f_x\) and \(f_y\text{.}\)

Approximating \(4.1\) with 4 gives \(dx = 0.1\text{;}\) approximating \(0.8\) with \(\pi/4\) gives \(dy \approx 0.015\text{.}\) Thus

Returning to Equation (14.1.1), we have

We, of course, can compute the actual value of \(f(4.1,0.8)\) with a calculator; the actual value, accurate to 5 places after the decimal, is \(1.45254\text{.}\) Obviously our approximation is quite good.

The point of the previous example was *not* to develop an approximation method for known functions. After all, we can very easily compute \(f(4.1,0.8)\) using readily available technology. Rather, it serves to illustrate how well this method of approximation works, and to reinforce the following concept:

â€śNew position = old position \(+\) amount of change,â€ť so

â€śNew position \(\approx\) old position + approximate amount of change.â€ť

In the previous example, we could easily compute \(f(4,\pi/4)\) and could approximate the amount of \(z\)-change when computing \(f(4.1,0.8)\text{,}\) letting us approximate the new \(z\)-value.

It may be surprising to learn that it is not uncommon to know the values of \(f\text{,}\) \(f_x\) and \(f_y\) at a particular point without actually knowing the function \(f\text{.}\) The total differential gives a good method of approximating \(f\) at nearby points.

#### Example 14.1.10. Approximating an unknown function.

Given that \(f(2,-3) = 6\text{,}\) \(f_x(2,-3) = 1.3\) and \(f_y(2,-3) = -0.6\text{,}\) approximate \(f(2.1,-3.03)\text{.}\)

The total differential approximates how much \(f\) changes from the point \((2,-3)\) to the point \((2.1,-3.03)\text{.}\) With \(dx = 0.1\) and \(dy = -0.03\text{,}\) we have

The change in \(z\) is approximately \(0.148\text{,}\) so we approximate \(f(2.1,-3.03)\approx 6.148\text{.}\)

### Subsection 14.1.3 Tangent Plane Approximation

Recall from ChapterÂ 2 that in one variable, the essence of differentiability is the tangent line approximation. This idea is emphasized in SectionÂ 4.4, where we first introduced the differential.

In SectionÂ 13.3.2 we saw that the partial derivatives of a function \(f(x,y)\) can be used to define the tangent *plane* to a graph \(z=f(x,y)\text{.}\) We will now see that this plane plays the same role for functions of two variables as the tangent line to a graph \(y=f(x)\) for a function of one variable.

Recall from DefinitionÂ 4.4.4 that for a function \(f(x)\text{,}\) when \(x\) is near \(c\) we have the linear approximation \(f(x)\approx \ell(x)\text{,}\) where

is the linearization of \(f\) at \(c\text{.}\) If we set \(dx=\dx = x-c\text{,}\) and evaluate the differential \(dy = f'(x)\,dx\) at \(c\text{,}\) then we have

Given the graph \(y=f(x)\text{,}\) we know that \(y=\ell(x)\) gives the tangent line to the graph at \(c\text{.}\) For the graph \(z=f(x,y)\) of a function of two variables, we similarly have the tangent plane

defined in DefinitionÂ 13.3.10, suggesting that we define the two variable linearization

Consider the total differential \(dz\) at \((a,b)\text{:}\)

If we assume that \((x,y)\) is â€ścloseâ€ť to \((a,b)\text{,}\) and set \(dx = x-a\text{,}\) \(dy = y-b\text{,}\) then we have

Since \(\ell(a,b)=f(a,b)\text{,}\) we have \(\ell(x,y)-\ell(a,b) = dz\text{,}\) which agrees with the one-variable situation, and reinforces the concept of the differential as the â€ślinear changeâ€ť in a function.

If we recast DefinitionÂ 14.1.3 in the language of tangent planes, we can more easily see the analogy with functions of a single variable. We can now say that \(f(x,y)\) is differentiable at \((a,b)\) if it has a valid tangent plane approximation at \((a,b)\text{.}\) Note that \(f(x,y)-\ell(x,y)\) is equal to the error term \(E_x\,dx+E_y\,dy\text{.}\)

By TheoremÂ 14.1.7, we know that the tangent plane at \((a,b,f(a,b))\) exists, and gives a good approximation to the graph \(z=f(x,y)\text{,}\) as long as the partial derivatives of \(f\) exist and are continuous at \((a,b)\text{.}\)

### Subsection 14.1.4 Error/Sensitivity Analysis

The total differential gives an approximation of the change in \(z\) given small changes in \(x\) and \(y\text{.}\) We can use this to approximate error propagation; that is, if the input is a little off from what it should be, how far from correct will the output be? We demonstrate this in an example.

#### Example 14.1.11. Sensitivity analysis.

A cylindrical steel storage tank is to be built that is 10ft tall and 4ft across in diameter. It is known that the steel will expand/contract with temperature changes; is the overall volume of the tank more sensitive to changes in the diameter or in the height of the tank?

A cylindrical solid with height \(h\) and radius \(r\) has volume \(V = \pi r^2h\text{.}\) We can view \(V\) as a function of two variables, \(r\) and \(h\text{.}\) We can compute partial derivatives of \(V\text{:}\)

The total differential is \(dV = (2\pi rh)dr + (\pi r^2)dh\text{.}\) When \(h = 10\) and \(r = 2\text{,}\) we have \(dV = 40\pi dr + 4\pi dh\text{.}\) Note that the coefficient of \(dr\) is \(40\pi\approx 125.7\text{;}\) the coefficient of \(dh\) is a tenth of that, approximately \(12.57\text{.}\) A small change in radius will be multiplied by 125.7, whereas a small change in height will be multiplied by 12.57. Thus the volume of the tank is more sensitive to changes in radius than in height.

The previous example showed that the volume of a particular tank was more sensitive to changes in radius than in height. Keep in mind that this analysis only applies to a tank of those dimensions. A tank with a height of 1ft and radius of 5ft would be more sensitive to changes in height than in radius.

One could make a chart of small changes in radius and height and find exact changes in volume given specific changes. While this provides exact numbers, it does not give as much insight as the error analysis using the total differential.

### Subsection 14.1.5 Differentiability of Functions of Three Variables

The definition of differentiability for functions of three variables is very similar to that of functions of two variables. We again start with the total differential.

#### Definition 14.1.12. Total Differential.

Let \(w=f(x,y,z)\) be continuous on a set \(D\text{.}\) Let \(dx\text{,}\) \(dy\) and \(dz\) represent changes in \(x\text{,}\) \(y\) and \(z\text{,}\) respectively. Where the partial derivatives \(f_x\text{,}\) \(f_y\) and \(f_z\) exist, the total differential of \(w\) is

This differential can be a good approximation of the change in \(w\) when \(w = f(x,y,z)\) is *differentiable*.

#### Definition 14.1.13. Multivariable Differentiability.

Let \(w=f(x,y,z)\) be defined on a set \(D\) containing \((x_0,y_0,z_0)\) where \(f_x(x_0,y_0,z_0)\text{,}\) \(f_y(x_0,y_0,z_0)\) and \(f_z(x_0,y_0,z_0)\) exist. Let \(dw\) be the total differential of \(w\) at \((x_0,y_0,z_0)\text{,}\) let \(\Delta w = f(x_0+dx,y_0+dy,z_0+dz) - f(x_0,y_0,z_0)\text{,}\) and let \(E_x\text{,}\) \(E_y\) and \(E_z\) be functions of \(dx\text{,}\) \(dy\) and \(dz\) such that

We say \(f\) is

*differentiable at \((x_0,y_0,z_0)\)*if, given \(\varepsilon \gt 0\text{,}\) there is a \(\delta \gt 0\) such that if \(\norm{\la dx,dy,dz\ra} \lt \delta\text{,}\) then \(\norm{\la E_x,E_y,E_z\ra} \lt \varepsilon\text{.}\)We say \(f\) is

*differentiable on \(B\)*if \(f\) is differentiable at every point in \(B\text{.}\) If \(f\) is differentiable on \(\mathbb{R}^3\text{,}\) we say that \(f\) is*differentiable everywhere*.

Just as before, this definition gives a rigorous statement about what it means to be differentiable that is not very intuitive. We follow it with a theorem similar to TheoremÂ 14.1.8.

#### Theorem 14.1.14. Continuity and Differentiability of Functions of Three Variables.

Let \(w=f(x,y,z)\) be defined on a set \(D\) containing \((x_0,y_0,z_0)\text{.}\)

If \(f\) is differentiable at \((x_0,y_0,z_0)\text{,}\) then \(f\) is continuous at \((x_0,y_0,z_0)\text{.}\)

If \(f_x\text{,}\) \(f_y\) and \(f_z\) are continuous on \(B\text{,}\) then \(f\) is differentiable on \(B\text{.}\)

This set of definition and theorem extends to functions of any number of variables. The theorem again gives us a simple way of verifying that most functions that we encounter are differentiable on their natural domains.

This section has given us a formal definition of what it means for a functions to be â€śdifferentiable,â€ť along with a theorem that gives a more accessible understanding. The following sections return to notions prompted by our study of partial derivatives that make use of the fact that most functions we encounter are differentiable.

### Exercises 14.1.6 Exercises

#### Terms and Concepts

##### 1.

T/F: If \(f(x,y)\) is differentiable on \(S\text{,}\) the \(f\) is continuous on \(S\text{.}\)

##### 2.

T/F: If \(f_x\) and \(f_y\) are continuous on \(S\text{,}\) then \(f\) is differentiable on \(S\text{.}\)

##### 3.

T/F: If \(z=f(x,y)\) is differentiable, then the change in \(z\) over small changes \(dx\) and \(dy\) in \(x\) and \(y\) is approximately \(dz\text{.}\)

##### 4.

Finish the sentence: â€śThe new \(z\)-value is approximately the old \(z\)-value plus the approximate .â€ť

#### Problems

##### Exercise Group.

In the following exercises, find the total differential \(dz\text{.}\)

###### 5.

\(z = x\sin(y) + x^2\)

###### 6.

\(z = (2x^2+3y)^2\)

###### 7.

\(z = 5x-7y\)

###### 8.

\(z = xe^{x+y}\)

##### Exercise Group.

In the following exercises, a function \(f(x,y)\) is given. Give the indicated approximation using the total differential.

###### 9.

\(f(x,y) = \sqrt{x^2+y}\text{.}\) Approximate \(f(2.95,7.1)\) knowing \(f(3,7) = 4\text{.}\)

###### 10.

\(f(x,y) = \sin(x) \cos(y)\text{.}\) Approximate \(f(0.1,-0.1)\) knowing \(f(0,0) = 0\text{.}\)

###### 11.

\(f(x,y) = x^2y-xy^2\text{.}\) Approximate \(f(2.04,3.06)\) knowing \(f(2,3) = -6\text{.}\)

###### 12.

\(f(x,y) = \ln(x-y)\text{.}\) Approximate \(f(5.1,3.98)\) knowing \(f(5,4) = 0\text{.}\)

##### Exercise Group.

The following exercises ask a variety of questions dealing with approximating error and sensitivity analysis.

###### 13.

A cylindrical storage tank is to be 2ft tall with a radius of 1ft. Is the volume of the tank more sensitive to changes in the radius or the height?

###### 14.

*Projectile Motion:* The \(x\)-value of an object moving under the principles of projectile motion is \(x(\theta,v_0,t)= (v_0\cos(\theta) )t\text{.}\) A particular projectile is fired with an initial velocity of \(v_0=250\)ft/s and an angle of elevation of \(\theta = 60^\circ\text{.}\) It travels a distance of \(375\)ft in 3 seconds.

Is the projectile more sensitive to errors in initial speed or angle of elevation?

###### 15.

The length \(\ell\) of a long wall is to be approximated. The angle \(\theta\text{,}\) as shown in the diagram (not to scale), is measured to be \(85^\circ\text{,}\) and the distance \(x\) is measured to be 30'. Assume that the triangle formed is a right triangle.

Is the measurement of the length of \(\ell\) more sensitive to errors in the measurement of \(x\) or in \(\theta\text{?}\)

###### 16.

It is â€ścommon senseâ€ť that it is far better to measure a long distance with a long measuring tape rather than a short one. A measured distance \(D\) can be viewed as the product of the length \(\ell\) of a measuring tape times the number \(n\) of times it was used. For instance, using a 3' tape 10 times gives a length of 30'. To measure the same distance with a 12' tape, we would use the tape 2.5 times. (i.e., \(30=12\times 2.5\text{.}\)) Thus \(D = n\ell\text{.}\)

Suppose each time a measurement is taken with the tape, the recorded distance is within 1/16'' of the actual distance. (i.e., \(d\ell = 1/16'' \approx 0.005\)ft). Using differentials, show why common sense proves correct in that it is better to use a long tape to measure long distances.

##### Exercise Group.

In the following exercises, find the total differential \(dw\text{.}\)

###### 17.

\(w= x^2yz^3\)

###### 18.

\(w= e^x\sin(y) \ln(z)\)

##### Exercise Group.

In the following exercises, use the information provided and the total differential to make the given approximation.

###### 19.

\(f(3,1) = 7\text{,}\)Â \(f_x(3,1) = 9\text{,}\) \(f_y(3,1) = -2\text{.}\) Approximate \(f(3.05, 0.9)\text{.}\)

###### 20.

\(f(-4,2) = 13\text{,}\)Â \(f_x(-4,2) = 2.6\text{,}\) \(f_y(-4,2) = 5.1\text{.}\) Approximate \(f(-4.12, 2.07)\text{.}\)

###### 21.

\(f(2,4,5) = -1\text{,}\)Â \(f_x(2,4,5) = 2\text{,}\)Â \(f_y(2,4,5) = -3\text{,}\)Â \(f_z(2,4,5) = 3.7\text{.}\) Approximate \(f(2.5,4.1,4.8)\text{.}\)

###### 22.

\(f(3,3,3) = 5\text{,}\)Â \(f_x(3,3,3) = 2\text{,}\)Â \(f_y(3,3,3) = 0\text{,}\)Â \(f_z(3,3,3) = -2\text{.}\) Approximate \(f(3.1, 3.1,3.1)\text{.}\)