## Continuous Differentiability

##### ©2015 Jeff Norden, Tenn Tech Univ

Every calculus student knows the important relationship between differentiability and continuity:
• Fact 1:  If $f$ is a differentiable function, then $f$ must be continuous.
• Fact 2:  A function can be continuous without being differentiable.
Well, every calculus student should know these facts. I'm sure that all students that pass my classes do!

The concept is not hard to understand. A differentiable function is smooth, so it shouldn't have any jumps or breaks in it's graph. But there are lots of examples, such as the absolute value function, which are continuous but have a sharp corner at a point on the graph and are thus not differentiable.

The easiest way to remember these facts is to just know that absolute value is a counterexample to one of the possible implications and that the other implication is true. If nothing else, this material is a good way to emphasize the distinction between an implication and its converse. See below for an indication of how to actually prove these facts using limit arguments.

In mathematics, every time we answer a question or discover a fact, we are lead naturally to ask additional questions. This is what keeps mathematics alive. Mathematicians have been proving theorems for 2500 years or so. Despite this, the number of unsolved problems is far greater than the number that have been solved. In fact, if you were to divide the number of theorems that have been proved by the total number of published questions, you would find that this fraction continually decreases over time. The denominator grows much more quickly than the numerator.

Given facts 1 and 2 above, a natural question to ask is the following:

• Question:  If $f$ is a differentiable function, must $f'$ be continuous?
Don't be tempted to think that fact 1 says that the answer is yes. The continuity of $f$ and the continuity of $f'$ are different statements. The absolute value function doesn't answer the question either, since it is not a differentiable function. It turns out that the answer to this question is: no. A differentiable function $f$ for which $f'$ is continuous is called continuously differentiable. This concept plays an important role in analysis, differential equations, and even vector calculus. Unfortunately, you'll have a hard time finding any mention of it in currently popular calculus textbooks. At best, it may appear as an exercise at the very end of one of the homework sets. The purpose of this page is to try and rectify this situation.
So, the task is to show that continuous differentiability is actually different from just plain old differentiability. This means we need to show that there is a function which is differentiable but has a discontinuous derivative. It turns out that such an example can't be defined quite as easily as the absolute value function. The simplest example is based on the interesting function $f(x)=\sin(1/x)$. With any luck, this is an example that you've seen before. It appears in most calculus (and even some pre-calculus) textbooks to show a discontinuity that isn't a jump or a vertical asymptote. The sine function oscillates between $+1$ and $-1$ on every interval of the form $[k\pi,(k+2)\pi]$. Thus, $\sin(1/x)$ oscillates between $+1$ and $-1$ on each interval $[\frac{1}{k\pi}, \frac{1}{(k+2)\pi}]$. All of the infinitely many oscillations of $\sin(x)$ which occur in the interval $[\pi,\infty)$ get squeezed into the interval $(0,\frac{1}{\pi}]$. If you aren't familiar with this function, or can't remember what its graph looks like, then you should review it before continuing. Start with pencil and paper and try to figure it out on your own. If you google sin(1/x) you'll find plenty of pictures of the graph. Or, try this link to the Desmos web site. Just type sin(1/x) into the box, and then zoom in to get a better view.
Now, the $\sin(1/x)$ function by itself doesn't answer our question. This function isn't even continuous. So, by Fact 1, it can't be differentiable (this is the contrapositive of the implication in Fact 1).

Instead, the example we'll use is based on $f(x)=x^2\sin(1/x)$. Multiplying by $x^2$ creates a differentiable function, but the oscillations turn out to make the derivative function discontinuous. Most textbook treatments of this example simply use limits to establish these facts (see below). But the geometry of this example is actually very compelling. To see that $f'(0)$ exists, draw the secant line from the origin to a second point on the graph. As the second point rides the curve and approaches the origin, the motion of the secant line damps down and approaches a slope of zero. On the other hand, to check the continuity of $f'$ at the origin, we need to see what happens to the tangent lines at other points on the curve. As we ride the curve and approach the origin, the tangent lines do not stabilize.

Below are links to pages that use the Desmos graphing software to illustrate the geometry described above. First, click on the slider labeled $h$ to see what happens to the secant line that connects the origin to the point $(h,f(h))$ on the curve. You can also drag the orange point to move it along the curve. Then, use the slider labeled $a$ (or drag the red point) to see what happens to the tangent lines at the point $(a,f(a))$. The link labeled part one does this in the simplest way, while the other parts explain some additional facts and raise additional questions (of course).

### Proofs

Despite the above heading, I'm not going to present complete proofs in this section. There are plenty of books you can go to if you just want to passively read a proof. For students at the level of an introductory calculus class, I'm going to outline how limits are used to give complete proofs. For students taking an advanced calculus or introductory real analysis class, you should be able to start with the arguments below and fill in the gaps, i.e., it follows that..., it is easy to see..., etc. For some of these, you'll need to directly use a precise limit definition (i.e., an $\varepsilon$-$\delta$ argument). For others, you can apply standard theorems (e.g., the squeeze theorem).

Of course, before we can prove anything, we must start with precise definitions (smooth graph and no breaks are not good enough for mathematicians). The first thing to understand is that continuity and differentiability are defined in a point-wise manner. Given a function $f:\Bbb R \to \Bbb R$ and a real number $x$, we use limits to define what it means for $f$ to be continuous or differentiable at $x$. We then say that $f$ is simply continuous or differentiable if the corresponding definition holds at all real numbers. (This is also generalized to define what it means for a function to be continuous or differentiable on a subset of $\Bbb R$, or on its domain if $f$ isn't defined everywhere. We won't deal with that here. There are some subtle issues if the set or the domain isn't an open set of real numbers.)

For a function $f:\Bbb R \to \Bbb R$ and a real number $x$, the statement $f$ is continuous at $x$ means that $\lim\limits_{t\to x}f(t)=f(x)$, or equivalently that $\lim\limits_{h\to 0}f(x+h)=f(x)$. In both of these equations, $x$ is the point where we are considering continuity. In the first equation, $t$ represents another point which is approaching $x$. In the second equation, the other point is $x+h$, and $h$ represents the distance between the points. Many introductory texts use the variable $a$ instead of $x$ because they make the (perhaps demeaning) assumption that students are incapable of realizing that mathematical variables can be used in different ways and have different meanings in different contexts. (Imagine taking an English class where you were required to explicitly define every word that you use if it can have multiple meanings!)

For a function $f:\Bbb R \to \Bbb R$ and a real number $x$, the statement $f$ is differentiable at $x$ means that the limit $\lim\limits_{h\to 0}\frac{f(x+h)-f(x)}{h}$ exists. The value of this limit is called the derivative of $f$ at $x$, and $f'$ is the new (derived) function which associates each number $x$ to the value $f'(x)$ of the limit. Many introductory texts make an entirely pointless distinction between derivative at a point and derivative as a function. This seems to be because authors assume that students are incapable of grasping the following simple fact: if we use a limit equation to define a number $f'(x)$ for each number $x$, then this relationship automatically defines a new function.

Proof of Fact 1: Fix a function $f$ and a real number $x$ and assume that $f$ is differentiable at $x$. We need to conclude that $f$ is also continuous at $x$. The differentiability of $f$ says that $\lim\limits_{h\to 0}\frac{f(x+h)-f(x)}{h}$ exists. But the limit of the denominator of this fraction is zero. It follows that the limit of the numerator must also be zero. Thus $\lim\limits_{h\to 0}{f(x+h)-f(x)}=0$, so $\lim\limits_{h\to 0}{f(x+h)=f(x)}$, and thus $f$ is continuous at $x$. ∎

Proof of Fact 2: We just need an example, and the one to use is $f(x)=|x|$. It is easy to check that $f$ is continuous at every non-zero point. The continuity of $f$ at zero follows from the the fact that the right and left limits are both equal to zero and that $f(0)=0$. But, $$f'(0)=\lim\limits_{h\to 0}\frac{f(0+h)-f(0)}{h}= \lim\limits_{h\to 0}\frac{|0+h|-|0|}{h}= \lim\limits_{h\to 0}\frac{|h|}{h}$$ The right and left hand limits for this expression are different, so $f'(0)$ is undefined. ∎

Answer to the question: Again we need an example to show that the answer is no. If you looked at the part two Desmos link, you realize we must actually define $f$ as follows: $$f(x)=\cases{x^2\sin(1/x)\quad x\ne0 \cr 0 \quad x=0}$$ The differentiability of $f$ at every non-zero point follows from the product, quotient, and chain rules. Now, $$f'(0)=\lim\limits_{h\to 0}\frac{f(0+h)-f(0)}{h}= \lim\limits_{h\to 0}\frac{h^2\sin(1/h)-0}{h}= \lim\limits_{h\to 0}{h\sin(1/h)}= 0$$ Thus, $f$ is differentiable at 0 and $f'(0)=0$. But, for $x\ne0$, $$f'(x)=2x\sin(1/x)+x^2\cos(1/x)\left(\frac{-1}{\;\;x^2}\right)= 2x\sin(1/x)-\cos(1/x)$$ Thus, $\lim\limits_{x\to0}f'(x)$ is undefined, so $f'$ is discontinuous at 0. ∎

As a final note, if we replace $x^2\sin(1/x)$ with $x\sin(1/x)$ in the definition of $f$ , then the equation for $f'$ (for $x\ne0$) simplifies to: $$f'(x)=\sin(1/x)-\frac{\cos(1/x)}{x}$$ As $x$ approaches zero, the tangent slopes don't simply oscillate from almost $+1$ to almost $-1$ as they do in the original example. Instead, they become very close to vertical lines at many (actually most) points. This explains the bad behavior of the tangent lines in the part three Desmos link.

 To be honest, the real purpose of this page is to encourage students to think about and explore mathematical concepts instead of (or in addition to) just memorizing a lot of formulas. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.