Differentiability

Learning Outcomes

  • Explain when a function of two variables is differentiable.
  • Use the total differential to approximate the change in a function of two variables.

When working with a function [latex]y=f\,(x)[/latex] of one variable, the function is said to be differentiable at a point [latex]x=a[/latex] if [latex]f'\,(a)[/latex] exists. Furthermore, if a function of one variable is differentiable at a point, the graph is “smooth” at that point (i.e., no corners exist) and a tangent line is well-defined at that point.

The idea behind differentiability of a function of two variables is connected to the idea of smoothness at that point. In this case, a surface is considered to be smooth at point [latex]P[/latex] if a tangent plane to the surface exists at that point. If a function is differentiable at a point, then a tangent plane to the surface exists at that point. Recall the formula for a tangent plane at a point [latex](x_0,\ y_0)[/latex] is given by

[latex]\large{z=f\,(x_0,\ y_0)+f_x\,(x_0,\ y_0)(x-x_0)+f_y\,(x_0,\ y_0)(y-y_0)}[/latex],

 

For a tangent plane to exist at the point [latex](x_0,\ y_0)[/latex], the partial derivatives must therefore exist at that point. However, this is not a sufficient condition for smoothness, as was illustrated in Figure 3. In that case, the partial derivatives existed at the origin, but the function also had a corner on the graph at the origin.

Definition


A function [latex]f\,(x,\ y)[/latex] is differentiable at a point [latex]P\ (x_0,\ y_0)[/latex] if, for all points [latex](x,\ y)[/latex] in a [latex]\delta[/latex] disk around [latex]P[/latex], we can write

[latex]\large{f\,(x,\ y,\ z)=f\,(x_0,\ y_0)+f_x\,(x_0,\ y_0)(x-x_0)+f_y\,(x_0,\ y_0)(y-y_0)+E\,(x,\ y)}[/latex],

 

where the error term [latex]E[/latex] satisfies

[latex]\large{\displaystyle\lim_{(x,\ y)\to(x_0,\ y_0)}\frac{E\,(x,\ y)}{\sqrt{(x-x_0)^{2}+(y-y_0)^{2}}}=0}.[/latex]

 

The last term in the Differentiable Function at a Point Equation is referred to as the error term and it represents how closely the tangent plane comes to the surface in a small neighborhood ([latex]\delta[/latex] disk) of point [latex]P[/latex]. For the function [latex]f[/latex] to be differentiable at [latex]P[/latex], the function must be smooth—that is, the graph of [latex]f[/latex] must be close to the tangent plane for points near [latex]P[/latex].

Example: Demonstrating Differentiability

Show that the function [latex]f\,(x,\ y)=2x^{2}-4y[/latex] is differentiable at point [latex](2,-3)[/latex].

TRY IT

Show that the function [latex]f\,(x,\ y)=3x-4y^{2}[/latex] is differentiable at point [latex](-1,\ 2)[/latex].

Watch the following video to see the worked solution to the above Try It

You can view the transcript for “CP 4.21” here (opens in new window).

The function [latex]f\,(x,\ y)=\begin{cases}\frac{xy}{\sqrt{x^{2}+y^{2}}}\ (x,\ y)\neq (0,\ 0)\\0\ \ \ \ \ \ \ \ \ \ \ (x,\ y)=(0,\ 0)\end{cases}[/latex] is not differentiable at the origin. We can see this by calculating the partial derivatives. This function appeared earlier in the section, where we showed that [latex]f_x\,(0,\ 0)=f_y\,(0,\ 0)=0[/latex]. Substituting this information into our definition equation using [latex]x_0=0[/latex] and [latex]y_0=0[/latex], we get

[latex]\begin{array}{ccc}\hfill {f\,(x,\ y)} & =\hfill & {f\,(0,\ 0)+f_x\,(0,\ 0)(x-0)+f_y\,(0,\ 0)(y-0)+E\,(x,\ y)}\hfill \\ \hfill {E\,(x,\ y)} & =\hfill & {\frac{xy}{\sqrt{x^{2}+y^{2}}}.} \hfill \\ \hfill \end{array}[/latex]

 

Calculating [latex]\displaystyle\lim_{(x,\ y)\to (x_0,\ y_0)}\frac{E\,(x,\ y)}{\sqrt{(x-x_0)^{2}+(y-y_0)^{2}}}[/latex] gives

[latex]\begin{array}{ccc}\hfill {\displaystyle\lim_{(x,\ y)\to (x_0,\ y_0)}\frac{E\,(x,\ y)}{\sqrt{(x-x_0)^{2}+(y-y_0)^{2}}}} & =\hfill & {\displaystyle\lim_{(x,\ y)\to (0,\ 0)}\frac{\frac{xy}{\sqrt{x^{2}+y^{2}}}}{\sqrt{x^{2}+y^{2}}}}\hfill \\ \hfill & =\hfill & {\displaystyle\lim_{(x,\ y)\to (0,\ 0)}\frac{xy}{x^{2}+y^{2}}.} \hfill \\ \hfill \end{array}[/latex]

 

Depending on the path taken toward the origin, this limit takes different values. Therefore, the limit does not exist and the function [latex]f[/latex] is not differentiable at the origin as shown in the following figure

A curved surface in xyz space that remains constant along the positive x axis and curves downward along the line y = –x in the second quadrant.

Figure 1. This function [latex]f(x,y)[/latex] is not differentiable at the origin.

Differentiability and continuity for functions of two or more variables are connected, the same as for functions of one variable. In fact, with some adjustments of notation, the basic theorem is the same.

Differentiability implies continuity


Let [latex]z=f\,(x,\ y)[/latex] be a function of two variables with [latex](x_0,\ y_0)[/latex] in the domain of [latex]f[/latex]. If [latex]f\,(x,\ y)[/latex] is differentiable at [latex](x_0,\ y_0)[/latex], then [latex]f\,(x,\ y)[/latex] is continuous at [latex](x_0,\ y_0)[/latex].

Differentiability Implies Continuity shows that if a function is differentiable at a point, then it is continuous there. However, if a function is continuous at a point, then it is not necessarily differentiable at that point. For example,

[latex]\large{f\,(x,\ y)=\begin{cases}\frac{xy}{\sqrt{x^{2}+y^{2}}}\ (x,\ y)\neq (0,\ 0)\\0\ \ \ \ \ \ \ \ \ \ \ (x,\ y)=(0,\ 0)\end{cases}}[/latex]

 

is continuous at the origin, but it is not differentiable at the origin. This observation is also similar to the situation in single-variable calculus.

Continuity of First Partials Implies Differentiability further explores the connection between continuity and differentiability at a point. This theorem says that if the function and its partial derivatives are continuous at a point, the function is differentiable.

Continuity of first partials implies differentiability


Let [latex]z=f\,(x,\ y)[/latex] be a function of two variables with [latex](x_0,\ y_0)[/latex] in the domain of [latex]f[/latex]. If [latex]f\,(x,\ y)[/latex], [latex]f_x\,(x,\ y)[/latex], and [latex]f_y\,(x,\ y)[/latex] all exist in a neighborhood of [latex](x_0,\ y_0)[/latex] and are continuous at [latex](x_0,\ y_0)[/latex], then [latex]f\,(x,\ y)[/latex] is differentiable there.

Recall that earlier we showed that the function

[latex]\large{f\,(x,\ y)=\begin{cases}\frac{xy}{\sqrt{x^{2}+y^{2}}}\ (x,\ y)\neq (0,\ 0)\\0\ \ \ \ \ \ \ \ \ \ \ (x,\ y)=(0,\ 0)\end{cases}}[/latex]

 

was not differentiable at the origin. Let’s calculate the partial derivatives [latex]f_x[/latex] and [latex]f_y[/latex]:

[latex]\LARGE{\frac{\partial f}{\partial x}=\frac{y^{3}}{(x^{2}+y^{2})^{3/2}}}[/latex] and [latex]\LARGE{\frac{\partial f}{\partial y}=\frac{x^{3}}{(x^{2}+y^{2})^{3/2}}}.[/latex]

 

The contrapositive of the preceding theorem states that if a function is not differentiable, then at least one of the hypotheses must be false. Let’s explore the condition that [latex]f_x(0,0)[/latex] must be continuous. For this to be true, it must be true that [latex]\displaystyle\lim_{(x,y)\to(0,0)}{f_x(0,0) = f_x(0,0)}[/latex]:

[latex]\large{\displaystyle\lim_{(x,y)\to(0,0)}{f_x(x,y)}=\displaystyle\lim_{(x,y)\to(0,0)}{\frac{y^3}{(x^2+y^2)^{3/2}}}}.[/latex]

Let [latex]x= ky[/latex]. Then

[latex]\begin{alignat}{2} \hspace{6cm}\displaystyle\lim_{(x,y)\to(0,0)}{\frac{y^3}{(x^2+y^2)^{3/2}}}&=\displaystyle\lim_{y\to0}{\frac{y^3}{((ky)^2+y^2)^{3/2}}}\\ &=\displaystyle\lim_{y\to0}{\frac{y^3}{(k^2y^2+y^2)^{3/2}}}&\quad\\ &=\displaystyle\lim_{y\to0}{\frac{y^3}{|y^3|(k^2+1)^{3/2}}}\\ &=\frac1{(k^2+1)^{3/2}}\displaystyle\lim_{y\to0}{\frac{|y|}{y}}\\ \end{alignat}[/latex]

If [latex]y>0[/latex]then this expression equals [latex]1/(k^2+1)^{3/2}[/latex]; if [latex]y<0[/latex] then it equals [latex]-\left(1/(k^2+1)^{3/2}\right)[/latex]In either case, the value depends on [latex]k[/latex]so the limit fails to exist.

Differentials

In Linear Approximations and Differentials we first studied the concept of differentials. The differential of [latex]y[/latex]written [latex]dy[/latex], is defined as[latex]f'(x)dx[/latex]The differential is used to approximate[latex]\Delta y = f(x+\Delta x)-f(x)[/latex], where[latex]\Delta x=dx[/latex]. Extending this idea to the linear approximation of a function of two variables at the point[latex](x_0, y_0)[/latex] yields the formula for the total differential for a function of two variables.

DEfinition


Let [latex]z=f(x,y)[/latex] be a function of two variables with [latex](x_0, y_0)[/latex] in the domain of [latex]f[/latex] and let [latex]\Delta x[/latex] and [latex]\Delta y[/latex] be chosen so that [latex](x_0+\Delta x, y_0+\Delta y)[/latex] is also in the domain of [latex]f[/latex]. If [latex]f[/latex] is differentiable at the point [latex](x_0, y_0)[/latex]then the differentials [latex]dx[/latex] and [latex]dy[/latex] are defined as

[latex]\large{dx= \Delta x}[/latex] and [latex]\large{dy= \Delta y}[/latex]

The differential [latex]dz[/latex] also called the total differential of [latex]z=f(x,y)[/latex] at [latex](x_0,y_0)[/latex]is defined as

[latex]\large{dz=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy}[/latex].

Notice that the symbol [latex]\partial[/latex] is not used to denote the total differential; rather, [latex]d[/latex] appears in front of [latex]z[/latex]. Now, let’s define [latex]\Delta z=f(x+\Delta x, y+\Delta y) - f(x,y)[/latex]. We use [latex]dz[/latex] to approximate [latex]\Delta z[/latex], so

[latex]\Delta z\approx dz=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy[/latex].

Therefore, the differential is used to approximate the change in the function [latex]z=f(x_0, y_0)[/latex] at the point [latex](x_0, y_0)[/latex] for given values of [latex]\Delta x[/latex] and [latex]\Delta y[/latex]. Since [latex]\Delta z=f(x+ \Delta x, y+ \Delta y)-f(x, y)[/latex], this can be used further to approximate [latex]f(x+ \Delta x, y+ \Delta y)[/latex]:

[latex]\hspace{8cm}\begin{alignat}{2} f(x+\Delta{x},y+\Delta{y})&=f(x,y)+\Delta{z}\\ &\approx{f}(x,y)+f_x(x_0,y_0)\Delta{x}+f_y(x_0,y_0)\Delta{y}.\\ \end{alignat}[/latex]

See the following figure.

A surface f in the xyz plane, with a tangent plane at the point (x, y, f(x, y)). On the (x, y) plane, there is a point marked (x + Δx, y + Δy). There is a dashed line to the corresponding point on the graph of f and the line then continues to the tangent plane; the distance to the graph of f is marked f(x + + Δx, y + Δy), and the distance to the tangent plane is marked as the linear approximation.

Figure 2. The linear approximation is calculated via the formula [latex]\small{f(x+\Delta{x},y+\Delta{y}) \approx f(x,y)+f_{x}(x_{0},y_{0})\Delta{x}+f_{y}(x_{0},y_{0})\Delta{y}}[/latex].

One such application of this idea is to determine error propagation. For example, if we are manufacturing a gadget and are off by a certain amount in measuring a given quantity, the differential can be used to estimate the error in the total volume of the gadget.

Example: Approximation by differentials

Find the differential [latex]dz[/latex] of the function [latex]f(x,y)=3x^{2}-2xy+y^{2}[/latex] and use it to approximate [latex]\Delta z[/latex] at point [latex](2, -3)[/latex]. Use [latex]\Delta x=0.1[/latex] and [latex]\Delta y=-0.05[/latex] What is the exact value of [latex]\Delta z[/latex]?

Try it

Find the differential [latex]dz[/latex] of the function [latex]f(x, y)=4y^{2}+x^{2}y-2xy[/latex] and use it to approximate [latex]\Delta z[/latex] at point [latex](1, -1)[/latex]. Use [latex]\Delta x=0.03[/latex] and [latex]\Delta y=-0.02[/latex]. What is the exact value of [latex]\Delta z[/latex]?

Watch the following video to see the worked solution to the above Try It

Try It

Differentiability of a Function of Three Variables

All of the preceding results for differentiability of functions of two variables can be generalized to functions of three variables. First, the definition:

DEfinition


A function [latex]f(x, y, z)[/latex] is differentiable at a point [latex]P(x_0, y_0, z_0)[/latex] if for all points [latex](x, y, z)[/latex] in a [latex]\delta[/latex] disk around [latex]P[/latex] we can write

[latex]\begin{alignat}{2}\hspace{6cm}f(x, y, z)&=f_x(x_0, y_0, z_0)(x-x_0)+f_y(x_0, y_0, z_0)(y-y_0)\\ & \;\; +f_z(x_0, y_0, z_0)(z-z_0)+E(x,y,z),\\ \end{alignat}[/latex]

where the error term [latex]E[/latex] satisfies

[latex]\displaystyle\lim_{(x,y,z)\to(x_0,y_0,z_0)}=\frac{E(x,y,x)}{\sqrt{(x-x_0)^2+(y-y_0)^2+(z-z_0)^2}}=0.[/latex]

If a function of three variables is differentiable at a point [latex](x_0, y_0, z_0)[/latex] then it is continuous there. Furthermore, continuity of first partial derivatives at that point guarantees differentiability.