12.4: Differentiability and the Total Differential
( \newcommand{\kernel}{\mathrm{null}\,}\)
We studied differentials in Section 4.4, where Definition 18 states that if y=f(x) and f is differentiable, then dy=f′(x)dx. One important use of this differential is in Integration by Substitution. Another important application is approximation. Let Δx=dx represent a change in x. When dx is small, dy≈Δy, the change in y resulting from the change in x. Fundamental in this understanding is this: as dx gets small, the difference between Δy and dy goes to 0. Another way of stating this: as dx goes to 0, the error in approximating Δy with dy goes to 0.
We extend this idea to functions of two variables. Let z=f(x,y), and let Δx=dx and Δy=dy represent changes in x and y, respectively. Let Δz=f(x+dx,y+dy)−f(x,y) be the change in z over the change in x and y. Recalling that fx and fy give the instantaneous rates of z-change in the x- and y-directions, respectively, we can approximate Δz with dz=fxdx+fydy; 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 dz.
Definition 86: Total Differential
Let z=f(x,y) be continuous on an open set S. Let dx and dy represent changes in x and y, respectively. Where the partial derivatives fx and fy exist, the total differential of z is
dz=fx(x,y)dx+fy(x,y)dy.
Example 12.4.1: Finding the total differential
Let z=x4e3y. Find dz.
Solution
We compute the partial derivatives: fx=4x3e3y and fy=3x4e3y. Following Definition 86, we have
dz=4x3e3ydx+3x4e3ydy.
We can approximate Δz with dz, but as with all approximations, there is error involved. A good approximation is one in which the error is small. At a given point (x0,y0), let Ex and Ey be functions of dx and dy such that Exdx+Eydy describes this error. Then
Δz=dz+Exdx+Eydy=fx(x0,y0)dx+fy(x0,y0)dy+Exdx+Eydy.
If the approximation of Δz by dz is good, then as dx and dy get small, so does Exdx+Eydy. The approximation of Δz by dz is even better if, as dx and dy go to 0, so do Ex and Ey. This leads us to our definition of differentiability.
Definition 87: Multivariable Differentiability
Let z=f(x,y) be defined on an open set S containing (x0,y0) where fx(x0,y0) and fy(x0,y0) exist. Let dz be the total differential of z at (x0,y0), let Δz=f(x0+dx,y0+dy)−f(x0,y0), and let Ex and Ey be functions of dx and dy such that
Δz=dz+Exdx+Eydy.
- f is differentiable at (x0,y0) if, given ϵ>0, there is a δ>0 such that if ||⟨dx,dy⟩||<δ, then ||⟨Ex,Ey⟩||<ϵ. That is, as dx and dy go to 0, so do Ex and Ey.
- f is differentiable on S if f is differentiable at every point in S. If f is differentiable on R2, we say that f is differentiable everywhere.
Example 12.4.2: Showing a function is differentiable
Show f(x,y)=xy+3y2 is differentiable using Definition 87.
Solution
We begin by finding f(x+dx,y+dy), Δz, fx and fy.
f(x+dx,y+dy)=(x+dx)(y+dy)+3(y+dy)2=xy+xdy+ydx+dxdy+3y2+6ydy+3dy2.
Δz=f(x+dx,y+dy)−f(x,y), so
Δz=xdy+ydx+dxdy+6ydy+3dy2.
It is straightforward to compute fx=y and fy=x+6y. Consider once more Δz:
Δz=xdy+ydx+dxdy+6ydy+3dy2 (now reorder)=ydx+xdy+6ydy+dxdy+3dy2=(y)⏟fxdx+(x+6y)⏟fydy+(dy)⏟Exdx+(3dy)⏟Eydy=fxdx+fydy+Exdx+Eydy.
With Ex=dy and Ey=3dy, it is clear that as dx and dy go to 0, Ex and Ey also go to 0. Since this did not depend on a specific point (x0,y0), we can say that f(x,y) is differentiable for all pairs (x,y) in R2, 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 104: Continuity and Differentiability of Multivariable Functions
Let z=f(x,y) be defined on an open set S containing (x0,y0).
If f is differentiable at (x0,y0), then f is continuous at (x0,y0).
THEOREM 105: Differentiability of Multivariable Functions
Let z=f(x,y) be defined on an open set S containing (x0,y0).
If fx and fy 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 87 and Theorem 105, though: it is possible for a function f to be differentiable yet fx and/or fy is not continuous. Such strange behavior of functions is a source of delight for many mathematicians.
When fx and fy 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
f(x,y)={xyx2+y2(x,y)≠(0,0)0(x,y)=(0,0)
We can find fx(0,0) and fy(0,0) using Definition 83:
fx(0,0)=limh→0f(0+h,0)−f(0,0)h=limh→00h2=0;fy(0,0)=limh→0f(0,0+h)−f(0,0)h=limh→00h2=0.
Both fx and fy exist at (0,0), but they are not continuous at (0,0), as
fx(x,y)=y(y2−x2)(x2+y2)2andfy(x,y)=x(x2−y2)(x2+y2)2
are not continuous at (0,0). (Take the limit of fx as (x,y)→(0,0) along the x- and y-axes; they give different results.) So even though fx and fy exist at every point in the x-y plane, they are not continuous. Therefore it is possible, by Theorem 105, for f to not be differentiable.
Indeed, it is not. One can show that f is not continuous at (0,0) (see Example 12.2.4), and by Theorem 104, this means f is not differentiable at (0,0).
Approximating with the Total Differential
By the definition, when f is differentiable dz is a good approximation for Δz when dx and dy are small. We give some simple examples of how this is used here.
Example 12.4.3: Approximating with the total differential
Let z=√xsiny. Approximate f(4.1,0.8).
Solution
Recognizing that π/4≈0.785≈0.8, we can approximate f(4.1,0.8) using f(4,π/4). We can easily compute f(4,π/4)=√4sin(π/4)=2(√22)=√2≈1.414. 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 Δz=f(4.1,0.8)−f(4,π/4). The total differential dz is approximately equal to Δz, so
f(4.1,0.8)−f(4,π/4)≈dz⇒f(4.1,0.8)≈dz+f(4,π/4).
To find dz, we need fx and fy.
fx(x,y)=siny2√x⇒fx(4,π/4)=sinπ/42√4=√2/24=√2/8.fy(x,y)=√xcosy⇒fy(4,π/4)=√4√22=√2.
Approximating 4.1 with 4 gives dx=0.1; approximating 0.8 with π/4 gives dy≈0.015. Thus
dz(4,π/4)=fx(4,π/4)(0.1)+fy(4,π/4)(0.015)=√28(0.1)+√2(0.015)≈0.039.
Returning to Equation ???, we have
f(4.1,0.8)≈0.039+1.414=1.4531.
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. 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 ≈ old position + approximate amount of change.''
In the previous example, we could easily compute f(4,π/4) and could approximate the amount of z-change when computing f(4.1,0.8), letting us approximate the new z-value.
It may be surprising to learn that it is not uncommon to know the values of f, fx and fy at a particular point without actually knowing the function f. The total differential gives a good method of approximating f at nearby points.
Example 12.4.4: Approximating an unknown function
Given that f(2,−3)=6, fx(2,−3)=1.3 and fy(2,−3)=−0.6, approximate f(2.1,−3.03).
Solution
The total differential approximates how much f changes from the point (2,−3) to the point (2.1,−3.03). With dx=0.1 and dy=−0.03, we have
dz=fx(2,−3)dx+fy(2,−3)dy=1.3(0.1)+(−0.6)(−0.03)=0.148.
The change in z is approximately 0.148, so we approximate f(2.1,−3.03)≈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 12.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?
Solution
A cylindrical solid with height h and radius r has volume V=πr2h. We can view V as a function of two variables, r and h. We can compute partial derivatives of V:
∂V∂r=Vr(r,h)=2πrhand∂V∂h=Vh(r,h)=πr2.
The total differential is dV=(2πrh)dr+(πr2)dh. When h=10 and r=2, we have dV=40πdr+4πdh.
Note that the coefficient of dr is 40π≈125.7; the coefficient of dh is a tenth of that, approximately 12.57. 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 1 ft and radius of 5 ft 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 88: Total Differential
Let w=f(x,y,z) be continuous on an open set S. Let dx, dy and dz represent changes in x, y and z, respectively. Where the partial derivatives fx, fy and fz exist, the total differential of w is
dz=fx(x,y,z)dx+fy(x,y,z)dy+fz(x,y,z)dz.
This differential can be a good approximation of the change in w when w=f(x,y,z) is differentiable.
Definition 89: Multivariable Differentiability
Let w=f(x,y,z) be defined on an open ball B containing (x0,y0,z0) where fx(x0,y0,z0), fy(x0,y0,z0) and fz(x0,y0,z0) exist. Let dw be the total differential of w at (x0,y0,z0), let Δw=f(x0+dx,y0+dy,z0+dz)−f(x0,y0,z0), and let Ex, Ey and Ez be functions of dx, dy and dz such that
Δw=dw+Exdx+Eydy+Ezdz
- f is differentiable at (x0,y0,z0) if, given ϵ>0, there is a δ>0 such that if ||⟨dx,dy,dz⟩||<δ, then ||⟨Ex,Ey,Ez⟩||<ϵ.
- f is differentiable on B if f is differentiable at every point in B. If f is differentiable on R3, 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 105.
THEOREM 106: Continuity and Differentiability of Functions of Three Variables
Let w=f(x,y,z) be defined on an open ball B containing (x0,y0,z0).
- If f is differentiable at (x0,y0,z0), then f is continuous at (x0,y0,z0).
- If fx, fy and fz are continuous on B, 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.