# 13.4 Differentiability and the Total Differential

We studied differentials in Section 4.3, where Definition 4.3.1 states that if $y=f(x)$ and $f$ is differentiable, then $\operatorname{d}\!y=f\,^{\prime}(x)\operatorname{d}\!x$. One important use of this differential is in Integration by Substitution. Another important application is approximation. Let $\Delta x=\operatorname{d}\!x$ represent a change in $x$. When $\operatorname{d}\!x$ is small, $\operatorname{d}\!y\approx\Delta y$, the change in $y$ resulting from the change in $x$. Fundamental in this understanding is this: as $\operatorname{d}\!x$ gets small, the difference between $\Delta y$ and $\operatorname{d}\!y$ goes to 0. Another way of stating this: as $\operatorname{d}\!x$ goes to 0, the error in approximating $\Delta y$ with $\operatorname{d}\!y$ goes to 0.

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

###### Definition 13.4.1 Total Differential

Let $z=f(x,y)$ be continuous on an open set $S$. Let $\operatorname{d}\!x$ and $\operatorname{d}\!y$ represent changes in $x$ and $y$, respectively. Where the partial derivatives $f_{x}$ and $f_{y}$ exist, the total differential of $z$ is

 $\operatorname{d}\!z=f_{x}(x,y)\operatorname{d}\!x+f_{y}(x,y)\operatorname{d}\!y.$
###### Example 13.4.1 Finding the total differential

Let $z=x^{4}e^{3y}$. Find $\operatorname{d}\!z$.

SolutionWe compute the partial derivatives: $f_{x}=4x^{3}e^{3y}$ and $f_{y}=3x^{4}e^{3y}$. Following Definition 13.4.1, we have

 $\operatorname{d}\!z=4x^{3}e^{3y}\operatorname{d}\!x+3x^{4}e^{3y}\operatorname{% d}\!y.$

We can approximate $\Delta z$ with $\operatorname{d}\!z$, 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})$, let $E_{1}$ and $E_{2}$ be functions of $\operatorname{d}\!x$ and $\operatorname{d}\!y$ such that $E_{1}\operatorname{d}\!x+E_{2}\operatorname{d}\!y$ describes this error. Then

 $\displaystyle\Delta z$ $\displaystyle=\operatorname{d}\!z+E_{1}\operatorname{d}\!x+E_{2}\operatorname{% d}\!y$ $\displaystyle=f_{x}(x_{0},y_{0})\operatorname{d}\!x+f_{y}(x_{0},y_{0})% \operatorname{d}\!y+E_{1}\operatorname{d}\!x+E_{2}\operatorname{d}\!y.$

If the approximation of $\Delta z$ by $\operatorname{d}\!z$ is good, then as $\operatorname{d}\!x$ and $\operatorname{d}\!y$ get small, so does $E_{1}\operatorname{d}\!x+E_{2}\operatorname{d}\!y$. The approximation of $\Delta z$ by $\operatorname{d}\!z$ is even better if, as $\operatorname{d}\!x$ and $\operatorname{d}\!y$ go to 0, so do $E_{1}$ and $E_{2}$. This leads us to our definition of differentiability.

###### Definition 13.4.2 Multivariable Differentiability

Let $z=f(x,y)$ be defined on an open set $S$ containing $(x_{0},y_{0})$ where $f_{x}(x_{0},y_{0})$ and $f_{y}(x_{0},y_{0})$ exist. Let $\operatorname{d}\!z$ be the total differential of $z$ at $(x_{0},y_{0})$, let $\Delta z=f(x_{0}+\operatorname{d}\!x,y_{0}+\operatorname{d}\!y)-f(x_{0},y_{0})$, and let $E_{1}$ and $E_{2}$ be functions of $\operatorname{d}\!x$ and $\operatorname{d}\!y$ such that

 $\Delta z=\operatorname{d}\!z+E_{1}\operatorname{d}\!x+E_{2}\operatorname{d}\!y.$
1. (a)

$f$ is differentiable at $(x_{0},y_{0})$ if

 $\lim_{(\operatorname{d}\!x,\operatorname{d}\!y)\to(0,0)}E_{1}=0\qquad\text{and% }\qquad\lim_{(\operatorname{d}\!x,\operatorname{d}\!y)\to(0,0)}E_{2}=0.$
2. (b)

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

###### Example 13.4.2 Showing a function is differentiable

Show $f(x,y)=xy+3y^{2}$ is differentiable using Definition 13.4.2.

SolutionWe begin by finding $f(x+\operatorname{d}\!x,y+\operatorname{d}\!y)$, $\Delta z$, $f_{x}$ and $f_{y}$.

 $\displaystyle f(x+\operatorname{d}\!x,y+\operatorname{d}\!y)$ $\displaystyle=(x+\operatorname{d}\!x)(y+\operatorname{d}\!y)+3(y+\operatorname% {d}\!y)^{2}$ $\displaystyle=xy+x\operatorname{d}\!y+y\operatorname{d}\!x+\operatorname{d}\!x% \operatorname{d}\!y+3y^{2}+6y\operatorname{d}\!y+3\operatorname{d}\!y^{2}.$

$\Delta z=f(x+\operatorname{d}\!x,y+\operatorname{d}\!y)-f(x,y)$, so

 $\Delta z=x\operatorname{d}\!y+y\operatorname{d}\!x+\operatorname{d}\!x% \operatorname{d}\!y+6y\operatorname{d}\!y+3\operatorname{d}\!y^{2}.$

It is straightforward to compute $f_{x}=y$ and $f_{y}=x+6y$. Consider once more $\Delta z$:

 $\displaystyle\Delta z$ $\displaystyle=x\operatorname{d}\!y+y\operatorname{d}\!x+\operatorname{d}\!x% \operatorname{d}\!y+6y\operatorname{d}\!y+3\operatorname{d}\!y^{2}\qquad\text{% (now reorder)}$ $\displaystyle=y\operatorname{d}\!x+x\operatorname{d}\!y+6y\operatorname{d}\!y+% \operatorname{d}\!x\operatorname{d}\!y+3\operatorname{d}\!y^{2}$ $\displaystyle=\underbrace{(y)}_{f_{x}}\operatorname{d}\!x+\underbrace{(x+6y)}_% {f_{y}}\operatorname{d}\!y+\underbrace{(\operatorname{d}\!y)}_{E_{1}}% \operatorname{d}\!x+\underbrace{(3\operatorname{d}\!y)}_{E_{2}}\operatorname{d% }\!y$ $\displaystyle=f_{x}\operatorname{d}\!x+f_{y}\operatorname{d}\!y+E_{1}% \operatorname{d}\!x+E_{2}\operatorname{d}\!y.$

With $E_{1}=\operatorname{d}\!y$ and $E_{2}=3\operatorname{d}\!y$, it is clear that as $\operatorname{d}\!x$ and $\operatorname{d}\!y$ go to 0, $E_{1}$ and $E_{2}$ also go to 0. Since this did not depend on a specific point $(x_{0},y_{0})$, we can say that $f(x,y)$ is differentiable for all pairs $(x,y)$ in $\mathbb{R}^{2}$, 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 provides a more tangible way of determining whether a great number of functions are differentiable or not.

###### Theorem 13.4.1 Differentiability of Multivariable Functions

Let $z=f(x,y)$ be defined on an open set $S$. If $f_{x}$ and $f_{y}$ are both continuous on $S$, then $f$ is differentiable on $S$.

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 13.4.2 and Theorem 13.4.1, though: it is possible for a function $f$ to be differentiable yet $f_{x}$ or $f_{y}$ is not continuous. Such strange behavior of functions is a source of delight for many mathematicians. When this happens, we need to use other methods to determine whether or not $f$ is differentiable at that point.

## Approximating with the Total Differential

By the definition, when $f$ is differentiable $\operatorname{d}\!z$ is a good approximation for $\Delta z$ when $\operatorname{d}\!x$ and $\operatorname{d}\!y$ are small. We give some simple examples of how this is used here.

###### Example 13.4.3 Approximating with the total differential

Let $f(x,y)=\sqrt{x}\sin y$. Approximate $f(4.1,0.2)$.

SolutionWe can approximate $f(4.1,0.2)$ using $f(4,0)=0$. 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 $\Delta z=f(4.1,0.2)-f(4,0)$. The total differential $\operatorname{d}\!z$ is approximately equal to $\Delta z$, so

 $f(4.1,0.2)-f(4,0)\approx\operatorname{d}\!z\quad\Rightarrow\quad f(4.1,0.2)% \approx\operatorname{d}\!z+f(4,0).$ (13.4.1)

To find $\operatorname{d}\!z$, we need $f_{x}$ and $f_{y}$.

 $\displaystyle f_{x}(x,y)$ $\displaystyle=\frac{\sin y}{2\sqrt{x}}\quad\Rightarrow$ $\displaystyle f_{x}(4,0)$ $\displaystyle=\frac{\sin 0}{2\sqrt{4}}=0$ $\displaystyle f_{y}(x,y)$ $\displaystyle=\sqrt{x}\cos y\quad\Rightarrow$ $\displaystyle f_{y}(4,0)$ $\displaystyle=\sqrt{4}\cos 0=2$

Approximating $4.1$ with 4 gives $\operatorname{d}\!x=0.1$; approximating $0.2$ with $0$ gives $\operatorname{d}\!y=0.2$. Thus

 $\operatorname{d}\!z(4,0)=f_{x}(4,0)(0.1)+f_{y}(4,0)(0.2)=0(0.1)+2(0.2)=0.4.$

Returning to Equation (13.4.1), we have

 $f(4.1,0.2)\approx 0.4+0=.4.$

We, of course, can compute the actual value of $f(4.1,0.2)$ with a calculator; to 5 places after the decimal, this is $0.40228$. 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.2)$ 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,0)$ and could approximate the amount of $z$-change when computing $f(4.1,0.2)$, letting us approximate the new $z$-value.

It may be surprising to learn that it is not uncommon to know the values of $f$, $f_{x}$ and $f_{y}$ at a particular point without actually knowing the function $f$. The total differential gives a good method of approximating $f$ at nearby points.

###### Example 13.4.4 Approximating an unknown function

Given that $f(2,-3)=6$, $f_{x}(2,-3)=1.3$ and $f_{y}(2,-3)=-0.6$, approximate $f(2.1,-3.03)$.

SolutionThe total differential approximates how much $f$ changes from the point $(2,-3)$ to the point $(2.1,-3.03)$. With $\operatorname{d}\!x=0.1$ and $\operatorname{d}\!y=-0.03$, we have

 $\displaystyle\operatorname{d}\!z$ $\displaystyle=f_{x}(2,-3)\operatorname{d}\!x+f_{y}(2,-3)\operatorname{d}\!y$ $\displaystyle=1.3(0.1)+(-0.6)(-0.03)$ $\displaystyle=0.148.$

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

## Error/Sensitivity Analysis

The total differential gives an approximation of the change in $z$ given small changes in $x$ and $y$. 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 13.4.5 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?

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

 $\frac{\partial V}{\partial r}=V_{r}(r,h)=2\pi rh\qquad\text{and}\qquad\frac{% \partial V}{\partial h}=V_{h}(r,h)=\pi r^{2}.$

The total differential is $\operatorname{d}\!V=(2\pi rh)\operatorname{d}\!r+(\pi r^{2})\operatorname{d}\!h.$ When $h=10$ and $r=2$, we have $\operatorname{d}\!V=40\pi\operatorname{d}\!r+4\pi\operatorname{d}\!h$. Note that the coefficient of $\operatorname{d}\!r$ is $40\pi$; the coefficient of $\operatorname{d}\!h$ is a tenth of that. A small change in radius will be multiplied by $40\pi$, whereas a small change in height will be multiplied by $4\pi$. 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.

## 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 13.4.3 Total Differential

Let $w=f(x,y,z)$ be continuous on an open set $S$. Let $\operatorname{d}\!x$, $\operatorname{d}\!y$ and $\operatorname{d}\!z$ represent changes in $x$, $y$ and $z$, respectively. Where the partial derivatives $f_{x}$, $f_{y}$ and $f_{z}$ exist, the total differential of $w$ is

 $\operatorname{d}\!w=f_{x}(x,y,z)\operatorname{d}\!x+f_{y}(x,y,z)\operatorname{% d}\!y+f_{z}(x,y,z)\operatorname{d}\!z.$

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

###### Definition 13.4.4 Multivariable Differentiability

Let $w=f(x,y,z)$ be defined on an open set $S$ containing $(x_{0},y_{0},z_{0})$ where $f_{x}(x_{0},y_{0},z_{0})$, $f_{y}(x_{0},y_{0},z_{0})$ and $f_{z}(x_{0},y_{0},z_{0})$ exist. Let $\operatorname{d}\!w$ be the total differential of $w$ at $(x_{0},y_{0},z_{0})$, let $\Delta w=f(x_{0}+\operatorname{d}\!x,y_{0}+\operatorname{d}\!y,z_{0}+% \operatorname{d}\!z)-f(x_{0},y_{0},z_{0})$, and let $E_{1}$, $E_{2}$ and $E_{3}$ be functions of $\operatorname{d}\!x$, $\operatorname{d}\!y$ and $\operatorname{d}\!z$ such that

 $\Delta w=\operatorname{d}\!w+E_{1}\operatorname{d}\!x+E_{2}\operatorname{d}\!y% +E_{3}\operatorname{d}\!z.$
1. (a)

$f$ is differentiable at $(x_{0},y_{0},z_{0})$ if

 $\displaystyle\lim_{(\operatorname{d}\!x,\operatorname{d}\!y,\operatorname{d}\!% z)\to(0,0,0)}E_{1}$ $\displaystyle=0,$ $\displaystyle\lim_{(\operatorname{d}\!x,\operatorname{d}\!y,\operatorname{d}\!% z)\to(0,0,0)}E_{2}$ $\displaystyle=0,\qquad\text{and}$ $\displaystyle\lim_{(\operatorname{d}\!x,\operatorname{d}\!y,\operatorname{d}\!% z)\to(0,0,0)}E_{3}$ $\displaystyle=0.$
2. (b)

$f$ is differentiable on $S$ if $f$ is differentiable at every point in $S$. If $f$ is differentiable on $\mathbb{R}^{3}$, 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 13.4.1.

###### Theorem 13.4.2 Differentiability of Functions of Three Variables

Let $w=f(x,y,z)$ be defined on an open set $S$ containing $(x_{0},y_{0},z_{0})$. If $f_{x}$, $f_{y}$, and $f_{z}$ are continuous on $S$, then $f$ is differentiable on $B$.

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 13.4

### Terms and Concepts

1. 1.

T/F: If $f(x,y)$ is differentiable on $S$, the $f$ is continuous on $S$.

2. 2.

T/F: If $f_{x}$ and $f_{y}$ are continuous on $S$, then $f$ is differentiable on $S$.

3. 3.

T/F: If $z=f(x,y)$ is differentiable, then the change in $z$ over small changes $\operatorname{d}\!x$ and $\operatorname{d}\!y$ in $x$ and $y$ is approximately $\operatorname{d}\!z$.

4. 4.

Finish the sentence: “The new $z$-value is approximately the old $z$-value plus the approximate             .”

### Problems

In Exercises 5–8., find the total differential $\operatorname{d}\!z$.

1. 5.

$z=x\sin y+x^{2}$

2. 6.

$z=(2x^{2}+3y)^{2}$

3. 7.

$z=5x-7y$

4. 8.

$z=xe^{x+y}$

In Exercises 9–12., a function $z=f(x,y)$ is given. Give the indicated approximation using the total differential.

1. 9.

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

2. 10.

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

3. 11.

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

4. 12.

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

Exercises 13–16. ask a variety of questions dealing with approximating error and sensitivity analysis.

1. 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?

2. 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$. A particular projectile is fired with an initial velocity of $v_{0}=250$ft/s and an angle of elevation of $\theta=60^{\circ}$. It travels a distance of $375$ft in 3 seconds.

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

3. 15.

The length $\ell$ of a long wall is to be approximated. The angle $\theta$, as shown in the diagram (not to scale), is measured to be $85^{\circ}$, 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$?

4. 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$.) Thus $D=n\ell$.

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^{\prime\prime}\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.

In Exercises 17–18., find the total differential $\operatorname{d}\!w$.

1. 17.

$w=x^{2}yz^{3}$

2. 18.

$w=e^{x}\sin y\ln z$

In Exercises 19–22., use the information provided and the total differential to make the given approximation.

1. 19.

$f(3,1)=7$,   $f_{x}(3,1)=9$,   $f_{y}(3,1)=-2$. Approximate $f(3.05,0.9)$.

2. 20.

$f(-4,2)=13$,   $f_{x}(-4,2)=2.6$,   $f_{y}(-4,2)=5.1$. Approximate $f(-4.12,2.07)$.

3. 21.

$f(2,4,5)=-1$,  $f_{x}(2,4,5)=2$,  $f_{y}(2,4,5)=-3$,  $f_{z}(2,4,5)=3.7$. Approximate $f(2.5,4.1,4.8)$.

4. 22.

$f(3,3,3)=5$,  $f_{x}(3,3,3)=2$,  $f_{y}(3,3,3)=0$,  $f_{z}(3,3,3)=-2$. Approximate $f(3.1,3.1,3.1)$.

1. 23.

Find where the function $z=\sqrt{x^{2}+y^{2}}$ is differentiable.