3.2 The Anatomy of Non-Differentiability

Let us build our intuition by examining the distinct ways where differentiability can break down.

3.2.1 The Corner

We redo the example above using a slightly different calculation. Consider the absolute value function, f⁢(x)=|x|f(x)=\left\lvert x\right\rvert, defined for all x∈(−∞,∞)x\in(-\infty,\infty). Thus, dom⁡(f)=ℝ\operatorname{dom}(f)=\mathbb{R}. Let cc be a real number. We calculate the derivative at cc using the limit definition:

limx→cf⁢(x)−f⁢(c)x−c=limx→c|x|−|c|x−c.\lim_{x\to c}\frac{f(x)-f(c)}{x-c}=\lim_{x\to c}\frac{\left\lvert x\right% \rvert-\left\lvert c\right\rvert}{x-c}.

By definition, |c|\left\lvert c\right\rvert evaluates to cc when c≥0c\geq 0, and −c-c when c<0c<0. We split into three cases:

  • •
    ​

    Case 1: c>0c>0. Then for xx close to cc, x>0x>0, so |x|=x\left\lvert x\right\rvert=x. The limit becomes

    limx→cx−cx−c=1.\lim_{x\to c}\frac{x-c}{x-c}=1.
  • •
    ​

    Case 2: c<0c<0. Then for xx close to cc, x<0x<0, so |x|=−x\left\lvert x\right\rvert=-x. The limit becomes

    limx→c−x−(−c)x−c=−1.\lim_{x\to c}\frac{-x-(-c)}{x-c}=-1.
  • •
    ​

    Case 3: c=0c=0. This is the critical point. We are evaluating:

    limx→0f⁢(x)−f⁢(0)x−0=limx→0|x|−|0|x−0=limx→0|x|x.\lim_{x\to 0}\frac{f(x)-f(0)}{x-0}=\lim_{x\to 0}\frac{\left\lvert x\right% \rvert-\left\lvert 0\right\rvert}{x-0}=\lim_{x\to 0}\frac{\left\lvert x\right% \rvert}{x}.

Due to the absolute value, we must split this into one-sided limits:

limx→0+|x|x=limx→0+xx=1,limx→0−|x|x=limx→0−−xx=−1.\begin{split}\lim_{x\to 0^{+}}\frac{\left\lvert x\right\rvert}{x}&{}=\lim_{x% \to 0^{+}}\frac{x}{x}=1,\\ \lim_{x\to 0^{-}}\frac{\left\lvert x\right\rvert}{x}&{}=\lim_{x\to 0^{-}}\frac% {-x}{x}=-1.\end{split}

Since the left and right limits disagree (1≠−11\neq-1), we deduce that the limit limx→0f⁢(x)−f⁢(0)x−0\lim_{x\to 0}\frac{f(x)-f(0)}{x-0} does not exist. Thus, ff is not differentiable at 0.

Intuition (The Geometry of a Corner).

Geometrically, f⁢(x)=|x|f(x)=\left\lvert x\right\rvert has a sharp corner at the origin, see Figure 3.1. A derivative requires the function to look locally like a single straight line when zoomed in. At x=0x=0, no matter how much you zoom in, the V-shape persists; it refuses to flatten out into a tangent line.

The graph of the absolute value function f(x) = |x|
has a corner at x = 0.
Figure 3.1: The graph of f⁢(x)=|x|f(x)=\left\lvert x\right\rvert has a corner at x=0x=0.
Exercise 3.2.1.

Pay attention to the divide-and-conquer argument above: why do we need 3 different cases for cc? Can you use this insight to answer 3.1.7?

3.2.2 The Vertical Tangent

Consider the function f⁢(x)=x1/3f(x)=x^{1/3}. The domain of ff is (−∞,∞)(-\infty,\infty). We calculate the difference quotient:

limh→0f⁢(x+h)−f⁢(x)h=limh→0(x+h)1/3−x1/3h.\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}=\lim_{h\to 0}\frac{(x+h)^{1/3}-x^{1/3}}{h}.

To resolve this 0/00/0 indeterminate form, we employ a clever algebraic trick using the difference of cubes identity:

(a−b)⁢(a2+a⁢b+b2)=a3−b3.(a-b)(a^{2}+ab+b^{2})=a^{3}-b^{3}.

By multiplying by the conjugate-like factor ((x+h)2/3+(x+h)1/3⁢x1/3+x2/3)\left((x+h)^{2/3}+(x+h)^{1/3}x^{1/3}+x^{2/3}\right), we obtain:

limh→0(x+h)1/3−x1/3h=limh→0[(x+h)1/3−x1/3]⁢((x+h)2/3+(x+h)1/3⁢x1/3+x2/3)h⁢((x+h)2/3+(x+h)1/3⁢x1/3+x2/3)=limh→0((x+h)1/3)3−(x1/3)3h⁢((x+h)2/3+(x+h)1/3⁢x1/3+x2/3)=limh→0(x+h)−xh⁢((x+h)2/3+(x+h)1/3⁢x1/3+x2/3)=limh→01(x+h)2/3+(x+h)1/3⁢x1/3+x2/3=1x2/3+x1/3⁢x1/3+x2/3=13⁢x2/3.\begin{split}\lim_{h\to 0}\frac{(x+h)^{1/3}-x^{1/3}}{h}&{}=\lim_{h\to 0}\frac{% \left[(x+h)^{1/3}-x^{1/3}\right]\left((x+h)^{2/3}+(x+h)^{1/3}x^{1/3}+x^{2/3}% \right)}{h\left((x+h)^{2/3}+(x+h)^{1/3}x^{1/3}+x^{2/3}\right)}\\ &{}=\lim_{h\to 0}\frac{((x+h)^{1/3})^{3}-(x^{1/3})^{3}}{h\left((x+h)^{2/3}+(x+% h)^{1/3}x^{1/3}+x^{2/3}\right)}\\ &{}=\lim_{h\to 0}\frac{(x+h)-x}{h\left((x+h)^{2/3}+(x+h)^{1/3}x^{1/3}+x^{2/3}% \right)}\\ &{}=\lim_{h\to 0}\frac{1}{(x+h)^{2/3}+(x+h)^{1/3}x^{1/3}+x^{2/3}}\\ &{}=\frac{1}{x^{2/3}+x^{1/3}x^{1/3}+x^{2/3}}\\ &{}=\frac{1}{3x^{2/3}}.\end{split}

Therefore, f′⁢(x)=13⁢x−2/3f^{\prime}(x)=\frac{1}{3}x^{-2/3}. However, observe what happens at x=0x=0: the denominator vanishes. Thus, dom⁡(f′)=(−∞,0)∪(0,∞)\operatorname{dom}(f^{\prime})=(-\infty,0)\cup(0,\infty). The curve possesses a vertical tangent line at the origin.

Intuition.

Observe what happens geometrically as x→0x\to 0. If you sketch the graph of f⁢(x)=x1/3f(x)=x^{1/3}, you will notice a curious phenomenon in Figure 3.2: As the curve passes through the origin, it briefly becomes completely vertical. The tangent line is the yy-axis itself! Thus, we expect the slope of the tangent line to be infinite, and accordingly, the derivative will fail to exist at x=0x=0, giving us another elegant example where dom⁡(f′)⊊dom⁡(f)\operatorname{dom}(f^{\prime})\subsetneq\operatorname{dom}(f) (beside the kink at 0 of f⁢(x)=|x|f(x)=\left\lvert x\right\rvert).

The graph of f(x) = x to the power 1/3, drawn in blue, passes through the origin, where it becomes vertical. Its tangent line there is the y-axis, drawn in red and labelled vertical tangent line.
Figure 3.2: The tangent line of the graph of f⁢(x)=x1/3f(x)=x^{1/3} at x=0x=0 is vertical.

3.2.3 The Discontinuity

Consider the step function:

f⁢(x)={1,x≥0−1,x<0f(x)=\begin{cases}1,&x\geq 0\\ -1,&x<0\end{cases}

On (0,∞)(0,\infty), f⁢(x)=1f(x)=1, so f′⁢(x)=0f^{\prime}(x)=0. On (−∞,0)(-\infty,0), f⁢(x)=−1f(x)=-1, so f′⁢(x)=0f^{\prime}(x)=0.

At x=0x=0, we calculate the limit directly:

limx→0f⁢(x)−f⁢(0)x−0=limx→0f⁢(x)−1x.\lim_{x\to 0}\frac{f(x)-f(0)}{x-0}=\lim_{x\to 0}\frac{f(x)-1}{x}.

Examining the one-sided limits, we have:

limx→0+f⁢(x)−1x=limx→0+1−1x=0,limx→0−f⁢(x)−1x=limx→0−−1−1x=limx→0−−2x=∞.\begin{split}\lim_{x\to 0^{+}}\frac{f(x)-1}{x}&{}=\lim_{x\to 0^{+}}\frac{1-1}{% x}=0,\\ \lim_{x\to 0^{-}}\frac{f(x)-1}{x}&{}=\lim_{x\to 0^{-}}\frac{-1-1}{x}=\lim_{x% \to 0^{-}}\frac{-2}{x}=\infty.\end{split}

Since ∞\infty is not a real number, ff is not differentiable at 0.

The graph of the step function: the horizontal line y = -1 for x less than 0, ending in an open circle at (0, -1), and the horizontal line y = 1 for x at least 0, starting with a filled dot at (0, 1). The graph jumps at x = 0.
Figure 3.3: The step function is discontinuous at x=0x=0.

From the examples above, we can isolate 33 primary scenarios where ff fails to be differentiable at cc:

  1. 1.
    ​

    ff has a corner at cc (e.g., f⁢(x)=|x|f(x)=\left\lvert x\right\rvert).

  2. 2.
    ​

    ff has a vertical tangent line at cc (e.g., f⁢(x)=x1/3f(x)=x^{1/3}).

  3. 3.
    ​

    ff is not continuous at cc.

Story (The Monster in the Zoo of Functions).

Looking at the graphs of our 3 examples above, they might give you a false sense of security. One might naturally form the false belief that a continuous function may only be non-differentiable at a few isolated points.

Lo and behold! Let me introduce the Weierstrass monster function. Discovered by Karl Weierstrass in the late 19th century, it is a function that is continuous everywhere but differentiable nowhere. It is a fractal-like beast, composed of infinitely many wiggles upon wiggles, see Figure 3.4. Its mere existence shocked the mathematical establishment, proving that geometric intuition can sometimes lead us drastically astray!

A line plot of the Weierstrass function on the interval from x = -2 to x = 2. The function displays an extremely jagged, self-similar, and fractal-like structure, illustrating a real-valued function that is continuous everywhere but differentiable nowhere. The blue curve oscillates between y = -1.875 and y = 1.875 with multiple levels of fine-grained detail.
Figure 3.4: The Weierstrass function W⁢(x)=∑n=0∞an⁢cos⁡(bn⁢π⁢x)W(x)=\sum_{n=0}^{\infty}a^{n}\cos(b^{n}\pi x).