# Differentials and the Total Differential • By David A. Smith, Founder & CEO, Direct Knowledge
• David Smith has a B.S. and M.S. in Mathematics and has enjoyed teaching calculus, linear algebra, and number theory at both Tarrant County College and the University of Texas at Arlington. David is the Founder and current CEO of Direct Knowledge.

## Differentials

Definition. Let $z=f(x,y)$ and let $\Delta x$ and $\Delta y$ be increments of $x$ and $y$, respectively. The differentials $dx$ and $dy$ of the independent variables $x$ and $y$ are defined by $dx=\Delta x$ and $dy=\Delta y.$ The differential $d z$, also called the total differential, is defined by \begin{equation} d z=f_x(x,y)d x+f_y(x,y)d y =\frac{\partial z}{\partial x}d x+\frac{\partial z}{\partial y}d y. \end{equation}

Theorem. If $f(x,y)$ and its partial derivatives $f_x$ and $f_y$ are defined on an open region $R$ containing the point $P\left(x_0,y_0\right)$ and both $f_x$ and $f_y$ are continuous at $P,$ then \begin{equation} \Delta f=f\left(x_0+\Delta x,y_0+\Delta y\right)-f\left(x_0,y_0\right)\approx f_x\left(x_0,y_0\right)\Delta x+f_y\left(x_0,y_0\right)\Delta y \end{equation} so that \begin{equation} \label{linappform} f\left(x_0+\Delta x,y_0+\Delta y\right)\approx f\left(x_0,y_0\right)+f_x\left(x_0,y_0\right)\Delta x+f_y\left(x_0,y_0\right)\Delta y. \end{equation}

Example. If $z=f(x,y)=x^2+3x y-y^2,$ find the differential $d z.$ Further, if $x$ changes from $2$ to $2.05$ and $y$ changes from $3$ to $2.96$, compare the values of $\Delta z$ and $d z.$ Which is easier to compute $\Delta z$ or $d z$?

Solution. By definition \begin{equation} d z=\frac{\partial z}{\partial x}d x+\frac{\partial z}{\partial y}d y=(2x+3y)d x+(3x-2y)d y. \end{equation} Putting $x=2$, $d x=\Delta x=0.05$, $y=3$, and $d y=\Delta y=-0.04$, we get \begin{equation} d z=[2(2)+3(3)]0.05+3(2)-2(3)=0.65. \end{equation} The increment of $z$ is \begin{align} \Delta z & =f(2.05,2.96)-f(2,3) \\ & =\left[(2.05)^2+3(2.05)(2.96)-(2.96)^2\right]-\left[2^2+3(2)-3^2\right] =0.6449.\end{align} Notice that $\Delta z\approx d z$ but $d z$ is easier to compute.

Example. Use differentials to approximate the real number \begin{equation} \sqrt{9(1.95)^2+(8.1)^2}. \end{equation}

Solution. Consider the function $$z=f(x,y)=\sqrt{9x^2+y^2}$$ and observe that we can easily calculate $f(2,8)=10.$ Therefore, we take $a=2, b=8, d x=\Delta x=-0.05,$ and $d y=\Delta y=0.1$ in our linear approximation formula with the multivariate function $f(x,y),$ so $$f(a+\Delta x,b+\Delta y)\approx f(a,b)+d z.$$ Next we compute the partial derivatives \begin{equation} f_x(x,y)=\frac{9x}{\sqrt{9x^2+y^2}} \qquad \text{and} \qquad f_y(x,y) = \frac{y}{\sqrt{9x^2+y^2}} \end{equation} Now using \eqref{linappform} \begin{align} & \sqrt{9(1.95)^2+(8.1)^2} =f(1.95,8.1) \approx f(2,8)+d z \\ & =f(2,8)+f_x(2,8)d x+f_y(2,8)d y =10+\frac{18}{10}(-0.05)+\frac{8}{10}(0.1) =9.99\end{align} This approximation is accurate to two decimal places.

Example. Use differentials to approximate the real number \begin{equation} 8.94\sqrt{9.99-(1.01)^3}. \end{equation}

Solution. Consider the multivariate function $z=f(w,x,y)=w\sqrt{x-y^3}$ and observe that we can easily calculate $$f(9,10,1)=9\sqrt{10-1^3}=27.$$ Therefore, we take $a=9,$ $b=10,$ $c=1,$ $d w=\Delta w=-0.06,$ $d x=\Delta x=-0.01$ and $d y=\Delta y=0.01$ in $$f(a+\Delta x,b+\Delta y,c+\Delta z)\approx f(a,b,c)+d z.$$ We find the partial derivatives \begin{equation} f_w(w,x,y)=\sqrt{x-y^3}, \quad f_x(w,x,y)=\frac{w}{2 \sqrt{x-y^3}}, \quad f_y(w,x,y)=-\frac{3 w y^2}{2 \sqrt{x-y^3}} \end{equation} Now using \eqref{linappform} \begin{align} & 8.94\sqrt{9.99-(1.01)^3} =f(8.94,9.99,1.01) \approx f(9,10,1)+d z \\ & \qquad =f(9,10,1)+f_w(9,10,1)d w+f_x(9,10,1)d x+f_y(9,10,1)d y \\ & \qquad =27+3(-0.06)+\frac{3}{2}(-0.01)+-\frac{9}{2}(0.01) =26.75\overline{9}.\end{align} This approximation is accurate to two decimal places.

## Differentiability

For a function of two variables $z=f(x,y)$, if $x$ and $y$ are given increments $\Delta x$ and $\Delta y$ , then the corresponding increment of $z$ is \begin{equation} \Delta z=f(x+\Delta x,y+\Delta y)-f(x,y). \end{equation}

Definition. If $z=f(x,y)$, then $f$ is differentiable at $(a,b)$ provided $\Delta z$ can be expressed in the form \begin{equation} \Delta z=f_x(a,b)\Delta x+f_y(a,b)\Delta y+\epsilon _1\Delta x+\epsilon _2\Delta y\end{equation} where $\epsilon _1\to 0$ and $\epsilon _2\to 0$ as $(\Delta x,\Delta y)\to (0,0).$ Additionally, $f(x,y)$ is said to be differentiable in the region $R$ of the plane if $f$ is differentiable at each point in $R.$

Theorem. (Differentiability Implies Continuity) Let $f$ be a function of two variables with $(a,b)$ in the domain of $f.$

$(1) \quad$ If $f$ is differentiable at $(a,b)$ then it is also continuous at $(a,b).$

$(2) \quad$ If $f$, $f_x$, $f_y$ are continuous in a disk $D$ centered at $(a,b)$, then $f$ is differentiable at $(a,b).$

Notice that the continuity of the three functions $f$, $f_x$, $f_y$ implies (a much stronger condition) differentiable of $f$.

Example. Let $f$ be the function defined by \begin{equation}\label{nondiffex}f(x,y)=\begin{cases} 1 & \text{ if } x>0 \text{ and } y>0 \\ 0 & \text{ otherwise }\end{cases}\end{equation} Show that the partial derivatives $f_x$ and $f_y$ exist at the origin, but $f$ is not differentiable there. The function defined by $f(x,y)=1$ whenever $x$ and $y$ are both positive and $f(x,y)=0$ otherwise, is not differentiable at $(0,0).$

Solution. Since $f(0,0)=0$, we have \begin{equation} f_x(0,0)=\lim_{\Delta x\to 0}\frac{f(0+\Delta x,0)-f(0,0)}{\Delta x}=0 \end{equation} and similarly $f_y(0,0) = 0.$ Thus, the partial derivatives both exist at the origin. If $f(x,y)$ were differentiable at the origin, it would have to be continuous there. Thus, we can show that $f$ is not differentiable by showing that it is not continuous at $(0,0).$ Toward this end, note that \begin{equation} \label{nondifflimex} \lim_{(x,y)\to (0,0)} f(x,y)
\end{equation} is 1 along the line $y=x$ in the first quadrant but it is $0$ if the approach is along the $x$-axis. This means that the limit in \eqref{nondifflimex} does not exist. Thus $f(x,y)$ is not differentiable at $(0,0).$

Therefore $f(x,y)$ is an example of a non-differentiable function for which $f_x$ and $f_y$ exist, or in other words, the word differentiable means more than just the partial derivatives exist because the existence of partial derivatives does not guarantees that a function is differentiable.

Example. Show that $f(x,y)=x^2y+x y^3$ is differentiable for all $(x,y).$ The polynomial function $f(x,y)=x^2y+x y^3$ is differentiable everywhere.

Solution. We find the partial derivatives \begin{equation} f_x(x,y)=\frac{\partial }{\partial x}\left(x^2y+x y^3\right)=2x y+y^3\end{equation} and \begin{equation} f_y(x,y)=\frac{\partial }{\partial y}\left(x^2y+x y^3\right)=x^2+3x y^2. \end{equation} Because $f,$ $f_x$ and $f_y$ are all polynomials in $x$ and $y$ they are continuous throughout the plane. Therefore $f$ must be differentiable for all $x$ and $y.$

Example. Determine whether the function $$f(x,y)=\frac{x^2y}{x^4+y^2}$$ is differentiable at either $(0,0)$ or $(1,1).$ Explain why. The rational function $f(x,y)=\frac{x^2y}{x^4+y^2}$ is not differentiable at $(0,0).$

Solution. Since $(0,0)$ is not in the domain of $f$, $f$ is not continuous at $(0,0)$, and thus not differentiable at $(0,0)$. To show that $f$ is differentiable at $(1,1)$ we compute the partial derivatives \begin{equation} f_x=\frac{-2 x^5 y+2 x y^3}{\left(x^4+y^2\right)^2} \quad \text{and} \quad f_y= \frac{x^6-x^2 y^2}{\left(x^4+y^2\right)^2}. \end{equation} Since these partial derivatives and $f$ are continuous on any open disk not containing $(0,0)$ we conclude that $f$ is differentiable at any point except $(0,0)$; and in particular at $(1,1).$

Example. Determine whether the function defined by \begin{equation} f(x,y)=\left\{ \begin{array}{ll} \frac{2(x-1)(y-1)}{(x-1)^2+(y-1)^2} & \text{if } (x,y)\neq (0,0) \\ 0 & \text{if } (x,y)= (0,0) \end{array}\right. \end{equation} is differentiable at either $(0,0)$ or $(1,1).$ Explain why. The function $f$ is not differentiable at $(1,1).$

Solution. The limit, \begin{equation} \lim_{(x,y)\to (1,1)}\frac{2(x-1)(y-1)}{(x-1)^2+(y-1)^2} \end{equation} does not exist because along $y=1$ \begin{equation} \lim_{ \begin{array}{c} (x,y)\to (1,1) \\ y=1 \end{array} } \frac{2(x-1)(y-1)}{(x-1)^2+(y-1)^2} =\lim_{x\to1}\frac{0}{(x-1)^2} =0 \end{equation} and along $y=x$ \begin{equation} \lim_{ \begin{array}{c} (x,y)\to (1,1) \\ y=x \end{array} } \frac{2(x-1)(y-1)}{(x-1)^2+(y-1)^2} =\lim_{x\to 1}\frac{2(x-1)^2}{(x-1)^2+(x-1)^2} =1. \end{equation} Therefore $f$ is not continuous at $(1,1).$ Hence $f$ is not differentiable at $(1,1).$ To show that $f$ is differentiable at $(0,0)$ we compute the partial derivatives, \begin{equation} f_x(x,y)= \frac{[(x-1)^2+(y-1)^2][2(y-1)]-[2(x-1)(y-1)][2(x-1)]}{(x-1)^2+(y-1)^2} \end{equation} for $(x,y)\neq (0,0)$ and \begin{equation} f_y(x,y)= \frac{[(x-1)^2+(y-1)^2][2(x-1)]-[2(x-1)(y-1)][2(y-1)]}{(x-1)^2+(y-1)^2} \end{equation} for $(x,y)\neq (0,0).$ Since $f$, $f_x$ and $f_y$ are rational functions they are continuous on any open disk not containing $(1,1).$ We conclude that $f$ is differentiable at any point except $(1,1)$; and in particular at $(0,0).$

## Exercises on Differentials

Exercise. Find the maximum rate of change of the function at the given point and the direction in which it occurs given $f(x,y)=\sqrt{x^2+2y}$ and $(4,10)$

Exercise. Show that if $x$ and $y$ are sufficiently close to zero and $f$ is differentiable at $(0,0),$ then \begin{equation} f(x,y)\approx f(0,0)+x f_x(0,0)+y f_y(0,0) \end{equation} Use this approximation for the expressions \begin{equation} \frac{1}{1+x-y} \qquad \text{and} \qquad \frac{1}{(x+1)^2+(y+1)^2} \end{equation} around $(0,0).$

Exercise. Find the total differential of the function $z=x^2-2x y +3y^2.$

Exercise. Find the tangent plane to the surface $z=x \sin y-x \cos x$ at $(\pi,0).$

Exercise. Find an equation for each horizontal tangent plane to the surface $z=5-x^2-y^2+4y.$

Exercise. Determine the total differential.

$(1) \quad z=5x^2y^3$

$(2) \quad z=\cos x^2y$

$(3) \quad z=y e^x$

$(4) \quad w=\sin x+\sin y+\cos z$

$(5) \quad w=z^2\sin (2x-3y)$

$(6) \quad w=3y^2z \cos x$

Exercise. Show that each functions is differentiable on $\mathbb{R}^2.$

$(1) \quad f(x,y)=x y^3+3 x y^2$

$(2) \quad f(x,y)=\sin \left(x^2+3y\right)$

$(3) \quad f(x,y)=x^2+4x-y^2$

$(4) \quad f(x,y)=e^{2x+y^2}$

Exercise. Determine the standard-form equation for the tangent plane to the surface at the specified point.

$(1) \quad f(x,y)=\sqrt{x^2+y^2}$ at $P_0\left(3,1,\sqrt{10}\right)$

$(2) \quad f(x,y)=x^2+y^2+ \sin x y$ at $P_0(0,2,4)$

$(3) \quad f(x,y)=e^{-x} \sin y$ at $P_0\left(0,\frac{\pi}{2},1\right)$

$(4) \quad z=10-x^2-y^2$ at $P(2,2,2)$

$(5) \quad z=\ln \left|x+y^2\right|$ at $P(-3,-2,0)$

Exercise. Use linear approximation (differentials) to find approximate value.

$(1) \quad \left(\sqrt{\frac{\pi }{2}}-0.01\right)$

$(2) \quad \sin \left(\sqrt{\frac{\pi }{2}}+0.01\right)$

$(3) \quad e^{1.01^20.98^2}$

Exercise. Show that if $x$ and $y$ are sufficiently close to zero and $f$ is differentiable at $(0,0),$ then \begin{equation} f(x,y)\approx f(0,0)+x f_x(0,0)+y f_y(0,0) \end{equation} Use this approximation for the expressions \begin{equation} \frac{1}{1+x-y} \qquad \text{and} \qquad \frac{1}{(x+1)^2+(y+1)^2} \end{equation} around $(0,0).$

Exercise. Find a unit vector that is normal to the given graph at the point $P_0\left(x_0,y_0\right)$ on the graph.

$(1) \quad$ the circle $x^2+y^2=a^2$

$(2) \quad$ the ellipse $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1.$

Exercise. Find a unit vector that is normal to each surface given at the prescribed point, and the standard form of the equation of the tangent plane at that point.

$(1) \quad \ln \left(\frac{x}{y-z}\right)=0$ at $(2,5,3)$

$(2) \quad z e^{x^2-y^2}=3$ at $(1,1,3)$