Continuity and differentiability, an example. A Demonstration Worksheet by Mike May, S.J.- maymk@slu.edu \302\2512006restart;The Problem in detailWe have been struggling with limits and continuity. It is worthwhile to make an extended look at a particular problem from a number of viewpoints. Start by defining the function and its partials. We recall that the book states that a function is differentiable at a point if both partials are continuous at the point. f := x*y*(x^2-y^2)/(x^2+y^2);
fx := simplify(diff(f,x));
fy := simplify(diff(f,y));The sneaky method, using polar coordinates:In all of the problems in this section, the question reduces to determining if the function and its partials are continuous at (0, 0). The problems in this section are all symmetric with respect to the origin. That makes it worthwhile to convert them to polar coordinates.makepolar := g -> simplify(subs({x=r*cos(theta), y=r*sin(theta)}, g));makepolar(f);makepolar(fx);makepolar(fy);It is clear that all three of these functions have a limit of 0 when r=0. (All three expressions are polynomials in r with no constant term and coefficients of the other terms bounded by11. Thus this function is differentiable at the origin, and since that was the only problem point, it is differentiable everywhere.Testing continuity by testing the behavior of the function on several pathsKnowing the correct answer, we are now ready to ask, "But what was I to do if I didn't think about converting to polar coordinates?" It is clear that we want to look at behavior of the function near the origin. Let us consider 4 paths to the origin, the x axis, the y axis, the line y = 2*x, and the curve y = x^2. We want to consider the function with these restrictions.f1 := simplify(subs(x=0, f));
f2 := simplify(subs(y=0, f));
f3 := simplify(subs(y=2*x, f));
f4 := simplify(subs(y=x^2, f));Since all 4 paths of these approach 0 = f(0,0) as the point approaches the origin we are very suspicious that the function is continuous.Testing differentiability by brute force methodsChecking differentiability can be a bit more straightforward if we know the function is continuous. We need to check that the tangent vectors all live in a plane. This can be done by checking the derivative as we approach along a line y = mx for an arbitrary scalar m. To eliminate the need to worry about unit vectors and scale we first want to subtract off the tangent planez=f[x](0,0)(x) + f[y](0,0)(y).In our example, the cross sections on the x and y axes were both constant, so the partials at the origin are both zero, and this adjustment does not change the problem.fm := simplify(subs(y=m*x, f));We see that any straight line path to the origin produces a cross section that is parabolic in shape with the tightness of the parabola determined by the slope of the line to the origin.dfm := diff(fm, x);
dfm0 := limit(dfm, x=0);Taking the derivative at x=0, we see that the directional derivative does not depend on the slope m. Thus all the tangent lines fit into a plane and the function is differentiable at the origin.of the cross section2 other problems for comparison.A problem where continuity failsWith this problem we start by looking at the behavior of the function on different paths approaching the origin.g:= x^2*y/(x^4 + y^2);
g1 := simplify(subs(x=0, g));
g4 := simplify(subs(y=x^2, g));Since g1 and g2 have different limits as x approaches 0, the function g is not continuous.A problem where directional derivatives fail to exist.Now look at the following problem:h := x*y/sqrt(x^2+y^2);
`hpolar` = makepolar(h);
hm := simplify(subs(y=m*x, h));Looking at the polar form, it seems the function is continuous. Time do check differentiability on straight line paths to the origin.dhm := diff(hm, x);
dhm0 := limit(dhm, x=0);Maple claims that the directional derivatives don't exist at the origin. To see what is going on, look from the two one sided limits involved in a directional derivative. limit[dir](dhm, x=0, right);
limit[dir](dhm, x=0, left);Since the two one-sided limits do not agree, the directional derivatives do not exist and the function is not differentiable.