Derivatives

We're moving to chapter 5 of our text on derivatives!

as well as in this YouTube video.

Basics

While we might or might not fully appreciate it, we all probably met something like the definition of the derivative in Calculus I:

Def 5.2.1: Let $g : A \to \mathbb R$ be a function defined on an interval $A$. Given $c \in A$, the derivative of $g$ at $c$ is defined by

$$g'(c) = \lim_{x\to c}\frac{g(x)-g(c)}{x-c}.$$

provided this limit exists. In this case we say $g$ is differentiable at $c$. If $g'$ exists for all points $c \in A$, we say that $g$ is differentiable on $A$.

Interpretation

  • The difference quotient $$\frac{g(x)-g(c)}{x-c}$$ is an approximation to the slope of the graph of $g$ at $x=c$.
  • In applied mathematics, we use the differentiation rules (power rule, product rule, etc) to compute derivatives. The fact that these yield the correct results can be proved using the definition.
  • Moreover, it's the difference quotient that confers to the derivative its important properties.

Algebraic differentiation rules

Thm 5.2.4: Let $f$ and $g$ be functions defined on an interval $A$, and assume both are differentiable at some point $c \in A$. Then,

  1. $\displaystyle (f+g)'(c) = f'(c)+g'(c)$,
  2. $\displaystyle (kf)'(c) = kf'(c)$, for all $k\in\mathbb R$,
  3. $\displaystyle (fg)'(c) = f'(c)g(c) + f(c)g'(c)$, and
  4. $\displaystyle (f/g)'(c) = \frac{f'(c)g(c)-f(c)g'(c)}{g(c)^2}$

Proof of (iii)

The proof of the product rule might look something like so:

$$\begin{aligned} \frac{(fg)(x)-(fg)(c)}{x-c} &= \frac{f(x)g(x)-f(c)g(x)+f(c)g(x)-f(c)g(c)}{x-c} \\ &= \frac{f(x)-f(c)}{x-c}g(x) + f(c)\frac{g(x)-g(c)}{x-c} \\ &\to f'(c){\color{gray}g(c)} + f(c)g'(c) \end{aligned}$$

Though, we might want to be careful with that $g(c)$!

The chain rule

Though it's not really "algebraic", the last differentiation rule is the chain rule:

Thm 5.2.5: Let $f : A \to \mathbb R$ and $g : B \to\mathbb R$ satisfy $f(A) \subset B$ so that the composition $g\circ f$ is defined. If $f$ is differentiable at $c\in A$ and if $g$ is differentiable at $f(c)\in $B,then $g\circ f$ is differentiable at $c$ with $$(g \circ f)'(c) = g'(f(c)) f'(c).$$

Example

If $f(x) = x^2 \sin(1/x)$, then

$$\begin{aligned} f'(x) &= 2x\sin(1/x) + x^2\cos(1/x)(-1/x^2) \\ &= 2x\sin(1/x) - \cos(1/x). \end{aligned}$$

I have no doubt that you folks can all do this but we're going to push this example a bit further in the next column of slides.

Derivatives and continuity

You probably remember something along these lines:

Thm 5.2.3: If $g : A \to \mathbb R$ is differentiable at a point $c\in A$, then $g$ is continuous at $c$ as well.

The proof is not too hard:

$$\begin{aligned} \lim_{x\to c}(g(x) - g(c)) &= \lim_{x\to c} \left(\frac{g(x)-g(c)}{x-c}(x-c)\right) \\ &= \lim_{x\to c}\frac{g(x)-g(c)}{x-c} \times \lim_{x\to c}(x-c) = g'(c) \times 0 = 0. \end{aligned}$$

A pure question

Here's a pure question, though: Are derivatives continuous?

More precisely, if $I$ is an open interval and $f:I\to\mathbb R$ is differentiable at every point, then is $f'$ continuous on $I$?

The answer, it turns out, is no but counterexamples are not particularly easy to find.

Note that $x\to|x|$ is not a counterexample.

Another look at $x^2\sin(1/x)$

That brings us back to our computational example, which we modify slightly to:

$$f(x) = \begin{cases} x^2 \sin(1/x) & x\neq0 \\ 0 & x= 0.\end{cases}$$

Note that $-1\leq \sin(1/x)\leq 1$ for all $x$, so that $$-x^2 \leq x^2 \sin(1/x) \leq x^2$$ for all $x$. This allows us to prove that $\lim_{x\to0} x^2\sin(1/x)=0$ using the squeeze theorem.

The graph

The graph of $f$, together with the envelope of $\pm x^2$, looks like so:

Differentiability

The envelope $\pm x^2$ forces continuity at $x=0$ by the squeeze theorem but it looks as if it might even force differentiability at the origin.

Indeed, we can compute $f'(0)$ directly from the definition of the derivative:

$$\begin{aligned} f'(0) &= \lim_{x\to0} \frac{f(x)-f(0)}{x-0} = \lim_{x\to0} \frac{x^2\sin(1/x)}{x} \\ &= \lim_{x\to0} x\sin(1/x) = 0. \end{aligned}$$

Differentiability everywhere

Together with our previous computation, we have a piecewise formula for $f'$:

$$f'(x) = \begin{cases} 2x\sin(1/x) - \cos(1/x) & x\neq 0 \\ 0 & x = 0. \end{cases}$$

Thus, $f$ is everywhere differentiable but that derivative is not continuous at the origin. Can you see why?

The graph

The graph of $f'$ near $x=0$, together with the envelope of $\pm x^2$, looks like so:

Darboux's theorem

If you look at the graph of $f'$, you might convince yourself that it satisfies the intermediate value property. In fact, this is a property enjoyed by all derivates - a fact known as Darboux's theorem:

Thm 5.2.7: If $f$ is differentiable on an interval $[a,b]$, and if $\alpha$ satisfies $$f'(a) < \alpha < f'(b) \: (\text{or } f'(a) > \alpha > f'(b)),$$ then there exists a point $c \in (a, b)$ where $f'(c) = \alpha$.

A couple other strange examples

Throughout the late 19th century, into the 20th century, and even continuing today, mathematicians have discovered not just a raft of weird functions but an absolute fleet of rafts of bizarreness falling into all kinds of categories. The third edition the definitive monograph of the subject was published just a few years ago.

In this last column will take a quick glance at just two more examples examining:

  • How non-differentiable can a continuous function be and
  • How discontinuous can a derivative be?

Nowhere differentiable functions

It's easy to produce examples of continuous functions that fail to be differentiable at isolated points, like $x\to|x|$, for example.

A natural question (of pure mathematics) is then: How non-differentiable can a continuous function be?

The astonishing answer is that continuous functions can be nowhere differentiable!

Weierstrass's function

Karl Weiestrass produced the first example of continuous but nowhere differentiable function in the 1870s. He published a family of examples, that have the form: $$ f_{a,b}(x) = \sum_{n=0}^{\infty} a^n \cos(b^n x). $$ If $a<1$ and $b>1$, then $f$ is the sum of waves with decreasing amplitude but increasing frequency. Furthermore:

  • The amplitudes decrease fast enough to for the sums to converge to a continuous function. (We might just prove this in chapter 6 near the end of our time together)
  • The frequencies increase fast enough so that it "wiggles" everywhere and is differentiable nowhere.

The graph of Weierstrass's function

Discontinuous derivatives

You may have noticed this picture on our class webpage:

Discontinuous derivative explanation

That picture is my attempt to generate a Volterra-like function, which is differentiable at every point in the unit interval but whose derivative fails to be continuous on at every point in the Cantor set.

You can form summation of copies of these things that are scaled to lie within the removed intervals in the construction of the Cantor set. Doing so recursively allows you to form a function that's differentiable on $[0,1]$ but who's derivative is discontinuous on a dense set of $[0,1]$

Discontinuous derivatives on Math.SE

Examples of functions with "very" discontinuous derivatives is the topic of this question on Math.StackExchange. My answer there is my top rated answer and the other answer discusses limitations on just how far that process can go.