Linear Algebra
10.128 min read

When the Derivative Does Not Exist

Not every continuous function is differentiable. The derivative fails to exist when the limit limh0f(x0+h)f(x0)h\lim_{h \to 0} \frac{f(x_0+h) - f(x_0)}{h} does not exist. There are three classical failure modes: kinks (corners), vertical tangents, and wild oscillations.

A kink occurs when the left-hand and right-hand derivatives differ: the function approaches a corner from different angles. Classic example: f(x)=xf(x) = |x| at x0=0x_0 = 0 — the left-derivative is 1-1 and the right-derivative is +1+1. A vertical tangent occurs when the limit of the difference quotient is ±\pm\infty — the graph becomes vertical. Wild oscillations like f(x)=xsin(1/x)f(x) = x \sin(1/x) near x=0x = 0 produce a limit that does not exist.

Formal View

Example 10.1 — Non-Differentiable at a Kink
The function f(x)=xf(x) = |x| satisfies f(x)=1f'(x) = -1 for x<0x < 0 and f(x)=+1f'(x) = +1 for x>0x > 0. At x=0x = 0: limh0hh=1+1=limh0+hh\lim_{h\to 0^-} \frac{|h|}{h} = -1 \neq +1 = \lim_{h\to 0^+} \frac{|h|}{h}. The two-sided limit does not exist, so ff is not differentiable at 00.

Even though x|x| is continuous everywhere, it is NOT differentiable at x=0x=0. Continuity does not imply differentiability.

Why This Matters

Knowing when derivatives fail is essential in optimization — non-smooth functions require specialized algorithms.

  • ReLU activation max(0,x)\max(0,x) has a kink at x=0x = 0 — it is not differentiable there, but subgradients are used in practice.
  • L1 regularization w|w| creates kinks in the loss landscape — solved by proximal methods or subgradient descent.
  • Contact mechanics: physical contact creates kinks in displacement fields.

Quiz

Question 1

At x=0x = 0, f(x)=xf(x) = |x| is:

Question 2

If a function is differentiable at x0x_0, it must also be continuous at x0x_0.

Common Mistakes

  • Thinking continuity implies differentiability — the function x|x| is the standard counterexample.
  • Forgetting that a vertical tangent also means non-differentiability (limit is ±\pm\infty, not a finite number).