# 13.6: Tangent Planes and Differentials

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

In this section, we consider the problem of finding the tangent plane to a surface, which is analogous to finding the equation of a tangent line to a curve when the curve is defined by the graph of a function of one variable, \(\displaystyle y=f(x)\). The slope of the tangent line at the point \(\displaystyle x=a\) is given by \(\displaystyle m=f′(a)\); what is the slope of a tangent plane? We learned about the equation of a plane in Equations of Lines and Planes in Space; in this section, we see how it can be applied to the problem at hand.

## Tangent Planes

Intuitively, it seems clear that, in a plane, only one line can be tangent to a curve at a point. However, in three-dimensional space, many lines can be tangent to a given point. If these lines lie in the same plane, they determine the tangent plane at that point. A more intuitive way to think of a tangent plane is to assume the surface is smooth at that point (no corners). Then, a tangent line to the surface at that point in any direction does not have any abrupt changes in slope because the direction changes smoothly. Therefore, in a small-enough neighborhood around the point, a tangent plane touches the surface at that point only.

Definition: tangent lines

Let \(\displaystyle P_0=(x_0,y_0,z_0)\) be a point on a surface \(\displaystyle S\), and let \(\displaystyle C\) be any curve passing through \(\displaystyle P_0\) and lying entirely in \(\displaystyle S\). If the tangent lines to all such curves \(\displaystyle C\) at \(\displaystyle P_0\) lie in the same plane, then this plane is called the *tangent plane*** **to \(\displaystyle S\) at \(\displaystyle P_0\) (Figure).

* Figure \(\PageIndex{1}\): The tangent plane to a surface \(\displaystyle S\) at a point \(\displaystyle P_0\) contains all the tangent lines to curves in *\(S\)

*that pass through \(\displaystyle P_0\).*

For a tangent plane to a surface to exist at a point on that surface, it is sufficient for the function that defines the surface to be differentiable at that point. We define the term tangent plane here and then explore the idea intuitively.

Definition: tangent planes

Let \(\displaystyle S\) be a surface defined by a differentiable function \(\displaystyle z=f(x,y),\) and let \(\displaystyle P_0=(x_0,y_0)\) be a point in the domain of \(\displaystyle f\). Then, the equation of the tangent plane to \(\displaystyle S\) at \(\displaystyle P_0\) is given by

\[z=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0). \label{tanplane}\]

To see why this formula is correct, let’s first find two tangent lines to the surface \(\displaystyle S\). The equation of the tangent line to the curve that is represented by the intersection of \(\displaystyle S\) with the vertical trace given by \(\displaystyle x=x_0\) is \(\displaystyle z=f(x_0,y_0)+f_y(x_0,y_0)(y−y_0)\). Similarly, the equation of the tangent line to the curve that is represented by the intersection of \(\displaystyle S\) with the vertical trace given by \(\displaystyle y=y_0\) is \(\displaystyle z=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)\). A parallel vector to the first tangent line is \(\displaystyle a=j+f_y(x_0,y_0)k\); a parallel vector to the second tangent line is \(\displaystyle b=i+f_x(x_0,y_0)k\). We can take the cross product of these two vectors:

\[\begin{align*} a\times b&=(j+f_y(x_0,y_0)k)×(i+f_x(x_0,y_0)k)\\[5pt] &=\begin{bmatrix}i&j&k\\[5pt] 0&1&f_y(x_0,y_0)\\[5pt] 1&0&f_x(x_0,y_0)\end{bmatrix} \\[5pt] &=f_x(x_0,y_0)i+f_y(x_0,y_0)j−k. \end{align*}\]

This vector is perpendicular to both lines and is therefore perpendicular to the tangent plane. We can use this vector as a normal vector to the tangent plane, along with the point \(\displaystyle P_0=(x_0,y_0,f(x_0,y_0))\) in the equation for a plane:

\[n·((x−x_0)i+(y−y_0)j+(z−f(x_0,y_0))k)=0\]

\[(f_x(x_0,y_0)i+f_y(x_0,y_0)j-k)·((x−x_0)i+(y−y_0)j+(z−f(x_0,y_0))k)=0\]

\[f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0)−(z−f(x_0,y_0))=0.\]

Solving this equation for *z* gives Equation.

Example \(\displaystyle \PageIndex{1}\): Finding a Tangent Plane

Find the equation of the tangent plane to the surface defined by the function \(\displaystyle f(x,y)=2x^2−3xy+8y^2+2x−4y+4\) at point \(\displaystyle (2,−1).\)

**Solution**

First, we must calculate \(\displaystyle f_x(x,y)\) and \(\displaystyle f_y(x,y)\), then use Equation with \(\displaystyle x_0=2\) and \(\displaystyle y_0=−1\):

\[\begin{align*} f_x(x,y)&=4x−3y+2 \\[5pt] f_y(x,y)&=−3x+16y−4 \\[5pt] f(2,−1)&=2(2)^2−3(2)(−1)+8(−1)^2+2(2)−4(−1)+4=34 \\[5pt] f_x(2,−1)&=4(2)−3(−1)+2=13 \\[5pt] f_y(2,−1)&=−3(2)+16(−1)−4=−26.\end{align*}\]

Then Equation \ref{tanplane} becomes

\[\begin{align*} z&=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0) \\[5pt] z&=34+13(x−2)−26(y−(−1)) \\[5pt] z&=34+13x−26−26y−26 \\[5pt] z&=13x−26y−18. \end{align*} \]

(See the following figure).

**Figure \(\PageIndex{2}\):** Calculating the equation of a tangent plane to a given surface at a given point.

Exercise \(\displaystyle \PageIndex{1}\)

Find the equation of the tangent plane to the surface defined by the function \(\displaystyle f(x,y)=x^3−x^2y+y^2−2x+3y−2\) at point \(\displaystyle (−1,3)\).

**Hint**-
First, calculate \(\displaystyle f_x(x,y)\) and \(\displaystyle f_y(x,y)\), then use Equation \ref{tanplane}.

**Answer**-
\(\displaystyle z=7x+8y−3\)

Example \(\displaystyle \PageIndex{2}\): Finding Another Tangent Plane

Find the equation of the tangent plane to the surface defined by the function \(\displaystyle f(x,y)=sin(2x)cos(3y)\) at the point \(\displaystyle (π/3,π/4).\)

**Solution**

First, calculate \(\displaystyle f_x(x,y)\) and \(\displaystyle f_y(x,y)\), then use Equation \ref{tanplane} with \(\displaystyle x_0=π/3\) and \(\displaystyle y_0=π/4\):

\[\begin{align*} f_x(x,y)& =2\cos(2x)\cos(3y) \\[5pt] f_y(x,y)&=−3\sin(2x)\sin(3y) \\[5pt] f\left(\dfrac{π}{3},\dfrac{π}{4}\right)&=\sin\left(2\left(\dfrac{π}{3}\right)\right)\cos(3(\dfrac{π}{4}))=(\dfrac{\sqrt{3}}{2})(−\dfrac{\sqrt{2}}{2})=−\dfrac{\sqrt{6}}{4} \\[5pt] f_x\left(\dfrac{π}{3},\dfrac{π}{4}\right)&=2\cos(2(\dfrac{π}{3}))\cos\left(3\left(\dfrac{π}{4}\right)\right)=2\left(−\dfrac{1}{2}\right)\left(−\dfrac{\sqrt{2}}{2}\right)=\dfrac{\sqrt{2}}{2} \\[5pt] f_y \left(\dfrac{π}{3},\dfrac{π}{4}\right)&=−3\sin\left(2\left(\dfrac{π}{3}\right)\right)\sin\left(3\left(\dfrac{π}{4}\right)\right)=−3\left(\dfrac{\sqrt{3}}{2}\right)\left(\dfrac{\sqrt{2}}{2}\right)=−\dfrac{3\sqrt{6}}{4}. \end{align*}\]

Then Equation \ref{tanplane} becomes

\[\begin{align*} z&=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0) \\[5pt] &=−\dfrac{\sqrt{6}}{4}+\dfrac{\sqrt{2}}{2}\left(x−\dfrac{π}{3}\right)−\dfrac{3\sqrt{6}}{4}(y−\dfrac{π}{4}) \\[5pt] &=\dfrac{\sqrt{2}}{2}x−\dfrac{3\sqrt{6}}{4}y−\dfrac{\sqrt{6}}{4}−\dfrac{π\sqrt{2}}{6}+\dfrac{3π\sqrt{6}}{16} \end{align*}\]

A tangent plane to a surface does not always exist at every point on the surface. Consider the piecewise function

\[f(x,y)=\begin{cases}\dfrac{xy}{\sqrt{x^2+y^2}}&(x,y)≠(0,0)\\[5pt] 0&(x,y)=(0,0)\end{cases}. \label{oddfunction}\]

The graph of this function follows.

**Figure \(\PageIndex{3}\):** Graph of a function that does not have a tangent plane at the origin. Dynamic figure powered by CalcPlot3D.

If either \(\displaystyle x=0\) or \(\displaystyle y=0\), then \(\displaystyle f(x,y)=0,\) so the value of the function does not change on either the *x-* or *y-axis.* Therefore, \(\displaystyle f_x(x,0)=f_y(0,y)=0\), so as either \(\displaystyle x\) or \(\displaystyle y\) approach zero, these partial derivatives stay equal to zero. Substituting them into Equation gives \(\displaystyle z=0\) as the equation of the tangent line. However, if we approach the origin from a different direction, we get a different story. For example, suppose we approach the origin along the line \(\displaystyle y=x\). If we put \(\displaystyle y=x\) into the original function, it becomes

\[f(x,x)=\dfrac{x(x)}{\sqrt{x^2+(x)^2}}=\dfrac{x^2}{\sqrt{2x^2}}=\dfrac{|x|}{\sqrt{2}}.\]

When \(\displaystyle x>0,\) the slope of this curve is equal to \(\displaystyle sqrt{2}/2\); when \(\displaystyle x<0\), the slope of this curve is equal to \(\displaystyle −(\sqrt{2}/2).\) This presents a problem. In the definition of tangent plane, we presumed that all tangent lines through point \(\displaystyle P\) (in this case, the origin) lay in the same plane. This is clearly not the case here. When we study differentiable functions, we will see that this function is not differentiable at the origin.

## Linear Approximations

Recall from Linear Approximations and Differentials that the formula for the linear approximation of a function \(\displaystyle f(x)\) at the point \(\displaystyle x=a\) is given by

\[y≈f(a)+f'(a)(x−a).\]

The diagram for the linear approximation of a function of one variable appears in the following graph.

**Figure \(\PageIndex{4}\):** Linear approximation of a function in one variable.

The tangent line can be used as an approximation to the function \(\displaystyle f(x)\) for values of \(\displaystyle x\) reasonably close to \(\displaystyle x=a\). When working with a function of two variables, the tangent line is replaced by a tangent plane, but the approximation idea is much the same.

Definition: Linear Approximation

Given a function \(\displaystyle z=f(x,y)\) with continuous partial derivatives that exist at the point \(\displaystyle (x_0,y_0)\), the linear approximation of \(f\) at the point \(\displaystyle (x_0,y_0)\) is given by the equation

\[L(x,y)=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0). \label{approx}\]

Notice that this equation also represents the tangent plane to the surface defined by \(\displaystyle z=f(x,y)\) at the point \(\displaystyle (x_0,y_0)\). The idea behind using a linear approximation is that, if there is a point \(\displaystyle (x_0,y_0)\) at which the precise value of \(\displaystyle f(x,y)\) is known, then for values of \(\displaystyle (x,y)\) reasonably close to \(\displaystyle (x_0,y_0)\), the linear approximation (i.e., tangent plane) yields a value that is also reasonably close to the exact value of \(\displaystyle f(x,y)\) (Figure). Furthermore the plane that is used to find the linear approximation is also the tangent plane to the surface at the point \(\displaystyle (x_0,y_0).\)

**Figure \(\PageIndex{5}\): **Using a tangent plane for linear approximation at a point.

Example \(\displaystyle \PageIndex{3}\): Using a Tangent Plane Approximation

Given the function \(\displaystyle f(x,y)=\sqrt{41−4x^2−y^2}\), approximate \(\displaystyle f(2.1,2.9)\) using point \(\displaystyle (2,3)\) for \(\displaystyle (x_0,y_0).\) What is the approximate value of \(\displaystyle f(2.1,2.9)\) to four decimal places?

**Solution**

To apply Equation \ref{approx}, we first must calculate \(\displaystyle f(x_0,y_0), f_x(x_0,y_0),\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=2\) and \(\displaystyle y_0=3:\)

\[\begin{align*} f(x_0,y_0)&=f(2,3)=\sqrt{41−4(2)^2−(3)^2}=\sqrt{41−16−9}=\sqrt{16}=\sqrt{4} \\[5pt] f_x(x,y)&=−\dfrac{4x}{\sqrt{41−4x^2−y^2}} \text{so} \; f_x(x_0,y_0)=−\dfrac{4(2)}{\sqrt{41−4(2)^2−(3)^2}}=−2 \\[5pt] f_y(x,y)&=−\dfrac{y}{\sqrt{41−4x^2−y^2}} \text{so}\; f_y(x_0,y_0)=−\dfrac{3}{\sqrt{41−4(2)^2−(3)^2}}=−\dfrac{3}{4}. \end{align*}\]

Now we substitute these values into Equation \ref{approx}:

\[\begin{align*} L(x,y)&=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0) \\[5pt] &=4−2(x−2)−\dfrac{3}{4}(y−3) \\[5pt] &=\dfrac{41}{4}−2x−\dfrac{3}{4}y. \end{align*} \]

Last, we substitute \(\displaystyle x=2.1\) and \(\displaystyle y=2.9\) into \(L(x,y):\)

\[\displaystyle L(2.1,2.9)=\dfrac{41}{4}−2(2.1)−\dfrac{3}{4}(2.9)=10.25−4.2−2.175=3.875. \nonumber \]

The approximate value of \(\displaystyle f(2.1,2.9)\) to four decimal places is

\[\displaystyle f(2.1,2.9)=\sqrt{41−4(2.1)^2−(2.9)^2}=\sqrt{14.95}≈3.8665, \nonumber\]

which corresponds to a \(\displaystyle 0.2%\) error in approximation.

Exercise \(\displaystyle \PageIndex{2}\)

Given the function \(\displaystyle f(x,y)=e^{5−2x+3y},\) approximate \(\displaystyle f(4.1,0.9)\) using point \(\displaystyle (4,1)\) for \(\displaystyle (x_0,y_0)\). What is the approximate value of \(\displaystyle f(4.1,0.9)\) to four decimal places?

**Hint**-
First calculate \(\displaystyle f(x_0,y_0),f_x(x_0,y_0),\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=4\) and \(\displaystyle y_0=1\), then use Equation \ref{approx}.

**Answer**-
\(\displaystyle L(x,y)=6−2x+3y,\) so \(\displaystyle L(4.1,0.9)=6−2(4.1)+3(0.9)=0.5\) \(\displaystyle f(4.1,0.9)=e^{5−2(4.1)+3(0.9)}=e^{−0.5}≈0.6065.\)

## Differentiability

When working with a function \(\displaystyle y=f(x)\) of one variable, the function is said to be differentiable at a point \(\displaystyle x=a\) if \(\displaystyle f′(a)\) 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 \(\displaystyle P\) 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 (Equation \ref{tanplane}) for a tangent plane at a point \(\displaystyle (x_0,y_0)\) is given by

\[z=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0) \nonumber\]

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

Definition: differentiable Functions

A function \(\displaystyle f(x,y)\) is *differentiable *at a point \(\displaystyle P(x_0,y_0)\) if, for all points \(\displaystyle (x,y)\) in a \(\displaystyle δ\) disk around \(\displaystyle P\), we can write

\[f(x,y)=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), \label{diff1}\]

where the error term \(\displaystyle E\) satisfies

\[\lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}=0. \label{diff2}\]

The last term in Equation \ref{diff1} is to as the **error term** and it represents how closely the tangent plane comes to the surface in a small neighborhood (\(\displaystyle δ\) disk) of point \(\displaystyle P\). For the function \(\displaystyle f\) to be differentiable at \(\displaystyle P\), the function must be smooth—that is, the graph of \(\displaystyle f\) must be close to the tangent plane for points near \(\displaystyle P\).

Example \(\displaystyle \PageIndex{4}\): Demonstrating Differentiability

Show that the function \(\displaystyle f(x,y)=2x^2−4y\) is differentiable at point \(\displaystyle (2,−3).\)

**Solution**

First, we calculate \(\displaystyle f(x_0,y_0),f_x(x_0,y_0),\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=2\) and \(\displaystyle y_0=−3,\) then we use Equation \ref{diff1}:

\[\begin{align*} f(2,−3)&=2(2)^2−4(−3)=8+12=20 \\[5pt] f_x(2,−3)&=4(2)=8 \\[5pt] f_y(2,−3)&=−4. \end{align*} \]

Therefore \(\displaystyle m_1=8\) and \(\displaystyle m_2=−4,\) and Equation \ref{diff1} becomes

\[ \begin{align*} f(x,y)&=f(2,−3)+f_x(2,−3)(x−2)+f_y(2,−3)(y+3)+E(x,y) \\[5pt] 2x^2−4y&=20+8(x−2)−4(y+3)+E(x,y) \\[5pt] 2x^2−4y&=20+8x−16−4y−12+E(x,y) \\[5pt] 2x^2−4y&=8x−4y−8+E(x,y) \\[5pt] E(x,y)&=2x^2−8x+8. \end{align*} \]

Next, we calculate the limit in Equation \ref{diff2}:

\[\begin{align*} \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x+0)^2+(y−y_0)^2}}&=\lim_{(x,y)→(2,−3)}\dfrac{2x^2−8x+8}{\sqrt{(x−2)^2+(y+3)^2}} \\[5pt] &=\lim_{(x,y)→(2,−3)}\dfrac{2(x^2−4x+4)}{\sqrt{(x−2)^2+(y+3)^2}} \\[5pt] &=\lim_{(x,y)→(2,−3)}\dfrac{2(x−2)^2}{\sqrt{(x−2)^2+(y+3)^2}} \\[5pt] &=\lim_{(x,y)→(2,−3)}\dfrac{2((x−2)^2+(y+3)^2)}{\sqrt{(x−2)^2+(y+3)^2}} \\[5pt] &=\lim_{(x,y)→(2,−3)}2\sqrt{(x−2)^2+(y+3)^2} \\[5pt] &=0. \end{align*}\]

Since \(\displaystyle E(x,y)≥0\) for any value of \(\displaystyle x\) or \(\displaystyle y\), the original limit must be equal to zero. Therefore, \(\displaystyle f(x,y)=2x^2−4y\) is differentiable at point \(\displaystyle (2,−3)\).

Exercise \(\displaystyle \PageIndex{3}\)

Show that the function \(\displaystyle f(x,y)=3x−4y^2\) is differentiable at point \((−1,2)\).

**Hint**-
First, calculate \(\displaystyle f(x_0,y_0),f_x(x_0,y_0),\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=−1\) and \(\displaystyle y_0=2\), then use Equation \ref{diff2} to find \(\displaystyle E(x,y)\). Last, calculate the limit.

**Answer**-
\[\begin{align*} f(−1,2)&=−19,f_x(−1,2)=3,f_y(−1,2)=−16,E(x,y)=−4(y−2)^2. \\[5pt] \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}&=\lim_{(x,y)→(−1,2)}\dfrac{−4(y−2)^2}{\sqrt{(x+1)^2+(y−2)^2}} \\[5pt] &≤\lim_{(x,y)→(−1,2)}\dfrac{−4((x+1)^2+(y−2)^2)}{\sqrt{(x+1)^2+(y−2)^2}} \\[5pt] &=\lim_{(x,y)→(2,−3)}−4\sqrt{(x+1)^2+(y−2)^2} \\[5pt] &=0. \end{align*}\]

This function from (Equation \ref{oddfunction})

\[\displaystyle f(x,y)=\begin{cases}\dfrac{xy}{\sqrt{x^2+y^2}}&(x,y)≠(0,0)\\[5pt] 0&(x,y)=(0,0)\end{cases} \nonumber\]

is not differentiable at the origin (Figure \(\PageIndex{3}\)). We can see this by calculating the partial derivatives. This function appeared earlier in the section, where we showed that \(\displaystyle f_x(0,0)=f_y(0,0)=0\). Substituting this information into Equations \ref{diff1} and \ref{diff2} using \(\displaystyle x_0=0\) and \(\displaystyle y_0=0\), we get

\[\begin{align*} f(x,y)&=f(0,0)+f_x(0,0)(x−0)+f_y(0,0)(y−0)+E(x,y) \\[5pt] E(x,y)&=\dfrac{xy}{\sqrt{x^2+y^2}}. \end{align*} \]

Calculating

\[\displaystyle \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}\]

gives

\[\begin{align*} \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}&=\lim_{(x,y)→(0,0)}\dfrac{\dfrac{xy}{\sqrt{x^2+y^2}}}{\sqrt{x^2+y^2}} \\[5pt] &=\lim_{(x,y)→(0,0)}\dfrac{xy}{x^2+y^2}. \end{align*}\]

Depending on the path taken toward the origin, this limit takes different values. Therefore, the limit does not exist and the function \(\displaystyle f\) is not differentiable at the origin as shown in the following figure.

**Figure \(\PageIndex{6}\):** This function \(\displaystyle f(x,y)\) (Equation \ref{oddfunction}) 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.

THEOREM: Differentiability Implies Continuity

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

Note 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, the function discussed above (Equation \ref{oddfunction})

\[f(x,y)=\begin{cases}\dfrac{xy}{\sqrt{x^2+y^2}}&(x,y)≠(0,0)\\[5pt] 0&(x,y)=(0,0)\end{cases} \nonumber\]

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.

We can further explores the connection between continuity and differentiability at a point. This next theorem says that if the function and its partial derivatives are continuous at a point, the function is differentiable.

Theorem: Continuity of First Partials Implies Differentiability

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

Recall that earlier we showed that the function in Equation \ref{oddfunction} was not differentiable at the origin. Let’s calculate the partial derivatives \(\displaystyle f_x\) and \(\displaystyle f_y\):

\[\displaystyle \dfrac{∂f}{∂x}=\dfrac{y^3}{(x^2+y^2)^{3/2}}\]

and

\[\dfrac{∂f}{∂y}=\dfrac{x^3}{(x^2+y^2)^{3/2}}.\]

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 \(\displaystyle f_x(0,0)\) must be continuous. For this to be true, it must be true that

\[\displaystyle \lim_{(x,y)→(0,0)} f_x(x,y)=f_x(0,0)\]

therefor

\[\displaystyle \lim_{(x,y)→(0,0)}f_x(x,y)=\lim_{(x,y)→(0,0)}\dfrac{y^3}{(x^2+y^2)^{3/2}}.\]

Let \(\displaystyle x=ky\). Then

\[\begin{align*} \lim_{(x,y)→(0,0)}\dfrac{y^3}{(x^2+y^2)^{3/2}}&=\lim_{y→0}\dfrac{y^3}{((ky)^2+y^2)^{3/2}} \\[5pt] &=\lim_{y→0}\dfrac{y^3}{(k^2y^2+y^2)^{3/2}} \\[5pt] & =\lim_{y→0}\dfrac{y^3}{|y|^3(k^2+1)^{3/2}} \\[5pt] & =\dfrac{1}{(k^2+1)^{3/2}}\lim_{y→0}\dfrac{|y|}{y}. \end{align*}\]

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

## Differentials

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

Definition: Total Differential

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

\[dx=Δx\]

and

\[dy=Δy.\]

The differential \(\displaystyle dz\), also called the ** total differential** of \(\displaystyle z=f(x,y)\) at \(\displaystyle (x_0,y_0)\), is defined as

\[dz=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy. \label{total}\]

Notice that the symbol \(\displaystyle ∂\) is not used to denote the total differential; rather, \(\displaystyle d\) appears in front of \(\displaystyle z\). Now, let’s define \(\displaystyle Δz=f(x+Δx,y+Δy)−f(x,y).\) We use \(\displaystyle dz\) to approximate \(\displaystyle Δz\), so

\[Δz≈dz=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy.\]

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

\[\displaystyle f(x+Δx,y+Δy)=f(x,y)+Δz≈f(x,y)+fx(x_0,y_0)Δx+f_y(x_0,y_0)Δy.\]

See the following figure.

**Figure \(\PageIndex{7}\): **The linear approximation is calculated via the formula \(\displaystyle f(x+Δx,y+Δy)≈f(x,y)+f_x(x_0,y_0)Δx+f_y(x_0,y_0)Δy.\)

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 \(\displaystyle \PageIndex{5}\): Approximation by Differentials

Find the differential \(\displaystyle dz\) of the function \(\displaystyle f(x,y)=3x^2−2xy+y^2\) and use it to approximate \(\displaystyle Δz\) at point \(\displaystyle (2,−3).\) Use \(\displaystyle Δx=0.1\) and \(\displaystyle Δy=−0.05.\) What is the exact value of \(\displaystyle Δz\)?

**Solution**

First, we must calculate \(\displaystyle f(x_0,y_0),f_x(x_0,y_0),\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=2\) and \(\displaystyle y_0=−3:\)

\[\begin{align*} f(x_0,y_0)&=f(2,−3)=3(2)^2−2(2)(−3)+(−3)^2=12+12+9=33 \\[5pt] f_x(x,y &=6x−2y \\[10pt] f_y(x,y) &=−2x+2y \\[5pt] f_x(x_0,y_0) &= fx(2,−3) \\[5pt] &=6(2)−2(−3)=12+6=18 \\[10pt] f_y(x_0,y_0)&=f_y(2,−3) \\[5pt] &=−2(2)+2(−3) \\[5pt] &=−4−6=−10. \end{align*}\]

Then, we substitute these quantities into Equation \ref{total}:

\[\begin{align*} dz&=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy \\[5pt] dz&=18(0.1)−10(−0.05)=1.8+0.5=2.3. \end{align*}\]

This is the approximation to \(\displaystyle Δz=f(x_0+Δx,y_0+Δy)−f(x_0,y_0).\) The exact value of \(\displaystyle Δz\) is given by

\[\begin{align*} Δz&=f(x_0+Δx,y_0+Δy)−f(x_0,y_0) \\[5pt] &=f(2+0.1,−3−0.05)−f(2,−3) \\[5pt] &=f(2.1,−3.05)−f(2,−3) \\[5pt] &=2.3425. \end{align*}\]

Exercise \(\displaystyle \PageIndex{4}\)

Find the differential \(\displaystyle dz\) of the function \(\displaystyle f(x,y)=4y^2+x2y−2xy\) and use it to approximate \(\displaystyle Δz\) at point \(\displaystyle (1,−1)\). Use \(\displaystyle Δx=0.03\) and \(\displaystyle Δy=−0.02\). What is the exact value of \(\displaystyle Δz\)?

**Hint**-
First, calculate \(\displaystyle f_x(x_0,y_0)\) and \(\displaystyle f_y(x_0,y_0)\) using \(\displaystyle x_0=1\) and \(\displaystyle y_0=−1\), then use Equation \ref{total}.

**Answer**-
\(\displaystyle dz=0.18\)

\(\displaystyle Δz=f(1.03,−1.02)−f(1,−1)=0.180682\)

## 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: Differentiability at a point

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

\[f(x,y)=f(x_0,y_0,z_0)+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),\]

where the error term *E* satisfies

\[\lim_{(x,y,z)→(x_0,y_0,z_0)}\dfrac{E(x,y,z)}{\sqrt{(x−x_0)^2+(y−y_0)^2+(z−z_0)^2}}=0.\]

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

## Key Concepts

- The analog of a tangent line to a curve is a tangent plane to a surface for functions of two variables.
- Tangent planes can be used to approximate values of functions near known values.
- A function is differentiable at a point if it is ”smooth” at that point (i.e., no corners or discontinuities exist at that point).
- The total differential can be used to approximate the change in a function \(\displaystyle z=f(x_0,y_0)\) at the point \(\displaystyle (x_0,y_0)\) for given values of \(\displaystyle Δx\) and \(\displaystyle Δy\).

## Key Equations

**Tangent plane**

\(\displaystyle z=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0)\)

**Linear approximation**

\(\displaystyle L(x,y)=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0)\)

**Total differential**

\(\displaystyle dz=f_x(x_0,y_0)dx+f_y(x_0,y_0)dy\).

**Differentiability (two variables)**

\(\displaystyle f(x,y)=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),\)

where the error term \(\displaystyle E\) satisfies

\(\displaystyle \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}=0\).

**Differentiability (three variables)**

\(\displaystyle f(x,y)=f(x_0,y_0,z_0)+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),\)

where the error term \(\displaystyle E\) satisfies

\(\displaystyle \lim_{(x,y,z)→(x_0,y_0,z_0)}\dfrac{E(x,y,z)}{\sqrt{(x−x_0)^2+(y−y_0)^2+(z−z_0)^2}}=0\).

## Glossary

**differentiable**-
a function \(\displaystyle f(x,y)\) is differentiable at \(\displaystyle (x_0,y_0)\) if \(\displaystyle f(x,y)\) can be expressed in the form \(\displaystyle f(x,y)=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),\)

where the error term \(\displaystyle E(x,y)\) satisfies \(\displaystyle \lim_{(x,y)→(x_0,y_0)}\dfrac{E(x,y)}{\sqrt{(x−x_0)^2+(y−y_0)^2}}=0\)

**linear approximation**- given a function \(\displaystyle f(x,y)\) and a tangent plane to the function at a point \(\displaystyle (x_0,y_0)\), we can approximate \(\displaystyle f(x,y)\) for points near \(\displaystyle (x_0,y_0)\) using the tangent plane formula

**tangent plane**- given a function \(\displaystyle f(x,y)\) that is differentiable at a point \(\displaystyle (x_0,y_0)\), the equation of the tangent plane to the surface \(\displaystyle z=f(x,y)\) is given by \(\displaystyle z=f(x_0,y_0)+f_x(x_0,y_0)(x−x_0)+f_y(x_0,y_0)(y−y_0)\)

**total differential**- the total differential of the function \(\displaystyle f(x,y)\) at \(\displaystyle (x_0,y_0)\) is given by the formula \(\displaystyle dz=f_x(x_0,y_0)dx+fy(x_0,y_0)dy\)

### Contributors

Gilbert Strang (MIT) and Edwin “Jed” Herman (Harvey Mudd) with many contributing authors. This content by OpenStax is licensed with a CC-BY 3/0 license. Download for free at http://cnx.org/contents/fd53eae1-fa2...49835c3c@5.191.