Checking differentiabilityWorksheet By Mike May, S.J. - maymk@slu.eduEdited by Russell Blyth - blythrd@slu.edurestart;We say a function in two variables is differentiable at a point if the graph near that point can be approximated by the tangent plane. A harder question is how to tell when a function given by a formula is differentiable. This worksheet investigates how to check if a function is differentiable at a point.Taking care of the easy points - nice functionA standard theorem states that a function is differentiable at a point if both partial derivatives are defined and continuous at that point. Recall that polynomials are continuous functions. Similarly we get a continuous function if we take the sum, difference, product, or composition of two continuous functions. The quotient of two continuous functions is continuous at points where the denominator is not zero, and a root of a continuous function is continuous, except that an even-power root of a function is undefined where the function is negative. We also recall that the derivative of a function is sometimes not defined where we take a root of zero. Thus for a nice function that is defined by a single algebraic expression, we easily note that the function is differentiable at all points in its domain, except perhaps at the points where we take a root of zero (note that points at which we would divide by zero are excluded from the domain).Exercise1. The following functions are from the exercises in the section on differentiability in McCallum's Multivariable Calculus book. For each function, the reasoning above allows us to say that the function is "nice" everywhere, except perhaps at a small set of points. For each function identify the set of "difficult" points.(a) f(x, y) = x/y + y/x if x*y \342\211\240 0 and f(x, y) = 0 if x*y = 0.(b) f(x, y) = 2*x*y/(x^2 + y^2)^2 if (x, y) \342\211\240 0 and f(0, 0) = 0.(c) f(x, y) = x*y/sqrt(x^2 + y^2) if (x, y) \342\211\240 0 and f(0, 0) = 0.(d) f(x, y) = x^2*y/(x^4 + y^2) if (x, y) \342\211\240 0 and f(0, 0) = 0.(e) f(x, y) = x*y^2/(x^2 + y^2) if (x, y) \342\211\240 0 and f(0, 0) = 0.(f) f(x, y) = x*y^2/(x^2 + y^4) if (x, y) \342\211\240 0 and f(0, 0) = 0.(g) f(x, y) = sqrt(abs(x*y)).(h) f(x, y) = x*y*(x^2 - y^2)/(x^2 + y^2) if (x, y) \342\211\240 0 and f(0, 0) = 0.Really bad points - Where the function is not continuousA function can only be differentiable where it is continuous. You may need to review the section on continuity in your text. Recall that a function is continuous at a point if the limit at that point equals the value of the function at that point. Since we are only worried about difficult points, the function will often be defined by a special rule at the point, and by a formula at nearby points. Consider the function NiMvLSUiZkc2JCUieEclInlHKihGJyIiIkYoRiosJiokKUYnIiIjRipGKiokKUYoRi5GKkYqISIi, unless (NiQlInhHJSJ5Rw==) is the origin, in which case we use the special rule NiMvLSUiZkc2JCIiIUYnRic=. The problem is at the origin. The first way to check continuity is always to look at a graph to see if the function jumps.plot3d(x*y/(x^2+y^2),x=-1..1, y=-1..1,view=-1..1,
axes=boxed, style=patchcontour, shading=z);It is clear from looking at the picture that this function is not continuous at the origin (rotate the surface to see this clearly). If we look down the z-axis it is clear that all the different contours extend in to the origin.(Technical tip - When looking at functions that might be discontinuous, it is often good to specify the view, or z-range. Otherwise the graph of a function going to infinity can eliminate the other details of the graph. It is also useful to use the shading=z option so that the color scheme is determined by the z-values. At discontinuous points lots of colors try to come together.) We would also like an algebraic way to consider continuity. To do that we pick two paths to the trouble spot that seem to follow different contours. We can then take old fashioned limits on the paths and see that they have different limits. (We may find a path that has no limit at all.) For our example we pick the line y=x and y=-x as we approach the origin. Maple lets us evaluate the limits either symbolically or graphically. func:= (x, y) -> x*y/(x^2+y^2);
path1 := func(x,-x);
path2 := func(x,x);
LimitOnPath1 := limit(path1, x=0);
LimitOnPath2 := limit(path2, x=0);
plot({path1,path2},x=-1..1, y=-1..1);Since these limits of the two paths as we approach the origin are different, the function cannot be continuous at the origin.Exercise2. Use a computer plot to show that the function defined by LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2J1EhRicvJSdpdGFsaWNHUSV0cnVlRicvJStiYWNrZ3JvdW5kR1EoWzAsMCwwXUYnLyUwZm9udF9zdHlsZV9uYW1lR1EnTm9ybWFsRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUYjNiVGKy1GIzYmRistRiM2JS1GLDYlUSJmRidGL0Y4LUkjbW9HRiQ2MFEwJkFwcGx5RnVuY3Rpb247RicvRjlRJ25vcm1hbEYnLyUmZmVuY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the origin so that the limits on the paths are different from each other.Difficult points that are differentiable - continuous partialsHaving dealt with the nice points and the really bad points, we are ready to start working on the points that fall between these extremes. Typically, we are looking at points where the main formula would have division by 0 at those points, so the function is defined by a second rule at those points. If the function is continuous at that point, the correct value was chosen to bridge the gap. We consider the function defined by f(x, y) = x*y*(x^2 - y^2)/(x^2 + y^2) away from the origin and f(0, 0) = 0. The origin is the difficult point in this example. The graph shows that we appear to have patched the hole at the origin with the correct value, so the function is continuous.func := x*y*(x^2-y^2)/(x^2+y^2);
plot3d(func(x,y),x=-1..1, y=-1..1,view=-1..1,
axes=boxed, style=patchcontour, shading=z);We next consider the partial derivativesfuncx := simplify(diff(func,x));
funcy := simplify(diff(func,y));Since we want to see if the partials are continuous, the obvious approach is to look at the graphs of the partials. plot3d(funcx, x=-1..1, y=-1..1,view=-1..1, axes=BOXED);
plot3d(funcy, x=-1..1, y=-1..1,view=-1..1, axes=BOXED);The graphs make it clear that the partials are continuous at the origin. By the theorem from the book, the function is differentiable at the origin, hence everywhere.Exercise3. Use the technique described above to show the function defined by NiMvLSUiZkc2JCUieEclInlHKigpRiciIiQiIiIpRihGK0YsKiQpLCYqJClGJyIiI0YsRiwqJClGKEYzRixGLEYzRiwhIiI= if NiMwNyQlInhHJSJ5RzckIiIhRig= and NiMvLSUiZkc2JCIiIUYnRic= is differentiable everywhere.Continuous but not differentiable for lack of partialsAs we start working on functions that are continuous but not differentiable, the obvious examples are those where the partial derivatives are not defined. These are functions that are not differentiable when we take a cross section in x or y The easiest examples involve absolute values and roots.Let NiMvLSUiZkc2JCUieEclInlHLSUkYWJzRzYjLCZGJyIiIkYoRi0=. The function is continuous everywhere. func := (x, y) -> abs(x + y);
plot3d(func(x,y),x=-1..1, y=-1..1,view=0..2,
axes=boxed, style=patchcontour, shading=z);When we take the cross sections x=0 and y=0 we get NiMtJSRhYnNHNiMlInlH and NiMtJSRhYnNHNiMlInhH respectively. Both of these curves have corners, so they are not differentiable at 0. Hence the partial derivatives of f(x,y) don't exist. func := (x, y) -> abs(x + y);
pathx := func(h,0);
pathy := func(0,h);
PartialOnPathx := diff(pathx, h);
LimitOnPathx := limit(PartialOnPathx, h=0);
PartialOnPathy := diff(pathy, h);
LimitOnPathy := limit(PartialOnPathy, h=0);
plot({PartialOnPathx,PartialOnPathy,pathx,pathy},h=-1..1, y=-1..1);Exercise4. Show that the function NiMvLSUiZkc2JCUieEclInlHKSwmKiQpRiciIiMiIiJGLiokKUYoRi1GLkYuKiZGLkYuIiImISIi is not differentiable at the origin.The hard case - showing non-differentiability for a continuous functionAs we mentioned earlier, continuity of the partial derivatives guarantees differentiability at a point. However, a function can still be differentiable even if the partials are not continuous. Nonetheless, if the partial derivatives are not continuous at a point of interest, then we are suspicious that the function is not differentiable at that point. We want some way to determine that such a function is not differentiable in this situation.The method is to notice that for a differentiable function all the tangent vectors at a point lie in a plane. Suppose that F(x,y) is differentiable at (a,b) with NiMvLSYlIkZHNiMlInhHNiQlImFHJSJiRyUiY0c= and NiMvLSYlIkZHNiMlInlHNiQlImFHJSJiRyUiZEc=.Let U=[u_1, u_2] be a unit vector. Then the directional derivative in direction U must be the same whether we compute it from the definition of the directional derivative or by taking the dot product of U with the gradient vector.Consider the function defined by LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUYjNiYtRiw2J0YuRi8vJStiYWNrZ3JvdW5kR1EoWzAsMCwwXUYnLyUwZm9udF9zdHlsZV9uYW1lR1EnTm9ybWFsRidGMi1GIzYlLUYsNiVRImZGJ0YvRjItSSNtb0dGJDYwUTAmQXBwbHlGdW5jdGlvbjtGJy9GM1Enbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRkwvJSlzdHJldGNoeUdGTC8lKnN5bW1ldHJpY0dGTC8lKGxhcmdlb3BHRkwvJS5tb3ZhYmxlbGltaXRzR0ZMLyUnYWNjZW50R0ZMLyUlZm9ybUdRJmluZml4RicvJSdsc3BhY2VHUSQwZW1GJy8lJ3JzcGFjZUdGaG4vJShtaW5zaXplR1EiMUYnLyUobWF4c2l6ZUdRKWluZmluaXR5RictSShtZmVuY2VkR0YkNiQtRiM2JS1GLDYlUSJ4RidGL0YyLUZFNjBRIixGJ0ZIRkovRk5GMUZPRlFGU0ZVRldGWUZmbi9Gam5RM3Zlcnl0aGlja21hdGhzcGFjZUYnRltvRl5vLUYsNiVRInlGJ0YvRjJGSC1GRTYwUSI9RidGSEZKRk1GT0ZRRlNGVUZXRlkvRmduUS90aGlja21hdGhzcGFjZUYnL0ZqbkZmcEZbb0Zeby1JJm1mcmFjR0YkNigtRiM2JS1JJW1zdXBHRiQ2JUZmby1JI21uR0YkNiRRIjJGJ0ZILyUxc3VwZXJzY3JpcHRzaGlmdEdRIjBGJy1GRTYwUTEmSW52aXNpYmxlVGltZXM7RidGSEZKRk1GT0ZRRlNGVUZXRllGZm5GaW5GW29GXm9GX3AtRiM2JUY3LUYjNidGNy1GIzYjRl1xLUZFNjBRIitGJ0ZIRkpGTUZPRlFGU0ZVRldGWS9GZ25RMG1lZGl1bW1hdGhzcGFjZUYnL0ZqbkZkckZbb0Zeby1GIzYjLUZecTYlRl9wRmBxRmRxRjdGNy8lLmxpbmV0aGlja25lc3NHUSIxRicvJStkZW5vbWFsaWduR1EnY2VudGVyRicvJSludW1hbGlnbkdGX3MvJSliZXZlbGxlZEdGTEYr.The comments earlier about easy points tell us that this function is differentiable everywhere except perhaps at the origin. Look at the graph of the function and its partial derivatives.func:= (x, y) -> x^2*y/(x^2+y^2);
funcx := simplify(diff(func(x,y),x));
funcy := simplify(diff(func(x,y),y));
plot3d(func(x,y), x=-1..1, y=-1..1,view=-1..1, axes=BOXED);
plot3d(funcx, x=-1..1, y=-1..1,view=-1..3, axes=BOXED);
plot3d(funcy, x=-1..1, y=-1..1,view=-3..1, axes=BOXED);We see from the graphs that the function is continuous and that the partials are discontinuous at the origin. The brute force methodWe can simply have Maple compute directional derivatives by both methods (gradient method and the limit definition) and compare them.func:= (x, y) -> x^2*y/(x^2+y^2);
funcxorg := limit(diff(func(x,0),x),x=0);
funcyorg := limit(diff(func(0,y),y),y=0);
dirderiv1 := theta -> cos(theta)*funcxorg+sin(theta)*funcyorg;
dirderiv2 := theta -> limit((func(h*cos(theta), h*sin(theta))-0)/h,h=0);
plot([dirderiv1(theta), dirderiv2(theta)], theta=0..2*Pi, axes=boxed,
legend=["Using partials", "Directional Dirivative"]);Since the two ways of computing directional derivatives do not always agree (and in fact disagree everywhere but on the axes) we conclude that the function is not differentiable. We can also look at where we expect points one unit from the origin to be based on the two methods of finding the directional derivative. Red points are computed using the gradient method. Blue points use directional derivatives (limit definition).del := 2;
surf:= plot3d(func(x,y), x=-del..del, y=-del..del, view=-del..del,
axes=boxed, color=green, style = patchcontour):
tanring1 :=plots[spacecurve]([cos(theta), sin(theta), dirderiv1(theta)],
theta=0..2*Pi, color=red, thickness=2):
tanring2 :=plots[spacecurve]([cos(theta), sin(theta), dirderiv2(theta)],
theta=0..2*Pi, color=blue, thickness=2):
plots[display3d]({surf, tanring1, tanring2},
view=[-2..2, -2..2, -4..4]);One interesting feature of this function is that the graph looks the same no matter how far you zoom in or out. (The picture looks the same if del is 1 or 0.000001.)del := 0.0001;
plot3d(func(x,y), x=-del..del, y=-del..del, view=-del..del, axes=normal,
style=patchcontour, orientation=[16,39]);Exercise5. Show that the function in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYpLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0YnLUYsNiZRImZGJ0YvLyUrYmFja2dyb3VuZEdRKFswLDAsMF1GJ0YyLUkjbW9HRiQ2MFEjOj1GJy9GM1Enbm9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xlR0ZlcS8lJXNpZGVHUSZyaWdodEYnLyUwbWlubGFiZWxzcGFjaW5nR0ZeeUY4Rj8vJSVvcGVuR1EifGZyRicvJSZjbG9zZUdGLkYrRis= is not differentiable at the origin even though it is continuous there.A non-graphing approachWe don't need to compute the directional derivative by both methods in every direction to show that a function is not differentiable. We simply need to show that the two methods give different answers in some direction. Consider the function that sends (x,y) to NiMsKCooKSUieEciIiMiIiIlInlHRigsJiokRiVGKEYoKiQpRilGJ0YoRighIiJGKC0lJHNpbkc2I0YmRigqJkYnRihGKUYoRi4= and sends the origin to 0. Once again, the comments about easy points tell us that this function is differentiable everywhere except perhaps at the origin. We compute the partials at the origin.func := (x, y) -> x^2*y/(x^2+y^2) + sin(x) -2*y;
funcxorg := eval(diff(func(x,0),x),x=0);
funcyorg := eval(diff(func(0,y),y),y=0);Now we compute the directional derivative along the line y=x (theta=Pi/4) using both methods.dirderiv1 := theta -> cos(theta)*funcxorg+sin(theta)*funcyorg:
dirderiv2 := theta -> limit((func(h*cos(theta), h*sin(theta))-0)/h,h=0):
"Deriv from partials" = dirderiv1(Pi/4);
"Deriv along path" = dirderiv2(Pi/4);Since we get different answers, we conclude that the function is not differentiable at the origin.Exercise6. Determine the status of the function defined byf(x, y) = x*y^2/(x^2 + y^4) if (x,y) \342\211\240 (0, 0) and f(0, 0) =0at the origin. Is it not continuous, continuous but not differentiable, or differentiable at the origin?A slick way to do these problems: converting to polar coordinatesThe exercises for this section have been set up with the difficult point at the origin and with the functions symmetric about the origin. Such functions are often easier to describe in terms of polar coordinates. We can use Maple to convert functions to polar coordinates.makepolar := g -> simplify(subs({x=r*cos(theta), y=r*sin(theta)}, g));Now look at the function from Exercise 3.func := x*y/sqrt(x^2+y^2);
polarfunc := makepolar(func); The function csgn(r) is a sign function that is either 1 or -1. Looking at the polar form, it is clear the the function is continuous at the origin. We also can see that the function is zero everywhere on the x or y axis. Time to check differentiability as r approaches 0.drfunc := diff(polarfunc,r);
drfunc0 := limit(drfunc, r=0);The problem we are running into is the csgn(r) which is 1 in one direction and -1 in the other.drfunc0r := limit[dir](drfunc, r=0, right);
drfunc0l := limit[dir](drfunc, r=0, left);Thus for most values of theta we get a corner, not a tangent line. (The right hand and left hand limits for the derivative exist, but they are different from each other.) The function is clearly not differentiable at the origin.Exercise7. Convert the functions in parts (b)-(h) of Exercise 1 into polar form. Comment about continuity and differentiability at the origin.