---
tag: 0CQ9ZM383N
kind: counterexample
name: Absolute value is continuous but not differentiable at 0
msc: [26A24]
uses: [0HXEX0DPRA, 07ZMX4ANJS]
sources:
  - url: https://en.wikipedia.org/wiki/Absolute_value
    locator: Derivative
---

## Counterexample

The function $f(x) = |x|$ is continuous on $\mathbb{R}$, but it is not differentiable at $0$.
The difference quotient is $\frac{|h|}{h}$, which is $1$ for $h > 0$ and $-1$ for $h < 0$. So it has no limit as $h \to 0$.

## Remarks

The [[one-sided derivatives|0HXEX0DPRA]] at $0$ exist: the right derivative is $1$ and the left derivative is $-1$.
So the converse of [[differentiable functions are continuous|07ZMX4ANJS]] fails.
For $x \ne 0$, the derivative is $x / |x|$, the sign of $x$. Mathlib states the failure at $0$ as `not_differentiableAt_abs_zero`.

## Explanations

### L1 human

The graph of $|x|$ is a V with a sharp corner at the origin.
At the corner, no single line fits the graph, so there is no tangent.
